easiest timeout script?

In my personal project, I was to make timeout script for server’s responding. I think this is the simpleset form of timeout feature in flash you can come up with.
The below is what I came out:


var timeout:Number = 5000;
var timeoutInterval:Number;
var timeoutFunc:Function = function() {
clearInterval(timeoutInterval);
// do your own script.
}
timeoutInterval = setInterval(timeoutFunc, timeout);

In addition to that, I attempted to make a class for it so that you could use it like this:


var myTimeout = new Timeout(1000,myFunction);
myTimeout.start();

As for the class that I’m making, I will post it later tomorrow.

  • Trackback are closed
  • Comments (1)
    • beatrice
    • June 22nd, 2004 3:29pm

    Hello Shin!

    what would the best way to communicate with you online than emailing? I would like to chat with you concerning FLASH MX 2004 PRO.

    i like your FLASH BLOG…

Comment are closed.