Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by rootbeerking

I can't seem to find an answer to this. I've successfully muted sounds using
<INPUT type="button" value="Mute Sound" name="mutebutton" id="muteButton" onClick="if (isMute == true){ig.Sound.enabled = true; replaceButtonText('muteButton', 'Mute Sound'); isMute = false;}
else
{ig.Sound.enabled = false; replaceButtonText('muteButton', 'Unmute Sound'); isMute = true;}">

in my index.html. However I can't find a way to do this with music. I tried adding ig.music.pause(); after ig.Sound.enabled = false; but the music kept playing. Any help with this would be much appreciated.

1 decade ago by Jerczu

I did that simply reducing the volume to 0

1 decade ago by dominic

The problem is that ig.Sound.enabled is only checked when beginning to play a sound file. If the sound is already playing (such as music), setting ig.Sound.enabled to false will have no effect.

You have to stop/pause the music explicitly: use ig.music.pause() for that.

1 decade ago by rootbeerking

@dominic Ah, so pause was supposed to go before disabling. Thank you very much.
Page 1 of 1
« first « previous next › last »