Name
MovieClip._xmouse Property — horizontal location of the mouse pointer
Availability
Flash 5
Synopsis
mc._xmouse
Access
Read-only
Description
The floating-point _xmouse property indicates the
horizontal location of the mouse pointer’s hotspot relative to
the coordinate space of mc. If
mc 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 Stage, use
_root._xmouse.
Example
Placing the following code on a clip causes it to mirror the mouse pointer’s horizontal position relative to the Stage (it moves left and right in a straight line):
onClipEvent (enterFrame) {
_x = _root._xmouse;
}See Also
MovieClip
._ ymouse
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access