电子时钟的制作 |
| 作者:佚名 来源:闪吧 作者: fuyiwei 更新:2007-1-13 20:48:42 错误报告 我要投稿 |
1、如下图做三个图层:图层1为存放数字,图层2存放脚本,图层3存放钟面(你喜欢作成怎样就怎样!呵呵!!)。 2、在图层2加入两个动态文本框,时、分、秒格式为“00:00:00”,年、月、日格式为“0000.00.00”。 3、在时、分、秒文本框属性的ar框中输入变量名TimeTextField,在年、月、日文本框属性的ar框中输入变量名DateTextField。
 4、在图层2的第一帧加入以下脚本: newDate = new Date(); DateTextField = (newDate.getfullyear()+"."+(newDate.getMonth()+1)+"." +newDate.getDate()); Cur_hour = newDate.getHours(); if (length(Cur_Hour)<2) { Cur_Hour = "0"+Cur_Hour; } Cur_Minute = newDate.getMinutes(); if (length(Cur_Minute)<2) { Cur_Minute = "0"+Cur_Minute; } Cur_Second=newDate.getSeconds(); if (length(Cur_Second)<2) { Cur_Second = "0"+Cur_Second; } timetextfield = cur_hour+":"+cur_minute+":"+cur_second;  第二帧加入:gotoAndPlay(1);
本例全部完成!!
点击浏览该文件
|
|
| 文章录入:skyuu 责任编辑:skyuu |
|
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |