Setselectcolor (Textsnapshot.setselectcolor Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
The following example illustrates how to use this method. To use this code, place a static text
field that contains the text "TextSnapshot Example" on the Stage. In the library, include the
font used by the static text field, and in Linkage options for the font, select Export for
ActionScript. To test the code, run the SWF file and point the mouse pointer to the onscreen
text.
var my_ts:TextSnapshot = getTextSnapshot();
this.onMouseMove = function() {
var hitIndex:Number = my_ts.hitTestTextNearPos(_xmouse, _ymouse, 0);
my_ts.setSelected(0, my_ts.getCount(), false);
if (hitIndex >= 0) {
my_ts.setSelected(hitIndex, hitIndex + 1, true);
}
};
See also
getTextSnapshot (MovieClip.getTextSnapshot method)
,
property)
_y (MovieClip._y property)
setSelectColor (TextSnapshot.setSelectColor
method)
public setSelectColor(color:Number) : Void
Specifies the color to use when highlighting characters that were selected with the
TextSnapshot.setSelected()
transparency value.
This method works correctly only with fonts that include character metric information;
however, by default, Macromedia Flash does not include this information for static text fields.
Therefore, the method might return
value is returned, you can force the Flash authoring tool to include the character metric
information for a font. To do this, add a dynamic text field that uses that font, select
Character Options for that dynamic text field, and then specify that font outlines should be
embedded for at least one character. (It doesn't matter which characters you specify, nor if
they are the characters used in the static text fields.)
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.
1262
ActionScript classes
method. The color is always opaque; you can't specify a
instead of an index value. To ensure that an index
-1
,
_x (MovieClip._x

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF