User Guide

TextField 1181
trace("TextFormat has the following properties:");
for (var prop in my_fmt) {
trace(prop+": "+my_fmt[prop]);
}
The MovieClip.getNextHighestDepth() method used in this example requires Flash Player
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth() method.
getTextFormat (TextField.getTextFormat method)
public getTextFormat([beginIndex:Number], [endIndex:Number]) : TextFormat
Returns a TextFormat object for a character, a range of characters, or an entire TextField
object.
The following table describes three possible usages:
Availability: ActionScript 1.0; Flash Player 6
Parameters
beginIndex:Number [optional] - An integer that specifies a character in a string. If you do
not specify
beginIndex and endIndex, the TextFormat object returned is for the entire
Te xt Fi e ld .
endIndex:Number [optional] - An integer that specifies the end position of a span of text. If
you specify
beginIndex but do not specify endIndex, the TextFormat returned is for the
single character specified by
beginIndex.
Usage Description
my_textField.getTextForm
at()
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 that is mixed, meaning that it has different values at
different points in the text, has a value of
null.
my_textField.getTextForm
at(beginIndex:Number)
Returns a TextFormat object containing a copy of the text field's
text format at the
beginIndex position.
my_textField.getTextForm
at(beginIndex:Number,end
Index:Number)
Returns a TextFormat object containing formatting information
for the span of text from
beginIndex to endIndex. Only properties
that are common to all of the text in the specified range are set in
the resulting TextFormat object. Any property that is mixed (that
is, has different values at different points in the range) has its
value set to
null.