Timer controle

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.

:slight_smile:

any ideas?
many thanks in advance,

C.

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