memix62 Posted June 13, 2011 Report Share Posted June 13, 2011 Hola hice un reproductor MP3 de un tutorial que encontré en youtube y me funciona todo ok. TENGO 2 PROBLEMAS: 1- AL SUBIR AL SERVIDOR LA MUSICA NO ME CARGA, INTENTE COLOCANDO LA CARPETA MP3 DENTRO DEL HOST, INCLUSO la saque y la deje libre y tampoco me carga la musica. 2- quisiera que en vez de presionar el boton PLAY_PAUSA y me carge la musica quisiera que la musica arranque sola. COLOCO EL CODIGO A CONTINUACIÓN //1 ASignar Variables play_pausa_btn.buttonMode = true; var archivoMp3:URLRequest = new URLRequest("mp3/lydo05.mp3"); var sonido:Sound = new Sound(); var controlAudio:SoundChannel = new SoundChannel(); var tiempoMp3:Number = 0 sonido.load(archivoMp3); // 2. Listeners de los botones al momento de su carga sonido.addEventListener(Event.COMPLETE, mp3Lodeado); function mp3Lodeado(event:Event):void { play_pausa_btn.addEventListener(MouseEvent.CLICK, reproducirSonido); stop_btn.addEventListener(MouseEvent.CLICK, pararSonido); } // 3. Reproducir el Sonido function reproducirSonido(event:MouseEvent):void { controlAudio = sonido.play(tiempoMp3); play_pausa_btn.removeEventListener(MouseEvent.CLICK, reproducirSonido); play_pausa_btn.addEventListener(MouseEvent.CLICK, pausaSonido); play_pausa_btn.gotoAndPlay("Reproducir"); controlAudio.addEventListener(Event.SOUND_COMPLETE, sonidoFinalizado); } // 4. Parar el Sonido function pararSonido(event:MouseEvent):void { tiempoMp3 = 0 controlAudio.stop(); play_pausa_btn.removeEventListener(MouseEvent.CLICK, pausaSonido); play_pausa_btn.addEventListener(MouseEvent.CLICK, reproducirSonido); play_pausa_btn.gotoAndPlay("Apagado"); } // 5. Pausar Sonido function pausaSonido(event:MouseEvent):void { tiempoMp3 = controlAudio.position; controlAudio.stop(); play_pausa_btn.removeEventListener(MouseEvent.CLICK, pausaSonido); play_pausa_btn.addEventListener(MouseEvent.CLICK, reproducirSonido); play_pausa_btn.gotoAndPlay("Pausa"); } // 6. Repetir Pista o Canción function sonidoFinalizado(event:Event):void { controlAudio.removeEventListener(Event.SOUND_COMPLETE, sonidoFinalizado); tiempoMp3 = 0; play_pausa_btn.removeEventListener(MouseEvent.CLICK, pausaSonido); play_pausa_btn.addEventListener(MouseEvent.CLICK, reproducirSonido); play_pausa_btn.gotoAndPlay("Repetir"); } Link to comment Share on other sites More sharing options...
Th3_K4T Posted June 13, 2011 Report Share Posted June 13, 2011 (edited) crea otra función que no requiera de el evento del click del ratón y que haga lo mismo, sería hacer sobrecarga de la función. Luego, simplemente la llamas, al inicio del programa. a todo esto, qué lenguaje es eso? actionscript? no lo reconozco :tonto: Edit: Ahh, si era, verdad que es flash :tonto: Edited June 13, 2011 by Th3_K4T Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now