Hello, I am trying to write some simple code that checks to see if an object exists on the stage. But I'm not really sure how this is supposed to work. If I check if it's on the stage i get a conversion error. If I try to do a simple if exists statement it always returns true. I just want to check if an object exists on every frame, and if it exists, pull it's coordinates.
I attached a small piece of sample code. This should be simple but actionscript makes it so difficult...
You need to assign an instance name to your Movie Clip instance using the Properties panel.
Also, there's no need to export the Movie Clip to ActionScript if you're not gonna need to add it at runtime. And if you do need it to be exported for ActionScript, choose a different name for the class.
And to safely check if a instance exists on the display lists, just check for the instance itself and for the stage property.
if (yourInstance && yourInstance.stage) // do something
As this is a duplicated question, I'm going to block the other discussion:
I hope this helps.
thank you, i was finally to get this working properly and pull the proper dimensions of the object.