Safari Flash mouse problem

purplelava

  • Posts: 82
If I attach a Follow the Mouse behavior to an actor, the actor will jerk to xy 0,0 when the mouse leaves the .swf stage. This happens only on Safari, not Chrome or Firefox. I know it's a Flash thing, not Stencyl-specific.

This is crucial for my Flash game, which is a bit like Geometry Wars, with the player sprite following the mouse. How to fix this?

letmethink

  • *
  • Posts: 2545
Perhaps set x and y to mouse x and y if mouse x and y don't equal 0
~Letmethink

purplelava

  • Posts: 82
Maybe I don't understand your response @letmethink, but I don't think you understood the problem.

I am using a Follow the Mouse with easing behavior - I don't want the sprite to just stick to the mousex and y.

Maybe the problem is in the easing code.

Anyhow I found a solution by creating a region which covers the whole game area except a 20-pixels border at runtime, sticking it to camera, and having the Follow Mouse behavior deactivate when the mouse is outside of the region (so this occurs BEFORE the mouse cursor leaves the stage). So far it works. Again, the problem would occur only on Safari, and would make the game based on the precision of mouse control unplayable there.