# Paused Loop

**URL:** <https://forum.kirupa.com/t/paused-loop/287894>\
**Category:** flash\
**Created:** [May 7, 2009, 3:25pm UTC](https://forum.kirupa.com/t/paused-loop/287894 "2009-05-07T15:25:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elcorazon](https://avatars.discourse-cdn.com/v4/letter/e/7ea924/32.png) [@elcorazon](https://forum.kirupa.com/u/elcorazon)\
**Post date:** [May 7, 2009, 3:25pm UTC](https://forum.kirupa.com/t/paused-loop/287894/1 "2009-05-07T15:25:26Z")

</div>

Hi all, thanks for any help in advance!  
I want to pull random flash pages into a banner and then make them re-fresh after 30 second or so.

i use the following code shich i found online works fine if there no re-fresh

filename = [“1.swf”, “2.swf”, “3.swf”, “4.swf”, “5.swf”];  
path = “[http://www.zzz.co.uk/adaptive/](http://www.zzz.co.uk/adaptive/)”;  
i = filename.length;  
k = Math.floor(Math.random()\*i);  
loadMovie(path+filename[k], movieTarget);

so i chnaged to the following adding a loop and pause to re-load another banner randomly after 3 secs

filename = [“1.swf”, “2.swf”, “3.swf”, “4.swf”, “5.swf”];  
path = “[http://www.zzz.com/adaptive/](http://www.zzz.com/adaptive/)”;  
a = filename.length;  
for (i=1; i\<1001; i++){  
k = Math.floor(Math.random()\*a);  
loadMovie(path+filename[k], movieTarget);  
start = getTimer();  
while (start+3000\>now) {  
now = getTimer();  
}  
}

however this donsn’t seem to work - I’m no coder, just using other people clips for my need so i may well have this really wrong - any ideas?

K
