# Loading Random Movies

**URL:** <https://forum.kirupa.com/t/loading-random-movies/156928>\
**Category:** Uncategorized\
**Created:** [July 28, 2005, 10:08pm UTC](https://forum.kirupa.com/t/loading-random-movies/156928 "2005-07-28T22:08:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattyshack](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mattyshack/32/1559_2.png) [@mattyshack](https://forum.kirupa.com/u/mattyshack)\
**Post date:** [July 28, 2005, 10:08pm UTC](https://forum.kirupa.com/t/loading-random-movies/156928/1 "2005-07-28T22:08:53Z")

</div>

I am using this code from Kirupa. Is there a way to keep playing the different movies at random without forcing users to reload the page?

```auto

filename = ["movie1.swf", "movie2.swf", "movie3.swf"];
path = "/flash/";
i = filename.length; k = Math.floor(Math.random()*i);
loadMovieNum(path+filename[k], 2);

```
