用flash做鍾其實很簡單的,主要看你畫的時鐘漂亮不,裏面的代碼就這一點:
_root.onEnterFrame = function() {
// 更新時間
myDate = new Date();
// 時鐘,分鐘,秒鐘指的角度,還有它們的影子的角度
hourHand._rotation = myDate.getHours()*30+(myDate.getMinutes()/2);
hourHandShadow._rotation = myDate.getHours()*30+(myDate.getMinutes()/2);
minuteHand._rotation = myDate.getMinutes()*6+(myDate.getSeconds()/10);
minuteHandShadow._rotation = myDate.getMinutes()*6+(myDate.getSeconds()/10);
secondHand._rotation = myDate.getSeconds()*6;
secondHandShadow._rotation = myDate.getSeconds()*6;
};