Tuesday 14 April 2009

Mute Problems

As i can see my project nearly completed in a short distance there is only one thing getting in my way and that it the mute button. It works but only on that scene and as soon as it starts a new scene the sound does as well. After looking on many different sites and finding diffrent codes that i could not get to work i thought i would see how my class mates were getting on by looking at there blogs, where i found my solution on Aliter's blog with the code for a mute button. At first i had problems but after talking to him it was explained like this...

put this piece of code at the very top of your action script frame

_root.globalSound = new Sound();

then when you write the code for your mute and un-mute button i used this code

mute.onRelease=function(){
muted = false;
if(muted == false){
_root.globalSound.setVolume(0);
muted = true;
}
}

un_mute.onRelease=function(){
if(muted == true){
_root.globalSound.setVolume(100);
muted = false;
}
}

No comments: