纯脚本下雪效果
看看
把背景设为黑的啊
//下面的脚本是创建雪花动画;
S_X = Stage.width;
S_Y =Stage.height;
_root.createEmptyMovieClip("a",1);
with(_root.a){
beginFill(0x000000,100);
lineStyle(0,0x000000,0);
moveTO(0,0);
lineTo(S_X,0);
lineTo(S_X,S_Y);
lineTo(0,S_Y);
lineTo(0,0);
endFill();
};
_root.createEmptyMovieClip("b",2);
with(_root.b){
lineStyle(0,0x000000,0);
beginFill(0xffffff);
moveTo(20,20);
curveTo(24,20,24,16);
curveTo(24,12,20,12);
curveTo(16,12,16,16);
curveTo(16,20,20,20);
endFill();
};
N_b=120;
_root.b._visible=0;
n = 3;
while(n<=N_b){
duplicateMovieClip("b","b"+n,n);
with(eval("b"+n)){
_x =random(S_X);
_y =random(S_Y);
_xscale=Math.random()*60+40;
_yscale=eval("b"+n)._xscale;
_alpha=eval("b"+n)._xscale+random(15);
}
n++;
};
for(var i=3;i<=N_b;i++){
var trueA=["b"+i];
_root[trueA].onEnterFrame =function(){
this._x+=Math.random()*(this._xscale)/10;
this._y+=Math.random()*(this._yscale)/10;
if(this._x>_root.S_X){
this._x=0;
}
if(this._y>_root.S_Y){
this._y=0;
}
};
}