
MovieClip._xmouse Property
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
708
|
ActionScript Language Reference
if (this.speed >= dist) {
this._x = leaderX;
this._y = leaderY;
} else {
this._x -= moveX;
this._y -= moveY;
}
}
}
// Usage...
butterfly_mc.speed = 10;
butterfly_mc.onEnterFrame = function () {
this.follow(_root._xmouse, _root._ymouse);
}
See Also
MovieClip.globalToLocal(), MovieClip.localToGlobal(), MovieClip._xscale, MovieClip._y
MovieClip._xmouse Property
horizontal location of the mouse pointer
Flash 5
read-only
mc._xmouse
Description
The floating-point _xmouse property indicates the horizontal location of the mouse
pointer’s hotspot, relative to the coordinate space of
mc.Ifmc is a main movie, _xmouse is
measured from the Stage’s left edge. If
mc is an instance, _xmouse is measured from the
instance’s registration point. To obtain a consistent
_xmouse coordinate that is always
measured relative to the movie in the Player, use
_level0._xmouse.
Example
Placing the following code on a clip causes it to follow the mouse pointer’s horizontal posi-
tion relative to the Stage (the clip moves left and right in a straight line):
this.onEnterFrame = function () {
this._x = _level0._xmouse;
}
See Also
MovieClip._ymouse
MovieClip._xscale Property
width of a clip or movie, as a percentage
Flash 4
read/write
mc._xscale
Description
The floating-point