基本上我有两个开/关按钮。如果我在播放声音时多次单击 ON 按钮,OFF 按钮将不再起作用,因此我无法停止声音。有人可以帮忙吗?
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();
}