User Guide

1182 TextArea component
You can make the background of TextArea components transparent by setting the
backgroundColor style globally to a value of undefined. You then need to set the
backgroundColor style to a color individually for all TextArea components that you do not
want to be transparent.
// Give all TextArea components transparent backgrounds.
_global.styles.TextArea.backgroundColor = undefined;
//Make this specific component instance have a white background.
myTextArea2.setStyle( "backgroundColor", "white" );
The TextArea component supports one set of component styles for all text in the field.
However, you can also display HTML that is compatible with Flash Player HTML rendering.
To display HTML text, set
TextArea.html to true.
If you do set the TextArea to display HTML text, the text style is set using the
TextField.StyleSheet class (see details for this class in the ActionScript 2.0 Language Reference).
For example:
1. Drag a TextArea component to the Stage, and give it the instance name my_ta.
2. Enter this code in Actions panel for Frame 1 of the timeline:
var my_styles = new TextField.StyleSheet();
my_styles.setStyle("p", {fontFamily:'Arial,Helvetica,sans-serif',
fontSize:'12px', color:'#CC6699'});
my_ta.styleSheet = my_styles;
my_ta.html = true;
my_ta.text = "<p>This is some text</p>";
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 1063 and “Using skins with the UIScrollBar component” on page 1394.
TextArea class
Inheritance MovieClip > UIObject class > UIComponent class > View > ScrollView >
Te xt Are 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.