swapChildrenAt method

void swapChildrenAt (int index1, int index2)

Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list.

All other child objects in the display object container remain in the same index positions.

Implementation

void swapChildrenAt(int index1, int index2) {
  DisplayObject child1 = getChildAt(index1);
  DisplayObject child2 = getChildAt(index2);
  _children[index1] = child2;
  _children[index2] = child1;
}