flash 调用 脚本

tech2024-05-12  89

flash 调用 脚本

Download the sample files here.

在此处下载示例文件 。

1. Create a small snowflake I used a small circle filled with white color.

1.创建一个小雪花我用一个充满白色的小圆圈。

2. Convert this snowflake object to a movie clip, and give it an instance name of "snow".

2.将此雪花对象转换为影片剪辑,并为其指定实例名称“ snow”。

3. Now, go in to the time line of this snow movie clip, and create three keyframes in this layer.

3.现在,进入该雪花影片剪辑的时间线,并在该层中创建三个关键帧。

4. In the first key frame give action:

4.在第一个关键帧中执行以下操作:

mov = 0; ran = getProperty("", _x);

5. In the second key frame give action:

5.在第二个关键帧中执行以下操作:

setProperty ("", _y, mov=mov+2); snowy = getProperty("", _y); setProperty ("", _x, (ran+random(2))); if(snowy > 310) { setProperty ("", _y, 50); mov=0; ran = ran - 10; }

6. In the third key frame give action:

6.在第三个关键帧中执行以下操作:

gotoAndPlay (2);

7. Now go back to the main timeline, and create two key frames in this layer.

7.现在回到主时间轴,并在此层中创建两个关键帧。

8. Insert these actions into the first key frame:

8.将以下操作插入第一个关键帧:

if (snowparticles<150) { duplicateMovieClip("snow","snow" add i,i) scale=random(60)+10 setProperty("snow" add i,_x,random(450)) setProperty("snow" add i,_xscale,scale) setProperty("snow" add i,_yscale,scale) snowparticles++ i++ }

9. Insert this action into the second key frame:

9.将此动作插入第二个关键帧:

gotoAndPlay (2);

That’s it! You have created your own snow effect.

而已! 您已经创建了自己的雪花效果。

翻译自: https://www.sitepoint.com/script-falling-snow-effect/

flash 调用 脚本

相关资源:精易模块[源码] V5.15
最新回复(0)