home subscribe to email updates subscribe to RSS updates

Experiment: More AS3 Particles

Hey all. Whilst I patiently await divine Flash inspiration, I’ve decided to revisit the ye olde AS3 particle engine. I’ve now been working with AS3 consistently for just over a month, so my understanding of it and it’s beauty has advanced somewhat.

Michael Battle - ActionScript Particle Engine v3

Back in the AS2 days (oh how I’m glad they’re behind me… touch wood) my general architecture methodology revolved around managing MovieClip depths. With AS3 and the Display List paradigm, things have changed dramatically and coding life is pretty sweet; we get to think more about the problem/implementation and less about the tools.

The following demo and source show a more refined approach than the previous attempts will hopefully give you a good indication of what Flash can handle across different browsers.

In the demo below, you can see how many particles are currently on the stage and you can also change how many are created per frame along with how many are created when a particle hits the ground.

Click here to download the source for the above experiment. Note: You’ll need Flash CS3 to be able to recompile it and if you do, make sure you update the AS3 classpath.

Have a play around with the applet above and note the performance difference when you toggle the alpha effect on and off.

When I run it locally, my machine can comfortably handle approx 1000 - 1500 particles at any one time… though the browser, it’s more like 300 - 600 depending on which one. Still quite cool when you consider AS2 would choke at 100ish.


« AS3 Reflections Tutorial
AddThis Social Bookmark Button

Related Posts:

Comments:

Dave Novakovic said,

August 4, 2007 @ 7:08 pm

happily does about 1000 in my browser here. starts to choke a little at about 1200. thats with the alpha on.

Michael Battle - Work & Play » ActionScript 3 - First Steps - Flash and Actionscript Experiments! said,

August 5, 2007 @ 8:19 am

[…] Update: There is a now a more recent version of this experiement here. […]

Gary said,

August 5, 2007 @ 3:04 pm

Hah got up to 7.5k on my machine/browser with alpha on… chokes at 10k

nice work!

RSS feed for comments on this post · TrackBack URI

Leave a Comment



« AS3 Reflections Tutorial