User Guide

702 ActionScript classes
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 Lite 2.0 - 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.
Example
This example creates a single-line text field that's just big enough to display a text string using
the specified formatting.
var my_str:String = "Small string";