查看完整版本: flash電子鐘程式碼請教
頁: [1]

pigismylife 發表於 2012-3-13 08:50 PM

flash電子鐘程式碼請教

curdate = new Date();
hours = curdate.getHours();
minutes = curdate.getMinutes();
seconds = curdate.getSeconds();
if (hours>12) {
hours = hours-12;
}
setProperty("hhh", _rotation, hours*30+minutes/2);
setProperty("mmm", _rotation, minutes*6);
setProperty("sss", _rotation, seconds*6);


可不可以請交我這裡面的指另還有一些她動作的程序
翻書跟上網都不是很懂欸   
希望你可以幫我駐解一下
謝謝啦
其中sss是我sec做的秒針名稱
其中mmm是我minuture做的秒針名稱
其中hhh是我hour做的秒針名稱

真的看不太懂怎麼動作的= =
麻煩越仔細越好
因為程度真的很差...<div class='locked'><em>瀏覽完整內容,請先 <a href='member.php?mod=register'>註冊</a> 或 <a href='javascript:;' onclick="lsSubmit()">登入會員</a></em></div><div></div>

angewang 發表於 2012-3-18 12:09 AM

//取得現在時間填入變數courdate
curdate = new Date();
//取得小時填入變數hours
hours = curdate.getHours();
//取得分填入變數minutees
minutes = curdate.getMinutes();
//取得秒填入變數seconds
seconds = curdate.getSeconds();
if (hours>12) {//因為date取得24小時至大於12 時針的位置
hours = hours-12;
}
//一圓圈為360度
//物件行為  _rotation 自轉 ,幾點 x 30 + 幾分/2取得時針物件的自轉多少度
setProperty("hhh", _rotation, hours*30+minutes/2);
//分針物件同上
setProperty("mmm", _rotation, minutes*6);
//分針物件同上
setProperty("sss", _rotation, seconds*6);

setProperty 這是函數請摻考
http://help.adobe.com/zh_TW/FlashLite/2.0_FlashLiteAPIReference2/WS5b3ccc516d4fbf351e63e3d118cd9b5f6e-7a33.html...<div class='locked'><em>瀏覽完整內容,請先 <a href='member.php?mod=register'>註冊</a> 或 <a href='javascript:;' onclick="lsSubmit()">登入會員</a></em></div>

loogn 發表於 2012-8-16 06:12 AM

謝謝大大無私分享,感激不盡,很有趣
頁: [1]