# Restarting the main timeline from a movie clip

**URL:** <https://forum.kirupa.com/t/restarting-the-main-timeline-from-a-movie-clip/21376>\
**Category:** Uncategorized\
**Created:** [May 21, 2003, 2:48am UTC](https://forum.kirupa.com/t/restarting-the-main-timeline-from-a-movie-clip/21376 "2003-05-21T02:48:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![milwaukee](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@milwaukee](https://forum.kirupa.com/u/milwaukee)\
**Post date:** [May 21, 2003, 2:48am UTC](https://forum.kirupa.com/t/restarting-the-main-timeline-from-a-movie-clip/21376/1 "2003-05-21T02:48:35Z")

</div>

I have a movie clip that generates random numbers until the numbers I specify come up. The movie clip takes a random amount of time to cycle through. It only plays once.

Basically, I want the main timeline of the movie to pause until the movie clip finishes, then continue on (to a new scene, or current scene if this is easier).

I got the main timeline to stop and wait for the MC to play, however, when I add the \_root.play() to the end of the MC script, it plays the main timeline right away, over the main timeline, rather than waiting for itself to finish.

HELP

---

<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:** [May 21, 2003, 2:57am UTC](https://forum.kirupa.com/t/restarting-the-main-timeline-from-a-movie-clip/21376/2 "2003-05-21T02:57:48Z")

</div>

Often if you attach your fla it can be easier to get help. Basically it sounds like flash is running all of your actionscript immediately, which is what would happen if the code were all inside the first frame of the movie clip. If you put \_root.play() inside a function that only runs when the random part is finished, it wont go on until then. Or instead, since you said the MC plays through once, why not put the \_root.play() code inside the movie clip on the last frame. It should only execute when it gets there.
