import flash.events.Event;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
var urlRequest:URLRequest;
var sound:Sound;
function loadSound(url:String):void {
urlRequest = new URLRequest(url);
sound = new Sound();
sound.addEventListener(Event.COMPLETE, loadSoundComplete);
sound.load(urlRequest);
}
function loadSoundComplete(e:Event):void {
sound.play();
}
loadSound("sound.mp3");
Welcome to my actionscript snippet library!
Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.
Load Sound
Posted by
admin
on Thursday, July 30, 2009
Labels:
Sound
0 comments:
Post a Comment