# \[MX/2004/8/CS3\] setInterval question

**URL:** <https://forum.kirupa.com/t/mx-2004-8-cs3-setinterval-question/226190>\
**Category:** flash\
**Created:** [May 18, 2007, 5:49pm UTC](https://forum.kirupa.com/t/mx-2004-8-cs3-setinterval-question/226190 "2007-05-18T17:49:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakattak](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@jakattak](https://forum.kirupa.com/u/jakattak)\
**Post date:** [May 18, 2007, 5:49pm UTC](https://forum.kirupa.com/t/mx-2004-8-cs3-setinterval-question/226190/1 "2007-05-18T17:49:55Z")

</div>

Looking for help from anyone who knows the ins and outs of setInterval 🙂

I’m stopping on a keyframe, then using setInterval to advance after a specific timeout. The first time through everything works fine, but when the movie loops (user-initiated) and it gets to that keyframe with setInterval again, setInterval immediately advances the timeline and doesn’t wait any time at all.

The keyframe in question is coded like the following:

```auto

setInterval(function(){gotoAndPlay("loaded");},5000);
stop();

```

All I need is for that keyframe to wait every time it is hit, and always wait for the setInterval timeout before advancing.
