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

Lightbox en Flash desde XML

Estas en el tema de Lightbox en Flash desde XML en el foro de Flash y Actionscript en Foros del Web. Hola! Mi problema surge porque quiero ejecutar Lightbox desde Flash. Primero cargo las imagenes en pequeño desde un XML, hasta aquí todo genial, y dentro ...
  #1 (permalink)  
Antiguo 30/06/2011, 16:27
 
Fecha de Ingreso: enero-2011
Mensajes: 9
Antigüedad: 13 años, 3 meses
Puntos: 0
Mensaje Lightbox en Flash desde XML

Hola! Mi problema surge porque quiero ejecutar Lightbox desde Flash. Primero cargo las imagenes en pequeño desde un XML, hasta aquí todo genial, y dentro de éste también coloco la URL de la imagen que va a cargar Lightbox.

Aqui esta el XML
Código XML:
Ver original
  1. <?xml version="2.0" encoding="ISO-8859-2"?>
  2. <botones>
  3. <item name="Producto n1" url="javascript:LightboxDelegate('green_enl.jpg','Green Wallpaper')" image="image1.jpg" />
  4. <item name="Producto n2" url="javascript:LightboxDelegate('orange_enl.jpg','Orange Wallpaper')" image="image2.jpg" />
  5. <item name="Producto n3" url="javascript:LightboxDelegate('blue_enl.jpg','Blue Wallpaper')" image="image3.jpg" />
  6. </botones>

Y aqui el AS

var myMenu:XML = new XML();
myMenu.ignoreWhite = true;
System.useCodepage = true;
myMenu.load("enlaces.xml");
linkBoton = new Array();
textoBoton = new Array();
imageBoton = new Array();
myMenu.onLoad = function() {
for (var i = 0; i<this.firstChild.childNodes.length; i++) {
textoBoton[i] = this.firstChild.childNodes[i].attributes.name;
linkBoton[i] = this.firstChild.childNodes[i].attributes.url;
imageBoton[i] = this.firstChild.childNodes[i].attributes.image;
}
creaBtns(this.firstChild.childNodes.length);
};
function creaBtns(cuantosBotones) {
var filas = 4;
var columnas = 2;
alturaY = 10;//posY en stage
alturaX = 10;//posX en stage
var xOffset = 295 //10 de separaciónX
var yOffset = 130 //10 de separaciónY
var depth = 0;
count = 0;
for (var f = 0; f<filas; f++) {
for (var c = 0; c<columnas; c++) {
target = this.attachMovie("boton", "boton"+depth, depth++, {_x: c*xOffset, _y: f*yOffset});
target.image_mc.loadMovie(imageBoton[depth-1]);
target.url = linkBoton[depth-1];
target.mytexto.text = textoBoton[depth-1];
target.onRelease = function() {
getURL("javascript:LightboxDelegate('linkBoton[depth-1]', '');", "_self");
};
if(++count>=cuantosBotones) return;
}
}
}

Si en esta linea "getURL("javascript:LightboxDelegate('linkBoto n[depth-1]', '');", "_self");" en vez de poner linkBoton[depth-1], ya que quiero que abra la url correspondiente que viene en el XML, pongo la ruta de la imagen "blue_enl.jpg" funciona a la perfección, pero el problema es que carga esa foto siempre y no es eso lo que quiero. Bueno espero haberme explicado bien y os agradecería que me ayudaseis porque ya no se que mas hacer.

Muchas gracias


Rocha

Etiquetas: flash, java, xml
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 23:52.