Artemix
Artemix

Reputation: 8655

Locking the mouse position

I have to resort to you again.

Is there a way to lock the mouse X and Y position?, I mean, I want to move my mouse but I want that the mouse position to be locked on.. let say, the center of the screen.

Btw, I need to do this using Flash.

If there is ANY workaround, i.e, using JS or something like that, would be appreciated.

Thx.

Upvotes: 0

Views: 1337

Answers (2)

Marcus Adams
Marcus Adams

Reputation: 53840

Use mouse.hide() to hide the cursor, go full screen, and draw your own "cursor" wherever you want it. The farthest the real cursor will go is to the edge of the screen anyway, so the user will be able to find their mouse again when they're done playing.

Upvotes: 2

Myk
Myk

Reputation: 6215

One thing you CAN do is hide the mouse cursor and draw your own. That probably doesn't help you, but on the off-chance it does I want to make sure you know it's possible. Then you can keep track of mouseX and mouseY on a MouseEvent.MOUSE_MOVE and update its position according to your needs - does that make sense?

But Flash doesn't let you actually capture and control the user's mouse on a system level. Just imagine the potential for abuse.

Upvotes: 0

Related Questions