PDA

View Full Version : setChildIndex


Ingenieurs
04-23-2008, 06:32 PM
Hello. I'm trying to set a movie clip to be at the top level whenever a certain function is called:

function Reveal(event:MouseEvent):void
{
Tweener.addTween (event.currentTarget, {scaleX:4, scaleY:4, alpha:1, time:0.5, transition:"easeInOutSine"});
stage.setChildIndex(stage.getChildAt(0), 1);

}

Basically I have about 100 squares which grow as you mouse over them. I need the same function thats makes them grow to also set the current target to the very front. I'm lost, I have hunted the help files, but am still without a clue. Any help would be appreciated.

Ta, A.

Sleeve
04-23-2008, 06:51 PM
Just call the addChild() method again on your DisplayObject and Flash will automatically place it in the topmost depth.