Search code examples
actionscript-3apache-flexflash-builderflex4.5

Flash Builder 4.7 I want the spark TextInput to have an background text like Username. Is there anything ready?


I would like my spark TextInput to have a background text. It just sounds like something that should be easily in the component and so I wouldn't want to program it in an ugly way. Something like, when the component is not focused it shows Username with different letter style like Italic for example. So when you press on the textInput it disappears and will only show again if there is no text. It sounds like something that I could easily code. But there must be something done for it already. Thanks, David


Solution

  • Just use promt property:

    <s:TextInput prompt="Not Focused Empy text" text="Other text" />
    

    See more here: http://help.adobe.com/en_US/flex/using/WS19f279b149e7481c-177b1c712d80a315e7-8000.html