Skip to main content
Inspiring
June 19, 2012
Question

Mute Sounds if mute switch on iPhone is active

  • June 19, 2012
  • 6 replies
  • 1764 views

Hey there,

I'm developing a game for iOS and implemented an option to turn music on and off. But is there a way to register if the mute switch on an iPhone is active? Sounds keep playing, even if it is active.

This topic has been closed for replies.

6 replies

Adobe Employee
June 19, 2012

Sounds do not respect the mute switch with the latest available release of AIR. However we are aware of the issue and looking into it.

You can learn more about the next AIR mobile and desktop features by applying for our private prerelease program. By doing so, you'll get to know the features of the upcoming release in advance!

Inspiring
June 19, 2012

That's great to hear Adobe is looking in to it.

For now, there are a few native extensions available for that.

I do not know which is best so I recommend google something like

"air mute native extension"

seilz2kAuthor
Inspiring
June 26, 2012

Hey,

i nearly forgot to thank you for the hint. so thank you

All the extensions i found suffered a common problem:

If you "closed" your app, and reopen it - the extension doesn't work anymore.

I thought maybe a event listener got lost so i managed to fix this bug with the following solution:

Add a event listener to your stage that detects if the focus of your app got restored (Event.ENABLE) after the app was closed, and do whatever the extension had to do on appstartup again.

Worked for me...

greetings

seilz