# Problem with arrays when trying to adapt XML gallery

**URL:** <https://forum.kirupa.com/t/problem-with-arrays-when-trying-to-adapt-xml-gallery/202851>\
**Category:** Uncategorized\
**Created:** [October 5, 2006, 9:40am UTC](https://forum.kirupa.com/t/problem-with-arrays-when-trying-to-adapt-xml-gallery/202851 "2006-10-05T09:40:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kathari](https://avatars.discourse-cdn.com/v4/letter/k/a183cd/32.png) [@kathari](https://forum.kirupa.com/u/kathari)\
**Post date:** [October 5, 2006, 9:40am UTC](https://forum.kirupa.com/t/problem-with-arrays-when-trying-to-adapt-xml-gallery/202851/1 "2006-10-05T09:40:49Z")

</div>

Hi,  
I am trying to adapt [Kirupa’s xml photogallery](http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm) 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() {  
maskOut();  
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\*];  
thumb.id = i;  
thumb.onRelease = function() {  
maskOut(image[this.id+1]);  
};  
}[/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?
