Generate thumbnails dynamically?

Hello dudes.

I have a question about generating a sort of imagegallery from a folder of pictures using Flash and a XML-document.
I have managed to get the the picturelisting working, but i would like to be able to click the images too, wich should open a url that’s specified in the XML-document. (the one in the <url>-tag for the specific image).

I’m not good to explain and my enlish sucks (as my flash-skills), so i’ll just post the source and the .fla for you to look at :slight_smile: (the xml and directories are included in the zipped file as well).

And if there is a simpler way to do this whitout having to put out 6 static container-movieclips and generate them dynamically, i would love to know how :slight_smile:

thanks.
MaggoT

Here is the actionscript:
// Variables
var whichBio = “adams”;
var whichXMLIndex = 0;

// Buttons
btn_adams.onRelease = function() {
whichBio = “adams”;
whichXMLIndex = 0;
processXMLData();
}
btn_gloria.onRelease = function() {
whichBio = “gloria”;
whichXMLIndex = 1;
processXMLData();
}
btn_city.onRelease = function() {
whichBio = “city”;
whichXMLIndex = 2;
processXMLData();
}

// Read data from XML-document
var xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad=processXMLData;
xmlData.load(“biobilder/content.xml”);
stop();

// Process the data and spit out the images
function processXMLData(success)
{
var bio = xmlData.childNodes[whichXMLIndex].childNodes;
for( var x=0; x<bio.length; x++ )
{
var currentImage = _root[“img”+(x+1)];
var currentHref = bio[x].childNodes[0].childNodes[0].nodeValue;
var currentInfo = bio[x].childNodes[1].childNodes[0].nodeValue;
var currentUrl = bio[x].childNodes[2].childNodes[0].nodeValue;
loadMovie(“biobilder/” + whichBio + “/” + currentHref, currentImage);
}
}