# Random movie play

**URL:** https://forum.kirupa.com/t/random-movie-play/4507
**Category:** Uncategorized
**Created:** [August 12, 2002, 11:38am UTC](https://forum.kirupa.com/t/random-movie-play/4507 "2002-08-12T11:38:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ryan](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@Ryan](https://forum.kirupa.com/u/Ryan)
#### Post date: [August 12, 2002, 11:38am UTC](https://forum.kirupa.com/t/random-movie-play/4507/1 "2002-08-12T11:38:59Z")

</div>

i am making a screen saver and there are 5 different movie clips that i wanted to play inside the main screen saver. i was wondering if it was possible to have the 5 movie clips play randomly? thank you

=ryan=

---

<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 12, 2002, 12:04pm UTC](https://forum.kirupa.com/t/random-movie-play/4507/2 "2002-08-12T12:04:45Z")

</div>

Hi Ryan,

Sure.

Place a blank first frame in your movie clips with just a stop() action. Place instances of the movie clips onstage, named in increments 0 - 4 (movieClip0, movieClip1… etc)

On the last frame of each movie clip and also at the point in the main movie that you want have the random 5 clips play, insert the following:

\_root.name = random(5);  
\_root[“movieClip” + \_root.name].play();

On the frame following that code just in the main movie:

stop();

That’s just one idea. Good luck.
