Looping audio con AS3

  • elBurroDiablo
  • Novice
  • Novice
  • Avatar de Usuario
  • Registrado: Jun 17, 2005
  • Mensajes: 16
  • Status: Offline

Nota Octubre 3rd, 2008, 11:51 am

El código de abajo está haciendo exactamente lo que yo quiero que haga...Pero necesito el clip de sonido del ciclo. ¿Alguna sugerencia??

Por favor ayuda! ¡Gracias!



Código: [ Select ]
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();
}
 
  1. var soundReq:URLRequest = new URLRequest("Assets/Audio/drums01.mp3");
  2. var sound:Sound = new Sound();
  3. var soundControl:SoundChannel = new SoundChannel();
  4. sound.load(soundReq);
  5.  
  6. sound.addEventListener(Event.COMPLETE, onComplete);
  7.  
  8.  
  9. function onComplete(event:Event):void{
  10.     drums1_mc.addEventListener(MouseEvent.CLICK, playSound);
  11.     drumsStop_mc.addEventListener(MouseEvent.CLICK, stopSound);
  12. }
  13.  
  14. function playSound(event:MouseEvent):void{
  15.     soundControl = sound.play();
  16. }
  17.  
  18. function stopSound(event:MouseEvent):void{
  19.     soundControl.stop();
  20. }
  21.  
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Octubre 3rd, 2008, 11:51 am

Publicar Información

  • Total de mensajes en este tema: 1 mensaje
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 79 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC