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();