[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
