I’ve got a shell.swf file that loads lots of pageXX.swf files into page_mc movieclip. Each pageXX.swf file calls external audio using the following convention.
music = new Sound(this);
music.onLoad = function(success:Boolean) {
if (success) {
playing = true;
}
}
music.loadSound("audio/mod2_050.mp3", true);
I tried using the following in shell.swf to turn the sound volume off, and it works great…until you go to the next page, then the audio for the new page starts playing.
if (this._parent.page_mc.music.getVolume() == 0) {
this._parent.page_mc.music.setVolume(100);
} else {
this._parent.page_mc.music.setVolume(0);
}
Is there a way I can toggle the volume on/off without having to change the code in every page?
Thanks!!