How can I set to load the function every 10 sec. e.g like
Firstly, load function a
after 10 sec, load function b
after 10 sec load function c
Do anyone know how to do that?
every 10 secs
Started by Ahmult, Oct 13 2006 07:18 PM
1 reply to this topic
#1
Posted 13 October 2006 - 07:18 PM
#2
Posted 13 October 2006 - 09:26 PM
Use the built in function setInterval.
setInterval(functionName, interval, params );
interval is in milliseconds.
so 10 sec would be 10000.
example:
If you ever want to stop the function calls you must clear the interval:
Good luck,
Max (PHD)
setInterval(functionName, interval, params );
interval is in milliseconds.
so 10 sec would be 10000.
example:
function spitFire(timeIs){
trace("FFOOOOOOOSSSSSSH!!! Crackel CRaCKel! at: "+ timeIs);
}
myInterval = setInterval(spitFire, 10000, getTimer());
If you ever want to stop the function calls you must clear the interval:
clearInterval(myInterval);
Good luck,
Max (PHD)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
