Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/06/2010, 20:37
julio_p_c
 
Fecha de Ingreso: junio-2010
Mensajes: 7
Antigüedad: 14 años, 9 meses
Puntos: 0
Exclamación Problema reproductor de mp3 en flash

Buenas, tengo un pequeño problema con un codigo de AS2, hoy hice un reproductor flash de mp3, pero el problema es que dicho repro, reproduce las canciones desde una carpeta a traves de una lista XML, lo que quisiera es que me ayuden a cambiar el codigo para que dicho reproductor no lea desde una carpeta si no desde una direccion de internet y tambien quisiera poner en el flash mismo una lista de los temas que estan en el reproductor, se los agradeceria mucho... si no pueden ayudarme tal vez puedan dejarme un tutorial donde vea la manera de hacerlo.

aqui dejo mi codigo AS2 (Compilado y sin errores):

--------------------------------------------------------------------------

var pos:Number = 0;
var posFinal:Number = 0;
var indice:Number= 0;
var mp3:Sound = new Sound();

var xml:XML = new XML();
xml.ignoreWhite = true;
xml.load("lista.xml");
xml.onLoad = function(exito)
{
if (exito)
{
mp3.loadSound ("musica/"+xml.firstChild.childNodes[0].attributes.dir,true);
}
else
{
trace("Error");
}
}

btnAtras.onRelease = function()
{
indice--;
if (indice < 0)
indice= xml.firstChild.childNodes.length-1;
mp3.loadSound ("musica/"+xml.firstChild.childNodes[indice].attributes.dir,true);
}
btnPause.onRelease = function()
{
pos = mp3.position;
mp3.stop();
}
btnPlay.onRelease = function()
{
mp3.start(pos/1000);
}
btnStop.onRelease = function()
{
mp3.stop();
pos=0
}
btnSiguiente.onRelease = function()
{
indice++;
if (indice >= xml.firstChild.childNodes.length)
indice = 0;
mp3.loadSound ("musica/"+xml.firstChild.childNodes[indice].attributes.dir,true);
}

barra.rep.stop();
barra.zona.stop();

onEnterFrame = function()
{
posFinal = Math.round(mp3.getBytesLoaded()*100/mp3.getBytesTotal());
barra.zona.gotoAndStop(posFinal);

var posFinal2:Number = Math.round(mp3.position*posFinal/mp3.duration);
barra.rep.gotoAndStop(posFinal2);

autor.text = mp3.id3.artist+" - "+mp3.id3.songname
}

barra.onRelease = function()
{
if (barra._xmouse/2 < posFinal)
mp3.start(barra._xmouse/2*mp3.duration/posFinal/1000);
}
------------------------------------------------------------------------------------

Muchas gracias por su atencion.