/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import flash.media.Sound; import flash.media.SoundChannel; import flash.net.URLRequest; var snd:Sound = new Sound(); var channel:SoundChannel = new SoundChannel(); snd.load(new URLRequest("song.mp3")); snd.addEventListener(Event.COMPLETE, onComplete, false, 0, true); function onComplete(evt:Event):void { channel = snd.play(); }