Bueno tengo una duda en flash, realize un tutorial de internet de como crear nieve, hasta ahi todo bien, el problema resulta cuando quiero eliminar toda la nieve, no encuentro manera de hacerlo, alguien me podria ayudar???
Aqui anexo la clase en AS3:
Código ActionScript :
package
{
import flash.display.*;
import flash.events.*;
public class SnowFlake extends MovieClip
{
private var xPos:Number = 0;
private var yPos:Number = 0;
private var xSpeed:Number = 0;
private var ySpeed:Number = 0;
private var radius:Number = 0;
private var scale:Number = 0;
private var alphaValue:Number = 0;
private var maxHeight:Number = 0;
private var maxWidth:Number = 0;
public function BlueCircle()
{
}
public function SetInitialProperties()
{
//Setting the various parameters that need tweaking
xSpeed = .05 + Math.random()*.1;
ySpeed = .1 + Math.random()*3;
radius = .1 + Math.random()*2;
scale = .01 + Math.random();
alphaValue = .1 + Math.random();
var stageObject:Stage = this.stage as Stage;
maxWidth = stageObject.stageWidth;
maxHeight = stageObject.stageHeight;
this.x = Math.random()*maxWidth;
this.y = Math.random()*maxHeight;
xPos = this.x;
yPos = this.y;
this.scaleX = this.scaleY = scale;
this.alpha = alphaValue;
this.addEventListener(Event.ENTER_FRAME, MoveSnowFlake);
}
function MoveSnowFlake(e:Event)
{
xPos += xSpeed;
yPos += ySpeed;
this.x += radius*Math.cos(xPos);
this.y += ySpeed;
if (this.y - this.height > maxHeight)
{
this.y = -10 - this.height;
}
}
}
}y Aqui donde la llamo ya en el archivo flash.
Código ActionScript :
function MakeItSnow(event:Event)
{
for (var i:int = 0; i <.000000005; i++)
{
var newCircle:SnowFlake = new SnowFlake();
this.addChild(newCircle);
newCircle.SetInitialProperties();
}
}
function Comienzo()
{
control.addEventListener(Event.ENTER_FRAME, MakeItSnow);
}
Comienzo();Por mas que intento no puedo quitar la nieve, porfavor ayudenme!!!
