Problem with arrays when trying to adapt XML gallery

I am trying to adapt Kirupa’s xml photogallery into one based on a separate thumbnail for each picture instead of the forward and backward arrows.

The following code sits On the frame in question and has been used for all the buttons (in a previous gallery I made).
[AS]this.onEnterFrame = function() {
bild_txt.htmlText = description[p];
delete this.onEnterFrame;
thumbArray = new Array();
thumbArray = _root.xmlNode.childNodes.length;
trace("thumbnails "+thumbArray);
for (var i = 0; i<thumbArray.length; i++) {
var thumb = this[thumbArray*]; = i;
thumb.onRelease = function() {
}[/AS]When tracing thumbArray it displays the correct number of pictures found, but somehow the onRelease event doesn’t work as it is written now and I don’t have knowledge enough to see what’s wrong.

Can someone help?