# Generate thumbnails dynamically?

**URL:** https://forum.kirupa.com/t/generate-thumbnails-dynamically/196588
**Category:** flash
**Created:** [August 9, 2006, 4:41pm UTC](https://forum.kirupa.com/t/generate-thumbnails-dynamically/196588 "2006-08-09T16:41:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MaggoT](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@MaggoT](https://forum.kirupa.com/u/MaggoT)
#### Post date: [August 9, 2006, 4:41pm UTC](https://forum.kirupa.com/t/generate-thumbnails-dynamically/196588/1 "2006-08-09T16:41:24Z")

</div>

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 🙂 (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 🙂

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