Basically I have two buttons on/off. If I click the button ON more than once while the sound is playing the OFF button doesn't work any more so I am unable to stop the sound. Can someone help?
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.events.MouseEvent;
var mySound:Sound = new Classical_snd();
var myChannel:SoundChannel = new SoundChannel();
myChannel.stop();
soundON_btn.addEventListener(MouseEvent.CLICK, soundON);
function soundON(event:MouseEvent):void{
myChannel = mySound.play();
}
soundOFF_btn.addEventListener(MouseEvent.CLICK,soundOFF);
function soundOFF(event:MouseEvent):void{
myChannel.stop();
}