function updateStage(event:Event):void {
if (particles_ary.length<numOfParticles) {// check the amount
//trace(numOfParticles);
var moveAsset2:MoveAsset2=new MoveAsset2 ;// creat movieclip off instance
var c:ColorTransform = new ColorTransform();
c.color = (Math.random() * 0xFFFFFF);// color transform defintion http://www.kirupa.com/developer/as3/random_colors_as3.htm
addChild(moveAsset2);
moveAsset2.ribbon_mc.ribbon_mc.color_mc.transform.colorTransform=c;// access Mc properties
moveAsset2.yVelocity = Math.floor(Math.random() * (maxVelocity - minVelocity)) + minVelocity;// round off the velocity number : Math.floor(Math.random() * (high - low)) + low;
moveAsset2.x = Math.floor(Math.random() * (((stage.stageWidth - (moveAsset2.width))) - (moveAsset2.width))) + moveAsset2.width;// round off according to stage
particles_ary.push(moveAsset2);//push to array
}
if (particles_ary.length>numOfParticles) {
trace("REMOVE RIBBONS!");
}
for (var i:uint = 0; i < particles_ary.length; i++) {//set repeat conditions for when particles go off stage
var particle:MoveAsset2=particles_ary*;
var c:ColorTransform = new ColorTransform();
c.color = (Math.random() * 0xFFFFFF);
particles_ary*.update();
if (particle.y>stage.stageHeight+particle.height/2) {
particle.yVelocity = Math.floor(Math.random() * (maxVelocity - minVelocity)) + minVelocity;
particle.x = Math.floor(Math.random() * ((stage.stageWidth - (particle.width)) - (particle.width))) + (particle.width);
particle.y=0;
particle.scaleY = particle.scaleX = Math.floor(Math.random() * (3 - 0) + 0);
particle.ribbon_mc.ribbon_mc.color_mc.transform.colorTransform=c;
//trace("scale = " + particle.scaleX);
if (particle.scaleX||particle.scaleY>1) {
particle.alpha=Math.random()*.8+.2;
}
}
}
}
Full code : http://emotioned.com/2009/07/flash-cs4-as3-confetti-particle-system-source-files-and-class/
Can anyone help me remove the particles?
thanks
Ian