# Problem with the tutorial Photo Gallery Using XML and Flash

**URL:** <https://forum.kirupa.com/t/problem-with-the-tutorial-photo-gallery-using-xml-and-flash/204871>\
**Category:** Uncategorized\
**Created:** [October 24, 2006, 7:27am UTC](https://forum.kirupa.com/t/problem-with-the-tutorial-photo-gallery-using-xml-and-flash/204871 "2006-10-24T07:27:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![panpan](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@panpan](https://forum.kirupa.com/u/panpan)\
**Post date:** [October 24, 2006, 7:27am UTC](https://forum.kirupa.com/t/problem-with-the-tutorial-photo-gallery-using-xml-and-flash/204871/1 "2006-10-24T07:27:25Z")

</div>

Hi I NEED HELP  
I have done the tutorial [http://www.kirupa.com/developer/mx2004/xml\_flash\_photogallery9.htm](http://www.kirupa.com/developer/mx2004/xml_flash_photogallery9.htm).

With a little modification for going from the last image to the first with the next button. Everything works with kirupa’s images in the xml.  
When I put my images in the xml I can’t see anything only the loader with Explorer Internet with flash player 6 or 7. It works in firefox, safari or IE with flash 8.  
The flash is exported flash 6 and actionscript 2.

the xml is  
\<?xml version=“1.0” encoding=“iso-8859-1”?\>  
\<images\>  
\<pic\>  
\<image\>[http://www.romy-vizzini.be/travaux/illus/4/2.jpg](http://www.romy-vizzini.be/travaux/illus/4/2.jpg)\</image\>  
\<caption\>INNEOV pictogrammes\</caption\>  
\</pic\>  
\<pic\>  
\<image\>[http://www.kirupa.com/developer/mx2004/pg/kresge.jpg](http://www.kirupa.com/developer/mx2004/pg/kresge.jpg)\</image\>  
\<caption\>INNEOV pictogrammes\</caption\>  
\</pic\>  
\</images\>

the actionscript is  
function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
description = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
description\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
}  
firstImage();  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“illus\_4.xml”);  
/////////////////////////////////////  
listen = new Object();  
listen.onKeyDown = function() {  
if (Key.getCode() == Key.LEFT) {  
prevImage();  
} else if (Key.getCode() == Key.RIGHT) {  
nextImage();  
}  
};  
Key.addListener(listen);  
previous\_btn.onRelease = function() {  
prevImage();  
};  
next\_btn.onRelease = function() {  
nextImage();  
};  
/////////////////////////////////////  
//p = 0;  
this.onEnterFrame = function() {  
filesize = picture.getBytesTotal();  
loaded = picture.getBytesLoaded();  
preloader.\_visible = true;  
if (loaded != filesize) {  
preloader.preload\_bar.\_xscale = 100\*loaded/filesize;  
} else {  
preloader.\_visible = false;  
if (picture.\_alpha\<100) {  
picture.\_alpha += 10;  
}  
}  
};  
function nextImage() {  
if (p\<=(total - 1)) {  
p++;  
if (p \>= total) {  
p = 0 ;  
}  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
picture\_num();  
}

}

}  
function prevImage() {  
if (p\>=0) {  
p–;  
if (p \< 0) {  
p = total - 1;  
}  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
picture\_num();  
}

}  
function firstImage() {  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[0], 1);  
desc\_txt.text = description[0];  
picture\_num();  
}  
}  
function picture\_num() {  
current\_pos = p+1;  
pos\_txt.text = current\_pos+" / "+total;  
}

someone can help me???
