Groups | Blog | Home
all groups > flash actionscript > september 2007 >

flash actionscript : Simple Analog Clock



Spray27
9/11/2007 10:22:39 PM
I have been playing with this code and can't seem to get it to do anything,
even display an error message. Ideally, when the app is launched, it will
rotate some hands on an analog clock to display the current time. If anyone can
point me in the right direction, I will be very thankful. Thanks.

//############ VARIABLES ##############
var currentDate:Date = new Date();
var clockMinutes:Number = new Number();
var clockSeconds:Number = new Number();
var clockHours:Number = new Number();

//############ GET VALUES #############
clockHours = parseInt(currentDate.getHours(), 10);
clockSeconds = parseInt(currentDate.getSeconds(), 10);
clockMinutes = parseInt(currentDate.getMinutes(), 10);

//############ MOVE HANDS #############
hours_mc.rotation = clockHours * (360/24));
minutes_mc.rotation = clockMinutes * (360/60));
seconds_mc.rotation = clockSeconds * (360/60));
kglad
9/12/2007 2:01:44 AM
AddThis Social Bookmark Button