Comunidad de diseño web y desarrollo en internet online

Ayuda para activar/desactivar los botones de una galeria

Citar            
MensajeEscrito el 06 Nov 2008 09:30 am
Hola a todxs!!!

Llevo unos días pegándome con una galería que me baje de internet (http://www.ffiles.com/flash/photo_galleries/vslide_gallery_xml_1825.html)

He logrado modificar varias cosas para adaptarlas a mis necesidades, pero hay un tema que no consigo resolver.

Las fotos se cargan a través de un fichero XML y con esa información se van generando los botones pequeños que harán que cargue la foto grande... las cuestión es que quiero que cuando pinche en una minifoto, este botón se deshabilite y cuando pinche en otro botón, el anterior vuelva a habitlitarse y este ultimo a deshabilitarse...

El código empleado en el fla es este:

_lockroot = true;

larghezzamovie = Stage.height;

posSin = 1;
vel = -2;
dimImm = 130;
selezione._x = 100;
letto = true;

pos_iniziale2 = Stage.width-dimImm;
pos_iniziale = 0;
_root.mc_desc.sf_desc._width = pos_iniziale2;

leggi = function () {
nuovo = new XML();
nuovo.ignoreWhite = true;
nuovo.load("file.xml");
nuovo.onLoad = function(success) {
if (success) {
nfoto = this.childNodes.length;
posDes = nfoto;
for (i=0; i<nfoto; i++) {
_root.attachMovie("mc","mc"+(i+1),i+1);
_root["mc"+(i+1)]._y = dimImm*i;
_root["mc"+(i+1)]._x = pos_iniziale;
_root["mc"+(i+1)].big = this.childNodes[i].attributes.photo_big;
_root["mc"+(i+1)].desc = this.childNodes[i].attributes.descrizione;
_root["mc"+(i+1)].contenitore.loadMovie(this.childNodes[i].attributes.photo);
_root["mc"+(i+1)]._alpha = 70;
//cambio del color inicial de las fotos
myColor = new Color(_root["mc"+(i+1)]);
myColorTransform = new Object();
myColorTransform = {ra:70, rb:179, ga:70, gb:0, ba:70, bb:0, aa:70, ab:0};
myColor.setTransform(myColorTransform);
_root.box.clip_mc.loadMovie(this.childNodes[0].attributes.photo_big);
_root.pre.loadMovie(this.childNodes[i].attributes.photo_big);
_root.image = this.childNodes[0].attributes.photo_big;
_root.mc_desc.descrizione.text = this.childNodes[0].attributes.descrizione;
_root["mc"+(i+1)].onRelease = released;
_root["mc"+(i+1)].onRollOver = rollover;
_root["mc"+(i+1)].onRollOut = rollout;
_root["mc"+(i+1)].onReleaseOutside = rollout;
}
letto = true;
} else {
_root.didascalia.text = "Error de lectura";
}
};
};
leggi();

_root.onMouseMove = function() {
x = _root._xmouse;
y = _root._ymouse;
if (x>pos_iniziale && x<100) {
if (y>0 && y<440) {
vel = -(Math.round((y-(larghezzamovie/2))/15));

}
if (y>440 && y<larghezzamovie) {
vel = -(Math.round((y-(larghezzamovie/2))/15));

}
} else {
/*if (vel>-1) {
vel = 1;
} else {
vel = -1;
}*/
vel=0;
}

};
function released() {
_root.image = this.big;
_root.box.play();
_root.box.clip_mc.loadMovie(_root.image);
_root.mc_desc.descrizione.text = this.desc;
//_root.selezione._y = (larghezzamovie)/2;
//_root.didascalia.text = this.etichetta.text;

//getURL(percorso,"_blank")
/*fotoactivar=fotoestamos;
_root["mc"+(fotoactivar)].enabled = true;*/
this._alpha = 100;
//Con esto consigo deshabilitar aquel boton que pincho, pero no logro volverlo a habilitar
this.enabled = false;
}

function rollover() {
this._alpha = 100;
}


function rollout() {
this._alpha = 70;
}

_root.onEnterFrame = function() {
if (letto) {
for (i=1; i<=nfoto; i++) {
_root["mc"+i]._y += vel;
}
if (vel>0 && _root["mc"+posSin]._y>0) {
_root["mc"+posDes]._y = _root["mc"+posSin]._y-dimImm;
posSin = posDes;
posDes--;
if (posDes == 0) {
posDes = nfoto;
}
}
if (vel<0 && _root["mc"+posSin]._y<=-dimImm) {
_root["mc"+posSin]._y = _root["mc"+posDes]._y+dimImm;
posDes = posSin;
posSin++;
if (posSin>nfoto) {
posSin = 1;
}
}
}
};

Si alguien me puede echar una mano, se lo agradecería mucho, el tema de la programación me supera en muchas ocasiones!!

Muchas gracias!!

Por lharpmen

3 de clabLevel



Genero:Masculino  

chrome
Citar            
MensajeEscrito el 06 Nov 2008 10:44 am
Postea el código entre etiquetas code, es mas fácil leerlo, y mas siendo tantas lineas.

Por Fusel

Claber

339 de clabLevel



Genero:Masculino  

Madrid (España)

safari

 

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