///pc/img/blank.gif" width="12" height="8">当前位置:///default.htm" class="under">亿度网络 -> ///pc/index.htm" class="under">网页制作教程 -> Flash实例


/pc/bin/msg.pl?file_id=k_flashjq11 target="_blank">///pc/img/message.gif" width="64" height="54" alt="请您留言" border="0">
谈谈您的看法

///pc/img/blank.gif" width="1" height="1">
11.从制作一个简单的计时器开始

预览成品:

///pc/homepage/flashsl/flash11/swf/cx01.zip">下载源程序


逐步说明:
  1)选择菜单File->New,创建一个新电影。
  2)选择工具栏中的文字工具///pc/homepage/flashsl/flash11/img/flashwz.gif" width="23" height="21" align="absmiddle" alt="文字工具">,在文字工具参数栏中选择字体大小为48,颜色为黑色,///pc/homepage/flashsl/flash11/img/flash001.gif" width="55" height="84" align="absmiddle" alt="字体字号颜色">

 

并点击“Text Field”按钮///pc/homepage/flashsl/flash11/img/flash002.gif" width="28" height="25" align="absmiddle" alt="文本框按钮">。
  3)在工作区中点击鼠标,出现一文本输入框。点击工具栏中的箭头按钮///pc/homepage/flashsl/flash11/img/flash003.gif" width="24" height="22" align="absmiddle">,选中并用鼠标右键单击文本输入框,在弹出的菜单中选择Properties项,

///pc/homepage/flashsl/flash11/img/flash004.gif" width="130" height="216" alt="文本框属性菜单">

进入文本属性对话框,在ariable域中输入变量“x”。

///pc/homepage/flashsl/flash11/img/flash005.gif" width="257" height="119" alt="设置文本框变量">

单击OK按钮,关闭属性设置对话框。
  4)在第12帧处插入一个关键帧,

///pc/homepage/flashsl/flash11/img/flash006.gif" width="282" height="148" alt="插入的关键帧">

并用鼠标双击该帧,弹出该帧属性对话框,切换到Action选项卡,点击“+”按钮///pc/homepage/flashsl/flash11/img/flash007.gif" width="24" height="24" align="absmiddle" alt="增加Actions按钮">,弹出一下拉菜单,点击“If”项,

///pc/homepage/flashsl/flash11/img/flash008.gif" width="144" height="171" alt="插入If语句">

在“If”语句的“Condition”域中输入“x<=19”。

///pc/homepage/flashsl/flash11/img/flash009.gif" width="462" height="167" alt="输入条件">

再次点击“+”按钮,弹出一下拉菜单,点击“Set Variable”项,分别在“Variable”域和“Value”域中输入变量“X”及表达式“X+1”。

///pc/homepage/flashsl/flash11/img/flash010.gif" width="441" height="152" alt="设置变量">

由于在“Value”域中输入的是数学表达式,所以应单击“abc”按钮///pc/homepage/flashsl/flash11/img/flash011.gif" width="27" height="24" align="absmiddle" alt="表达式类型按钮">,在弹出的菜单中选择“Expression”项。

      ///pc/homepage/flashsl/flash11/img/flash012.gif" width="164" height="97" alt="数学表达式类型菜单">    ///pc/homepage/flashsl/flash11/img/flash013.gif" width="148" height="31" alt="数学表达式">

重新选择“If”语句,点击“Add Else/Else If clause”按钮,这时您将看到左边程序栏中增加了一条“Else”语句。选择“Else”语句,点击“+”按钮,在弹出的菜单中选择“Set Variable”项,再在“Variable”域和“Value”域中输入变量“X”及表达式“1”。

///pc/homepage/flashsl/flash11/img/flash014.gif" width="435" height="188" alt="最终Actions">

完成后点击“确定”按钮,关闭帧属性对话框。
  5)选择菜单Contrl->Test Movie,即可看到计时器的效果。


上一实例(够cool按钮)  下一实例(酷炫鼠标)

/pc/bin/msg.pl?file_id=k_flashjq11 target="_blank">///pc/img/message.gif" width="64" height="54" alt="请您留言" border="0">
谈谈您的看法

 

网页制作 网页设计 网站建设 网站设计 网站制作 做网站 做网页