您好!欢迎你光临简单实用时钟制作教程_月亮湾B站!

体育

I

交友

I

论坛

I

会员注册

I

本站搜索

I

收藏本站

当前位置:首页 >>>教材系列>>>FLASH实例(1)>>>简单实用时钟制作教程
简单实用时钟制作教程
发表日期:2008/6/20 8:15:00 出处:网络 作者:xfsh 发布人:xfshabc 已被访问 4315


效果图


 

双击自动滚屏 【打印本页】 【关闭窗口
 相关评论:



从零开始
(2011/2/5 7:59:00) [175.151.81.]

怎么这时钟快10天,我按此方法制作的所有时钟都快10天


从零开始
(2011/2/5 7:09:00) [175.151.81.]

这时钟怎么快10分呢 我按此制作的时钟都快 老师怎么解决呢


蝴蝶
(2008/7/20 12:12:00) [221.235.71.]

代码

//画钟表边线
this.createEmptyMovieClip("bianxian_mc", 1);
with (bianxian_mc) {
lineStyle(2, 0xCCCCCC);
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 = 100;
_y = 110;
}
//创建时间动态文本
this.createTextField("my_txt", 2, 0, 0, 0, 0);
with (my_txt) {
autoSize = true;
textColor = 0x555555;
_x = 70;
_y = 60;
}
//画12个表格
this.createEmptyMovieClip("biaoge_mc", 3);
with (biaoge_mc) {
lineStyle(2, 0xCCCCCC);
moveTo(0, -96);
lineTo(0, -92);
_x = 100;
_y = 110;
}
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 = 100;
_y = 110;
}
//画分针
this.createEmptyMovieClip("fenzhen_mc", 17);
with (fenzhen_mc) {
lineStyle(2, 0x666666);
moveTo(0, 0);
lineTo(0, -75);
_x = 100;
_y = 110;
}
//画秒针
this.createEmptyMovieClip("miaozhen_mc", 18);
with (miaozhen_mc) {
lineStyle(1, 0x666666);
moveTo(0, 0);
lineTo(0, -90);
_x = 100;
_y = 110;
}
//让时针、分针、秒针动起来
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 = 100;
_y = 110;
}



330193430
(2008/7/20 5:11:00) [218.75.90.]

老师你的这些代码可以做来让我们直接复制进贴进AS语句那里面不呢?谢谢!


moonabc
(2008/6/21 8:02:00)

谢谢;,

 发表评论:共有 5 条评论

身份选择:会员 游客(游客不需要输入密码)
用 户 名: 密 码:
评论内容:
(最多评论字数:500)

月亮湾B站 | 设为首页 | 加入收藏 | 联系我们 | 进入管理 | 关于站长 | 本站搜索

联系电话:QQ340623306 联系人:王小华