TextSnapshot

Object
    |
    +-TextSnapshot

public class TextSnapshot
extends Object

TextSnapshot objects let you work with static text in a movie clip. You can use TextSnapshot objects, for example, to layout text with greater precision than that allowed by dynamic text, but still access the text as read-only.

You don't use a constructor to create a TextSnapshot object; it is returned by the MovieClip.getTextSnapshot() method.

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.

See also

getTextSnapshot (MovieClip.getTextSnapshot method)

Property summary

Properties inherited from class Object

constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)


Method summary

Modifiers

Signature

Description

findText(startIndex:Number, textToFind:String, caseSensitive:Boolean) : Number

Searches the specified TextSnapshot object and returns the position of the first occurrence of textToFind found at or after startIndex.

getCount() : Number

Returns the number of characters in a TextSnapshot object.

getSelected(start:Number, [end:Number]) : Boolean

Returns a Boolean value that specifies whether a TextSnapshot object contains selected text in the specified range.

getSelectedText([includeLineEndings:Boolean]) : String

Returns a string that contains all the characters specified by the corresponding TextSnapshot.setSelected() method.

getText(start:Number, end:Number, [includeLineEndings:Boolean]) : String

Returns a string that contains all the characters specified by the start and end parameters.

getTextRunInfo(beginIndex:Number, endIndex:Number) : Array

Returns an array of objects that contains information about a run of text.

hitTestTextNearPos(x:Number, y:Number, [closeDist:Number]) : Number

Lets you determine which character within a TextSnapshot object is on or near the specified x, y coordinates of the movie clip containing the text in the TextSnapshot object.

setSelectColor(color:Number) : Void

Specifies the color to use when highlighting characters that were selected with the TextSnapshot.setSelected() method.

setSelected(start:Number, end:Number, select:Boolean) : Void

Specifies a range of characters in a TextSnapshot object to be selected or not.

Methods inherited from class Object

addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)