is supported in part by

August 27, 2007

Event.DEACTIVATE doesn't work in all browsers

I have just confirmed with Flash Player engineering that Flash Player's Event.DEACTIVATE event does not work in all browsers. For example, on some versions of Macintosh Safari, neither Event.ACTIVATE nor Event.DEACTIVATE occur. In others, Event.ACTIVATE occurs, but Event.DEACTIVATE does not. In Macintosh Firefox, Event.ACTIVATE occurs, but Event.DEACTIVATE is not triggered unless system focus moves to another Firefox window (not another application window) or the browser address bar.

Moral of the story: before using the Event.DEACTIVATE or Event.ACTIVATE events, test to make sure they work on your target browser(s). (So far I haven't seen any problems on Windows browsers.)

>> Test Event.ACTIVATE here
>> Source code

As an alternative to Event.DEACTIVATE, consider detecting when the mouse pointer leaves the Player area via Event.MOUSE_LEAVE. Note that there's (strangely) no companion Event.MOUSE_ENTER event for Event.MOUSE_LEAVE, but you can hack one yourself using MouseEvent.MOUSE_MOVE.

Thanks to Michael Shamoon and Hoss Gifford for bringing this issue to my attention.

Posted by moock at August 27, 2007 11:51 PM