# Showing Images one after another in Flash with XML

**URL:** <https://forum.kirupa.com/t/showing-images-one-after-another-in-flash-with-xml/78978>\
**Category:** programming\
**Created:** [February 9, 2005, 4:30pm UTC](https://forum.kirupa.com/t/showing-images-one-after-another-in-flash-with-xml/78978 "2005-02-09T16:30:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_MB](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@Paul\_MB](https://forum.kirupa.com/u/Paul_MB)\
**Post date:** [February 9, 2005, 4:30pm UTC](https://forum.kirupa.com/t/showing-images-one-after-another-in-flash-with-xml/78978/1 "2005-02-09T16:30:50Z")

</div>

Hi Everybody:  
I am working in an XML Image gallery.  
Every Image is loaded with a preloader.  
My Idea is showing 7 images together loaded one after another with their preloaders until reach the seventh image, and the stop the load.  
I have been working on and adapted the Kirupa’s tutorial, but I haven’t figure it out how to load an Image after another.  
here is the code:

```auto

function cargarXML(cargado) {
if (cargado) {
xmlNodo = this.firstChild;
imagen = [];
descripcion = [];
total = xmlNodo.childNodes.length;
for (i=0; i<total; i++) {
	imagen* = xmlNodo.childNodes*.childNodes[0].firstChild.nodeValue;
	descripcion* = xmlNodo.childNodes*.childNodes[1].firstChild.nodeValue;
}
CargarPrimeraImagen();
} else {
trace("algo ha fallado");
}
}
xmlAlbum = new XML();
xmlAlbum.ignoreWhite = true;
xmlAlbum.onLoad = cargarXML;
xmlAlbum.load("imagenes.xml");
////PRELOAD///////
this.onEnterFrame = function() {

peso =contenedor_mc.getBytesTotal()
cargado = contenedor_mc.getBytesLoaded()
 if (cargado != peso ) {
precarga_txt.text = Math.round(cargado*100/peso)+" % cargado";
 } else {
if (contenedor_mc._alpha<100) {
contenedor_mc._alpha += 15;
}
}
};

posarray=0

////First IMAGE///////
//generamos la funcion
function CargarPrimeraImagen() {
contenedor_mc._alpha = 0;
contenedor_mc.loadMovie(imagen[0],1);
titulo_txt.text = descripcion[0];
posicion_txt.text = posarray+1+" / "+total;
}

///Next Image////////
function SiguienteImagen() {
//Si al menos queda una imagen para llegar al total
if (posarray<(total-1)) {
contenedor_mc._alpha = 0;
posarray++;
contenedor_mc.loadMovie(imagen[posarray]);
titulo_txt.text = descripcion[posarray];
posicion_txt.text = posarray+1+" / "+total;
}
}
////Previous Image//////
function AnteriorImagen() {
//Si no es la primera imagen
if (posarray>0) {
contenedor_mc._alpha = 0;
posarray--;
contenedor_mc.loadMovie(imagen[posarray]);
titulo_txt.text = descripcion[posarray];
posicion_txt.text = posarray+1+" / "+total;
}
}

////Buttons actions/////////
this.adelante_btn.onRelease = function(){
	SiguienteImagen();
}

this.atras_btn.onRelease = function(){
	AnteriorImagen();
}

```

I hope some of you might help me to modify the code so I will be able to finish this work.  
Thanks in Advance.  
Grettings  
Paul MB…  
:be:
