MovieClip.getTextSnapshot()
581
MovieClip.getTextSnapshot()
Availability
Authoring: Flash MX 2004.
Playback: SWF files published for Flash Player 6 or later, playing in Flash Player 7 or later.
Usage
my_mc
.getTextSnapshot()
: TextSnapshot
Parameters
None.
Returns
A TextSnapshot object that contains the static text from
my_mc
.
Description
Method; returns a TextSnapshot object that contains the text in all the static text fields in the
specified movie clip; text in child movie clips is not included. This method always returns a
TextSnapshot object.
Flash concatenates text and places it in the TextSnapshot object in an order that reflects the tab
index order of the static text fields in the movie clip. Text fields that don’t have tab index values
are placed in a random order in the object, and precede any text from fields that do have tab index
values. No line breaks or formatting indicates where one field ends and the next begins.
Note:
You can’t specify a tab index value for static text in Flash. However, other products may do so
(for example, Macromedia FlashPaper).
The contents of the TextSnapshot object aren’t dynamic; that is, if the movie clip moves to a
different frame, or is altered in some way (for example, objects in the movie clip are added or
removed), the TextSnapshot object might not represent the current text in the movie clip. To
ensure that the object’s contents are current, reissue this command as needed.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Example
The following code dynamically creates a TextSnapshot object called
textShapshot_txt
inside a
movie clip called
text_mc
.
this.createEmptyMovieClip("text_mc", this.getNextHighestDepth());
text_mc.createTextField("textSnapshot_txt", text_mc.getNextHighestDepth(), 10,
10, 240, 160);
text_mc.textSnapshot_txt.multiline = true;
text_mc.textSnapshot_txt.wordWrap = true;
text_mc.textSnapshot_txt.autoSize = true;
text_mc.textSnapshot_txt.border = true;
text_mc.textSnapshot_txt.html = true;
//
var textSnap:TextSnapshot = text_mc.getTextSnapshot();
text_mc.textSnapshot_txt.htmlText = "<textformat tabstops='[150]'>";
for (var i in textSnap) {
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...