Link to home
Start Free TrialLog in
Avatar of hzrdc2
hzrdc2

asked on

Run function when sound is complete

I have an MP3 loading / playing in my flash file (code below).

My question, how can I tell flash to do something (run function) when the file is completed playing...?
var soundReq:URLRequest = new URLRequest("path1_a.mp3");
var sound:Sound = new Sound();
sound.load(soundReq);
 
sound.addEventListener(Event.COMPLETE, onComplete);
 
function onComplete (event:Event):void
{
	sound.play();
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Antonio Estrada
Antonio Estrada
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hzrdc2
hzrdc2

ASKER

I should just hire you Vulturous! You have been batting 1000 for me!
Oh, I'm just glad I could help :)

-V