Hi,
I have a mute button in my game, it works on the inital frame (titlepage) and the main game page.
However when the user quits back to the title page, odd behavious happens.
To diagnose I traced the volume (as this is how I toggled the sound on/off)
See code below:-
var globalVolume:Sound = new Sound();
globalVolume.setVolume(50);
//Key Listener to allow sound volume to be 0/50 to mimic a mute button
keyslistener = new Object();
keyslistener.onKeyDown=function(){
if(Key.isDown(83))
{
keypress = "on";
globalVolume.setVolume(50-globalVolume.getVolume());
trace(globalVolume.getVolume());
}
}
Initally the code worked as expected showing the toggle off volumes 0,50,0,50 etc…, until I quit the game and then it would print 0 & 50 on one single keypress.
Can anyone shed some light? It appears as if there are two ‘groups’ of sounds running.
Confused.com
Thanks
Rob