TextSnapshot.getCount()
Availability
Authoring: Flash MX 2004.
Playback: SWF files published for Flash Player 6 or later, playing in Flash Player 7 or later.
Usage
my_snap.getCount() : Number
Parameters
None.
Returns
An integer representing the number of characters in the specified TextSnapshot object.
Description
Method; returns the number of characters in a TextSnapshot object.
Example
The following example illustrates how you can output the number of characters in a specified
TextSnapshot object. To use this code, place a static text field containing the text "TextSnapshot
Example" on the Stage.
// this example assumes that the movie clip contains
// the static text "TextSnapshot Example"
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); // output: 20
trace(theText); // output: TextSnapshot Example
See also
TextSnapshot.getText()
966
Chapter 2: ActionScript Language Reference
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?