Hello, I haven't coded in literally 9 years so bear with me on the stupidity. I was used to AS2 as well so this is entirely new for me. I'm just teaching myself again and trying to make a simple counter that keeps track of minutes and seconds. However, when I trace, the seconds and minutes do not increase, and the "counter" variable just alternates between 1 and 2. What am I doing wrong?
Code:
//30 fps
var counter:int = 0;
var seconds:int = 0;
var minutes:int = 0;
var hours:int = 0;
addEventListener(Event.ENTER_FRAME, time);
function time(e:Event):void
{
if (! pause)
{
if (counter<30)
{
counter++;
}
else
{
counter = 0;
if (seconds<59)
{
seconds++;
}
else
{
minutes++;
seconds = 0;
}
}
}
trace("Elapsed time: "+minutes+" minutes "+seconds+" seconds");
}