Flash Lite 2 |
|||
| Flash Lite 2.x ActionScript Language Reference > ActionScript classes > TextFormat > color (TextFormat.color property) | |||
public color : Number
A number that indicates the color of text. The number contains three 8-bit RGB components; for example, 0xFF0000 is red, and 0x00FF00 is green.
Note: For Arabic, Hebrew, and Thai, this property works for paragraph-level formatting only.
Availability: ActionScript 1.0; Flash Lite 2.0
The following example creates a text field and sets the text color to red.
var my_fmt:TextFormat = new TextFormat();
my_fmt.blockIndent = 20;
my_fmt.color = 0xFF0000; // hex value for red
this.createTextField("my_txt", 1, 100, 100, 300, 100);
my_txt.multiline = true;
my_txt.wordWrap = true;
my_txt.border = true;
my_txt.text = "this is my first text field object text";
my_txt.setTextFormat(my_fmt);