Using ActionScript 3.0 Components |
|
|
|
| Customizing the UI Components > Customizing the TextArea > Using styles with the TextArea | |||
The TextArea component's styles specify values for its skins, padding, and text format when the component is drawn. The texFormat and disabledTextFormat styles govern the style of the text that the TextArea displays. For more information about the skin style properties, see Using skins with the TextArea.
The following example sets the disabledTextFormat style to change the appearance of text when the TextArea is disabled but the same process applies to setting the textFormat style for an enabled TextArea.
To set the disabledTextFormat style for a TextArea:
var tf:TextFormat = new TextFormat();
tf.color = 0xCC99FF;
tf.font = "Arial Narrow";
tf.size = 24;
myTa.setStyle("disabledTextFormat", tf);
myTa.text = "Hello World";
myTa.setSize(120, 50);
myTa.move(200, 50);
myTa.enabled = false;
|
|
|
|