Textcolor (Textfield.textcolor Property); Textheight (Textfield.textheight Property) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

textColor (TextField.textColor property)

public textColor :
Indicates the color of the text in a text field. The hexadecimal color system uses six digits to
represent color values. Each digit has sixteen possible values or characters. The characters
range from 0 to 9 and then A to F. Black is represented by (
opposite end of the color system, is (
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following ActionScript creates a text field and changes its color property to red.
this.createTextField("my_txt", 99, 10, 10, 100, 300);
my_txt.text = "this will be red text";
my_txt.textColor = 0xFF0000;

textHeight (TextField.textHeight property)

public textHeight :
Indicates the height of the text.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example creates a text field, and assigns a string of text to the field. A trace
statement is used to display the text height and width in the Output panel. The
method is used to write the text height and width in the log file. The
then used to resize the text field, and the new height and width will also be displayed in the
Output panel.The
autoSize
and width also write to the log file.
this.createTextField("my_txt", 99, 10, 10, 100, 300);
my_txt.text = "Sample text";
trace("textHeight: "+my_txt.textHeight+", textWidth: "+my_txt.textWidth);
trace("_height: "+my_txt._height+", _width: "+my_txt._width+"\n");
my_txt.autoSize = true;
trace("after my_txt.autoSize = true;");
trace("_height: "+my_txt._height+", _width: "+my_txt._width);
Which outputs the following information:
textHeight: 15, textWidth: 56
_height: 300, _width: 100
after my_txt.autoSize = true;
_height: 19, _width: 60
Number
#FFFFFF
Number
property is then used to resize the text field, and the new height
#000000
).
) and white, at the
trace()
property is
autoSize
TextField
687

Advertisement

Table of Contents
loading

Table of Contents