Creating buttons with AS

Hi all,

i am new to flash, so there comes a beginner question:

i want to load in thumbnails with xml, and show them on a scrolling bar, using the import from the photoslide of this page

 
function loadXML(loaded) { 
if (loaded) { 
xmlNode = this.firstChild; 
image = []; 
description = []; 
thumb = [];
total = xmlNode.childNodes.length; 
for (i=0; i<total; i++) { 
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue; 
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue; 
thumb* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue; 
} 
 

ok, now i generate a movie clip (called “myTn”) with size 100x75 for all thumbs, and generating new movie clips with different x-position over it
like this


function thumbs()
{
setProperty (myTn, _height, 56);
setProperty (myTn, _width, 75);
for (i=0; i < total; i++){
myTn.createEmptyMovieClip(i,i);
myTn._x=i*105;
myTn.loadMovie(thumb*, 1);
}

 

this works so far (its not the best way to solve this problem, but best i can… perhaps someone has another idea ?!? :wink: )

but the problem is, i want to use it to link to the main slideshow (from this website), i have the function working with normal buttons:


function jumpImage() { 
p=3;
if (loaded == filesize) { 
picture._alpha = 0; 
picture.loadMovie(image[p], 1); 
desc_txt.text = description[p]; 
picture_num(); 
} 
} 

and after this long introduction, the final (simple?!?) question: how do i create buttons with actionscript, dependant from the number of thumbs, which are not known (by flash) before loading the xml, to link up with the jump function.

thanks for any ideas,

chi ras