Getnewtextformat (Textfield.getnewtextformat Method); Gettextformat (Textfield.gettextformat Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

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()
properties defined. No property is
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
- A TextFormat object.
TextFormat
Example
The following example displays the specified text field's (
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]);
}

getTextFormat (TextField.getTextFormat method)

public getTextFormat([beginIndex:Number], [endIndex:Number]) : TextFormat
Returns a TextFormat object for a character, for a range of characters, or for an entire
TextField object.
Usage 1:
my_textField.getTextFormat()
Returns a TextFormat object containing formatting information for all text in a text field.
Only properties that are common to all text in the text field are set in the resulting
TextFormat object. Any property which is mixed, meaning that it has different values at
different points in the text, has a value of
Usage 2:
my_textField.getTextFormat(beginIndex:Number)
Returns a TextFormat object containing a copy of the text field's text format at the
position.
beginIndex
is invoked, the TextFormat object returned has all of its
.
null
null.
) text format object.
my_txt
TextField
659

Advertisement

Table of Contents
loading

Table of Contents