# Flash XML Photo issue Help!

**URL:** <https://forum.kirupa.com/t/flash-xml-photo-issue-help/296192>\
**Category:** flash\
**Created:** [September 10, 2009, 4:51pm UTC](https://forum.kirupa.com/t/flash-xml-photo-issue-help/296192 "2009-09-10T16:51:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cato22](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@cato22](https://forum.kirupa.com/u/cato22)\
**Post date:** [September 10, 2009, 4:51pm UTC](https://forum.kirupa.com/t/flash-xml-photo-issue-help/296192/1 "2009-09-10T16:51:20Z")

</div>

I know I’m missing something simple but I’ve followed the tutorial at [http://www.kirupa.com/developer/mx2004/xml\_flash\_photogallery.htm](http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm) and I created the images.xml and have all of the links set correctly but I’m getting the following error in that it seems that it can’t see past the first node/photo in the images.xml file. Not sure what I’m missing or why the images aren’t getting loaded. I’m a veteran coder but new to coding in Flash.

**Here’s the code on the action tab in Flash (CS4) on the action layer:**

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(“images.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 (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
picture\_num();  
}  
}  
}  
function prevImage() {  
if (p\>0) {  
p–;  
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;  
}

**And here’s the output after 3 tries (jarodboat1.jpg being the second node in the xml file:**

Error opening URL 'file:///photos/jarodboat1.jpg\>  
’  
Error opening URL 'file:///photos/jarodboat1.jpg\>  
’  
Error opening URL 'file:///photos/jarodboat1.jpg\>

What did I miss?
