# Waiting for a MC to stop before continuing?

**URL:** <https://forum.kirupa.com/t/waiting-for-a-mc-to-stop-before-continuing/226226>\
**Category:** flash\
**Created:** [May 19, 2007, 12:13am UTC](https://forum.kirupa.com/t/waiting-for-a-mc-to-stop-before-continuing/226226 "2007-05-19T00:13:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cedwyn](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@Cedwyn](https://forum.kirupa.com/u/Cedwyn)\
**Post date:** [May 19, 2007, 12:13am UTC](https://forum.kirupa.com/t/waiting-for-a-mc-to-stop-before-continuing/226226/1 "2007-05-19T00:13:32Z")

</div>

Hello all,

I am hoping someone has done this before - basically I have an animation stored in a movieclip. I have 5 instances off this mc stored off the stage. Whenever the user enters a wrong response, one of the mc’s play a walk animation and a person ‘walks’ onto the screen. After moving 80 pixels, an if function in the onEnterFrame deletes the onEnterFrame.

However, if the user enters more then 5 wrong answers, the persons start a new animation. The problem is that if the user gets a question wrong before the person has finished moving - the person stops and does the new animation.

Thus I was hoping to use setInterval after a check to see if anything is moving. Yet it doesn’t see to work. My traces show no delay between the interval trace and the trace after the interval.

Here is a section of my code; basically when k = 6, the fifth person has been called previously and the moving variable is a boolean set to true. But when run, there is no 20 second delay, it just says ‘slow’ then ‘delay’ and then kicks into the final animation.

```auto
if (k > 5){
        trace(person5.moving);
        if (person5.moving){
            trace("slow");
            slow1 = setInterval(blank(),20000);
        }
        End();
    }

function blank(){
    trace("delay");}

```

In the end, I was hoping to have the script wait until the end of the last persons animation (when it stops walking) and then play the new animation. Any suggestions?

Thank you,  
Cedwyn
