/ Published in: ActionScript 3
Lets you know if you are off the flash movie. Handy for when games lose focus so you can pause it. Please note that this doesn't work in all browsers properly.
Expand |
Embed | Plain Text
stage.addEventListener(Event.ACTIVATE, flashActive); stage.addEventListener(Event.DEACTIVATE, flashDeactive); private function flashActive (event:Event):void { trace("flash gained focus"); } private function flashDeactive (event:Event):void { trace("flash lost focus"); }
Comments
Subscribe to comments
You need to login to post a comment.

This only seems to work if you click on the swf and click off the swf video when working in flash.
Doesn't seem to work with respects to hovering on or off the swf file.
Yeah this wouldn't respond to hover. Flash only loses focus when being clicked out of.