///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_flashjq13 target="_blank">///pc/img/message.gif" width="64" height="54" alt="请您留言" border="0">
谈谈您的看法

///pc/img/blank.gif" width="1" height="1">
13.制作电影的预载之二

  6)分别在图层Layer1中的第1、3帧处插入关键帧。用鼠标双击第一帧,进入帧属性对话框,切换到Actions选项卡,输入语句如图所示。

///pc/homepage/flashsl/flash13/img/flash011.gif" width="483" height="181" alt="第一条语句解释">

  7)我们输入的语句是一个“If...Else...End If”结构。下面我们逐一解释一下:第一、第二两条语句表示如果(_framesloaded >= _totalframes)已下载的影帧数已经等于电影文件的总影帧数,代表电影已经下载完成,就会跳至主画面的第1个影帧start播放。这里的“_framesloaded”和“_totalframes”属于系统变量。点击“=”按钮,在弹出的菜单中选择“Expression Editor”,

///pc/homepage/flashsl/flash13/img/flash012.gif" width="163" height="88" alt="调用变量函数菜单">

即进入调函数和变量的对话框,这两个变量可在这里找到并调用。

///pc/homepage/flashsl/flash13/img/flash013.gif" width="468" height="240" alt="调用变量函数">

第三条语句是“Else”,表示如果条件不成立,将执行以下的语句。

///pc/homepage/flashsl/flash13/img/flash014.gif" width="366" height="92" alt="第三条语句解释">

在这里,第四、第五条两语句即为条件不成立时所要执行的语句。第四条表示:如果电影文件尚未下载完成,就会设定长方形色块的X缩放等于下载影帧百分比乘以一百,因为X缩放的设定值是1到100,所以要乘以一百。

///pc/homepage/flashsl/flash13/img/flash015.gif" width="471" height="134" alt="第四条语句解释">

第五条表示:如果电影文件尚未下载完成,就会在Text Field“percent”处显示“下载影帧百分比乘以一百”的整数(Int),再加上一个百分比符号。

///pc/homepage/flashsl/flash13/img/flash016.gif" width="473" height="116" alt="第五条语句解释">

第六条表示:结束“If”语句。
  8)用鼠标双击图层Layer1的第三帧,在弹出的对话框中切换到Action项,输入“go to and play(1)”语句。最后得到的程序如下图所示:

///pc/homepage/flashsl/flash13/img/flash018.gif" width="343" height="168" alt="最后程序">

  9)测试电影下载情况:在本机上运行,由于下载速度太快,可能看不到下载画面,我们可以这样测试:选择菜单Control->Test Movie,进入测试影片画面,然后选中Contrl菜单中的“Show Streaming”项,

///pc/homepage/flashsl/flash13/img/flash019.gif" width="112" height="131" alt="进入测试影片菜单">    ///pc/homepage/flashsl/flash13/img/flash020.gif" width="139" height="86" alt="模拟下载菜单">

这样就可以在你的电脑上模拟下载的速度。下载完毕后跳到主画面的带有“start”标签的帧。


上一步  下一实例(文字滚动条)

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

 

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