Tema: Efecto nieve
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/07/2009, 04:27
helkariel
 
Fecha de Ingreso: diciembre-2007
Mensajes: 28
Antigüedad: 16 años, 5 meses
Puntos: 0
Efecto nieve

Hola chicos! estoy haciendo una pagina web sobre esquís y sierra nevada y quiero hacer el efecto de la nieve cayendo, he visto un script que me ha gustado mucho el problema es que al cabo de un rato la nieve para. Os pongo el codigo a ver si podeis ayudarme a que no pare nunca el efecto.
Gracias!!

Código:
baslama_suresi = 50;
kar_seyrekligi = 1;
kar_hiz = 1;
kar_boyut = 0;
bitis_suresi = 2000;
//----------------------------------------------------------------------------
//CODED BY GAZİNG//
a = 0;
i = -1;
mc._y = -mc._height;
function cogalt() {
	a++;
	if (a>bitis_suresi) {
		clearInterval(z);
	}
	i++;
	_root.mc.duplicateMovieClip("mc"+i, i);
	_root["mc"+i].hiz = kar_hiz+random(6);
	_root["mc"+i].boyut = kar_boyut+random(5);
	_root["mc"+i]._x = random(Stage.width);
	_root["mc"+i].rasgele = random(2);
	_root["mc"+i].cacheAsBitmap(true);
	if (_root["mc"+i].rasgele == 0) {
		_root["mc"+i].konum = -(random(3));
	} else {
		_root["mc"+i].konum = +(random(3));
	}
	_root["mc"+i].onEnterFrame = function() {
		this._y += this.hiz;
		this._x += this.konum;
		this._width = this._height=this.boyut;
		if (this._x>Stage.width or this._x<0 or this._y>Stage.height) {
			delete this.onEnterFrame;
			removeMovieClip(this);
		}
		if (_root.engel.hitTest(this._x, this._y, true)) {
			delete this.onEnterFrame;
		}
	};
}
s = 0;
function sure() {
	s++;
	if (s>baslama_suresi) {
		z = setInterval(cogalt, kar_seyrekligi);
		clearInterval(zamanla);
	}
}
zamanla = setInterval(sure, 1);