ghess1000
March 10th, 2008, 12:47 PM
I would like to be able to import these short audio voiceovers and wait on a frame until they complete playing before moving on. The script below works with external sounds , but I don't know how to declare the var if the sound is just loaded into a frame. Thanks.
stop()
var soundReq:URLRequest = new URLRequest("Audio2.mp3");
var sound:Sound = new Sound();
sound.load(soundReq);
var soundControl:SoundChannel = sound.play();
soundControl.addEventListener(Event.SOUND_COMPLETE , onEnd);
sound.addEventListener(Event.COMPLETE, onComplete);
function onComplete(event:Event):void
{
sound.play();
}
function onEnd (event:Event):void
{
trace("done!!!");
gotoAndPlay(2);
}
stop()
var soundReq:URLRequest = new URLRequest("Audio2.mp3");
var sound:Sound = new Sound();
sound.load(soundReq);
var soundControl:SoundChannel = sound.play();
soundControl.addEventListener(Event.SOUND_COMPLETE , onEnd);
sound.addEventListener(Event.COMPLETE, onComplete);
function onComplete(event:Event):void
{
sound.play();
}
function onEnd (event:Event):void
{
trace("done!!!");
gotoAndPlay(2);
}