This movie requires Flash Player 8
Actionscript:
-
var cantidad = 250;
-
var max = 50;
-
var min = 10;
-
var ancho = Stage.width;
-
var altura = Stage.height;
-
for (var i = 0; i <cantidad; i++) {
-
copo_mc = this.attachMovie("copo_mc", "copo_mc" + i, i);
-
with (copo_mc) {
-
_x = Math.floor(Math.random() * ancho);
-
_y = Math.floor(Math.random() * altura);
-
_xscale = _yscale = _alpha = Math.floor(Math.random() * (max - min + 1)) + min;
-
}
-
copo_mc._ypos = Math.floor(Math.random() * 2 + .5);
-
copo_mc.incremento = -0.025 + Math.random() * 0.05;
-
copo_mc.onEnterFrame = function() {
-
this.radianes += this.incremento;
-
this._x += Math.sin(this.radianes);
-
this._y += this._ypos;
-
if (this._y>= altura || this._x>= ancho || this._x <= 0) {
-
this._y = -10;
-
this._x = -10 + Math.floor(Math.random() * ancho + 10);
-
}
-
};
-
}
Descarga Nieve.zip
Nieve.zip se ha descargado 7,222 veces.

0 Responses to “Efecto nieve”