用FLASH如何计算时间呀,

来源:百度知道 编辑:UC知道 时间:2024/07/03 22:24:04
我想在FLASH里面求一下从
从2007。4。25日3。00到现在的时间
要在FLASH里面显示出来,如果那位高手可以帮帮忙
在下感激不尽

QQ155322297

在flash 中新建一个文档,在舞台中建立一个动态文本框,在属性栏中将其命名为my_txt
然后在主场景中新建一个图层,命名为action,在第一帧中写入如下代码:

reconize_date = new Date(2007, 04, 25,03, 00, 00);//开始的那天,时间的格式是年月日时分秒
now_date = new Date();
difference = now_date.getTime()-reconize_date.getTime();
millisecondPerDay = 1000*60*60*24;
difference = Math.floor(difference/millisecondPerDay);
my_txt.wordWrap = true;
my_txt.text = "在"+difference;