Ver Mensaje Individual
  #6 (permalink)  
Antiguo 09/11/2006, 16:45
André_01
 
Fecha de Ingreso: agosto-2006
Mensajes: 159
Antigüedad: 17 años, 8 meses
Puntos: 4
Hola:

Elimina la parte del boton y simplemente llama a la funcion:

Código:
parado = true;
copos = 200;
//Variables para el movimiento rectilineo armonico simple
vinicialx = 20;
acelerax = 20;
periodox = 2;
function crearNieve() {
	for (i=0; i<copos; i++) {
		attachMovie("nieve", "copo"+i, i);
		this["copo"+i]._x = Math.round(Math.random()*350)-25;
		this["copo"+i]._y = Math.round(Math.random()*400)*(-1);
		this["copo"+i]._alpha = Math.round(Math.random()*50)+50;
		//Rangos aleatorios
		this["copo"+i]._width = Math.random()*3+1;
		this["copo"+i]._height = this["copo"+i]._width;
		this["copo"+i].n = Math.random()*3;
		this["copo"+i].veloc = Math.random()*3+1;
		this["copo"+i].amplitudx = Math.random();
		this["copo"+i].desfase = Math.round(Math.random()*2)+1*Math.PI;
		this["copo"+i].onEnterFrame = function() {
			t = this.n/30;
			this._y += this.veloc;
			this._x += this.amplitudx*(Math.cos((2*Math.PI*t)/periodox+this.desfase));
			//Si la lluvia llega abajo la subimos arriba otra vez
			if (this._y>225) {
				this._x = Math.round(Math.random()*350)-25;
				this._y = Math.round(Math.random()*200)*(-1);
			}
			this.n += 1;
		};
	}
}
crearNieve();