0
我正在使用AS3庫StandingWave並試圖讓「完成」事件觸發音頻播放器。我有下面的代碼,事件似乎從未開火。我沒有得到跟蹤而不是按鈕重新啓用。AS3駐波庫完成事件不會觸發
var player:AudioPlayer = new AudioPlayer();
play_btn.addEventListener(MouseEvent.CLICK,playSinewave);
function playSinewave(e:Event):void{
var sinewave:IAudioSource = new SineSource(new AudioDescriptor(),5,440,0.2);
play_btn.enabled = false;
player.addEventListener(Event.COMPLETE,doComplete);
player.play(sinewave);
}
function doComplete(e:Event):void{
trace("COMPLETE")
play_btn.enabled = true;
}