I have the following test code:
[AS]_root.txtIn = function(str:String, txt:TextField):Boolean {
try {
var len = str.length;
var index:Number = new Number(0);
func = function () {
if (index>=len) {
clearInterval(si);
return true;
}
index++;
};
si = setInterval(func, 20);
} catch (myError) {
txt.text = myError;
return false;
}
};[/AS]As you can see, it runs through several intervals before it actually returns a value. How would I go about evaluating it, if it always returns undefined before the interval ends? For example [AS]if(_root.txtIn(txtm, txtmain)) {
trace(true);
}
trace(_root.txtIn(txtm, txtmain));[/AS]2nd trace returns undefined. Any ideas?