Particle System - Fireworks

Hi - I’m trying to create a fireworks background using as3. I had found one tutorial that looks great, but uses as2 and i’m having trouble converting it to as3. i’ve done all of the lynda.com tutorials on particle systems, but still can’t quite figure out how to get the firework working correctly.

here’s the as2 fireworks that i like: http://www.wipeout44.com/tutorials/flash_fireworks.asp

The as2 code used is:

var numOfParticles:unit = 25;
var particles_ary:Array = [];

function updateStage(event:Event):void
{
if(particles_ary.length < numOfParticles)
{
var bluebit:Bluebit = new Bluebit();
addChild(bluebit);
bluebit.rotation = Math.random() * 360;
bluebit.alpha = Math.random(30) + 80;
bluebit.scaleX = 50 + Math.random(60);
bluebit.scaleY = 50 + Math.random(60);
gotoAndPlay(random(5));
}
}

Can anyone direct me to a tutorial that would help me figure out how to update this as2 to as3?

Thanks!

what part of that code are you having problem converting? btw that doesnt look like AS2 to me :stuck_out_tongue:

I pasted the code from the wrong file… i have so many files that i’ve been working from… the code i previously pasted was something i tried, but didn’t work in as3. this is the original as2 code:

for (n=8; n<50; n++) {
duplicateMovieClip(“particle”, “particle” add n, n);
setProperty(“particle” add n, _rotation, random(360));
setProperty(“particle” add n, _alpha, random(30)+80);
setProperty(“particle” add n, _xscale, 50+Number(random(60)));
setProperty(“particle” add n, _yscale, 50+Number(random(60)));
tellTarget (“particle” add n) {
gotoAndPlay(random(5));
}
}

thanks for noticing!

Sorry, i cannot help you with your code example, but if you want to create fireworks particle effects, you might have a look at http://flintparticles.org.