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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -