Math.random

ive got a load of small thumbnail images in a library and i want to display a random 50 of them on the stage when a generate button is pressed. I was going to do it by placing 50 empty movie clips on the stage and then have each one of them load a random one of the jpegs using a code a bit like below:

on (release) {

filename = [“thumb1.swf”, “thumb2.swf”, “thumb3.swf”, “thumb4.swf”, “thumb5.swf”, “thumb6.swf”,etc…];

i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(filename[k], “_root.screen_mc”);
}

However im not sure how to adapt this to load into 50 empty mcs at once without just copy and pasting it 50 times!!! There is also the problem of duplicates ( different mcs showing the same thumbnail) …im not too worried about this but if there is a way around it id love to know how.

THANKS ALL.