confetti in under 1k - just one movieclip for the confetti object, a simple grey square that fades to white and back to grey, with a small sparkle on the few white frames, and then just this code:

spawnConfetti = function(){
i = bits.getNextHighestDepth();
confetti = bits.attachMovie(’con’,'con’+i,i);

confetti._x = Math.random()*Stage.width;
confetti._y = -5;
confetti._alpha = Math.random()*70+30;
confetti.ainc = 10*(Math.round(Math.random())-.5)
confetti.yinc = 1.5+Math.random()*1.5;
confetti.xinc = Math.random()*3-1.5;
confetti.rinc = Math.random()*10-5;
confetti.onEnterFrame = moveConfetti;
}

moveConfetti = function(){
this._y += this.yinc;
this._x += this.xinc;
this._rotation += this.rinc;
this._yscale = this._alpha += this.ainc;
if(this._alpha >= 100 || this._alpha <= 30)this.ainc *= -1;
if(this._y > Stage.height) removeMovieClip(this);
}

onEnterFrame = function(){
for(n=1;n<3;n++){
spawnConfetti();
}
}

flash / Comments / 2007.03.15.14:25