|
發表於 2011-6-28 11:14:06
|
顯示全部樓層
先建立三個影片片段-時針、分針、秒針
並給予實體名稱
nowtime();
function nowtime(){
var watch = new Date();
hours_mc.rotation = (watch.getHours()*30)+(watch.getMinutes()*0.5);
minutes_mc.rotation = (watch.getMinutes()*6)+(watch.getSeconds()*0.1);
seconds_mc.rotation = watch.getSeconds()*6;
var myTimer=setTimeout(nowtime,1000);
}
這個範例在104網頁設計專班的第二本書第六章有教,還有數字鐘 |
|