A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Mouse Coordinates

  1. #1
    Junior Member
    Join Date
    Jan 2003
    Posts
    8

    Mouse Coordinates

    Anyone know how to grab the mouse coordinates and then display a movieClip exactly where those coordinates are when rolling over a button?

    Also, is there a way where you could place the movieClip just a little off of those coordinates? say, maybe 50+/- pixels off of the y axis?





    thanks.
    4zero4

  2. #2
    Junior Member
    Join Date
    Apr 2000
    Posts
    23
    _root._xmouse is the mouse x position
    _root._ymouse is the mouse y position
    Is it just me, or does Flash
    kick ass?

  3. #3
    muted.
    Join Date
    Jun 2002
    Location
    ... from a boring place.
    Posts
    52
    Check the Flash reference for MovieClip._xmouse

    Property (read-only); returns the x coordinate of the mouse position.
    You coud read this value, assign it to a variable, add 50 to the value and you have an offset from the x coordinate of the mouse.
    M2 //.. mutemuse // .. baseboard // .. lavertue // .. specs

  4. #4
    Junior Member
    Join Date
    Jan 2003
    Posts
    8

    This is what I did

    Code:
    onClipEvent(enterFrame){
    	this._y = _root._ymouse;
    	this._x = _root._xmouse;
    }

    one problem tho, the MC keeps following my mouse. is there way to do a rollOut where it will stop?



    thanks.
    4zero4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center