A string specifying the text to search for. If you specify a string literal instead of a
textToFind
variable of type String, enclose the string in quotation marks.
caseSensitive
of the string in
textToFind
Returns
The zero-based index position of the first occurrence of the specified text, or -1.
Description
Method; searches the specified TextSnapshot object and returns the position of the first
occurrence of
textToFind
method returns -1.
Example
The following example illustrates how to use this method. To use this code, create a static text
field that contains the text "TextSnapshot Example".
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); // output: 4
trace(index2); // output: -1
trace(index3); // output: 4
See also
TextSnapshot.getText()
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.
A Boolean value specifying whether the text in
.
found at or after
my_snap
. If
startIndex
textToFind
must match the case
is not found, the
TextSnapshot.getCount()
791
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?