flash数字显示时钟怎么编写的啊?

2024-11-17 13:29:32
推荐回答(1个)
回答(1):

建3个动态文本框,把变量名分别设置成,s,f,m
在第一祯上加下面的代码
_root.onEnterFrame = function() {
sj = new Date();
shi = sj.getHours();
if (shi<10) {
s = "0"+shi+":";
} else {
s = shi+":";
}
fen = sj.getMinutes();
if (fen<10) {
f = "0"+fen;
} else {
f = fen;
}
miao = sj.getSeconds();
if (miao<10) {
m = ":0"+miao;
} else {
m = ":"+miao;
}
};