# Loading random movies

**URL:** <https://forum.kirupa.com/t/loading-random-movies/140144>\
**Category:** Uncategorized\
**Created:** [March 8, 2005, 7:35pm UTC](https://forum.kirupa.com/t/loading-random-movies/140144 "2005-03-08T19:35:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smoking\_monkey](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@smoking\_monkey](https://forum.kirupa.com/u/smoking_monkey)\
**Post date:** [March 8, 2005, 7:35pm UTC](https://forum.kirupa.com/t/loading-random-movies/140144/1 "2005-03-08T19:35:04Z")

</div>

i have a small problem with loading a random swf into a html page. i have a script that works in that it will load one of 4 different swf files into a html page the only drawback is that the hittests within that movie then dont work. anyone have any suggestions, any help would be apreciated.

thanks a lot

the script that im using at the moment is

filename = ["…swf", “…swf”, “…swf”, “…swf”];  
//the files that i want to randomly load  
path = “[http://www.smoking-monkey.net](http://www.smoking-monkey.net)”;  
//where the files are  
i = filename.length;  
k = Math.floor(Math.random()\*i);  
getURL(path+filename[k], movieTarget);

//all that is on a frame with a movieclip named movieTarget on the stage
