actionscript 2 - How to clear a text input on focus but still be able to type? Flash/AS2 -



actionscript 2 - How to clear a text input on focus but still be able to type? Flash/AS2 -

i trying create user input in swf , want clear default text on focus still allow user type input.

currently using next as2 code:

input.zip.onsetfocus = function() { input.zip.text = ""; }

this clears text expected, 1 time text cleared, cannot type input. if remove code, can type in input fine.

any ideas? thanks!

you're either continuously setting text empty... or setting text once, you're changing type. code snippet should resolve both issues.

//store boolean somewhere var hadfocus = false; input.zip.onsetfocus = function() { if(!hadfocus){ input.zip.text = ""; input.zip.type = "input"; hadfocus = true; } } input.zip.onkillfocus = function() { hadfocus = false; }

flash actionscript-2

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -