![MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference Download Page 1235](http://html.mh-extra.com/html/macromedia/flash-8-actionscript-2-0-language/flash-8-actionscript-2-0-language_reference_6875371235.webp)
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
.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...