[Flash CS4 AS2] Tried to alter code of FLash/xml gallery - where did I go wrong?

Hi Folks,

I followed Kirupa’s excellent tutorial on integrating XML into a Flash gallery (kirupa.com - XML and Flash Photogallery, Page 1). All went well on the tutorial, and I understood the concepts (or so I thought!).

However I didn’t want text in my gallery, and wanted to experiment with thumbnails. So i deleted the text fields layer, and got rid of all of the AS2 code relating to it. I also just to be on the safe side took the descriptions out of the XML. I created a new XML node for thumbnails (tn) and created a movieclip elsewhere on the stage in it’s own layer for the thumbs, which I called tn.

At this point I would b happy if it just showed the thumb at the same time as the main image, so I copied anythjing refering to the image node and changed the copied script to tn where appropriate.

However when I test the movie there is no sign of the thumbs. Can anybody tell me where I’ve gone wrong?

AS2 script and XML below

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = ;
tn = ;
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
tn* = 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;}
if (tn._alpha<100) {
tn._alpha += 10;}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
tn._alpha = 0;
tn.loadMovie(tn[p], 1);
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p–;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
tn._alpha = 0;
tn.loadMovie(tn[p], 1);
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
tn._alpha = 0;
tn.loadMovie(tn[0], 1);
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}

<?xml version=“1.0” encoding=“UTF-8” standalone=“yes”?>
<images xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
<pic>
<image>LargeImageFiles/001_1.jpg</image>
<tn>Thumbnails/001_1_tn.jpg</tn>
</pic>
<pic>
<image>LargeImageFiles/002_2.jpg</image>
<tn>Thumbnails/002_2_tn.jpg</tn>
</pic>
<pic>
<image>LargeImageFiles/003_3.jpg</image>
<tn>Thumbnails/003_3_tn.jpg</tn>
</pic>
<pic>
<image>LargeImageFiles/004_4.jpg</image>
<tn>Thumbnails/004_4_tn.jpg</tn>
</pic>
<pic>
<image>LargeImageFiles/005_5.jpg</image>
<tn>Thumbnails/005_5_tn.jpg</tn>
</pic>
<pic>
<image>LargeImageFiles/006_6.jpg</image>
<tn>Thumbnails/006_6_tn.jpg</tn>
</pic>
<pic>
<image>LargeImageFiles/007_7.jpg</image>
<tn>Thumbnails/007_7_tn.jpg</tn>
</pic>
</images>

Any help would be appreciated,

Timmay