Flash Snow Drift Code
A good view of the effect of the picture.
var scenewidth = sceneheight=300;
var sidediswidth = STAGE.WIDTH/2-SCENEWIDTH/2;
var sidedisheight = STAGE.HEIGHT/2-SCENEHEIGHT/2;
var snownum = 80;
var snowspace:movieclip = _root.createemptymovieclip ("Room", 1);
function Addmasker () {
_root.createemptymovieclip ("Masker", 10000);
With (Masker) {
Beginfill (0x000550, 100);
MoveTo (Sidediswidth, sidedisheight);
LineTo (Sidediswidth+scenewidth, sidedisheight);
LineTo (Sidediswidth+scenewidth, sidedisheight+sceneheight);
LineTo (Sidediswidth, sidedisheight+sceneheight);
LineTo (Sidediswidth, sidedisheight);
Endfill ();
}
Snowspace.setmask (masker);
Createsnow ();
}
function Snowproperty (Snow, W, h) {
snow._x = Sidediswidth+math.random () *w;
Snow._y = Sidedisheight+math.random () *h;
Snow._rotation = Math.random () *120+30;
SNOW.STEPX = Math.Cos ((SNOW._ROTATION*MATH.PI)/180);
Snow.stepy = Math.random () *2+1;
SetInterval (snowfall, snow);
}
function Drawsnow (Snow:movieclip, Radius:number) {
var p = radius*.9;
With (Snow) {
colors = [0xCCCCCC, 0xFFFFFF];
Alphas = [100, 100];
Ratios = [0, 255];
Matrix = {matrixtype: "box", X:-math.random () *2*radius, Y:-math.random () *2*radius, W:2*radius, H:2*radius, r90/180) * Math.PI};
Begingradientfill ("Radial", colors, alphas, ratios, matrix);
MoveTo (0,-radius);
Curveto (p, p, radius, 0);
Curveto (p, p, 0, RADIUS);
Curveto (-P, p,-radius, 0);
Curveto (p, p, 0,-radius);
Endfill ();
}
Snowproperty (Snow, scenewidth, sceneheight);
}
function Createsnow () {
var n = 0;
while (N<snownum) {
var snow:movieclip = Snowspace.createemptymovieclip ("s" +n, N);
var radius:number = Math.random () *3;
Drawsnow (snow, radius);
n++;
}
}
Function snowfall (Snow) {
Snow._x + = snow.stepx;
Snow._y + = Snow.stepy;
if (snow._x<sidediswidth) {
snow._x = Sidediswidth+scenewidth;
}
if (snow._x>sidediswidth+scenewidth) {
snow._x = Sidediswidth;
}
if (snow._y>sidedisheight+sceneheight) {
snow._y = Sidedisheight;
}
}
Addmasker ();
_root.createemptymovieclip ("MYMC", 10);
With (MYMC) {
LineStyle (1, 0XCCCCCC, 100);
MoveTo (Sidediswidth, sidedisheight);
LineTo (Sidediswidth+scenewidth, sidedisheight);
LineTo (Sidediswidth+scenewidth, sidedisheight+sceneheight);
LineTo (Sidediswidth, sidedisheight+sceneheight);
LineTo (Sidediswidth, sidedisheight);
var Infor:textfield = Mymc.createtextfield ("Infor", 1, sidediswidth+scenewidth-100, Sidedisheight+sceneheight, 100, 20 );
Infor.autosize= "Right";
Infor.selectable=false;
Infor.textcolor = 0XCCCCCC;
Infor.text = "by Holybozo";
}
_root.createemptymovieclip ("BG",-1);
With (BG) {
Beginfill (0x999999, 100);
MoveTo (0, 0);
LineTo (stage.width, 0);
LineTo (Stage.width, stage.height);
LineTo (0, stage.height);
LineTo (0, 0);
Endfill ();
}