香江之水音画网

标题: Flash纯脚本制作的时钟【附源码下载】 [打印本页]

作者: 漫步人生    时间: 2018-10-5 12:44
标题: Flash纯脚本制作的时钟【附源码下载】

http://mb.xiangjiangriverwater.com/F8bfq/bfq00.swf


源码下载:


  1. //把以下代码复制到主场景中的第一帧上:
  2. //画钟表边线
  3. this.createEmptyMovieClip("bianxian_mc", 1);
  4. with (bianxian_mc) {
  5.         lineStyle(2, 0x0000EE);
  6.         moveTo(Math.cos(0*Math.PI/180)*96, Math.sin(0*Math.PI/180)*96);
  7.         for (var i = 360; i>=0; i--) {
  8.                 lineTo(Math.cos(i*Math.PI/180)*96, Math.sin(i*Math.PI/180)*96);
  9.         }
  10.         _x = 260;
  11.         _y = 200;
  12. }
  13. //创建时间动态文本
  14. this.createTextField("my_txt", 2, 0, 0, 0, 0);
  15. with (my_txt) {
  16.         autoSize = true;
  17.         textColor = 0x555555;
  18.         _x = 230;
  19.         _y = 150;
  20. }
  21. //画12个表格
  22. this.createEmptyMovieClip("biaoge_mc", 3);
  23. with (biaoge_mc) {
  24.         lineStyle(2, 0x00FFFF);
  25.         moveTo(0, -96);
  26.         lineTo(0, -92);
  27.         _x = 260;
  28.         _y = 200;
  29. }
  30. for (i=1; i<12; i++) {
  31.         duplicateMovieClip(biaoge_mc, "biaoge_mc"+i, 3+i);
  32.         setProperty("biaoge_mc"+i, _rotation, i*30);
  33. }
  34. //画时针
  35. this.createEmptyMovieClip("shizhen_mc", 16);
  36. with (shizhen_mc) {
  37.         lineStyle(4, 0x666666);
  38.         moveTo(0, 0);
  39.         lineTo(0, -60);
  40.         _x = 260;
  41.         _y = 200;
  42. }
  43. //画分针
  44. this.createEmptyMovieClip("fenzhen_mc", 17);
  45. with (fenzhen_mc) {
  46.         lineStyle(2, 0x666666);
  47.         moveTo(0, 0);
  48.         lineTo(0, -75);
  49.         _x = 260;
  50.         _y = 200;
  51. }
  52. //画秒针
  53. this.createEmptyMovieClip("miaozhen_mc", 18);
  54. with (miaozhen_mc) {
  55.         lineStyle(1, 0x666666);
  56.         moveTo(0, 0);
  57.         lineTo(0, -90);
  58.         _x = 260;
  59.         _y = 200;
  60. }
  61. //让时针、分针、秒针动起来
  62. this.createEmptyMovieClip("time_mc", 19);
  63. time_mc.onEnterFrame = function() {
  64.         my_date = new Date();
  65.         shi = my_date.getHours();
  66.         fen = my_date.getMinutes();
  67.         miao = my_date.getSeconds();
  68.         shizhen_mc._rotation = shi/12*360+fen/60*30;
  69.         fenzhen_mc._rotation = fen/60*360+miao/60*6;
  70.         miaozhen_mc._rotation = miao/60*360;
  71.         if (shi<10) {
  72.                 shi = "0"+shi;
  73.         }
  74.         if (fen<10) {
  75.                 fen = "0"+fen;
  76.         }
  77.         if (miao<10) {
  78.                 miao = "0"+miao;
  79.         }
  80.         my_txt.text = shi+":"+fen+":"+miao;
  81. };
  82. //画中心圆
  83. this.createEmptyMovieClip("yuan_mc", 20);
  84. with (yuan_mc) {
  85.         beginFill(0x555555);
  86.         moveTo(Math.cos(0*Math.PI/180)*4, Math.sin(0*Math.PI/180)*4);
  87.         for (var i = 360; i>=0; i--) {
  88.                 lineTo(Math.cos(i*Math.PI/180)*4, Math.sin(i*Math.PI/180)*4);
  89.         }
  90.         _x = 260;
  91.         _y = 200;
  92. }
复制代码

作者: 大海無邊    时间: 2018-10-5 23:35
非常精彩
作者: 大海無邊    时间: 2018-10-5 23:35
音乐传奇
作者: 大海無邊    时间: 2018-10-5 23:36
播放器有个性
作者: 大海無邊    时间: 2018-10-5 23:36
美图自然 播放器细腻迷人,谢分享
作者: 大海無邊    时间: 2018-10-5 23:36
-欣赏佳作如诗如画,赞美香江之水
作者: 大海無邊    时间: 2018-10-5 23:36
香江有你更精彩!你有香江辉煌
作者: 大海無邊    时间: 2018-10-5 23:37
画面美得心醉,音乐听到魄碎
作者: 大海無邊    时间: 2018-10-5 23:37
图图美美哒哒,音乐婉转动听,陶醉!
作者: 大海無邊    时间: 2018-10-5 23:37
香江因你支持更加美好
作者: 大海無邊    时间: 2018-10-5 23:38
精美的影像,浪漫的造型,迷人的音乐,营造出美妙的意境
作者: 大海無邊    时间: 2018-10-5 23:38
聆听着美妙的歌曲、欣赏着优美的的图画、品味着高雅的意境
作者: 大海無邊    时间: 2018-10-5 23:38
聆听经典音乐,咀嚼人生,尽在这美妙的旋律之中
作者: 大海無邊    时间: 2018-10-5 23:38
感谢支持香江
作者: 大海無邊    时间: 2018-10-5 23:39
制作辛苦,请用茶
作者: 大海無邊    时间: 2018-10-5 23:41
谢无私奉献
作者: 岩新新    时间: 2018-10-6 05:58
欣赏点赞!
作者: 容轩听雨    时间: 2023-12-12 20:36
精彩




欢迎光临 香江之水音画网 (http://www.xiangjiangriverwater.com/) Powered by Discuz! X3.2