I would like to know how to detect on which layer is an instance located.For example i put a circle named bob on the first layer and a square named test on the second layer. In actionscript, can i detect on which layer is test.
I want to use this because in my game i will put all the non solid objects on the first layer and all the solid objects on the second layer and i want to detect in actionscript which instances are located in which layers
In actionscript 3 there is no such thing as layers. It is only a convenience for Flash IDE users to group certain elements until actual SWF compiling occurs. At compile time all the objects are added to the
stageaccording to the hierarchy of the layers but they all belong to the samestageobject with differentchildIndexproperties.To use the concept of layers in actionscript 3, you should add your solid objects to a
SpriteorMovieClipand then check, whether the instance in question is belonging to solid object or not, like this: