Creating a counting up total in Animate
I'm still relatively new to using Animate (and particularly the action coding). I want to create a counting up total, like this one CountUp.js
I've tried to create it using the code below but it either comes up with the total number and nothing else, or an error message "#1120: Access of undefined property countUp", any help would be much appreciated!!
var countUpInc:Number = 6429;
var totalSecs = 304709;
var countUp = totalSecs;
counter.text = countUp;
var time:Timer = new Timer(countUpInc * 1000);
time.addEventListener(TimerEvent.TIMER, tick);
function tick(e:TimerEvent):void {
if(CountUp == 304709) {
trace("count up complete");
time.stop();
countUp = totalSecs;
} else {
countUp = countUp + countUpInc;
counter.text = countUp;
}
}
