# Loading Random SWF file problems

**URL:** https://forum.kirupa.com/t/loading-random-swf-file-problems/154095
**Category:** flash
**Created:** [July 6, 2005, 9:36pm UTC](https://forum.kirupa.com/t/loading-random-swf-file-problems/154095 "2005-07-06T21:36:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cameron\_](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cameron\_](https://forum.kirupa.com/u/cameron_)
#### Post date: [July 6, 2005, 9:36pm UTC](https://forum.kirupa.com/t/loading-random-swf-file-problems/154095/1 "2005-07-06T21:36:33Z")

</div>

```auto
filename = ["header1.swf", "header2.swf", "header3.swf", "header4.swf", "header5.swf"];
path = "[www.domain.com/images](http://www.domain.com/images)";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget); 

```

That is the code that I am using for the container swf. I know the code works because I used it for static images and it worked fine. When I take a look and the HTML file, this is the error I get.

" A script in this movie is causing Macromedia FLash Player 7 to run slowly. If it continues to run, your computer may become unresponsive."

each of the header swf files are about 40k, and they each load AS from a single AS file. Do I need a preloader? Does anyone have any ideas?
