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.
Showing posts with label Sound. Show all posts
Showing posts with label Sound. Show all posts