I’ve got the code below working as I’d like, but once my if statement returns true, i get this in the output window:
256 levels of recursion were exceeded in one action list.
This is probably an infinite loop.
Further execution of actions has been disabled in this movie.
The delete this.onEnterFrame triggers and stops the trace from continuing, so I’m not sure why this is happening. On the same note I’d like to know if my script is okay or if there is any “easier” more practical way to write it?
I like to follow in the footsteps of some of kirupa’s best
stop();
startTime = getTimer();
bar_mc._width = 0;
onEnterFrame = function() {
elapsedTime = getTimer()-startTime;
elapsedSecs = Math.floor(elapsedTime/1000);
elapsedHun = Math.floor(elapsedTime/100);
timer_txt = "00:"+elapsedSecs+":"+elapsedHun;
bar_mc._width = elapsedHun/4;
if (elapsedSecs >= 40) {
trace("do stuff here");
delete this.onEnterFrame();
}
}