Hi all,
Sorry if this is a basic question, but I am new to ActionScript (v3) and I'm just going round in circles here.
I have a countdown timer script that I am wanting to use "TweenLite.from" on. But the output is blank.
Anyone have any idea what's wrong?
Any help is appreciated.
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void
{
var nowDate:Date = new Date();
var ms:Number = targetDate.getTime() - nowDate.getTime();
var sec:Number = Math.floor(ms/1000);
var min:Number = Math.floor(sec/60);
var hr:Number = Math.floor(min/60);
var day:Number = Math.floor(hr/24);
// Normalise the values
// See http://layersmagazine.com/build-a-simple-countdown-timer-in-flash.html
sec = sec % 60;
min = min % 60;
hr = hr % 24;
daytxt.text = day.toString();
hrtxt.text = (hr < 10) ? "0"+hr.toString() : hr.toString();
mintxt.text = (min < 10) ? "0"+min.toString() : min.toString();
sectxt.text = (sec < 10) ? "0"+sec.toString() : sec.toString();
TweenLite.from(sectxt, 1, {alpha:0});
}