03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The following figure illustrates these measurements.<br />

When setting up your TextFormat object, set all the attributes exactly as they will be set for<br />

the creation of the text field, including font name, font size, <strong>and</strong> leading. The default value for<br />

leading is 2.<br />

Parameters<br />

text:String - A string.<br />

width:Number [optional] - A number that represents the width, in pixels, at which the<br />

specified text should wrap.<br />

Returns<br />

Object - An object with the properties width, height, ascent, descent, textFieldHeight,<br />

textFieldWidth.<br />

Example<br />

This example creates a single-line text field that's just big enough to display a text string using<br />

the specified formatting.<br />

var my_str:String = "Small string";<br />

// Create a TextFormat object,<br />

// <strong>and</strong> apply its properties.<br />

var my_fmt:TextFormat = new TextFormat();<br />

with (my_fmt) {<br />

font = "Arial";<br />

bold = true;<br />

TextFormat 661

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!