If I place some working setInterval code within a function and then call the function, it fails:
function RevealLinks():Void {
menu_mc._visible = true;
// Begin with Menu Links hidden
for (var i = 0; i < 12; i++) {
_root.menu_mc["item" + i + "_mc"]._visible = false;
}
clearInterval(thisID);
var thisID:Number;
var count:Number = 0;
var maxCount:Number = 11;
var duration:Number = 100;
function executeCallback():Void {
_root.menu_mc["item" + count + "_mc"]._visible = true;
if (count >= maxCount) {
clearInterval(thisID);
}
count++;
}
thisID = setInterval(this, "executeCallback", duration);
}
RevealLinks();
Can someone remind me why this sort of thing doesn’t work?