replaceChild
Replaces the direct child at the given index with child, detaching the previous child (its parent becomes null).
Return
the previous child that was at index, now detached.
Parameters
index
the position of the child to replace; must be in 0 until children.size.
child
a node that is not already attached to a tree. To move a node that already has a parent, call detach on it first.
Throws
if index is out of range.