getCount (TextSnapshot.getCount method)

public getCount() : Number

Returns the number of characters in a TextSnapshot object.

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 7 or later.

Returns

Number - The number of characters in the TextSnapshot object.

Example

The following example illustrates how you can return the number of characters in a TextSnapshot object. To use this code, place one static text field that contains the text "TextSnapshot Example" (and only that text) 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

getText (TextSnapshot.getText method)