Loading a random swf

I want to load a random swf from a group of 6. Basically from the intial page i want the user to press a button and this then displays one of the 6 swfs randomly.

I have saved my swf files as numbers 1-6.swf and saved them in a folder called movies. I need to firstly generate a random number between 1 and 6 and then load this corresponding swf file.

Can anyone help me please?

Well theres this:
http://www.kirupa.com/developer/mx/loadingrandombackground.htm

and this:
http://www.kirupa.com/developer/actionscript/loading_random_movie.htm

Hope this helps
pxa

Thanks for those pointers but it wasn’t exactly what I wanted to do. I didn’t actually want to have to list all of the swf files instead I wanted to be able to just generate a random number between 1 and 6 which would be the variable “movie” these numbers then correspond to the swf files in the folder. Is it possible to do this please?

[AS]function loadSWF():Void {
max=6, min=1;
var randomNum:Number = Math.floor(Math.random()*(max-min+1))+min;
container.loadMovie(randomNum+".swf");
}[/AS]:slight_smile: