Sunday, 2 June 2013

as3: mouse_move event in full screen mode and mouseLock on slow mouse movements

as3: mouse_move event in full screen mode and mouseLock on slow mouse movements

With flash and AS3 it seems to be a problem with mouse move event in full screen mode and mouseLock activated that I don't understand how to solve.
When I enter in full screen mode with Stage.mouseLock property enabled and i make very slow movements with the mouse, the two properties to determine the location of the mouse (MouseEvent.movementX and MouseEvent.movementY) return zero (0).
A print of the event event.toString() returns:
 [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=2 localX=0 localY=0  stageX=0 stageY=0 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0]
The mouse can be moved as far as I want always returning 0 for x and y if the mouse are moved very slow, so it's impossible to determine the movement of the mouse.
It's very strange because the event are fired correctly when the mouse is moved (also with slow movements), but the returning movement is 0. Seems like the movement is < 1 but are reported only integer movements, so the values are always returned 0.
I've tried also changing mouse settings of OS (Mac OSX) without success.
If you want I can give you sample code to enter in fullscreen mode and activate Stage.mouseLock properties.
Thank you for any suggestion.

No comments:

Post a Comment