Identifiers - sound

okay… I’m using FXdown.wav as a sound effect when you move over a button. I’m calling for it by means of actionscript (instead of putting the sound in an actual frame). The identifier for the FXdown.wav is buttonSound.

this.onRollOver = function(){
menuSound = new Sound(this);
menuSound.attachSound(“buttonSound”);
menuSound.start(0, 1);
rewind = false;
play();
}

I want to be able to disable the sound effect FXdown.wav throughout the entire page by clicking another button on the flash page.

Should I change the identifier of FXdown.wav via a click? If so, does anyone have the AS for that? Or, what’s the best way to do this?

PS… I only want FXdown.wav to be disabled throughout the page, not all sounds ie stopAllSounds();

And, I must be able to re-enable it by clicking another button.

I figured out a lame way to do it… but there’s gotta be a simple line of code for this.

menuSound.stop(“buttonSound”);

I need to clarify something I guess. The sound is not active until you move your mouse over a button.

So stopping the sound doesn’t do anything. I need to stop it’s ability to call the sound by clicking a button. And then be able to reactive it by using another button.

I could do something like this:

on(press){
_root.AB.unloadMovie();
}

AB is a movieclip on the main timeline that contains the .wav file.

However, once I’ve unloaded that movieclip, I don’t know how to get it to reappear. It’s like a permanent “off button” for that .wav sound.

_root.AB.loadMovie() doesn’t work

Alright, then call the Sound.stop method when you press the button . . .

something like this:
[AS]var playMenuSound:Boolean = true;
//
var menuSound:Sound = new Sound(this);
menuSound.attachSound(“buttonSound”);
//
some_mc.onRollOver = function() {
if (playMenuSound) {
menuSound.start();
}
rewind = false;
this.play();
};
//
toggleMenuSound_mc.onRelease = function() {
playMenuSound = !playMenuSound;
};[/AS]