Button open/close text field

i dont know if this solvable via flash cs3 section or its a as3 issue…

well i still a newb on the learning curve of as3…i would appreciate and great full
to those that can help me with this…

i know and did the buttons for the text fields…
i did most of the work just it ain’t working like expected so hoping for information on how to solve this puzzle…

i want my button when pressed to open a text box in current frame; but when i press it again the same button that it closes it.

thank you very much for assistance

10+ views please if know anything that can lead me to answer please tell me. any help even from newbs be much appreciated …we all started from somewhere…

thanks again

a followup to what you asked.

what i am trying to do is as follows…

i have a button with the 3 statuses up/over/down…when i press it a textbox appears…
when i press it again then it vanishes

thank you please confirm on this asc3 to make it happen

anyone willing to view and share their wisdom to this…

thank you

First set the text object in the library to be exported for actionscript (right click and click on properties).

Then change the code to this:
button.addEventListener(MouseEvent.CLICK, showText);
var _text:myText = new myText();

function showText(event:MouseEvent):void {
this.addChild(_text);
_text.x = 100;
_text.y = 100;
button.removeEventListener(MouseEvent.CLICK, showText);
button.addEventListener(MouseEvent.CLICK, hideText);
}

function hideText(event:MouseEvent):void {
this.removeChild(_text);
button.removeEventListener(MouseEvent.CLICK, hideText);
button.addEventListener(MouseEvent.CLICK, showText);
}
stop();

Should work.

thanks and deeply appreciate your effort and time with the help.

thanks and it works wonderfully :):party: