init = function ()
{
snowflakes = 400;
snow_speed = 1.500000;
snow_wind = 2;
min_snow_size = 30;
max_snow_size = 80;
stop_height = 80;
Width = Stage.width;
Height = Stage.height;
for (i = 0; i < snowflakes; i++)
{
sf = attachMovie("flake", "flake" + i, this.getNextHighestDepth());
sf._alpha = 20 + Math.random() * 60;
sf._x = -Width / 2 + Math.random() * (1.500000 * Width);
sf._y = -Height / 2 - Math.random() * (1.500000 * Height);
sf._xscale = sf._yscale = randRange(min_snow_size, max_snow_size);
sf.speed = snow_speed + Math.random() * 2;
sf.wind = snow_wind - 4 + Math.random() * 4.200000;
sf.finished = false;
sf.stop = randRange(Height * stop_height / 100, Height);
sf.onEnterFrame = falling;
} // end of for
count_more = snowflakes;
};
falling = function ()
{
if (this.finished)
{
return;
} // end if
if (!(this._y < Height && this._y > this.stop) || !stop_height)
{
this._x = this._x + this.wind;
this._y = this._y + this.speed;
if (this._y > Height + 10)
{
this._y = -20;
} // end if
if (this._x > Width + 20 || this._x < -20)
{
this._x = -Width / 2 + Math.random() * (1.500000 * Width);
this._y = -200;
} // end if
}
else
{
this.finished = true;
++count_more;
s = attachMovie("flake", "flake" + count_more, count_more);
s._alpha = 20 + Math.random() * 60;
s._x = -Width / 2 + Math.random() * (1.500000 * Width);
s._y = -Height / 2 - Math.random() * (1.500000 * Height);
s._xscale = s._yscale = randRange(min_snow_size, max_snow_size);
s.speed = snow_speed + Math.random() * 2;
s.wind = snow_wind - 4 + Math.random() * 4.200000;
s.finished = false;
s.stop = randRange(Height * stop_height / 100, Height);
s.onEnterFrame = falling;
this.onEnterFrame = fade_out_snow;
} // end else if
};
randRange = function (min, max)
{
randomNum = Math.floor(Math.random() * (max - min + 1)) + min;
return (randomNum);
};
fade_out_snow = function ()
{
this._alpha = this._alpha - 0.100000;
if (this._alpha < 2)
{
removeMovieClip (this);
} // end if
};
init();
{
snowflakes = 400;
snow_speed = 1.500000;
snow_wind = 2;
min_snow_size = 30;
max_snow_size = 80;
stop_height = 80;
Width = Stage.width;
Height = Stage.height;
for (i = 0; i < snowflakes; i++)
{
sf = attachMovie("flake", "flake" + i, this.getNextHighestDepth());
sf._alpha = 20 + Math.random() * 60;
sf._x = -Width / 2 + Math.random() * (1.500000 * Width);
sf._y = -Height / 2 - Math.random() * (1.500000 * Height);
sf._xscale = sf._yscale = randRange(min_snow_size, max_snow_size);
sf.speed = snow_speed + Math.random() * 2;
sf.wind = snow_wind - 4 + Math.random() * 4.200000;
sf.finished = false;
sf.stop = randRange(Height * stop_height / 100, Height);
sf.onEnterFrame = falling;
} // end of for
count_more = snowflakes;
};
falling = function ()
{
if (this.finished)
{
return;
} // end if
if (!(this._y < Height && this._y > this.stop) || !stop_height)
{
this._x = this._x + this.wind;
this._y = this._y + this.speed;
if (this._y > Height + 10)
{
this._y = -20;
} // end if
if (this._x > Width + 20 || this._x < -20)
{
this._x = -Width / 2 + Math.random() * (1.500000 * Width);
this._y = -200;
} // end if
}
else
{
this.finished = true;
++count_more;
s = attachMovie("flake", "flake" + count_more, count_more);
s._alpha = 20 + Math.random() * 60;
s._x = -Width / 2 + Math.random() * (1.500000 * Width);
s._y = -Height / 2 - Math.random() * (1.500000 * Height);
s._xscale = s._yscale = randRange(min_snow_size, max_snow_size);
s.speed = snow_speed + Math.random() * 2;
s.wind = snow_wind - 4 + Math.random() * 4.200000;
s.finished = false;
s.stop = randRange(Height * stop_height / 100, Height);
s.onEnterFrame = falling;
this.onEnterFrame = fade_out_snow;
} // end else if
};
randRange = function (min, max)
{
randomNum = Math.floor(Math.random() * (max - min + 1)) + min;
return (randomNum);
};
fade_out_snow = function ()
{
this._alpha = this._alpha - 0.100000;
if (this._alpha < 2)
{
removeMovieClip (this);
} // end if
};
init();