Table of Contents

TextField.password Property Flash 5

obscure characters displayed in the fieldFlash 6; accessible only via authoring tool in read/write
theField.password

Description

The Boolean password property specifies whether a field's characters should be displayed normally (false) or obscured on screen for privacy (true). When true, all characters, including spaces, are displayed as asterisks (*). For example, the words "hi there" are displayed as "********". This allows users to enter text without casual onlookers seeing it.

Any text entered while password is true is not altered and can be retrieved as usual through the text property. The password property does not affect other line display properties such as multiline and wordWrap; text in a password-enabled field can both wrap and span multiple lines. The Cut and Copy commands do not function in a password text field.

Fields for which password is true are not secure despite being masked on screen. Their content is still visible if, say, it is transmitted to a server-side script. For information on securing a Flash application, see http://www.macromedia.com/desdev/security and http://www.macromedia.com/desdev/mx/flash/extreme/extreme003.html.

Example

The following code creates typical username and password text input fields:

this.createTextField("nameInput_txt", 1, 0, 0, 200, 20);
nameInput_txt.type = "input";
nameInput_txt.border = true;
this.createTextField("passInput_txt", 2, 0, 30, 200, 20);
passInput_txt.type = "input";
passInput_txt.border = true;
passInput_txt.password = true;

See Also

TextField.multiline, TextField.text, TextField.type, TextField.wordWrap


Table of Contents