User Guide

TextArea component 725
TextArea component
The TextArea component wraps the native ActionScript TextField object. You can use styles to
customize the TextArea component; when an instance is disabled, its contents display in a color
represented by the disabledColor style. A TextArea component can also be formatted with
HTML, or as a password field that disguises the text. See “Applying a style sheet to a TextArea
component” in Using ActionScript in Flash.
A TextArea component can be enabled or disabled in an application. In the disabled state, it
doesnt receive mouse or keyboard input. When enabled, it follows the same focus, selection, and
navigation rules as an ActionScript TextField object. When a TextArea instance has focus, you can
use the following keys to control it:
For more information about controlling focus, see “Creating custom focus navigation
on page 50 or “FocusManager class” on page 419.
A live preview of each TextArea instance reflects changes made to parameters in the Property
inspector or Component inspector during authoring. If a scroll bar is needed, it appears in the live
preview, but it does not function. Text is not selectable in the live preview, and you cannot enter
text in the component instance on the Stage.
When you add the TextArea component to an application, you can use the Accessibility panel to
make it accessible to screen readers.
Using the TextArea component
You can use a TextArea component wherever you need a multiline text field. If you need a single-
line text field, use the Text In p u t co mp o n en t. For example, you could use a TextArea component
as a comment field in a form. You could set up a listener that checks if the field is empty when a
user tabs out of the field. That listener could display an error message indicating that a comment
must be entered in the field.
TextArea parameters
You can set the following authoring parameters for each TextArea component instance in the
Property inspector or in the Component inspector:
text indicates the contents of the TextArea component. You cannot enter carriage returns in the
Property inspector or Component inspector. The default value is "" (an empty string).
html indicates whether the text is formatted with HTML (true) or not (false). The default
value is
false.
Key Description
Arrow keys Move the insertion point one line up, down, left, or right.
Page Down Moves one screen down.
Page Up Moves one screen up.
Shift+Tab Moves focus to the previous object.
Tab Moves focus to the next object.
CHAPTER 6
Components Dictionary