gotoAndStop() 方法在正在加载的声音上调用,当声音完成时触发跟踪。任何帮助将不胜感激!
这是我的代码:
import flash.events.Event;
import flash.media.Sound;
import flash.net.URLRequest;
var sound:Sound = new Sound();
var soundReq:URLRequest = new
URLRequest("testmp3.mp3");
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, soundPlay);
function soundPlay(event:Event):void
{
var soundChannel:SoundChannel;
soundChannel = sound.play();
soundChannel.addEventListener(Event.SOUND_COMPLETE, soundComplete);
}
function soundComplete(event:Event):void
{
trace("The sound has finished playing.");
gotoAndStop(3);
}