Hi guys,
quick question about clearInterval() -
How come that after clearing an interval created with setInterval, the intervalID still persists?
If i trace intervalID after clearInterval has been called, it still returns the id :-/
In a class im writing , i'm executing some code depending on whether an interval has been cleared. Will i have to force intervalID = null each time i use clearInterval?
eg.
quick question about clearInterval() -
How come that after clearing an interval created with setInterval, the intervalID still persists?
If i trace intervalID after clearInterval has been called, it still returns the id :-/
In a class im writing , i'm executing some code depending on whether an interval has been cleared. Will i have to force intervalID = null each time i use clearInterval?
eg.
Code:
function callback() {
trace("interval called: "+getTimer()+" ms.");
}
var intervalID:Number = setInterval(callback, 1000);
clearInt_btn.onRelease = function(){
clearInterval( intervalID );
trace("cleared interval: " + intervalID);
};