|
●预览成品:
●逐步说明:
1)总体程序如图所示:

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

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

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

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

第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帧形成循环。
|