# Timer controle

**URL:** <https://forum.kirupa.com/t/timer-controle/182860>\
**Category:** Uncategorized\
**Created:** [March 22, 2006, 12:43am UTC](https://forum.kirupa.com/t/timer-controle/182860 "2006-03-22T00:43:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clemenshackl](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@clemenshackl](https://forum.kirupa.com/u/clemenshackl)\
**Post date:** [March 22, 2006, 12:43am UTC](https://forum.kirupa.com/t/timer-controle/182860/1 "2006-03-22T00:43:04Z")

</div>

Hi guys,

Problem: I have a sound clip running in flash and i want to jump to the next frame after a certain amount of time. unfortunately it is not always the same time span. how can i meassure the elapsed time and call a function accordingly?

for example: after 17 second go to frame x, then after 25 seconds go to frame y, etc. until the end of the sound clip (2 min 50 sec.)

p.s.: each frame holds an individual animation that is related to the current sound.

🙂

any ideas?  
many thanks in advance,

C.

---

<div class="post-metadata">

**Author:** ![phorte](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@phorte](https://forum.kirupa.com/u/phorte)\
**Post date:** [March 22, 2006, 1:38am UTC](https://forum.kirupa.com/t/timer-controle/182860/2 "2006-03-22T01:38:40Z")

</div>

Somtin like this might work. Simply edit the array to the variables you want. Eg: the curreny array with go to frame 10 after 5 seconds then to frame 20 after a further second, then to frame 25 after a further 2 seconds.  
So yeah, see how that goes.

[AS]skipAry = [[10,5000],[20,1000],[25,2000]]  
i = 0  
intrvl = setInterval(skipFrame,skipAry\*[1])  
function skipFrame(){  
trace(i)  
\_root.gotoAndStop(skipAry\*[0])  
clearInterval(intrvl)  
i++  
if(i \< skipAry.length){  
intrvl = setInterval(skipFrame,skipAry\*[1])  
} else {  
trace(“no more”)  
}  
}[/AS] -Aussie Devil
