HomeAbout

Wait

From the site:

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”);

http://polygeek.com/159_adobeflash/actionscript_wait-just-a-second

1 Comment »

  1. There is an undocumented function in Flash that does that: setTimeout. It works very similar to setInterval.
    You can find out how to use it at http://www.flashguru.co.uk/flash-8-settimeout/

    Cheers

    Comment by Sergi Mansilla — April 6, 2007 @ 12:34 am

RSS feed for comments on this post. | TrackBack URI
You can also bookmark this on del.icio.us or check the cosmos

Leave a comment





XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .