How do you detect when the mouse leaves the stage in ActionScript 2?
Posted
by Theo
on Stack Overflow
See other posts from Stack Overflow
or by Theo
Published on 2009-01-15T11:28:51Z
Indexed on
2010/03/14
23:59 UTC
Read the original article
Hit count: 231
actionscript-2
|flash
I have the bad luck of having to downport some ActionScript 3 code to ActionScript 2 and I have a problem with detecting when the mouse leaves the stage.
In ActionScript 3 there is an event called Event.MOUSE_LEAVE
, which can be used to detect when the mouse leaves the stage, but there is no equivalent in ActionScript 2 as far as I can see.
How would you best emulate the same functionality?
Listening for mouse movement and checking the mouse coordinates against the bounds of the stage doesn't work because the mouse coordinates stop updating when the mouse leaves the stage.
© Stack Overflow or respective owner