I had this problem before, but I was able to solve it for legacy mode using this:
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.DEACTIVATE to work like in Flash they should be dispatched in
All other functions, like
onWindowMinimize, etc. are not required to dispatch these events.
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
DEACTIVATE in Flash, and it works this way:
- when you click something other on the page, stage receives
- same for AIR, if you simply switch to another app, you receive
I don’t say, it’s the right way, but that’s the way it works in Flash.
That’s what I’m used to, certainly.