Hello.
The theme question sais it all.
I have an input text-field on the stage that has some text describing text in it before the user types anything. Now, how do I clear this text when the user focuses on (clicks) the field?
Hello.
The theme question sais it all.
I have an input text-field on the stage that has some text describing text in it before the user types anything. Now, how do I clear this text when the user focuses on (clicks) the field?
Listen for the FocusEvent.FOCUS_IN
event on your textfield and clear it once that fires.
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/events/FocusEvent.html
This should do it. (Although, my AS3 is a bit rusty.)
textbox.addEventListener(FocusEvent.FOCUS_IN, clearBox);
function clearBox(e:FocusEvent){
textbox.setText("");
}