# Particle System - Fireworks

**URL:** <https://forum.kirupa.com/t/particle-system-fireworks/265699>\
**Category:** flash\
**Created:** [July 11, 2008, 1:28pm UTC](https://forum.kirupa.com/t/particle-system-fireworks/265699 "2008-07-11T13:28:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danieray](https://avatars.discourse-cdn.com/v4/letter/d/f07891/32.png) [@danieray](https://forum.kirupa.com/u/danieray)\
**Post date:** [July 11, 2008, 1:28pm UTC](https://forum.kirupa.com/t/particle-system-fireworks/265699/1 "2008-07-11T13:28:01Z")

</div>

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](http://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](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!

---

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [July 11, 2008, 1:39pm UTC](https://forum.kirupa.com/t/particle-system-fireworks/265699/2 "2008-07-11T13:39:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![danieray](https://avatars.discourse-cdn.com/v4/letter/d/f07891/32.png) [@danieray](https://forum.kirupa.com/u/danieray)\
**Post date:** [July 11, 2008, 3:56pm UTC](https://forum.kirupa.com/t/particle-system-fireworks/265699/3 "2008-07-11T15:56:50Z")

</div>

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!

> [@sekasi;2356868](#):
>
> what part of that code are you having problem converting? btw that doesnt look like AS2 to me 😛

---

<div class="post-metadata">

**Author:** ![flobster](https://avatars.discourse-cdn.com/v4/letter/f/c5a1d2/32.png) [@flobster](https://forum.kirupa.com/u/flobster)\
**Post date:** [July 11, 2008, 9:26pm UTC](https://forum.kirupa.com/t/particle-system-fireworks/265699/4 "2008-07-11T21:26:55Z")

</div>

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](http://flintparticles.org).
