# Looping through functions

**URL:** <https://forum.kirupa.com/t/looping-through-functions/285309>\
**Category:** flash\
**Created:** [March 30, 2009, 11:46am UTC](https://forum.kirupa.com/t/looping-through-functions/285309 "2009-03-30T11:46:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ex8roS](https://avatars.discourse-cdn.com/v4/letter/e/b2d939/32.png) [@Ex8roS](https://forum.kirupa.com/u/Ex8roS)\
**Post date:** [March 30, 2009, 11:46am UTC](https://forum.kirupa.com/t/looping-through-functions/285309/1 "2009-03-30T11:46:38Z")

</div>

I thought looping through functions would be pretty easy but i’ve been working on it for some time now and haven’t managed to make it work.

What i wanna do is:

1. Run function 1
2. After 40 secs run function 2
3. After 80 secs run function 3
4. After 120 secs run function 4
5. After 160 secs run function 1 again
6. Back to step 2

Maybe i confused you with these steps, what i mean is i wanna run a function and wait 40 secs before running the next.

And basically i want this to go on forever. I’ve tried some stuff with setTimeout and setInterval, maybe i used them in a wrong way, but as i said i didn’t manage to make it work.

Thanks a bunch.
