Mute Button

Let me start off and say that I am new to Corona and so far love it. I am having one issue that I have been trying to resolve and I can not seem to get it to work. I have been looking at a few code samples but havent had much luck yet.

I am trying to add a mute button that mutes all sounds when pressed. It seems simple enough but I must be missing something.

Any suggestions or advice would be greatly appreciated.

Thanks
Derek

I'm not sure this is the best way to do it, but it'll work.

Have a global variable 'isMuted' that toggles whenever you press the mute button. On every sound you play, you do:

1
2
3
if not isMuted then
    //play sound
end

@dbooncha,
Mute could work in two ways, one is Pause, where you pause/stop the audio/music that is playing

The other way is that the audio/music keeps playing but you MUTE the sound by setting the volume to 0 and then set it back to what it was when you unmute it.

HTH,

?:)

Great Thanks! Thats what I was looking for.

Thanks again.

views:2277 update:2011/9/28 21:38:26
corona forums © 2003-2011