# \[Flash8\] Help with random attachmovie

**URL:** <https://forum.kirupa.com/t/flash8-help-with-random-attachmovie/193286>\
**Category:** flash\
**Created:** [July 10, 2006, 1:55pm UTC](https://forum.kirupa.com/t/flash8-help-with-random-attachmovie/193286 "2006-07-10T13:55:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sadat](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@sadat](https://forum.kirupa.com/u/sadat)\
**Post date:** [July 10, 2006, 1:55pm UTC](https://forum.kirupa.com/t/flash8-help-with-random-attachmovie/193286/1 "2006-07-10T13:55:08Z")

</div>

Hi there,

I’m using the following code to attach a random movieclip from inside the library.

```auto

_root.onLoad = function() {
    ran = Math.round(Math.random()*2+1);
    empty.attachMovie("team"+ran, "", 100)
    trace("team"+ran)
};

```

I would like the random movie clip to load and once it has finished for another random movie clip to load in its place.

What code would I use to achieve this?

cheers :hugegrin:
