MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference page 973

Actionscript language reference
Table of Contents

Advertisement

var my_mc:MovieClip = this;
var my_ts:TextSnapshot = my_mc.getTextSnapshot();
my_mc.onMouseMove = function() {
// find which character the mouse pointer is over (if any)
var hitIndex:Number = my_ts.hitTestTextNearPos(_xmouse, _ymouse, 0);
// deselect everything
my_ts.setSelected(0, my_ts.getCount(), false);
if (hitIndex>=0) {
// select the single character the mouse pointer is over
my_ts.setSelected(hitIndex, hitIndex+1, true);
}
};
See also
MovieClip.getTextSnapshot(), MovieClip._x,
MovieClip._y
TextSnapshot.hitTestTextNearPos()
973

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents