Sounds like all you want to do is hide the textField
initially and reveal it later. If this is the case you can simply set the field's visible
property.
// Hide the field initially
greetMe.visible = false;
// And show it when required
greetMe.visible = true;
If you need to put the textfield
behind your button, you can use the swapChildren
method of DisplayList
. From the documentation):
Swaps the z-order (front-to-back order) of the two specified child objects. All other child objects in the display object container remain in the same index positions.
swapChildren(greetMe, myButton);
Or you could use setChildIndex
to ensure the textField is at the bottom of the displayList
like so (documentation):
setChildIndex(greetMe, 0);