用Flash制作动态时钟

来源 :电脑学习 | 被引量 : 0次 | 上传用户:xin__yonghu
下载到本地 , 更方便阅读
声明 : 本文档内容版权归属内容提供方 , 如果您对本文有版权争议 , 可与客服联系进行内容授权或下架
论文部分内容阅读
  摘要:利用Flash动作脚本提供的交互程序设计。只需掌握一些简单的脚本命令,就可制作精美的动态时钟。
  关键词:Flash Action 元件 图层
  中图分类号:TP317.4 文献标识码:B 文章编号:1002-2422(2008)01-0048-02
  
  用Flash制作一个精美的动态小时钟,将它拖到屏幕一角。方便查看当前时间和日期。最终效果图见图1。
  (1)启动Flash,新建一个影片文件(大小自定);
  (2)制作时钟里的时针。新建一个影片剪辑元件,命名为hours,进入元件的编辑区后,使用钢笔工具绘制时针形状,适当填充颜色,同时适当调整将中心位置,如图2所示;
  (3)制作时钟里的分针。新建一个影片剪辑元件,命名为minutes,方法同步骤(2),如图3所示;
  (4)制作时钟里的秒针。新建一个影片剪辑元件,命名为seconds,方法同步骤(2),如图4所示;
  (5)返回场景1,将图层命名为“表盘”,先导入背景图片并拖入到舞台,调整大小,打散;使用椭圆工具制作一个空心圆环,适当调整位置大小,用作时钟的边框;添加表盘刻度:
  (6)新建图层,重命名为“指针”,然后将元件Hours、minutes和Seconds拖到场景中,注意指针中心位置应与表盘中心对齐;
  
  (8)添加一个图层命名为Action,设置控制时钟运行的Action脚本;
  在第1帧添加如下Action:
  time=new Date();
  hours=time.getHours();  minutes=time.getMinutes();
  seconds=time.getSeeonds();
  if(hours>12){
  hours=hours-12;
  }
  if(hours<1){
  hours=12;
  }
  hours=hours*30 int(minutes/2);
  minutes=minutes*6 int(seconds/10);
  MoDnd8=seconds*6;
  millisecond=fime.getMilllseeonds();
  hours=hours*30 (minutes/2);  minutes=minutes*6 (seconds/10);
  seconds=(seconds millisecond/1000)*6;
  注意:替换上边相应三句,可改变指针跳动频率
  year=time.getFullYear():
  datestr=year “年” (time.getMonth() 1) “月” time.getDate() “日”;
  switch(time.getDay()){
  case 1:datestrfdatestr “星期一”;break;
  cage 2:datestr=datestr “星期一”;break;
  case 3:datestr=datestr “星期三”;break;
  case 4:datesu’=datestr “星期四”;break;
  case 5:datestr=datestr “星期五”;break;
  case 6:datestr=datestr “星期六”;break;
  case 0:datestr=datestr “星期日”;break;}
  在第2帧添加如下Action:
  gotoAndPlay(1);
  (9)给三个表针添加各自的Action,使其可以按照自
  己的规律进行旋转。
  给时针添加如下Action:
  onClipEvent(enterFmme){
  setProperty(this,_rotation,_root.hours);}
  给分针添加如下Action:
  onClipEvent(enterFrame){
  setProperty(this,_rotation,_root.minutes);}
  给秒针添加如下Action:
  onClipEvent(enterFrame){
  setProperty(this,_rotation,_root.seconds);}
其他文献
英语教材改革后,对教师是一次新的挑战。单词量增加,内容超前,更注重学生能力的培养和听说读写的综合运用。作为教师,必须分析,钻研教材,对一些难点,掌握规律,巧编口诀,力争让学生在短时间内掌握得更准,更牢。  下面,我谈谈在英语中对几个难点的突破。  一、一般现在时动词(单复数时)的变化  对于初一学生来说,第一次接触“时态”。能理解好概念,本也不易,为了让更多的学生懂得变化规则,我编了以下口诀:  
Mike was an 11 years old boy. He was the only son to his parent. His father worked as a carpenter1 and his mother was a house wife. Although Mike’s family wasn’t a rich one, they had a happy life.  迈克
摘要:该文通过对Android操作系统和移动学习系统平台进行研究,分析了Android操作系统的平台优势,探讨如何基于Android操作系统对移动学习系统平台进行设计与实现,并在此基础上,总结几点设计与开发原则。  关键词:Android;移动学习平台;教学活动设计  中图分类号:F252.8 文献标识号:A  Design and Development Principles of Mobile
A man was really worried about his son, who was sixteen years old but had no courage at all. So the father decided to call on a Buddhist monk to train his child.  一位父亲十分担心自己的儿子,他已经16岁了,却一点儿也不勇敢。于是父亲决定
徐航宇  出生日期:2005年7月30日  愛好:足球  座右铭:时间就是金钱。  就读学校班级:安徽省濉溪县百善中心学校七(2)班  指导老师:姜经志  My Friend  Tom King is my good friend. He works hard at his lessons. He is one of the best students in our class. He likes
朱丹妮  出生日期:2005年12月16日  愛好:画画  座右铭:人努力了不一定会成功,但放弃了就一定会失败。  就读学校班级:江苏省连云港市赣榆区罗阳中学初一(2)班  指导老师:陈传光  Many of my friends have pets at home. I want one, too.  I’d like to keep a fish. I think fish are lovel
出生日期:2003年7月28日  愛好:画画  座右铭:A road of a thousand miles begins with one step. 千里之行,始于足下。  就读学校班级:安徽省濉溪县百善中心学校  七(1)班  指导老师:姜经志  A Supermarket  Near my home there is a supermarket. I often go shopping t
Part One 听力部分 (20分)    Ⅰ.听录音,选出相应的图片。读一遍。(每小题1分,共5分)    1. 2. 3. 4. 5.   Ⅱ.听录音,根据你所听到的内容选择最佳答语。读一遍。(每小题1分,共5分)  ()6. Whose (谁的) basketball is it?  A. It’s Mary’s.B. It’s Kate’s.C. It’s Lucy’s.  ()7. W
Bobby was named after his best friend, his grandfather, Bob.  One of the best things Bob and Bobby did was to play with the old wooden blocks that were kept on a shelf, in the small sewing1 room under
“The walls in our apartment are so thin that whenever our neighbors open their windows in winter, we are sure to catch a cold.” said A.  “The walls in our apartment are so thin that I once asked my wi