Trouble making function from dynamically loaded thumbnail

Hi everyone,

This is my first major Flash MX project, and I’m a bit stumped at one point.

I’m making a gallery by reading an XML file. I can read in all the data just fine, and can display it okay, but I’m running into a roadblock when I try to just display the thumbnails, and have the details text and large image appear when the thumbnail is clicked.

Any help or suggestions are appreciated. I’ve highlighted the troubling portion in red below:

[AS]
galleryXml = new XML();
galleryXml.ignoreWhite = true;
galleryXml.onLoad = function(success) {
if (success) {
galleryItem = this.firstChild.childNodes;
for (var i=0; i<galleryItem.length; i++) {
currthumb = loadMovie(galleryItem*.attributes.thumb, thumbbox);
currthumb._x = i * 50;
[COLOR=red] currthumb.onRelease = function() {
titl.text = galleryItem*.attributes.name;
description.text = galleryItem*.attributes.data;
loadMovie(galleryItem*.attributes.image, bigimage);
}[/COLOR]
}
}
}
galleryXml.load(“test.xml”);
[/AS]