|
|
|
Thanks for the information. This helped me to create a sleep function for my flash application. Unfortunately, Flash doesn't have a sleep function built in. Here is a similar example below in english:
function sleep(seconds:Number, functionToCall:Function) {
milliseconds = seconds * 1000;
this.stop();
this.intervalNumber = setInterval(this, "sleepStopper", milliseconds, functionToCall);
}
function sleepStopper(functionToCall:Function) {
trace("In the sleepStoper function.");
clearInterval(this.intervalNumber);
functionToCall();
}
// Here is how to call it
sleep(5, methodNameNotInQuotes);
ScottThoughts |
01.03.06 - 4:10 pm | #
|
|
Commenting by HaloScan
|