Comunidad de diseño web y desarrollo en internet online

Galeria Fotos

Citar            
MensajeEscrito el 22 Sep 2010 01:06 pm
Hola, a ver si me podeis ayudar, tengo una galeria de fotos con XML y AS3, el codigo es el siguiente
[as][color=#729FCF]var loader:URLLoader = new URLLoader();
var XmlExterno:XML;
var i:Number=0;
var lista:XMLList;
var total:Number;
var fotos = new Loader();
addChild(fotos);
fotos.x = 0;
fotos.y= 0;

loader.addEventListener(Event.COMPLETE,cargarXML);
loader.load(new URLRequest("galeria.xml"));

function cargarXML(event:Event){
var cargador:URLLoader = event.target as URLLoader;
XmlExterno = new XML(cargador.data);

lista=XmlExterno.children();
total=lista.length();
var foto = new Loader();
addChild(foto);


descripcion.text=lista[i].attribute("descripcion");
fotos.load(new URLRequest(lista[i].attribute("imagen")));

}
//boton1
boton1.addEventListener(MouseEvent.CLICK,siguiente);
boton2.addEventListener(MouseEvent.CLICK,atras);
//boton2

function siguiente(event:MouseEvent){
if(i<total-1)i++;
descripcion.text=lista[i].attribute("descripcion");
fotos.load(new URLRequest(lista[i].attribute("imagen")));
}

function atras(event:MouseEvent){
if(i>0)i--;
descripcion.text=lista[i].attribute("descripcion");
fotos.load(new URLRequest(lista[i].attribute("imagen")));
}[/color][/as]
Mi problema es que no se como hacer para que los botones 1 y 2 aparezcan delante de las fotos, poque me aparecen detras de las fotos y no se ven, agradecería vuestra ayuda, gracias.
Maite

Por Maite

30 de clabLevel



Genero:Femenino  

Badajoz/España

msie8
Citar            
MensajeEscrito el 22 Sep 2010 01:29 pm
reemplaza este: addChild(fotos); por este: addChildAt(fotos, 0);

Por CLAnonimo

Claber

600 de clabLevel

5 tutoriales
1 articulo

 

Este es un usuario anónimo genérico para las cuentas borradas o perdidas.

firefox
Citar            
MensajeEscrito el 22 Sep 2010 04:15 pm
Muchas gracias, me has resuelto el problema, el codigo envia las fotos al fondo
addChildAt(fotos, 0);

Por Maite

30 de clabLevel



Genero:Femenino  

Badajoz/España

msie8

 

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