User Guide
TextField.getNewTextFormat() 887
TextField.getNewTextFormat()
Availability
Flash Player 6.
Usage
my_txt.getNewTextFormat() : TextFormat
Parameters
None.
Returns
A TextFormat object.
Description
Method; 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 inserted with the
replaceSel() method or text entered by a user, receives. When getNewTextFormat() is
invoked, the TextFormat object returned has all of its properties defined. No property is
null.
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]);
}