Skip to main content
Inspiring
November 10, 2012
Question

StageText change displayAsPassword at Runtime

  • November 10, 2012
  • 1 reply
  • 1458 views

Hi there,

in my mobile app i have a login screen where the shown text input fields (which use StageText internally) should show the title of the input field per default

(e.g. "Login", "Password"). When the user clicks on such a field the title text should be cleared.

That works fine for the login input field, but for the password field the attribute displayAsPassword needs to be set to true after clearing or with the start

of the user's first character entering, and this doesn't work so far.

I tried this switch in the focusIn (no reaction) and the keyDown (only Enter Key is recognized) handler and i don't see any other suitable event handler around

that could help.

Example of the focusIn handler:

if (this.stageText.text == _defaultTitle) {

 

    if (_passwordField == true) {

        this.stageText.displayAsPassword = true;

   }

   this.text = this.stageText.text = "";

}

It works fine in the AIR Simulator, but not in the iOS Simulator and on the device itself.

Does someone know how i can successfully toggle from a normal to a password input field and back or

is there another solution when using StageText ?

Thanks a lot.

valley

This topic has been closed for replies.

1 reply

Adobe Employee
November 15, 2012

If you are using Flex TextInput field, changing the skin class to spark.skins.mobile.TextInputSkin would help. Refer this link for details.

-Neha

Legend
November 16, 2012

The alternative would be just to swap out a button with the textfield on mouse down.

G

Participating Frequently
June 7, 2013

valley t,

Did you figure out a good solution for this?