03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

getTextSnapshot (MovieClip.getTextSnapshot<br />

method)<br />

public getTextSnapshot() : TextSnapshot<br />

Returns a TextSnapshot object that contains the text in all the static text fields in the specified<br />

movie clip; text in child movie clips is not included. This method always returns a<br />

TextSnapshot object.<br />

Flash concatenates text <strong>and</strong> places it in the TextSnapshot object in an order that reflects the<br />

tab index order of the static text fields in the movie clip. Text fields that don't have tab index<br />

values are placed in a r<strong>and</strong>om order in the object, <strong>and</strong> precede any text from fields that do<br />

have tab index values. No line breaks or formatting indicates where one field ends <strong>and</strong> the<br />

next begins.<br />

Note: You can't specify a tab index value for static text in Flash. However, other products may<br />

do so (for example, Macromedia FlashPaper).<br />

The contents of the TextSnapshot object aren't dynamic; that is, if the movie clip moves to a<br />

different frame, or is altered in some way (for example, objects in the movie clip are added or<br />

removed), the TextSnapshot object might not represent the current text in the movie clip. To<br />

ensure that the object's contents are current, reissue this comm<strong>and</strong> as needed.<br />

You can extend the methods <strong>and</strong> event h<strong>and</strong>lers of the MovieClip class by creating a subclass.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 7 - SWF files published for Flash Player 6 or later,<br />

playing in Flash Player 7 or later.<br />

Returns<br />

TextSnapshot - A TextSnapshot object that contains the static text from the movie clip.<br />

Example<br />

The following example shows how to use this method. To use this code, place a static text field<br />

that contains the text "TextSnapshot Example" on the Stage.<br />

var textSnap:TextSnapshot = this.getTextSnapshot();<br />

trace(textSnap.getText(0, textSnap.getCount(), false));<br />

See also<br />

TextSnapshot<br />

getURL (MovieClip.getURL method)<br />

public getURL(url:String, [window:String], [method:String]) : Void<br />

MovieClip 883

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!