# XML Gallery thumbnail problem

**URL:** https://forum.kirupa.com/t/xml-gallery-thumbnail-problem/192798
**Category:** flash
**Created:** [July 1, 2006, 6:03am UTC](https://forum.kirupa.com/t/xml-gallery-thumbnail-problem/192798 "2006-07-01T06:03:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tollady](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@tollady](https://forum.kirupa.com/u/tollady)
#### Post date: [July 1, 2006, 6:03am UTC](https://forum.kirupa.com/t/xml-gallery-thumbnail-problem/192798/1 "2006-07-01T06:03:10Z")

</div>

Hi All,

I’m adapting the xml thumbnail gallery but can’t seem to solve this little problem. I’m loading the images in fine, but want to be able to load thumbnails with different widths (the kirupa version here has same-width thumbnails).

I’ll post my code so far below. It works fine if the thumb widths are all the same, but how can I change it to allow for differing widths (each thumbnail will be different)?

Cheers,

* * *

function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
description = [];  
thumbnails = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
description\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
thumbnails\* = xmlNode.childNodes\*.childNodes[2].firstChild.nodeValue;  
thumbnails\_fn(i);  
}  
firstImage();  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load("…/images/en\_images.xml");  
/////////////////////////////////////  
function thumbnails\_fn(k) {  
thumbnail\_mc.createEmptyMovieClip(“t”+k, thumbnail\_mc.getNextHighestDepth());  
tlistener = new Object();  
tlistener.onLoadInit = function(target\_mc) {  
target\_mc.\_x = (eval(“thumbnail\_mc.t”+k).\_width)\*k;  
target\_mc.pictureValue = k;  
};  
image\_mcl = new MovieClipLoader();  
image\_mcl.addListener(tlistener);  
image\_mcl.loadClip(thumbnails[k], “thumbnail\_mc.t”+k);  
}  
stop();
