TextArea class

Inheritance UIObject > UIComponent > View > ScrollView > TextArea

ActionScript Class Namespace mx.controls.TextArea

The properties of the TextArea class allow you to set the text content, formatting, and horizontal and vertical position at runtime. You can also indicate whether the field is editable, and whether it is a "password" field. You can also restrict the characters that a user can enter.

Setting a property of the TextArea class with ActionScript overrides the parameter of the same name set in the Property inspector or Component Inspector panel.

The TextArea component overrides the default Flash Player focus rectangle and draws a custom focus rectangle with rounded corners.

The TextArea component supports CSS styles and any additional HTML styles supported by Flash Player.

Each component class has a version property which is a class property. Class properties are only available on the class itself. The version property returns a string that indicates the version of the component. To access the version property, use the following code:

trace(mx.controls.TextArea.version);

Note: The following code returns undefined: trace(myTextAreaInstance.version);.

Property summary for the TextArea class

Property

Description

TextArea.editable

A Boolean value indicating whether the field is editable (true) or not (false).

TextArea.hPosition

Defines the horizontal position of the text within the scroll pane.

TextArea.hScrollPolicy

Indicates whether the horizontal scroll bar is always on ("on"), never on ("off"), or turns on when needed ("auto").S

TextArea.html

A flag that indicates whether the text field can be formatted with HTML.

TextArea.length

The number of characters in the text field. This property is read-only.

TextArea.maxChars

The maximum number of characters that the text field can contain.

TextArea.maxHPosition

The maximum value of TextArea.hPosition.

TextArea.maxVPosition

The maximum value of TextArea.vPosition.

TextArea.password

A Boolean value indicating whether the field is a password field (true) or not (false).

TextArea.restrict

The set of characters that a user can enter into the text field.

TextArea.text

The text contents of a TextArea component.

TextArea.vPosition

A number indicating the vertical scrolling position

TextArea.vScrollPolicy

Indicates whether the vertical scroll bar is always on ("on"), never on ("off"), or turns on when needed ("auto").S

TextArea.wordWrap

A Boolean value indicating whether the text wraps (true) or not (false).

Event summary for the TextArea class

Event

Description

TextArea.change

Notifies listeners that text has changed.