textHeight (TextField.textHeight property)

public textHeight : Number

Indicates the height of the text, in pixels.

Availability: ActionScript 1.0; Flash Player 6

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 autoSize property is then used to resize the text field, and the new height and width will also be displayed in the Output panel.

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

See also

textWidth (TextField.textWidth property)


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00002246.html