User Guide

728 Chapter 6: Components Dictionary
The TextArea and TextInput components use exactly the same styles and are often used in the
same manner. Thus, by default they share the same class-level style declaration. For example, the
following code sets a style on the TextInput declaration, but it affects both TextInput and
TextArea components.
_global.styles.TextInput.setStyle("disabledColor", 0xBBBBFF);
To separate the components and provide class-level styles for one and not the other, create a new
style declaration.
import mx.styles.CSSStyleDeclaration;
_global.styles.TextArea = new CSSStyleDeclaration();
_global.styles.TextArea.setStyle("disabledColor", 0xFFBBBB);
This example does not check if _global.styles.TextArea existed before overwriting it; it
assumes you know it exists and want to overwrite it.
Using skins with the TextArea component
The TextArea component uses an instance of RectBorder for its border and scroll bars for
scrolling images. For more information about skinning these visual elements, see “RectBorder
class” on page 647 and “Using skins with the UIScrollBar component” on page 831.
TextArea class
Inheritance MovieClip > UIObject class > UIComponent class > View > ScrollView >
Te xt A re a
ActionScript Class Name mx.controls.TextArea
The properties of the TextArea class let you 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.
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.
textAlign
Both The text alignment: either "left", "right", or "center". The
default value is
"left".
textIndent
Both A number indicating the text indent. The default value is 0.
textDecoration
Both The text decoration: either "none" or "underline". The default
value is
"none".
Style Theme Description