Reputation: 11
I need to change the index of and object generated by a class. I know this code myObject.parent.setChildIndex( myObject, newZIndex); but it only works on movieclips found on the stage.
when i try to use it on a class so every ball that falls gets behind the Bag that catches those balls. No matter what index I give to the Bag which is a movieclip, the balls always get in front of the bag, I need to change the index of the balls (from a class located in an array), to an index lower than the bag's index.
appreciate any help, ty.
Upvotes: 0
Views: 72
Reputation: 6751
You need to change your approach in solving this issue.
Create a Sprite
layer for your bag and a Sprite
layer for your balls.
Add the balls layer first, then the bag layer.
If you do that, it'll be impossible for the bag to appear behind a ball.
Upvotes: 1