Controlling the z-index of display objects
Problem: Depth doesn’t exist in ActionScript 3, which means that the swapDepths and getNextHighestDepth methods can no longer be used to change the z-axis of a display object.
Solution: Controlling the z-axis and finding the highest z-index is possible. Since display objects reside on the display list, the syntax reflects the new architecture.
Code: setChildIndex is an inherent display object method that can be used to set the z-axis index of child display objects. The numChildren property is an inherent display object property that can be used to determine the highest z-axis index in the current display list.