TextField.password Property

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
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



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net