flash 调用 脚本_Flash脚本-落雪效果

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 调用 脚本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值