Actionscript image gallery

hi everybody-

i wrote a bit of actionscript to dynamically create an image gallery based on how many images are in a given directory. as of now, i’ve got it to display thumbnails in rows. my next step would be to get these thumbnails to link to the fullsize images, but i cant figure out how to do that. my code is as follows:

 
endingNumber = new LoadVars();
endingNumber.load("end.txt", 0); //loads text file with # of images in directory
 
endingNumber.onLoad = function(success) {
if (success == true) {
var num1 = endingNumber.e1; 
ender = parseInt(num1); //creates an integer based on data from text file
 
//begin thumbnail creation
xer = 10;
yer = 10;
 
my_mcl = new MovieClipLoader();
 
for (i=1; i<=ender; i++) {
 
duplicateMovieClip(pic2, "pik"+i, i); //duplicates an empty movie clip
setProperty("pik"+i, _x, xer); 
setProperty("pik"+i, _y, yer); //sets dimensions
my_mcl.loadClip("s"+i+".jpg", "pik"+i); //loads jpg into duplicated MC
 
if (i%8 == 0) {
	xer = 10;
	yer += 60;
} 
else {
	xer += 60;
}
 
 
}
//end thumbnail creation
}
};

so as of right now, i have a rough-looking set of thumbnails that don’t function as links. is there any way to make those thumbnails act as links, using only actionscript? or, is there any better(easier) way to create a dynamic image gallery with flash so that my client will never have to open an .fla file to add more images?