im new to actionscript3 flash. I have a int variable and i would like to add +2 every second since game started. How can i do this ? how do i know how much time has elapsed?
var a:int = 0;
var onTimer:Function = function (e:TimerEvent):void {
a += 2;
}
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();