Unfortunately, it doesn’t work as expected anymore. (cause music lag here)
Any chance to fix this?
If someone is minimize my game, I need it to stop playing background music.
Well, just discovered, it works only half way.
If I minimize/restore my app - it works.
But if I just switch to another app (Alt-TAB) - it does not work.
I did some tests, in order for Event.ACTIVATE and Event.DEACTIVATE to work like in Flash they should be dispatched in onWindowFocusIn and onWindowFocusOut respectively.
All other functions, like onWindowActivate, onWindowMinimize, etc. are not required to dispatch these events.
The Event.DEACTIVATE and Event.ACTIVATE events are often used for completely putting an application to sleep. Do you think this should always be the behavior when an application loses focus, but is still active?
Flash Player might be a bit different than Adobe AIR in this regard, and perhaps different, too, than what we want.
If you think of a website, you get a DEACTIVATE when you leave the browser tab, but not if you scroll the page or click on something other than Flash on the page. In that case, you’ve lost focus, but the Flash content is still active