I’ve looked up setInterval() and call() but I’m having a hard time understanding it still. I’m hoping someone can explain to me a bit better. I’m in the process of learning OOP and I downloaded a small file and am editing it a bit and trying to read the code and follow it to better understand. However, I am stumped on one thing - where is ‘m’ coming from? No where in my code is ‘m’ being set other than this function and when I trace it, it outputs the name of an mc as ‘_level0.mmi0’. And why does it need to “call” it? Thanx in advance.
private function setTimeout(f:Function, t:Number) {
if (interval != undefined) {
clearInterval(interval);
}
interval = setInterval(
function (m) {
trace(m);
clearInterval(m.interval);
f.call(m);
}, t*1000, this);
}