# Loading Random Picture (swf)

**URL:** <https://forum.kirupa.com/t/loading-random-picture-swf/216637>\
**Category:** Uncategorized\
**Created:** [February 19, 2007, 7:18am UTC](https://forum.kirupa.com/t/loading-random-picture-swf/216637 "2007-02-19T07:18:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fenomnon64](https://avatars.discourse-cdn.com/v4/letter/f/df705f/32.png) [@fenomnon64](https://forum.kirupa.com/u/fenomnon64)\
**Post date:** [February 19, 2007, 7:18am UTC](https://forum.kirupa.com/t/loading-random-picture-swf/216637/1 "2007-02-19T07:18:33Z")

</div>

I found the script which will load a random picture on each refresh of the page:

* * *

filename = [“a.swf”, “b.swf”, “c.swf”];  
path = “[http://areaofpictures/images/](http://areaofpictures/images/)”;  
i = filename.length;  
k = Math.floor(Math.random()\*i);  
loadMovie(path+filename[k], bgTarget);

* * *

OK, this is good if I just have 1 picture to show on a page, but does anyone know how to modify this code to switch the image swf every 30 seconds without the need of a refresh?  
:party:
