User Guide

TextFormat 1235
The width and height measurements provide the width and height of the text string. The
textFieldHeight and textFieldWidth measurements provide the height and width
required for a text field object to display the entire text string. Text fields have a 2-pixel-wide
gutter around them, so the value of
textFieldHeight is equal the value of height + 4;
likewise, the value of
textFieldWidth is always equal to the value of width + 4.
If you are creating a text field based on the text metrics, use
textFieldHeight rather than
height and textFieldWidth rather than width.
The following figure illustrates these measurements.
When setting up your TextFormat object, set all the attributes exactly as they will be set for
the creation of the text field, including font name, font size, and leading. The default value for
leading is 2.
Availability: ActionScript 1.0; Flash Player 6 - The width parameter is supported in Flash
Player 7.
Parameters
text:String - A string.
width:Number [optional] - A number that represents the width, in pixels, at which the
specified text should wrap.
Returns
Object - An object with the properties width, height, ascent, descent, textFieldHeight,
textFieldWidth.