The code below is doing exactly what I want it to do...BUT I need the sound clip to loop. Any suggestions??
Please help! Thank you!!!
var soundReq:URLRequest = new URLRequest("Assets/Audio/drums01.mp3");
var sound:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
function onComplete(event:Event):void{
drums1_mc.addEventListener(MouseEvent.CLICK, playSound);
drumsStop_mc.addEventListener(MouseEvent.CLICK, stopSound);
}
function playSound(event:MouseEvent):void{
soundControl = sound.play();
}
function stopSound(event:MouseEvent):void{
soundControl.stop();
}
- var soundReq:URLRequest = new URLRequest("Assets/Audio/drums01.mp3");
- var sound:Sound = new Sound();
- var soundControl:SoundChannel = new SoundChannel();
- sound.load(soundReq);
-
- sound.addEventListener(Event.COMPLETE, onComplete);
-
-
- function onComplete(event:Event):void{
- drums1_mc.addEventListener(MouseEvent.CLICK, playSound);
- drumsStop_mc.addEventListener(MouseEvent.CLICK, stopSound);
- }
-
- function playSound(event:MouseEvent):void{
- soundControl = sound.play();
- }
-
- function stopSound(event:MouseEvent):void{
- soundControl.stop();
- }
-