/ Published in: ActionScript 3
Expand |
Embed | Plain Text
setChildIndex(myMovieClip,numChildren - 1)
Comments
Subscribe to comments
You need to login to post a comment.
mecsekikrisztian on 03/10/11
4 people have marked this snippet as a favorite
scottwatkins
jazzy_miles
codism
shockway
setChildIndex(myMovieClip,numChildren - 1)
Subscribe to comments
You need to login to post a comment.
Hi!
If your clip to order is in an another mc just use this line instead:
mc_holder.setChildIndex(myMovieClip, i)
If your clip is in an array of buttons, your aproach should be like this:
var buttonArray:Array = [btn1, btn2, btn3, btn4] for(var i:int = 0; i < buttonArray.length; i++) { buttonArray[i].addEventListener(MouseEvent.ROLL_OVER, buttonOver) }
function buttonOver (e:MouseEvent):void{ setChildIndex(DisplayObject(e.currentTarget), i) }
Happy coding! Cheers!