魔法门之英雄无敌礼包:谁有数字flash时钟的代码?

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 20:11:26
要那种数字式的,不要圆盘的那种
最好是写在板子上那样的

建三个动态文本:变量名分别是hn,mn,sn,各自代表时、分、秒。然后在建一个actionscript层,将下面的代码贴上就可以了。其他的外观的东西自己做应该没问题吧?呵呵:)
sydate = new Date();
s = sydate.getseconds();
m = sydate.getminutes();
h = sydate.gethours();
hn = h;
mn = m;
sn = s;
delete sydate;
if (h <10) {
hn = "0"+ hn;
}
if (m <10) {
mn = "0"+ mn;
}
if (s <10) {
sn = "0"+ sn;
}