I have some mc’S stored in an array. I put the mc on the stage and I want that when I click on one of them this one should be in foreground and the others in the background.
How can I do the parentig?
Thank you for your time
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If all of your MCs are in the same container, i.e., another MovieClip/Sprite, you can either update the child index of the “clicked mc” or just add it to the container again.
This would be your click handler:
It would be cleaner to reference the container by its’ instance name (like container.addChild()) rather than using e.target.parent. If you use “e.target”, make sure the ‘mouseChildren’ property in your MC is ‘false’.
If you prefer to set the child index of the clicked MC, you would do something like this:
Again, any time you use “e.target” make sure ‘mouseChildren’ is false or else the mouse focus could actually click on display objects inside of your “clicked mc”.