Red de conocimiento informático - Conocimiento del nombre de dominio - Buscamos urgentemente un guión para la caída de copos de nieve repentinos

Buscamos urgentemente un guión para la caída de copos de nieve repentinos

Crea un nuevo videoclip llamado SnowFlake en la biblioteca y coloca la imagen del copo de nieve en él. Luego cree una nueva capa en la línea de tiempo, inserte un fotograma clave en blanco e ingrese el siguiente lenguaje de escritura:

this.createEmptyMovieClip("holderClip",this.getNextHighestDepth();

); titularClip.maxFlakes=100;

holderClip.dropSpeed=2.5;

var thisFlake:MovieClip

for(var i: Número =0;i

{

holderClip.attachMovie("snowFlake","snowFlake"+i,holderClip.getNextHighestDepth());

thisFlake= titularClip[ "copo de nieve"+i];

thisFlake._x=randomRange(0,Stage.width);

thisFlake._y=randomRange(0,Stage.height); /p >

thisFlake._xscale=thisFlake._yscale=randomRange(50,150);

thisFlake._alpha=thisFlake._xscale-50;

thisFlake.cacheAsBitmap=true; /p >

thisFlake.oscillationSeed=randomRange(0,200);

}

holderClip.onEnterFrame=function()

{

var thisFlake:MovieClip;

for (var i:Number=0;i

{

thisFlake=this[ "copo de nieve "+i];

thisFlake._y+=thisFlake._xscale*(this.dropSpeed/100

thisFlake._x+=Math.sin((thisFlake._y+); thisFlake.oscillationSeed)/50);

if (thisFlake._y>=Stage.height)

{

thisFlake._x=randomRange(0,Stage) .width );

thisFlake._y=0;

}

}

}

función rango aleatorio. (min:Número,max:Número)

{

return Math.random()*(max-min)+min

}

100 en la segunda línea es el número de copos de nieve y 2,5 en la tercera línea es la velocidad de caída. Estos dos números se pueden modificar según sus propias necesidades de aprendizaje.