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


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

///pc/img/blank.gif" width="1" height="1" border="0">
18.星风

预览成品:

///pc/homepage/flashsl/flash18/swf/hlf.zip">下载源程序


逐步说明:
  1)总体程序如图所示:

///pc/homepage/flashsl/flash18/img/flash001.gif" width="474" height="361" alt="总体程序" border="0">

  隐形电影夹子的实体名字为:start();moviestart电影夹子的实体名字为:star;control电影夹子的实体名字为:control。
  现在我们先打开隐形电影夹子,发现里面什么也没有。

///pc/homepage/flashsl/flash18/img/flash002.gif" width="230" height="69" alt="隐形电影夹子程序" border="0">

  它在图层Layer1的第1帧(即程序一开始)被调用,主要起鼠标跟随的作用。

///pc/homepage/flashsl/flash18/img/flash003.gif" width="453" height="263" alt="调用隐形电影夹子" border="0">

  打开moviestar电影夹子如图所示:

///pc/homepage/flashsl/flash18/img/flash004.gif" width="506" height="192" alt="moviestar电影夹子程序" border="0">

  即为一颗红色的星星绕白色的圆周一圈。
  最后打开control电影夹子:

///pc/homepage/flashsl/flash18/img/flash005.gif" width="225" height="93" alt="control电影夹子程序" border="0">

  第1帧的Actions为:
Comment: 复制夹子的总数
Set Variable: "i" = 36
Comment: 一圈内的夹子数
Set Variable: "n" = 12
Comment: 跟随快慢的系数
Set Variable: "r" = 3
Set Variable: "counter" = 1
Loop While (counter <= i)
 Duplicate Movie Clip ("/star", "star" & counter, counter)
 Set Property ("/star" & counter, Rotation) = 360-(360 / n) * counter
 Set Property ("/star" & counter, Alpha) = 100-(100 / i) * counter
 Set Variable: "counter" = counter + 1
End Loop
Set Property ("/star", Visibility) = False
Set Variable: "x" = GetProperty ("/star0", _x )
Set Variable: "y" = GetProperty ("/star0", _y )
  大体意思为:连续复制电影夹子moviestar,总数为36个,并设定每个相应的旋转角度和透明度;设定实体名字为star的电影夹子不可见;设定“X”、“Y”为隐形电影夹子的“X”、“Y”坐标值。
  第2帧的Actions为:
Set Variable: "counter" = 1
Loop While (counter <= i)
 Set Property ("/star" & counter, X Position) = GetProperty ("/star" & counter, _x ) + (GetProperty ( "/star" &(counter-1) , _x ) -      GetProperty ("/star" & counter, _x )) / r
 Set Property ("/star" & counter, Y Position) = GetProperty ("/star" & counter, _y ) + (GetProperty ( "/star" &(counter-1) , _y ) -      GetProperty ("/star" & counter, _y )) / r
 Set Variable: "counter" = counter + 1
End Loop
大体意思为:设定刚复制的36个电影夹子的“X”和“Y”坐标。
  第3帧的Actions为: Go to and Play (2)
  即与第2帧形成循环。

上一实例(判断数字大小)  下一实例(反弹球)

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


 

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