Well, I searched and searched and finally found something. Thanks (http://www.actionscript.org/forums/showthread.php3?t=32982)! I made some simple modifications.
This is my code. I made a MC with 2 frames and buttons in it. In frame 1, a button that calls "mute();" here's the button code for the one that's in frame 1.
on (release) {And frame 2 has this:
nextFrame();
this._parent.mute();
}
on(release) {
prevFrame();
this._parent.unmute();
}
And here's the code in the root. I could easily make a volume slider that sets the "level" variable, and would then set. But for most stuff, we simply need the sound to be either there... or not.
level = 100;
globalSound = new Sound();
globalSound.setVolume(level);
function mute() {
trace("mute");
//previewaudio.stop();
globalSound.setVolume(0);
}
function unmute() {
trace("unmute");
globalSound.setVolume(100);
}
Enjoy!
1 comment:
I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.
Post a Comment