Wait just a second

How many times have you been coding Actionscript and needed to run some code in a second, or two, or whatever? I know, you can create a setInterval, blah, blah, blah. But that’s such a pain in the the ass.

So, I made a class with just one method to do make it easier for you to wait a second. If you need to call a function/method in, say half-a-second, then all you would write is this:

Wait.For(500, myMethod).

Done.

But, wait, there’s more. You can pass arguments that you need to send to your function/method. Just like this:

Wait.For(500, myMethod, “coffee”, “hot”, “cream”, suger”);

is that sweet or what?

There is a limit of 10 arguments that you can pass. If you really need to send more then edit the class yourself.

Here’s the code for the class below or you can download the file: Wait.asWait.zip.