UID44
好友
注册时间2017-9-11
最后登录1970-1-1
在线时间 小时
积分37430
TA的每日心情 | 开心 2019-12-19 11:48 |
---|
签到天数: 238 天 [LV.7]常住居民III
|
源码下载:
- //把以下代码复制到主场景中的第一帧上:
- //画钟表边线
- this.createEmptyMovieClip("bianxian_mc", 1);
- with (bianxian_mc) {
- lineStyle(2, 0x0000EE);
- moveTo(Math.cos(0*Math.PI/180)*96, Math.sin(0*Math.PI/180)*96);
- for (var i = 360; i>=0; i--) {
- lineTo(Math.cos(i*Math.PI/180)*96, Math.sin(i*Math.PI/180)*96);
- }
- _x = 260;
- _y = 200;
- }
- //创建时间动态文本
- this.createTextField("my_txt", 2, 0, 0, 0, 0);
- with (my_txt) {
- autoSize = true;
- textColor = 0x555555;
- _x = 230;
- _y = 150;
- }
- //画12个表格
- this.createEmptyMovieClip("biaoge_mc", 3);
- with (biaoge_mc) {
- lineStyle(2, 0x00FFFF);
- moveTo(0, -96);
- lineTo(0, -92);
- _x = 260;
- _y = 200;
- }
- for (i=1; i<12; i++) {
- duplicateMovieClip(biaoge_mc, "biaoge_mc"+i, 3+i);
- setProperty("biaoge_mc"+i, _rotation, i*30);
- }
- //画时针
- this.createEmptyMovieClip("shizhen_mc", 16);
- with (shizhen_mc) {
- lineStyle(4, 0x666666);
- moveTo(0, 0);
- lineTo(0, -60);
- _x = 260;
- _y = 200;
- }
- //画分针
- this.createEmptyMovieClip("fenzhen_mc", 17);
- with (fenzhen_mc) {
- lineStyle(2, 0x666666);
- moveTo(0, 0);
- lineTo(0, -75);
- _x = 260;
- _y = 200;
- }
- //画秒针
- this.createEmptyMovieClip("miaozhen_mc", 18);
- with (miaozhen_mc) {
- lineStyle(1, 0x666666);
- moveTo(0, 0);
- lineTo(0, -90);
- _x = 260;
- _y = 200;
- }
- //让时针、分针、秒针动起来
- this.createEmptyMovieClip("time_mc", 19);
- time_mc.onEnterFrame = function() {
- my_date = new Date();
- shi = my_date.getHours();
- fen = my_date.getMinutes();
- miao = my_date.getSeconds();
- shizhen_mc._rotation = shi/12*360+fen/60*30;
- fenzhen_mc._rotation = fen/60*360+miao/60*6;
- miaozhen_mc._rotation = miao/60*360;
- if (shi<10) {
- shi = "0"+shi;
- }
- if (fen<10) {
- fen = "0"+fen;
- }
- if (miao<10) {
- miao = "0"+miao;
- }
- my_txt.text = shi+":"+fen+":"+miao;
- };
- //画中心圆
- this.createEmptyMovieClip("yuan_mc", 20);
- with (yuan_mc) {
- beginFill(0x555555);
- moveTo(Math.cos(0*Math.PI/180)*4, Math.sin(0*Math.PI/180)*4);
- for (var i = 360; i>=0; i--) {
- lineTo(Math.cos(i*Math.PI/180)*4, Math.sin(i*Math.PI/180)*4);
- }
- _x = 260;
- _y = 200;
- }
复制代码 |
评分
-
参与人数 2 | 威望 +14 |
金钱 +13 |
贡献 +13 |
收起
理由
|
岩新新
| + 7 |
+ 7 |
+ 7 |
非常精彩! |
大海無邊
| + 7 |
+ 6 |
+ 6 |
谢谢分享,论坛有您更精彩! |
查看全部评分
|