MovieClip._xmouse Property

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
MovieClip._xmouse Property Flash 5

horizontal location of the mouse pointer 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. 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 follow the mouse pointer's horizontal position 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



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net