Flash Lite 2.x and 3.0 ActionScript Language Reference

getNewTextFormat (TextField.getNewTextFormat method)

public getNewTextFormat() : TextFormat

Returns a TextFormat object containing a copy of the text field's text format object. The text format object is the format that newly inserted text, such as text entered by a user, receives. When getNewTextFormat() is invoked, the TextFormat object returned has all of its properties defined. No property is null.

Returns

TextFormat - A TextFormat object.

Example

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

this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160, 120);
var my_fmt:TextFormat = my_txt.getNewTextFormat();
trace("TextFormat has the following properties:");
for (var prop in my_fmt) {
    trace(prop+": "+my_fmt[prop]);
}