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

galeria de imagene xml - Problema con los botones anterior y siguiente

Estas en el tema de galeria de imagene xml - Problema con los botones anterior y siguiente en el foro de Flash y Actionscript en Foros del Web. Hola! Tengo un problema con los botones "anterior" y "siguiente" de mi galeria xml. Mi galeria consta de una serie de thumbs, que cuado se ...
  #1 (permalink)  
Antiguo 29/08/2008, 17:49
 
Fecha de Ingreso: noviembre-2007
Mensajes: 29
Antigüedad: 16 años, 5 meses
Puntos: 0
galeria de imagene xml - Problema con los botones anterior y siguiente

Hola!
Tengo un problema con los botones "anterior" y "siguiente" de mi galeria xml.
Mi galeria consta de una serie de thumbs, que cuado se clikean despliegan una imagen en grande, en esta instancia aparecen los botones siguiente y anterior.

Con este código elboton siguiente, en lugar de ir a la imagen que le sigue a la que clickié, me va siempre a la segunda. Osea que toma la imagen clikeada como numero uno. Como hago para que calcule que imagen clickió para que cargue la siguiente a esa?
Algún tutorial del que pueda aprender?

Mi código es este:

///ESTA PARTE NO TIENE MUCHA IMPORTANCIA
stop();
letrasetxt._visible = false;
captionT._visible = false;

x = 450;
y = 200;

ancho = 55;
alto = 55;

num_columnas = 14;

miXML = new XML();

miXML.ignoreWhite = true;

recGris = this.createEmptyMovieClip("holder", 92);
recGris.loadMovie("recuadro_fotos.swf");
recGris._x =600;
recGris._y =100;

cuadradoTrans = this.createEmptyMovieClip("cont", 90);
cuadradoTrans._x =400;
cuadradoTrans._y =110;

cerrar = this.createEmptyMovieClip("conte", 120);
cerrar._x =1085;
cerrar._y =463;

texto = this.createEmptyMovieClip("t", 121);
texto._x =650;
texto._y =473;

previous_btn = this.createEmptyMovieClip("pre", 122);
previous_btn._x =900;
previous_btn._y =463;
next_btn = this.createEmptyMovieClip("ne", 123);
next_btn._x =950;
next_btn._y =463;

this.createEmptyMovieClip ("mcVacio", 100);
mcVacio._x = 650;
mcVacio._y = 118;

miXML.onLoad = function(succes) {
if (succes) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = this.firstChild.childNodes[i].attributes.url;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;

thumb = this.firstChild.childNodes[i].attributes.id;

holder_mc = createEmptyMovieClip("holder_mc" + i, i + 1);

item = holder_mc.createEmptyMovieClip("diapo" + i, i + 1);

item.loadMovie(thumb);

holder_mc._x = x;
holder_mc._y = y;

holder_mc.caption = this.firstChild.childNodes[i].attributes.caption;

holder_mc.url = this.firstChild.childNodes[i].attributes.url;

cuadradoTrans.onRelease = function () {
}
cuadradoTrans.useHandCursor = false;


holder_mc.onRelease = function() {
letrasetxt._visible = true;
cuadradoTrans.attachMovie("cuadradoT", n1, 1);
cuadradoTrans._alpha = 0;
cerrar.attachMovie("cruz", n2, 1);
cerrar._visible = true;
texto.attachMovie("texto_foto", tf, 1)
texto._visible = true;
cerrar._visible = true;
previous_btn.attachMovie("izq",iz, 1)
previous_btn._visible = true;
next_btn.attachMovie("der", de, 1)
next_btn._visible = true;
captionT._visible = true;
loadMovie(this.url,"mcVacio");
usted_txt.visible = true;
captionT.text = this.caption;
this.onEnterFrame = function() {
if (recGris.getBytesLoaded() != 0 && clip_mc.getBytesLoaded() == clip_mc.getBytesTotal()) {
trace("cargo");
recGris.gotoAndPlay("abierto");
delete this.onEnterFrame;
}
};

};


x += ancho;

columna += 1;

if (columna == num_columnas) {
columna = 0;
x -= (ancho * num_columnas);
y += alto;
}
}
}
};

miXML.load("comerciales/decorados/imagenes.xml");

cerrar.onRelease = function() {
mcVacio.unloadMovie();
cuadradoTrans.unloadMovie();
captionT._visible = false;
cerrar._visible = false;
texto._visible = false;
previous_btn._visible = false;
next_btn._visible = false;
recGris.gotoAndPlay("cerrado");
letrasetxt._visible = false;
}

/////////AQUI ESTAN LOS BOTONES

previous_btn.onRelease = function ()
{
prevImage();
}
;
next_btn.onRelease = function ()
{
nextImage();
}
;


function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
loadMovie(image[p], "mcVacio");
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
loadMovie(image[p], "mcVacio");
picture_num();
}
}

function picture_num() {
current_pos = p+1;
}


GRACIAS!!!
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 16:14.