just cause i’m trying to optimize my project to the fullest (concerned about garbage collection and all that…), i want to know something about timers…
is the killTimer function enough? or do i also have to remove the listeners?
var theTimer:Timer;
function startTimer():void
{
theTimer = new Timer(1000);
theTimer.addEventListener(TimerEvent.TIMER, timerRan);
theTimer.start();
}
function killTimer():void
{
theTimer.stop();
theTimer = null;
}
function timerRan(event:TimerEvent):void
{
// do something...
}