Table of Contents

TextField.textColor Property Flash 6

sets the color for all characters in the text field read/write
theField.textColor

Description

The integer textColor property is a convenience property for quickly setting the color of the text (not the background color) for an entire text field with minimal fuss. It defaults to black (i.e., hex 0x000000). The following code makes the title_txt field red:

this.createTextField("title_txt", 1, 0, 0, 200, 20);
title_txt.text = "The Story of Princess Gwendolyn";
title_txt.textColor = 0xFF0000;

To set the background color, use the backgroundColor property. To color and format text on a character-by-character basis, use setTextFormat( ) or htmlText instead. Any assignment to textColor overwrites specific character color information contained in the field's htmlText property or TextFormat objects. Once textColor is set, all subsequent text appears in the specified color. Functionally, assigning textColor is identical to creating a TextFormat object with a color property set, then applying that format to the entire field with setTextFormat( ) and also applying it to any new text with setNewTextFormat( ). The value of textColor is also reflected in htmlText if the html property is true.

See Also

The Color class, TextField.backgroundColor, TextField.borderColor, TextField.html, TextField.htmlText, TextField.setNewTextFormat( ), TextField.setTextFormat( )


Table of Contents