Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/01/2012, 13:48
kidart
 
Fecha de Ingreso: junio-2010
Mensajes: 108
Antigüedad: 13 años, 10 meses
Puntos: 2
Sacar Streaming a mp3 player

Hola,


Tengo un mp3 player muy simple quehice a traves de un tutorial.

El codigo es:
Código actionscript:
Ver original
  1. var mcPath:MovieClip = this;
  2. var timer:Number = 0;
  3. var wTime:Number = mcTime._width;
  4.  
  5. var music:Sound = new Sound();
  6. music.loadSound("music/denea.mp3", false);
  7. music.onLoad = function() {
  8.     startProgress();
  9.     btPlay.enabled = true;
  10. }
  11. music.onSoundComplete = function() {
  12.     timer = 0;
  13.     btPlay._visible = true;
  14.     stopProgress();
  15. }
  16. function startProgress() {
  17.     delete mcPath.onEnterFrame;
  18.     mcPath.onEnterFrame = function() {
  19.         txtTime.text = "TIME: "+music.position+" / "+music.duration;
  20.         mcTime._width = wTime*(music.position/music.duration);
  21.     }
  22. }
  23. function stopProgress() {
  24.     delete mcPath.onEnterFrame;
  25. }
  26. btPlay.enabled = false;
  27. btPlay.onRelease = function() {
  28.     music.start(timer/1000);
  29.     startProgress();
  30.     btPlay._visible = true;
  31.  
  32. }
  33. btPause.onRelease = function() {
  34.     music.stop()
  35.     stopProgress();
  36.     btPlay._visible = true;
  37.  
  38. }

Cuando se carga el sitio, automaticamente el mp3 comienza a streamear.

CÓMO HAGO PARA QUE SOLO COMIENCE A STREAMER UNA VEZ QUE SE CLICKEA "PLAY" Y NO ANTES?


Por favor ayuda, me imagino que debe ser una modificacion muy leve del codigo, un true/false o algo. Ayudaaaaaaa