1258 ActionScript classes
Example
The following example illustrates how you can return the number of characters in a specified
TextSnapshot object. To use this code, place a static text field that contains the text
"TextSnapshot Example" on the Stage.
var my_mc:MovieClip = this;
var my_snap:TextSnapshot = my_mc.getTextSnapshot();
var count:Number = my_snap.getCount();
var theText:String = my_snap.getText(0, count, false);
trace(count); // 20
trace(theText); // TextSnapshot Example
See also
getCount (TextSnapshot.getCount method)
,
getSelectedText
(TextSnapshot.getSelectedText method)
getTextRunInfo (TextSnapshot.getTextRunInfo
method)
public getTextRunInfo(beginIndex:Number, endIndex:Number) : Array
Returns an array of objects that contains information about a run of text. Each object
corresponds to one character in the range of characters specified by the two method
parameters.
Availability:
ActionScript 1.0; Flash Player 7 - The SWF file must be published for Flash
Player 6 or later, and must be played in Flash Player 7r19 or later.
Parameters
beginIndex
:Number
- The index value of the first character in the range of characters.
endIndex
:Number
- The index value of the last character in the range of characters.
NO
TE
Using the
getTextRunInfo()
method for a large range of text can return a large object.
Macromedia recommends limiting the text range defined by the
beginIndex
and
endIndex
parameters.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...