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.

getNewTextFormat (TextField.getNewTextFormat<br />

method)<br />

public getNewTextFormat() : TextFormat<br />

Returns a TextFormat object containing a copy of the text field's text format object. The text<br />

format object is the format that newly inserted text, such as text entered by a user, receives.<br />

When getNewTextFormat() is invoked, the TextFormat object returned has all of its<br />

properties defined. No property is null.<br />

Returns<br />

TextFormat - A TextFormat object.<br />

Example<br />

The following example displays the specified text field's (my_txt) text format object.<br />

this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160,<br />

120);<br />

var my_fmt:TextFormat = my_txt.getNewTextFormat();<br />

trace("TextFormat has the following properties:");<br />

for (var prop in my_fmt) {<br />

trace(prop+": "+my_fmt[prop]);<br />

}<br />

getTextFormat (TextField.getTextFormat method)<br />

public getTextFormat([beginIndex:Number], [endIndex:Number]) : TextFormat<br />

Returns a TextFormat object for a character, for a range of characters, or for an entire<br />

TextField object.<br />

■ Usage 1:my_textField.getTextFormat()<br />

Returns a TextFormat object containing formatting information for all text in a text field.<br />

Only properties that are common to all text in the text field are set in the resulting<br />

TextFormat object. Any property which is mixed, meaning that it has different values at<br />

different points in the text, has a value of null.<br />

■ Usage 2:my_textField.getTextFormat(beginIndex:Number)<br />

Returns a TextFormat object containing a copy of the text field's text format at the<br />

beginIndex position.<br />

■ Usage 3:my_(extField.getTextFormat(beginIndex:Number,endIndex:Number)<br />

622 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!