//第一帧动作
import flash.events.Event; for(var k:int=;k<;k++)
{
var xuehua:xue= new xue();
xuehua.alpha = Math.random()+.;
xuehua.height = xuehua.width = Math.random()*+;
xuehua.x=Math.random()*;
xuehua.y=Math.random()*;
piaoxuekongjian.addChild(xuehua);
} addEventListener(Event.ENTER_FRAME,webcyz); function webcyz(e:Event)
{
for(var k:int;k<;k++)
{
var xuehua:xue= new xue();
xuehua.alpha = Math.random()+.;
xuehua.height = xuehua.width = Math.random()*+;
xuehua.x=Math.random()*;
piaoxuekongjian.addChild(xuehua);
}
//trace(piaoxuekongjian.numChildren); for(var i:int=;i<piaoxuekongjian.numChildren;i++)
{ var mc:xue = xue(piaoxuekongjian.getChildAt(i)); if(mc.y>)
{
piaoxuekongjian.removeChild(mc);
i--;
}
else
{
mc.y+=Math.random()*;
mc.x+=(Math.random()-.)*;
} } }
//项目库中雪花的子类
package { import flash.display.MovieClip; public class xue extends MovieClip { public function xue() {
// constructor code
}
} }