Getcount (Textsnapshot.getcount Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
The following example illustrates how to use this method. 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 index1:Number = my_snap.findText(0, "Snap", true);
var index2:Number = my_snap.findText(0, "snap", true);
var index3:Number = my_snap.findText(0, "snap", false);
trace(index1); // 4
trace(index2); // -1
trace(index3); // 4
See also
getText (TextSnapshot.getText method)

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
- The number of characters in the TextSnapshot object.
Number
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)
1254
ActionScript classes

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents