Flash AS创作:实时时钟
类别: Flash教程
这两天做了一个实时的时钟~ 发上来和大家分享一下!
« Full Screen »
newDate = new Date();
newDate.month = newDate.getMonth()+1;
DateTextField =
newDate.getFullYear()+"-"+ newDate.month +"-"+ newDate.getDate();
now_hours = newDate.getHours();
if(length(now_hours)<2){
now_hours = "0" + now_hours;
}
now_minutes = newDate.getMinutes();
if(length(now_minutes)<2){
now_minutes = "0" + now_minutes;
}
now_seconds = newDate.getSeconds();
if(length(now_seconds)<2){
now_seconds = "0" + now_seconds;
}
TimeTextField =
now_hours +":"+ now_minutes +":"+ now_seconds;
_root.second._rotation = newDate.getSeconds()*6;
_root.minute._rotation = newDate.getMinutes()*6 + newDate.getSeconds()*(1/10);;
_root.hour._rotation = newDate.getHours()*30 + newDate.getMinutes()*(1/2);
newDate.month = newDate.getMonth()+1;
DateTextField =
newDate.getFullYear()+"-"+ newDate.month +"-"+ newDate.getDate();
now_hours = newDate.getHours();
if(length(now_hours)<2){
now_hours = "0" + now_hours;
}
now_minutes = newDate.getMinutes();
if(length(now_minutes)<2){
now_minutes = "0" + now_minutes;
}
now_seconds = newDate.getSeconds();
if(length(now_seconds)<2){
now_seconds = "0" + now_seconds;
}
TimeTextField =
now_hours +":"+ now_minutes +":"+ now_seconds;
_root.second._rotation = newDate.getSeconds()*6;
_root.minute._rotation = newDate.getMinutes()*6 + newDate.getSeconds()*(1/10);;
_root.hour._rotation = newDate.getHours()*30 + newDate.getMinutes()*(1/2);
原文件传上来,想要学的朋友可以下栽去看看
- 上一篇: 用EventDispatcher自定义事件
- 下一篇: As3.0 概要?了解AS3.0的改变
-= 资 源 教 程 =-
文 章 搜 索