Posted on Saturday 7 May 2005
The alternative form of setInterval for classes is:
setInterval(instance, 'functionName', time);
It seems to work intermittently in some circumstances, if you have a complicated class layout. In addition, the second parameter does not get checked by the compiler, so if you misspell it it can take a while to spot. You can get rid of those issues using the ever useful mx.utils.Delegate:
import mx.utils.Delegate;
setInterval(Delegate.create(instance, function), time);
'this' will be correct in the called function and you'll get a warning if you try to reference a function that doesn't exist. Thanks Mike!


