Sometimes all you want to do is wait a few seconds to make a call to a given function, particularly when you're doing some sequenced animation. While this is certainly easier now that we've got the Timer instead of setInterval (*shudder*), it's still not a one-liner, especially once you take garbage collection into account.
That's where Delayer comes in.
- import com.squidder.delayer.Delayer;
- new Delayer( _testfunction , 3000 , "hello there" , 33 );
- function _testfunction( s:String , n:Number ) : void {
- trace( s + " , " + n );
- }
Simple enough! The only required variables are the function and the delay (in milliseconds). From there, you can pass through as many arguments you like, if any. There's also a cancel function, in case you're into that kind of thing.
Go grab it up over at our fancy Google Code project page.

Leave a comment