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.

leading:Number [optional] - A number that indicates the amount of leading vertical space<br />

between lines.<br />

Example<br />

The following example creates a TextFormat object, formats the stats_txt text field, <strong>and</strong><br />

creates a new text field to display the text in:<br />

// Define a TextFormat which is used to format the stats_txt text field.<br />

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

my_fmt.bold = true;<br />

my_fmt.font = "Arial";<br />

my_fmt.size = 12;<br />

my_fmt.color = 0xFF0000;<br />

// Create a text field to display the player's statistics.<br />

this.createTextField("stats_txt", 5000, 10, 0, 530, 22);<br />

// Apply the TextFormat to the text field.<br />

stats_txt.setNewTextFormat(my_fmt);<br />

stats_txt.selectable = false;<br />

stats_txt.text = "Lorem ipsum dolor sit amet...";<br />

To view another example, see the animations.fla file in the ActionScript samples folder at<br />

www.adobe.com/go/learn_fl_samples. Download <strong>and</strong> decompress the .zip file <strong>and</strong> navigate to<br />

the folder for your version of ActionScript to access the sample.<br />

underline (TextFormat.underline property)<br />

public underline : Boolean<br />

A Boolean value that indicates whether the text that uses this text format is underlined (true)<br />

or not (false). This underlining is similar to that produced by the tag, but the latter is<br />

not true underlining, because it does not skip descenders correctly. The default value is null,<br />

which indicates that the property is undefined.<br />

Note: For Arabic, Hebrew, <strong>and</strong> Thai, this property works for paragraph-level formatting only.<br />

Example<br />

The following example creates a text field <strong>and</strong> sets the text style to underline.<br />

this.createTextField("mytext",1,100,100,200,100);<br />

mytext.multiline = true;<br />

mytext.wordWrap = true;<br />

mytext.border = true;<br />

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

myformat.underline = true;<br />

mytext.text = "This is my first text field object text";<br />

mytext.setTextFormat(myformat);<br />

668 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!