Skip to main content
February 5, 2013
Answered

How do I reposition x & y coordinates of mouse?

  • February 5, 2013
  • 2 replies
  • 607 views

Please let me know if this can be done (or if I am insane for asking), but say I have a starting point on the root stage of x is 500 and y is 250.  I want a player to navigate his cursor through a maze (an MC) with out touching the walls.  If the walls of maze_mc are touched because of a onRollOver function, can I send the mouse back to _x=500, _y=250?

Thanks

This topic has been closed for replies.
Correct answer Ned Murphy

You cannot force the mouse/cursor position to be anywhere with code, only using the mouse can do this.

Instead of navigating the cursor, navigate a movieclip that behaves like a cursor until your conditions dictate otherwise.  Let the user rollover that object and have it latch on, hiding the true cursor at that point.  When the object hits a wall, release it from following the mouse and send it back to the starting position.

2 replies

Ned Murphy
Ned MurphyCorrect answer
Legend
February 5, 2013

You cannot force the mouse/cursor position to be anywhere with code, only using the mouse can do this.

Instead of navigating the cursor, navigate a movieclip that behaves like a cursor until your conditions dictate otherwise.  Let the user rollover that object and have it latch on, hiding the true cursor at that point.  When the object hits a wall, release it from following the mouse and send it back to the starting position.

Nabren
Inspiring
February 5, 2013

You definitely cannot do this in regular Flash and I am all but certain that this isn't even possible in Adobe AIR without a native extension.