hi there,
i have a toggling sound on/off button on my website. its a MC with 2 frames with the first frame showing my sound ON image and frame 2 showing my sound OFF image. the MC contains the following code to operate:
on(release){
if(_root.globalvolume.getVolume() > 0){
_root.globalvolume.setVolume(0);
play();
} else {
_root.globalvolume.setVolume(100);
play();
}
}
there is a small script on entering the first scene of the website:
globalvolume = new Sound();
now the button works as in it turns the sound on and off.. hoorah... but i had a problem when the user choose to enter another section of the website (a new scene in flash)
when entering the new scene the sound button would show as expected... the first frame.. the sound ON image. so this was a problem if the user had switched the sound OFF while in the first scene.
so i added in a script to the first frame of the 2nd scene. shown as follows:
if(globalvolume >0){
_root.soundonoffbtn_mc.gotoAndStop (1);
}else{
_root.soundonoffbtn_mc.gotoAndStop(2);
}
My problem now is that when I enter scene 2 without touching the sound button (leaving it in its sound ON state) when scene 2 opens - ths sound button changes to the OFF image.
if i switch the sound OFF while in scene 1 and click to enter scene 2... the sound button stays in its OFF image.
am i going about things totally wrongly? can someone help me sort this out?
thanks dudes