Rondomize images at load

i saw this great tutorial about randomizing movieclips : http://www.kirupa.com/developer/actionscript/loading_random_movie.htm

this is the code that’s being used :

filename = [“circular.swf”, “vibration.swf”, “random_movement.swf”];
path = “images/”;
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget);

instead of loading swf files i would like to load images. when i replace the swf files with image files it works great, but i would like to do it a little bit different. my question is… if it’s possible to direct to a directory filled with images so that i don’t have to fill in the images that it can choose from but that it automatically takes a picture that’s in that directory. i thought about the next code but it doesn’t work :

filename = ["*.jpg"];
path = “images/”;
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget);

perhaps someone else nows something better.
thanks,
max.