GALERIA EN FLASH
Publicado por mauro (6 intervenciones) el 13/09/2006 17:13:14
Hola amigos
resulta que estoy realizando una galeria de imagenes en flash mx 2004, resulta que he encontrado un codigo en internet que funciona perfecto, una vez generado el swf, este lo que hace es buscar un archivo de texto para saber cuantas imagenes mostrar, las imagenes estan en una carpeta. el archivo de texto se llama """fotos.txt""" y el codigo que contiene es &totalFotos=18
este valor "18" lo puedo cambiar segun el numero de fotos que quiero mostrar en la galeria.
mi pregunta es: Que parte de el codigo debo cambiar en caso de querer agregar una galeria mas osea """fotos2.txt"""
________________________________________________________________
function peques()
{
for (y = 1; y <= incremento; y++)
{
if (cargadas + y <= totalFotos)
{
jj = cargadas + y + ".jpg";
afoto = ruta + jj;
foton = eval("boton" + y);
loadMovie(afoto, foton.btn);
} // end if
} // end of for
} // End of the function
function centra()
{
an = invi._width;
al = invi._height;
if (an == al)
{
forma = "cohone";
} // end if
if (al > an)
{
forma = "retrato";
}
else
{
forma = "panoramica";
} // end if
if (an > anPeli || al > alPeli)
{
redimensiona(forma);
}
else
{
joto._width = invi._width;
joto._height = invi._height;
} // end if
joto._x = (anPeli - joto._width) / 1.5;
if (al > alPeli)
{
joto._y = botonera;
}
else
{
joto._y = (alPeli - al) / 2 + botonera;
} // end if
valor = "alto " + al;
} // End of the function
function redimensiona(como)
{
valor5 = "entro " + como;
if (como == "retrato")
{
pcAl = parseInt(alPeli / al * 100);
joto._height = alPeli;
valor4 = "tambien";
joto._width = parseInt(pcAl * an / 100);
}
else if (como == "panoramica")
{
pcAn = parseInt(anPeli / an * 100);
joto._width = anPeli;
valor4 = "tambien en panoramica";
joto._height = parseInt(pcAn * al / 100);
if (joto._height > alPeli)
{
redimensiona("retrato");
} // end if
}
else
{
joto._height = alPeli;
joto._width = alPeli;
} // end if
} // End of the function
function seniala(cual)
{
for (tt = 1; tt <= incremento; tt++)
{
botoncete = eval("boton" + tt);
botoncete.cuadrorojo._visible = false;
botoncete.seniala = false;
} // end of for
cual.seniala = true;
} // End of the function
function numFoto(cual)
{
_root.gal2 = "foto " + cual + " de " + totalFotos;
} // End of the function
getURL("FSCommand:fullscreen", true);
var ruta = "imas/";
totalFotos = _level0.plas.totalFotos;
var cargadas = 0;
incremento = 10;
var botonera = 95;
var anPeli = Stage.width;
var alPeli = Stage.height - botonera;
var siguientes = true;
var anteriores = false;
_root.ante._alpha = 30;
valor2 = alPeli;
var forma;
var galeria = 1;
_root.gal = "Galería " + galeria;
_root.gal2 = "fotos: " + totalFotos;
var al;
var an;
var dife = incremento;
var efes = new Array(10);
if (incremento > totalFotos)
{
dife = totalFotos;
} // end if
for (yyy = 1; yyy <= dife; yyy++)
{
botoncito = eval("boton" + yyy);
botoncito.act = true;
efes[yyy - 1] = true;
} // end of for
perico = "perico";
valor9 = "efe4 = " + efes[5];
f1 = efes[0];
f2 = efes[1];
f3 = efes[2];
f4 = efes[3];
f5 = efes[4];
f6 = efes[5];
f7 = efes[6];
f8 = efes[7];
f9 = efes[8];
f10 = efes[9];
invi._visible = false;
joto._visible = false;
peques();
resulta que estoy realizando una galeria de imagenes en flash mx 2004, resulta que he encontrado un codigo en internet que funciona perfecto, una vez generado el swf, este lo que hace es buscar un archivo de texto para saber cuantas imagenes mostrar, las imagenes estan en una carpeta. el archivo de texto se llama """fotos.txt""" y el codigo que contiene es &totalFotos=18
este valor "18" lo puedo cambiar segun el numero de fotos que quiero mostrar en la galeria.
mi pregunta es: Que parte de el codigo debo cambiar en caso de querer agregar una galeria mas osea """fotos2.txt"""
________________________________________________________________
function peques()
{
for (y = 1; y <= incremento; y++)
{
if (cargadas + y <= totalFotos)
{
jj = cargadas + y + ".jpg";
afoto = ruta + jj;
foton = eval("boton" + y);
loadMovie(afoto, foton.btn);
} // end if
} // end of for
} // End of the function
function centra()
{
an = invi._width;
al = invi._height;
if (an == al)
{
forma = "cohone";
} // end if
if (al > an)
{
forma = "retrato";
}
else
{
forma = "panoramica";
} // end if
if (an > anPeli || al > alPeli)
{
redimensiona(forma);
}
else
{
joto._width = invi._width;
joto._height = invi._height;
} // end if
joto._x = (anPeli - joto._width) / 1.5;
if (al > alPeli)
{
joto._y = botonera;
}
else
{
joto._y = (alPeli - al) / 2 + botonera;
} // end if
valor = "alto " + al;
} // End of the function
function redimensiona(como)
{
valor5 = "entro " + como;
if (como == "retrato")
{
pcAl = parseInt(alPeli / al * 100);
joto._height = alPeli;
valor4 = "tambien";
joto._width = parseInt(pcAl * an / 100);
}
else if (como == "panoramica")
{
pcAn = parseInt(anPeli / an * 100);
joto._width = anPeli;
valor4 = "tambien en panoramica";
joto._height = parseInt(pcAn * al / 100);
if (joto._height > alPeli)
{
redimensiona("retrato");
} // end if
}
else
{
joto._height = alPeli;
joto._width = alPeli;
} // end if
} // End of the function
function seniala(cual)
{
for (tt = 1; tt <= incremento; tt++)
{
botoncete = eval("boton" + tt);
botoncete.cuadrorojo._visible = false;
botoncete.seniala = false;
} // end of for
cual.seniala = true;
} // End of the function
function numFoto(cual)
{
_root.gal2 = "foto " + cual + " de " + totalFotos;
} // End of the function
getURL("FSCommand:fullscreen", true);
var ruta = "imas/";
totalFotos = _level0.plas.totalFotos;
var cargadas = 0;
incremento = 10;
var botonera = 95;
var anPeli = Stage.width;
var alPeli = Stage.height - botonera;
var siguientes = true;
var anteriores = false;
_root.ante._alpha = 30;
valor2 = alPeli;
var forma;
var galeria = 1;
_root.gal = "Galería " + galeria;
_root.gal2 = "fotos: " + totalFotos;
var al;
var an;
var dife = incremento;
var efes = new Array(10);
if (incremento > totalFotos)
{
dife = totalFotos;
} // end if
for (yyy = 1; yyy <= dife; yyy++)
{
botoncito = eval("boton" + yyy);
botoncito.act = true;
efes[yyy - 1] = true;
} // end of for
perico = "perico";
valor9 = "efe4 = " + efes[5];
f1 = efes[0];
f2 = efes[1];
f3 = efes[2];
f4 = efes[3];
f5 = efes[4];
f6 = efes[5];
f7 = efes[6];
f8 = efes[7];
f9 = efes[8];
f10 = efes[9];
invi._visible = false;
joto._visible = false;
peques();
Valora esta pregunta


0