0

Haxe NME call function with delay

Posted by Dana on April 1, 2013 in NME |

Haxe Timer has the delay method.
haxe.Timer.delay(func , time_ms);

The function can’t accept parameters or return anything.

If you need one of those things to happen I would suggest using it like this:

haxe.Timer.delay(function () { func(arg1, arg2); }, delay);

 

EDIT theres a new way of doing this.

You can use Actuate like this

Actuate.timer(1).onComplete(delayedFunction);

Actuate.timer(i).onComplete(delayedFunction, [functionParameterValue]);

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2012-2017 Code in GoGoLand All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.