# Simple delay/setInterval?

**URL:** <https://forum.kirupa.com/t/simple-delay-setinterval/34623>\
**Category:** flash\
**Created:** [November 4, 2003, 4:44pm UTC](https://forum.kirupa.com/t/simple-delay-setinterval/34623 "2003-11-04T16:44:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Inflicted](https://avatars.discourse-cdn.com/v4/letter/i/82dd89/32.png) [@Inflicted](https://forum.kirupa.com/u/Inflicted)\
**Post date:** [November 4, 2003, 4:44pm UTC](https://forum.kirupa.com/t/simple-delay-setinterval/34623/1 "2003-11-04T16:44:56Z")

</div>

I have 2 MC’s on the stage: mc\_1 & mc\_2.  
Both have following action:

```auto
onClipEvent (enterFrame) {
    speed = 20;
    this._y += speed;
    if (this._y>=100) {
        this._y = 100;
    }
}

```

How can I create a simple delay between  
the 2 mc’s? setInterval?  
Can anyone help me with this?

thanks,

regards

---

<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:** [November 4, 2003, 5:00pm UTC](https://forum.kirupa.com/t/simple-delay-setinterval/34623/2 "2003-11-04T17:00:49Z")

</div>

I’m not sure with movies but with my buttons I use this…

button0.onRollOver = function() {  
\_root.expiration = getTimer() + 1000; //  
button0.onEnterFrame = count;  
}  
button0.onRollOut = function() {  
button0.onEnterFrame = null;  
}

function count() {  
if (getTimer() \> \_root.expiration) {  
…your code when delay is fulfilled…  
}  
}
