Flash Mod
Mensaje instantáneo
Enviar mensaje
|
Publicado:
nov 25, 2007 2:49 a.m.
Taken from http://www.webwasp.co.uk/
Make a function repeat every interval:
function wait() { // a function called 'wait'
trace("The time is now !!"); // the action you want, in this case a trace.
}
myTimer = setInterval(wait, 1000); // calls the function after 1 second
This will make the function wait one second and then repeat ever second after that.
Make a function wait and then execute once:
function wait() { // a function called 'wait'
trace("The time is now !!"); // the action you want, in this case a trace.
clearInterval(myTimer); //stops the function being called again.
}
myTimer = setInterval(wait, 2000); // calls the function wait after 2 seconds
This will make the function wait 2 seconds and only repeat once.
------------------------------------------------------------------------------------------
Enjoy
~Flash Mod
|
mike
Mensaje instantáneo
Enviar mensaje
|
Publicado:
nov 25, 2007 9:17 p.m.
use setTimeout instead.
make the function as usual but instead of usinger setInterval use setTimeout
setTimeout(function name , delay in milliseconds);
ie:
function hello(){
trace("hello world");
}
setTimeout(hello, 2000);
would trace "hello world" in 2 seconds.
|