Quick function for moving a sprite to the highest depth

private function moveToHighestDepth(displayObject:*):void{
      var curParent = displayObject.parent;
      curParent.removeChild(displayObject);
      curParent.addChild(displayObject);
 }

Why not just use DisplayObjectContainer’s “setChildIndex” method? ;)

Leave a Comment

You must be logged in to post a comment.