# Loading random extrenal movies

**URL:** <https://forum.kirupa.com/t/loading-random-extrenal-movies/27925>\
**Category:** Uncategorized\
**Created:** [August 7, 2003, 11:32pm UTC](https://forum.kirupa.com/t/loading-random-extrenal-movies/27925 "2003-08-07T23:32:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![the\_chad](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@the\_chad](https://forum.kirupa.com/u/the_chad)\
**Post date:** [August 7, 2003, 11:32pm UTC](https://forum.kirupa.com/t/loading-random-extrenal-movies/27925/1 "2003-08-07T23:32:36Z")

</div>

Hi there,

Can someone please help me. This is really urgent.  
I need to randomly load an external swf into the main movie each time the browser is refreshed. I have three external swfs so far.

when loading individual external swfs, I normally create an empty movie clip on the main movie and call the external swf by using the \_root.emptymovieclip command

Is the same principal used for calling external swfs randomly?

Thanks heaps,

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 8, 2003, 12:22am UTC](https://forum.kirupa.com/t/loading-random-extrenal-movies/27925/2 "2003-08-08T00:22:26Z")

</div>

Hey chat,  
Here is the code I use on the home page:[AS]  
cn = 1+Math.round(Math.random()\*6);

loadMovie(“[http://www.kirupa.com/random/home/content"+cn+".swf](http://www.kirupa.com/random/home/content%22+cn+%22.swf)”, \_root.content);[/AS]

Where the movie files are named content1.swf, content2.swf, etc. Hopefully this code helps you out.

Cheers!  
Kirupa :}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 8, 2003, 2:08am UTC](https://forum.kirupa.com/t/loading-random-extrenal-movies/27925/3 "2003-08-08T02:08:40Z")

</div>

hey kirupa…

you’re a legend… it works like a charm!

thanks so much!

I had tried several ways and none of them were working… thanks again!
