Actionscript Sound Toggle

Ok, I’m brain dead.
That out of the way…

I’ve looked at all the messages in the forums and the tutorials.
I used http://www.kirupa.com/developer/actionscript/sound.htm
tutorial and made a working button to START the sound. This method is the simplest. Can’t stop the sound yet.

Given that tutorial, what’s the simplest way to complete the audio toggle on/off task?

I don’t need anything elaborate. Just the basic toggle button.

Thanks all

Got my act together.
Works now. Figured it out on my own.

Modifies Kirupa’s code to read as follows:

on (release) {
if(!music){
music=true;
kirupaSound = new Sound(this);
kirupaSound.attachSound(“coolsound”);
kirupaSound.start(0, 99);
}
else {
music=false;
stopAllSounds();
}
}

Works fine!!

Thanks Kirupa.