0

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.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Not sure what you are asking.
I didn't learn sprite yet so I have no Idea how to use it. I need an example of the code or something.
Probably best for you to take a step back and learn about the display list. adobe.com/devnet/flash/quickstart/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.