Foros del Web » Creando para Internet » Flash y Actionscript »

Cargar imagenes en galeria en Flash...

Estas en el tema de Cargar imagenes en galeria en Flash... en el foro de Flash y Actionscript en Foros del Web. Hola a todos...!!! He visto esta galeria simple en Flash: http://www.ole.clarin.com la misma figura como "click deportivo" Lo que no entiendo (entre otras cosas), cómo ...
  #1 (permalink)  
Antiguo 21/09/2006, 13:52
 
Fecha de Ingreso: octubre-2004
Mensajes: 768
Antigüedad: 19 años, 6 meses
Puntos: 3
Cargar imagenes en galeria en Flash...

Hola a todos...!!!
He visto esta galeria simple en Flash:
http://www.ole.clarin.com la misma figura como "click deportivo"
Lo que no entiendo (entre otras cosas), cómo hace para mostrar las imágenes y el texto. Aqui muestro el actionscript de la galeria.
De a poco me estoy insertando y me gustaria aprender, desde ya muchas gracias!!!

ActionScript
Código:
function depth()
{
    return (j++);
} // End of the function
stop ();
System.useCodepage = true;
Stage.showMenu = false;
var j = 100;
var actual = 1;
estado = "play";
panel = "nada";
botonera_mc.play_mc._visible = false;
cuanto = 50;
botonera_mc.play_mc.gotoAndStop(10);
botonera_mc.play_mc.enabled = false;
cargador_mc._visible = false;
block_mc.useHandCursor = false;
block_mc.onRollOver = function ()
{
};
block_mc._visible = false;
var my_mcl = new MovieClipLoader();
myListener = new Object();
myListener.onLoadStart = function (target_mc)
{
    cargador_mc._visible = true;
};
myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes)
{
    var _loc1 = Math.round(loadedBytes * 100 / totalBytes);
    cargador_mc.cargadores_mc.porcentaje_txt.text = "cargando " + _loc1 + "%";
};
myListener.onLoadComplete = function (target_mc)
{
    cargador_mc._visible = false;
    contenedor_mc.gotoAndPlay("on");
    if (fotos[actual - 1] == undefined)
    {
        textoo = "";
    }
    else
    {
        textoo = fotos[actual - 1];
    } // end else if
    bajada_txt.text = textoo;
};
my_mcl.addListener(myListener);
var fotos = [];
var obj_xml = new XML();
obj_xml.ignoreWhite = true;
obj_xml.onLoad = function ()
{
    function cambio()
    {
        my_mcl.loadClip(_root.fotosfecha + actual + ".jpg", contenedor_mc.foto_mc);
        slider_mc.globo_mc.info_mc.numero_txt.text = actual + "/" + fotos.length;
        slider_mc.globo_mc._x = slider_mc.control_mc._x;
        if (!movim)
        {
            slider_mc.globo_mc.gotoAndPlay("on");
        } // end if
    } // End of the function
    function cambioFoto()
    {
        finalee = fotos.length + 1;
        for (k = 1; k < finalee; k++)
        {
            uno = k;
            dos = uno + 1;
            if (slider_mc.control_mc._x > slider_mc["marca" + uno]._x && slider_mc.control_mc._x < slider_mc["marca" + dos]._x)
            {
                if (actual != uno)
                {
                    actual = uno;
                    cambio();
                } // end if
            } // end if
        } // end of for
        if (slider_mc.control_mc._x < slider_mc["marca" + finalee]._x)
        {
            slider_mc.control_mc._x = slider_mc.control_mc._x + avanza;
            slider_mc.globo_mc._x = slider_mc.control_mc._x;
        }
        else
        {
            final = true;
            if (estado == "play" && !nada)
            {
                nada = true;
                actual = 1;
                slider_mc.control_mc._x = slider_mc.barra_mc._x;
                cambio();
            } // end if
        } // end else if
    } // End of the function
    duracion = String(obj_xml.firstChild.childNodes[1].childNodes[0]) * 1000;
    for (var _loc4 = 0; _loc4 < obj_xml.firstChild.childNodes[0].childNodes.length; ++_loc4)
    {
        fotos.push(obj_xml.firstChild.childNodes[0].childNodes[_loc4].childNodes[0]);
    } // end of for
    slider_mc.globo_mc.info_mc.numero_txt.text = actual + "/" + fotos.length;
    porcFoto = 100 / Number(fotos.length);
    pixelFoto = Math.round(porcFoto * slider_mc.barra_mc._width) / 100;
    avanza = cuanto * pixelFoto / duracion;
    for (var _loc3 = 0; _loc3 < fotos.length; ++_loc3)
    {
        tmp = slider_mc.attachMovie("marca", "marca" + (_loc3 + 1), depth());
        tmp._y = slider_mc.barra_mc._y;
        tmp._x = slider_mc.barra_mc._x + pixelFoto * _loc3;
        tmp._alpha = 0;
    } // end of for
    tmp = slider_mc.attachMovie("marca", "marca" + (fotos.length + 1), depth());
    tmp._y = slider_mc.barra_mc._y;
    tmp._x = slider_mc.barra_mc._x + slider_mc.barra_mc._width;
    tmp._alpha = 0;
    cambio();
    id = setInterval(cambioFoto, cuanto);
    botonera_mc.play_mc.onPress = function ()
    {
        this._visible = false;
        botonera_mc.pausa_mc._visible = true;
        nada = false;
        this.enabled = false;
        botonera_mc.pausa_mc.enabled = true;
        botonera_mc.pausa_mc.gotoAndPlay("off");
        if (final == true)
        {
            final = false;
            actual = 1;
            slider_mc.control_mc._x = slider_mc.marca1._x;
            cambio();
            clearInterval(id);
            id = setInterval(cambioFoto, cuanto);
        } // end if
        estado = "play";
        clearInterval(id);
        id = setInterval(cambioFoto, cuanto);
    };
    botonera_mc.pausa_mc.onPress = function ()
    {
        this._visible = false;
        botonera_mc.play_mc._visible = true;
        this.enabled = false;
        botonera_mc.play_mc.enabled = true;
        botonera_mc.play_mc.gotoAndPlay("off");
        estado = "pausa";
        clearInterval(id);
    };
    botonera_mc.flecha1_mc.onPress = function ()
    {
        if (estado == "play")
        {
            clearInterval(id);
            id = setInterval(cambioFoto, cuanto);
        } // end if
        if (final == true)
        {
            final = false;
        } // end if
        if (actual == 1)
        {
            actual = fotos.length;
        }
        else
        {
            --actual;
        } // end else if
        slider_mc.control_mc._x = slider_mc["marca" + actual]._x;
        cambio();
    };
    botonera_mc.flecha2_mc.onPress = function ()
    {
        if (estado == "play")
        {
            clearInterval(id);
            id = setInterval(cambioFoto, cuanto);
        } // end if
        if (actual == fotos.length)
        {
            actual = 1;
        }
        else
        {
            ++actual;
        } // end else if
        slider_mc.control_mc._x = slider_mc["marca" + actual]._x;
        cambio();
    };
};
obj_xml.load(_root.fotosfecha + "galeria.xml");
  #2 (permalink)  
Antiguo 09/10/2006, 12:13
 
Fecha de Ingreso: octubre-2004
Mensajes: 768
Antigüedad: 19 años, 6 meses
Puntos: 3
Es mucha ayuda la que pido?

Hola gente...
Veo que no hay ayuda para aprender sobre esto... tal vez me estoy desubicando con la ayuda que pido.
Espero algún buen samaritano que me diga si estoy chungo en pedir esta ayuda!!!
Saludos!!!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:26.