# MC looping if site not cached

**URL:** <https://forum.kirupa.com/t/mc-looping-if-site-not-cached/69693>\
**Category:** flash\
**Created:** [November 7, 2004, 12:39am UTC](https://forum.kirupa.com/t/mc-looping-if-site-not-cached/69693 "2004-11-07T00:39:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pat\_Begg](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Pat\_Begg](https://forum.kirupa.com/u/Pat_Begg)\
**Post date:** [November 7, 2004, 12:39am UTC](https://forum.kirupa.com/t/mc-looping-if-site-not-cached/69693/1 "2004-11-07T00:39:07Z")

</div>

Hi all,  
hopefully someone can help me with this little one. I am using a loading random movies into the main movie using the code below, however, if you are visiting the site for the first time the movie clip loaded will continuously loop instead of stopping once loaded. If you visit the site again though, once it has been cached locally it doesn’t do it!! its getting on my knockers now!!

//code to load random movie  
filename = [“aerial\_pic\_1.swf”, “aerial\_pic\_2.swf”, “aerial\_pic\_3.swf”];  
path = “[http://www.charlesward.com/](http://www.charlesward.com/)”;  
i = filename.length;  
k = Math.floor(Math.random()\*i);  
loadMovie(path+filename[k], \_root.main\_image);

URL: [www.charlesward.com](http://www.charlesward.com)

Any help much appreciated,  
Cheers, Pat
