I have a sprite and when it is added to the screen, I want it to be added on top of everything else on the stage.
What is the best way to ensure that a sprite when added, is on top of everything and not hidden behind other sprites?
Thanks,
~ kcg
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.
Anytime you add a clip it is added on top by default.
So can use
or
But if by any reason you are you are using flash/flex IDE & trying to keep the clip on the top of everything always & not really spawning them on the run, then I would suggest you to simply add the clip to the top most layer. But since you have tagged it as only actionscript the layer thing does not really exist here.
Also you might consider using swapchildren for already existing clips & swapping thier depths in the parent display object.