Efecto nieve

This movie requires Flash Player 8

Actionscript:
  1. var cantidad = 250;
  2. var max = 50;
  3. var min = 10;
  4. var ancho = Stage.width;
  5. var altura = Stage.height;
  6. for (var i = 0; i <cantidad; i++) {
  7. copo_mc = this.attachMovie("copo_mc", "copo_mc" + i, i);
  8. with (copo_mc) {
  9. _x = Math.floor(Math.random() * ancho);
  10. _y = Math.floor(Math.random() * altura);
  11. _xscale = _yscale = _alpha = Math.floor(Math.random() * (max - min + 1)) + min;
  12. }
  13. copo_mc._ypos = Math.floor(Math.random() * 2 + .5);
  14. copo_mc.incremento = -0.025 + Math.random() * 0.05;
  15. copo_mc.onEnterFrame = function() {
  16. this.radianes += this.incremento;
  17. this._x += Math.sin(this.radianes);
  18. this._y += this._ypos;
  19. if (this._y>= altura || this._x>= ancho || this._x <= 0) {
  20. this._y = -10;
  21. this._x = -10 + Math.floor(Math.random() * ancho + 10);
  22. }
  23. };
  24. }

Descarga Nieve.zip

Nieve.zip se ha descargado 7,257 veces.

1 Votes | Average: 5 out of 51 Votes | Average: 5 out of 51 Votes | Average: 5 out of 51 Votes | Average: 5 out of 51 Votes | Average: 5 out of 5 (1 votos, promedio: 5 sobre 5)
Loading ... Loading ...

0 Responses to “Efecto nieve”


  1. No Comments

Leave a Reply




Subscribe

Subscribe to my RSS Feeds