Posted By

ozke on 04/16/09


Tagged

sort utilities as3 Depth


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

gudeidea
ozke
macKaminski
TrentSkunk


Move a clip to the highest depth


 / Published in: ActionScript 3
 

Add this to your Utilities class and use it like Utilities.moveToTop(your_clip);

  1. public static function moveToTop(child:DisplayObject):void{
  2. (child.parent != null) ? child.parent.setChildIndex(child, child.parent.numChildren-1) : null;
  3. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: MrMarkers on April 17, 2009

I guess the easiest way is parent.addChild(child) ?

Posted By: ozke on December 2, 2009

What if there is no parent?

You need to login to post a comment.