# LoadMovie NOT random order

**URL:** <https://forum.kirupa.com/t/loadmovie-not-random-order/270487>\
**Category:** flash\
**Created:** [September 10, 2008, 2:06pm UTC](https://forum.kirupa.com/t/loadmovie-not-random-order/270487 "2008-09-10T14:06:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kcladdagh](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@kcladdagh](https://forum.kirupa.com/u/kcladdagh)\
**Post date:** [September 10, 2008, 2:06pm UTC](https://forum.kirupa.com/t/loadmovie-not-random-order/270487/1 "2008-09-10T14:06:03Z")

</div>

I have a an array of external swfs set to load in random order each time page is loaded. The trouble is that there is often a repeat of the same swf 2 or 3 times in a row. Is there a way to eliminate the repeat or set the code so that the swfs load in order (not random) then repeat only when the order is finished?  
here’s the code:  
filename = [“quotes2.swf”, “quotes9.swf”, “quotes3.swf”, “quotes10.swf”, “quotes15.swf”, “quotes16.swf”, “quotes18.swf”];  
path = “[http://www.mywebsite.com/quotes/](http://www.mywebsite.com/quotes/)”;  
i = filename.length;  
k = Math.floor(Math.random()\*i);  
loadMovie(path+filename[k], movieTarget);

Thanks!
