How to hide a TextField when clicking another button
Hello!
I've been able to generate a TextField to appear when clicking a button, but when I click on another button, to display some more information, I still have the first TextField displayed. I've had a look around, but not been able to find anything to help me with getting the first to disappear. Can anyone provide any ideas for this?
The code I'm using for displaying the TextField is:
button10.addEventListener(MouseEvent.CLICK, fl_ClickToPosition);
var fl_TF:TextField;
var fl_TextToDisplay:String = "Send disply to the right screen/projector";
function fl_ClickToPosition(event:MouseEvent):void
{
fl_TF = new TextField();
fl_TF.autoSize = TextFieldAutoSize.LEFT;
fl_TF.background = true;
fl_TF.border = true;
fl_TF.x = 300;
fl_TF.y = 100;
fl_TF.text = fl_TextToDisplay;
addChild(fl_TF);
}
Many thanks in advance