/ Published in: ActionScript 3

Often used in conjunction with dragging elements around the screen, you may want the item most recently picked up to jump to the top of the "stack." Here's how to do it. In the event handler you create, you tell the item's parent to set its child's index to the highest number of its children.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private function YourHandlerFunction(e:MouseEvent):void { e.currentTarget.parent.setChildIndex(DisplayObject(e.currentTarget), e.currentTarget.parent.numChildren - 1); e.currentTarget.startDrag(); }
Comments
