04 February 2011

Getting Started With Flint AS3 Particle System

Flint is very mature particle system written in AS3. Project has started back in 2008 by Richard Lord. Few days ago on 20th January, version 3.0.0 is released. Big change is that new version targets only Flash Player 10 and beyond.

You can start by downloading source code from project website. There are few options: source code for Flash or Flex, swc for Flash or Flex, documentation and excellent examples files.

In order to include library code to your project you have two options. First one is to modify classpath of specific document you are working on or global classpath.

I'm using second approach. Create working folder somewhere on your hard drive and name it MyFlintExamles. Unzip Flint_3_0_0_src.zip file you've already downloaded from project website and extract 'org' folder inside MyFlintExamles folder.

I'll show you how to change existing example to suit your needs and just get started with Flint. Open Flint_3_0_0_examples.zip file and browse to examples2D\LogoTween\Flash where you will find two files you will need to extract in MyFlintExamples Frame1.as and LogoTween.fla.

Now open LogoTween file and check Library (CTRL+L) and you will find two png files flint.png and particles.png. These two files you will have to create with your favorite graphics editing software. Make sure you save your files in png format 320x80.

Here are my two files.

Inside LogoTween file, open Library and right-click on flint.png first and choose Properties to open Bitmap Properties. Click on Import... and select your first image. Leave everything else as it is.



Do the same thing for other Library item particles.png and import your second (tween destination) file.

You can modify number of particles used for tweening effect by opening Frame1.as and change number 5000 to something else on line 48:

startEmitter.counter = new Blast( 5000 );

Flash Player 10 is required to see this example.


View on ShareSWF


*_*

1 comments:

flanture said...

just wanted to mention this great Flint examples article http://slekx.com/2009/12/flint-visual-introduction/

 

template by blogger templates