①新建一个FLASH文档,背景色改为黑色。
②在图层一的第一帧在加上代码:
雪花飘落();
function 雪花飘落() {
import flash.filters.BlurFilter;
var mc:MovieClip = createEmptyMovieClip("mymc", 0);
mc._visible = false;
var 雪花的数量:Number = 60;
with (mc) {
beginFill(0xffffff);
curveTo(2, 8, 5, 0);
endFill();
}
for (var i = 0; i<雪花的数量; i++) {
this["模糊"+i] = new BlurFilter(Math.floor(i/12), Math.floor(i/12), 3);
var myArray:Array = new Array(this["模糊"+i]);
this["雪花的速度"+i] = (i+19)/20;
mc.duplicateMovieClip("mc"+i, i+1);
this["mc"+i].filters = myArray;
with (this["mc"+i]) {
_x = Math.floor(Math.random()*Stage.width);
_y = Math.floor(Math.random()*Stage.height);
_xscale = _yscale=Math.floor(Math.random()*100+20+i);
_rotation = Math.floor(Math.random()*90);
}
}
onEnterFrame = function () {
for (var i = 0; i<雪花的数量; i++) {
with (this["mc"+i]) {
_y += this["雪花的速度"+i];
_rotation += 1;
if (_y>Stage.height+_height/2) {
_y = -_height/2;
//var mycolor:Color = new Color(this["mc"+i]);
//mycolor.setRGB(Math.random()*0xffffff);
}
}
}
};
}