Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I reposition x & y coordinates of mouse?

Guest
Feb 04, 2013 Feb 04, 2013

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

TOPICS
ActionScript
568
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 04, 2013 Feb 04, 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.

Translate
Engaged ,
Feb 04, 2013 Feb 04, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 04, 2013 Feb 04, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines