At 6/9/05 11:22 AM, Pumking wrote: how do i make a clock in a flash that matches actual time?
There should be a clock in the samples, it's all there just use that and change it's graphics
At 6/9/05 11:22 AM, Pumking wrote: how do i make a clock in a flash that matches actual time?
Create three hands (hour/minute/second) all pointing upwards
Make them MCs
Give the hour hand the Instance Name 'hhand'
Give the minute hand the Instance Name 'mhand'
Select the second hand, and add these actions:
onClipEvent(enterFrame){
MyDate = new Date();
hour = MyDate.getHours();
minute = MyDate.getMinutes();
second = MyDate.getSeconds();
this._rotation=6*second;
_parent.mhand._rotation=6*minute
if(hour>12){hour=hour-12;}
_parent.hhand._rotation=(30*hour)+(0.5*minute)
}
The hands will have to have their rotation point at the bottom to work correctly
ok sounds really complicated to me so i just do it the old way
Put this code on a dynamic text box with the VAR: field filled with the word: time
_root.onEnterFrame = function() {
myDate = new Date();
time = (myDate.getHours()+":"+myDate.getMinutes()+":"+myDate.getSeconds());
}