TextArea.password

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

textAreaInstance.password

Description

Property; a Boolean value indicating whether the text area is a password field (true) or not (false). If password is true, the text area is a password text area and hides the input characters with asterisks. If password is false, the text area is not a password text area. The default value is false.

Example

The following example treats the text in the TextArea called my_ta as a password field if the check box called my_ch is checked. Otherwise it treats it as ordinary text.

You must first add an instance of the TextArea component to the Stage and name it my_ta and also add a check box and name it my_ch; then add the following code to Frame 1.

/**
 Requires:
  - TextArea instance on Stage (instance name: my_ta)
  - CheckBox instance on Stage (instance name: my_ch)
*/
var my_ta:mx.controls.TextArea;
var my_ch:mx.controls.CheckBox;

my_ta.wordWrap = false;
my_ta.password = true;
my_ch.selected = my_ta.password;

var chListener:Object = new Object();
chListener.click = function(evt_obj:Object) {
 my_ta.password = my_ch.selected;
}
my_ch.addEventListener("click", chListener);