怎样用flash搞成下雪的效果。。。

来源:百度知道 编辑:UC知道 时间:2024/06/16 10:13:19
圣诞节快到了。。我想用flash买给女朋友一张用flash所做和圣诞卡。
请各位帮帮忙。最好就是有教程。

视频实例教程:绘制雪花

http://video.banma.com/flashpeixun/15/index.shtml

this.onLoad = function (){
n = 40;
var i = 1;
while (n >= i){
this.attachMovie("snow","snow"+i,i);
var a = Math.round(40 * Math.random() + 41);
var b = Math.round(20 * Math.random() + 51);
with (this["snow" + i]){
_x = 640*Math.random();
_y = 480*Math.random();
_xscale = a;
_yscale = a;
_alpha = b;
_rotation =a;
this["snow" + i].x = Math.cos(Math.PI * Math.random());
//雪花沿x轴每帧播放后的位移增量
this["snow" + i].y = 2+ 2*Math.random();
//雪花沿y轴每帧播放后的位移增量
}
i++;
}
}
this.onLoad();
this.onEnterFrame = function(){
var a = 1;
while (n>= a){
with (this["snow" + a]){
_x += x;
_y += y;