Comunidad de diseño web y desarrollo en internet online

Problema reproductro mp3

Citar            
MensajeEscrito el 25 Nov 2010 09:51 pm
Hola amigos
estoy haciendo un reproductor mp3 en flash
que carga una lista de un xml
end donde se muestra el nombre de la cancion
ahora quiero que muestre tambien la letra de la
cancion pero no se como


el codigo es este

Código ActionScript :

function barra_boton_objeto_mascara(barra, btn, objeto, mascara)
{
    mover = false;
    _root[barra][btn].onPress = function ()
    {
        _root[barra][btn].startDrag(false, 0, 0, 0, _root[barra]._height - _root[barra][btn]._height);
        mover = true;
    };
    _root[barra][btn].onRelease = _root[barra][btn].onReleaseOutside = function ()
    {
        _root[barra][btn].stopDrag();
        mover = false;
    };
    _root[barra][btn].onMouseMove = function ()
    {
        if (mover)
        {
            _root[objeto]._y = _root[mascara]._y - _root[barra][btn]._y / (_root[barra]._height - _root[barra][btn]._height) * (_root[objeto]._height - _root[mascara]._height);
        }
    };
    _root[objeto].setMask([mascara]);
}
function LeerDatos(DatosCompletos)
{
    if (DatosCompletos)
    {
        un_Sonido = new Array();
        titulo_sonido = new Array();
        lista_audio = new Array();
        lista_audio = this.firstChild.childNodes;
        lista_total = lista_audio
      
      
      
      
        if (lista_total > 14)
        {
            barra_boton_objeto_mascara("mi_scroll", "btn", "inferior", "mmmm");
        }
        lista_de_sonidos = 1;
        ReproducirSonido();
    }
}
function click_en_la_lista(rob)
{
    lista_de_sonidos = rob;
    Mi_Sonido.stop();
    ReproducirSonido();
}
function ReproducirSonido()
{
    var _loc2 = this;
    musica = un_Sonido[lista_de_sonidos - 1];
    trace (lista_de_sonidos);
    if (pausePos > 0)
    {
        Mi_Sonido.start(pausePos, 0);
        pausePos = 0;
        return;
    }
    Mi_Sonido = new Sound();
    Mi_Sonido.loadSound(musica, true);
    Mi_Sonido.setVolume(100);
    Mi_Sonido.setVolume(volume);
    Mi_Sonido.onSoundComplete = function ()
    {
        switch (modo_reproduccion)
        {
            case "normal":
            {
                lista_de_sonidos = lista_de_sonidos + 1;
            break;
            } 
            case "aleatoreo":
            {
                lista_de_sonidos = Math.floor(Math.random() * lista_total) + 1;
            break;
            } 
            case "repetir":
            {
                lista_de_sonidos = lista_de_sonidos;
                break;
            } 
            default:
            {
                lista_de_sonidos = lista_de_sonidos + 1;
                break;
            } 
        }
        trace (lista_de_sonidos + " --- " + modo_reproduccion);
        ReproducirSonido();
    };
    barra.track_load.onEnterFrame = function ()
    {
        var _loc2 = this;
        total = _loc2._parent._parent.Mi_Sonido.getBytesTotal();
        geladen = _loc2._parent._parent.Mi_Sonido.getBytesLoaded();
        if (geladen != total)
        {
            _loc2._parent.load_display = Math.round(geladen * 100 / total) + "% Loaded";
            _loc2._xscale = Math.round(geladen * 100 / total);
            return;
        }
        _loc2._xscale = 100;
        display.indicador._visible = 1;
        delete _loc2.onEnterFrame;
        delete _loc2._parent.load_display;
    };
}
function checkDigits(toCheck)
{
    return (toCheck < 10 ? (toCheck = "0" + toCheck, toCheck) : (toCheck));
}
function marquesina_titulo()
{
    titulo.texto_del_titulo.autoSize = true;
    i = checkDigits(lista_de_sonidos) + ". " + titulo_sonido[lista_de_sonidos - 1] + "      ";
    titulo.texto_del_titulo.text = i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i + i;
    titulo._x + titulo._width / 2 + 8 < mascara_de_marquesina._x ? (titulo._x = mascara_de_marquesina._x) : (titulo._x--);
} 
function marquesina_publicidad()
{
    publicidad.texto.autoSize = true;
    j = "               // Reproductor MP3     Felipe  813 //          ";
    publicidad.texto.text = j + j + j + j + j + j + j + j + j + j + j + j + j + j + j;
    publicidad._x + publicidad._width / 2 + 8 < mascara_de_publicidad._x ? (publicidad._x = mascara_de_publicidad._x) : (publicidad._x--);
} 
function seguir()
{
    if (!movio)
    {
        barra_pos.butone._x = int(pos / dur * 3.126000E+002);
    }
}
function repetir()
{
    totalsec = int(Mi_Sonido.duration / 1000);
    sec = int(Mi_Sonido.position / 1000);
    minutes = int(totalsec / 60);
    minutes10 = int(minutes / 10) + 1;
    minutes1 = minutes % 10 + 1;
    sec = totalsec % 60;
    sec10 = int(sec / 10) + 1;
    sec1 = sec % 10 + 1;
    tiempodeduraciondigitime_m10.gotoAndStop(minutes10);
    tiempodeduraciondigitime_m1.gotoAndStop(minutes1);
    tiempodeduraciondigitime_s10.gotoAndStop(sec10);
    tiempodeduraciondigitime_s1.gotoAndStop(sec1);
    totalsec = int(Mi_Sonido.position / 1000);
    sec = int(Mi_Sonido.position / 1000);
    minutes = int(totalsec / 60);
    minutes10 = int(minutes / 10) + 1;
    minutes1 = minutes % 10 + 1;
    sec = totalsec % 60;
    sec10 = int(sec / 10) + 1;
    sec1 = sec % 10 + 1;
    digitime_m10.gotoAndStop(minutes10);
    digitime_m1.gotoAndStop(minutes1);
    digitime_s10.gotoAndStop(sec10);
    digitime_s1.gotoAndStop(sec1);
    seguir();
    dur = int(Mi_Sonido.duration / 1000);
    pos = int(Mi_Sonido.position / 1000);
    dur_min = int(dur / 60);
    dur_seg = dur % 60;
    pos_min = int(pos / 60);
    pos_seg = pos % 60;
    if (top.load_display == undefined)
    {
        top.display = playTime.total + " / " + trackTime.total;
    }
    else
    {
        top.display = top.load_display;
    }
    if (top.trackDrag != true)
    {
        prozent = pos * 100 / dur;
        top.track_play._xscale = prozent;
    }
    pos_min < 10 ? (pos_min = "0" + pos_min) : (pos_min = pos_min);
    pos_seg < 10 ? (pos_seg = "0" + pos_seg) : (pos_seg = pos_seg);
    dur_min < 10 ? (dur_min = "0" + dur_min) : (dur_min = dur_min);
    dur_seg < 10 ? (dur_seg = "0" + dur_seg) : (dur_seg = dur_seg);
    tiempo.text = dur_min + ":" + dur_seg;
    juancarlos.text = pos_min + ":" + pos_seg;
    seguir();
} 
inferior.Lista_de_audio.boton.texto._visible = 0;
stop ();
volume = 100;
robney_xml = new XML();
robney_xml.ignoreWhite = true;
robney_xml.onLoad = LeerDatos;
//if (_root.rob == "Principal")
//{
    robney_xml.load("lista.xml");
//}
//else
//{
 
//}
mute.onRollOver = function ()
{
    if (so.getVolume() == 100)
    {
        this.gotoAndStop("onOver");
    }
    else
    {
        this.gotoAndStop("muteOver");
    }
};
mute.onRollOut = function ()
{
    if (so.getVolume() == 100)
    {
        this.gotoAndStop("on");
    }
    else
    {
        this.gotoAndStop("mute");
    }
};
this.onEnterFrame = function ()
{
    dur = int(Mi_Sonido.duration / 1000);
    pos = int(Mi_Sonido.position / 1000);
    playTime = {};
    playTime.minutes = int(pos / 60);
    playTime.seconds = int(pos % 60);
    playTime.total = checkDigits(playTime.minutes) + ":" + checkDigits(playTime.seconds);
    trackTime = {};
    trackTime.minutes = int(dur / 60);
    trackTime.seconds = int(dur % 60);
    trackTime.total = checkDigits(trackTime.minutes) + ":" + checkDigits(trackTime.seconds);
    if (tiempo.load_display == undefined)
    {
        tiempo.display = playTime.total + " - " + trackTime.total;
    }
    else
    {
        barra.display = barra.load_display;
    }
    if (barra.trackDrag != true)
    {
        prozent = pos * 100 / dur;
        barra.track_play._xscale = prozent;
    }
};
barra.track_back.onPress = function ()
{
    this._parent.trackDrag = true;
    this._parent.track_play.onEnterFrame = function ()
    {
        perc = (this._parent._xmouse - this._parent.track_back._x) / this._parent.track_back._width;
        max = this._parent.track_load._width / this._parent.track_back._width;
        perc > max ? (perc = max) : (null);
        perc < 1;
        0 ? (perc = 1, 0) : (null);
        this._width = this._parent.track_back._width * perc;
        this._parent._parent.pausePos = perc * this._parent._parent.Mi_Sonido.duration / 1000;
    };
};
barra.track_back.onRelease = barra.track_back.onReleaseOutside = function ()
{
    delete this._parent.track_play.onEnterFrame;
    this._parent.trackDrag = false;
    ReproducirSonido();
};
vol_back.onPress = function ()
{
    vol_front.onEnterFrame = function ()
    {
        perc = (_xmouse - vol_back._x) / vol_back._width;
        perc > 9.500000E-001 ? (perc = 1) : (null);
        perc < 5.000000E-002 ? (perc = 0) : (null);
        this._width = vol_back._width * perc;
        volume = Math.round(perc * 100);
        Mi_Sonido.setVolume(volume);
        indicador_de_volumen.text = volume ;
        display.indicador._yscale = volume;
    };
};
vol_back.onRelease = vol_back.onReleaseOutside = function ()
{
    delete vol_front.onEnterFrame;
};
vol_front.setMask(vol_mask);
display.btn_play.onRelease = function ()
{
    ReproducirSonido();
};
display.btn_pause.onRelease = function ()
{
    if (pausePos > 0)
    {
        Mi_Sonido.start(pausePos, 0);
        pausePos = 0;
    }
    else
    {
        pausePos = Mi_Sonido.position / 1000;
        Mi_Sonido.stop();
    }
};
display.btn_siguiente.onRelease = function ()
{
    lista_de_sonidos == lista_total ? (lista_de_sonidos = 1) : (lista_de_sonidos++);
    Mi_Sonido.stop();
    ReproducirSonido();
};
display.btn_anterior.onRelease = function ()
{
    lista_de_sonidos == 1 ? (lista_de_sonidos = lista_total) : (lista_de_sonidos--);
    Mi_Sonido.stop();
    ReproducirSonido();
};
titulo.setMask(mascara_de_marquesina);
setInterval(marquesina_titulo, 20);
publicidad.setMask(mascara_de_publicidad);
setInterval(marquesina_publicidad, 20);
r = setInterval(repetir, 100);
movio = false;
barra_pos.butone.onPress = function ()
{
    this.startDrag(false, 0, 0, 3.126000E+002, 0);
    movio = true;
    this.onMouseMove = function ()
    {
        if (movio)
        {
            Mi_Sonido.start(int(this._x / 3.126000E+002 * dur));
        } 
    };
};
barra_pos.butone.onRelease = barra_pos.butone.onReleaseOutside = function ()
{
    this.stopDrag();
    movio = false;
};



en el xml tengo esto

<?xml version="1.0" encoding="UTF-8"?>
<songs>

<song title=" "
path=" "/>

</songs>

Por CLAnonimo

Claber

600 de clabLevel

5 tutoriales
1 articulo

 

Este es un usuario anónimo genérico para las cuentas borradas o perdidas.

firefox
Citar            
MensajeEscrito el 26 Nov 2010 02:06 pm
¿340 líneas de código ... really?

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.