Adobe Flash CS5.5 and AS3 – Classic TextField vs. TLFTextField for password usage

The following demonstrates how to use the Classic TextField and the TLFTextField for the purposes of creating a password behavior type text.

Classic Text

Drag a Text Tool to the stage and call the Instance Name, txtPassword
Choose ‘Classic Text’ for the text engine
Choose ‘Input Text’ as the text type

In the code, set the txtPassword for password behavior as follows:

 txtPassword.displayAsPassword = true;

To disable txtPassword so the user can not enter data:

 txtPassword.type= "input";

To enable txtPassword so the user can enter data:

 txtPassword.type = "dynamic"

++++++++++++++++++++++++++++++++++++++++++++++++++++++

TLF Text

Drag a Text Tool to the stage and call the Instance Name, txtPassword
Choose ‘TLF Text’ for the text engine
Choose ‘Editable’ as the text type
Choose ‘Password’ as the behavior

To disable txtPassword so the user can not enter data:

 txtPassword.type= "input";

To enable txtPassword so the user can enter data:

 txtPassword.type = "dynamic"

Leave a Reply

Your email address will not be published. Required fields are marked *