Packagecom.rubenswieringa.utils
Classpublic class ChildTool

All-static class that provides additional functionality for adding and removing children to and from Containers.



Public Methods
 MethodDefined by
  
moveChild(child:DisplayObject, container:DisplayObjectContainer, index:int = -1):void
[static] Removes a DisplayObject from its parent and adds it to a new parent at a certain index (if provided).
ChildTool
  
swapChildren(child1:DisplayObject, child2:DisplayObject):void
[static] Moves child1 to child2 its place and the other way around.
ChildTool
Method detail
moveChild()method
public static function moveChild(child:DisplayObject, container:DisplayObjectContainer, index:int = -1):void

Removes a DisplayObject from its parent and adds it to a new parent at a certain index (if provided).

Parameters
child:DisplayObject — DisplayObject to move.
 
container:DisplayObjectContainer — New parent for child.
 
index:int (default = -1) — Index at which to add child to container.
swapChildren()method 
public static function swapChildren(child1:DisplayObject, child2:DisplayObject):void

Moves child1 to child2 its place and the other way around.

Parameters
child1:DisplayObject — DisplayObject to move to child2's place.
 
child2:DisplayObject — DisplayObject to move to child1's place.