# Movie Loading Randomly inside Movie Clip

**URL:** https://forum.kirupa.com/t/movie-loading-randomly-inside-movie-clip/4528
**Category:** flash
**Created:** [August 12, 2002, 8:33pm UTC](https://forum.kirupa.com/t/movie-loading-randomly-inside-movie-clip/4528 "2002-08-12T20:33:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Moutombr](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@Moutombr](https://forum.kirupa.com/u/Moutombr)
#### Post date: [August 12, 2002, 8:33pm UTC](https://forum.kirupa.com/t/movie-loading-randomly-inside-movie-clip/4528/1 "2002-08-12T20:33:24Z")

</div>

If anyone could help me with this I would be very greatful… here’s the problem :

I want to load different movie files into one movie file randomly, all the movie files being loaded would be in the same layer, so after they are loaded, and have played, the next file would open, and so on… If anyone has any idea for a script please help me…

thx

---

<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 13, 2002, 2:31am UTC](https://forum.kirupa.com/t/movie-loading-randomly-inside-movie-clip/4528/2 "2002-08-13T02:31:12Z")

</div>

are you going to load them after a button is pressed? After a certain movie option? How? When?

in any case… here’s the basic part of your code…

```auto

mynumber=math.floor(Math.Random()*5)+1; //will yield numbers
//between 1 and 5

loadmovie("mc"+mynumber, mynumber)

```

this assumes that you have movie clips named  
mc1  
mc2  
mc3  
mc4  
mc5

if you find that “mc” + mynumber is not working for you, look into the eval command.

Good luck.
