也给我发一个FLASH数字时钟的源文件吧,要能修改的那种源文件,带年月日,小时分钟的。

我的邮箱:newhua11@qq.com
2024-11-17 18:37:55
推荐回答(2个)
回答(1):

这个简单,源文件发到你邮箱里了。请查收。
可以新建一个as3的文档,在空白帧上按F9,直接写代码如下:

import flash.text.TextField;
var id:Number;
var yerStr:String;
var monStr:String;
var dayStr:String;
var horStr:String;
var minStr:String;
var secStr:String;
var weekArray:Array = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
var my_txt:TextField = new TextField();
my_txt.width = 300;
addChild(my_txt);
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.size = 20;
refreshTime(my_txt);
id = setInterval(refreshTime, 1000, my_txt);
function refreshTime(obj){
var myDate:Date = new Date();
yerStr = myDate.getFullYear()+"年";
monStr = myDate.getMonth()+1;
if (Number(monStr)< 10){
monStr = "0"+monStr+"月";
}else{
monStr = monStr+"月";
}
if (myDate.getDate()<10){
dayStr = "0"+myDate.getDate()+"日";
}else{
dayStr = myDate.getDate()+"日";
}
if (myDate.getHours()<10){
horStr = "0"+myDate.getHours()+":";
}else{
horStr = myDate.getHours()+":";
}
if (myDate.getMinutes()<10){
minStr = "0"+myDate.getMinutes()+":";
}else{
minStr = myDate.getMinutes()+":";
}
if (myDate.getSeconds()<10){
secStr = "0"+myDate.getSeconds();
}else{
secStr = ""+myDate.getSeconds();
}
obj.text = yerStr+monStr+dayStr+weekArray[myDate.getDay()]+" "+horStr+minStr+secStr;
obj.setTextFormat(my_fmt);
}

需要as2版本的,可以帮你改成as2的。

回答(2):

需要源文件对吧?!这个可以有。但是不免--费。