MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 1259

Actionscript 2.0 language reference
Table of Contents

Advertisement

Returns
- An array of objects in which each object contains information about a specific
Array
character in the specified range. Each object contains the following properties:
A zero-based integer index of the character (relative to the entire string rather
indexInRun
than the selected run of text).
A Boolean value that indicates whether the character is selected
selected
otherwise.
The name of the character's font.
font
The combined alpha and color value of the character. The first two hexidecimal
color
digits represent the alpha value, and the remaining digits represent the color value. (The
example includes a method for converting decimal values to hexidecimal values.)
The height of the character, in pixels.
height
,
matrix_a
matrix_b
matrix that define the geometric transformation on the character. Normal, upright text
always has a matrix of the form
character within the parent movie clip, regardless of the height of the text. The matrix is in
the parent movie clip coordinate system, and does not include any transformations that
may be on that movie clip itself (or its parent).
,
corner0x
corner0y
The corners of the bounding box of the character, based on the coordinate
corner3y
system of the parent movie clip. These values are only available if the font used by the
character is embedded in the SWF file.
Example
The following example illustrates how to use this method. To use this code, on the Stage
create a static text field that contains the text "AB". Rotate the text field by 45 degrees, and set
the second character to be superscript with a color of 0xFFFFFF with a 50% alpha, as the
following figure shows:
The following script lists the
var myTS:TextSnapshot = this.getTextSnapshot();
var myArray:Array = myTS["getTextRunInfo"](0, myTS.getCount());
for (var i = 0; i < myTS.getCount(); i++) {
trace("indexInRun: " + myArray[i].indexInRun);
trace("selected: " + myArray[i].selected);
trace("font: " + myArray[i].font);
trace("color: " + decToHex(myArray[i].color));
trace("height: " + myArray[i].height);
,
,
matrix_c
matrix_d
[1 0 0 1 x y]
,
,
corner1x
corner1y
getTextRunInfo()
,
, and
matrix_tx
matrix_ty
, where
and
are the position of the
x
y
,
,
corner2x
corner2y
properties of each character in the text field:
;
true
false
The values of a
,
, and
corner3x
TextSnapshot
1259

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents