Particles are randomly generated content used by Flash that can be manipulated into repeating events to simulate movement in a pattern-like manner. A good way to explain is how rain or snow might appear if falling on your stage. It would fall and appear in an unpredictable way. The same type of concept is used with particles in flash. I have decided to use beach balls, don't ask me why. Below is an example of how creating a particle system can give you a repeating, random effect.

 

 

flash icon

  1. Create

    Import any image onto the stage, or create your own graphic. Once you have create the basic particle shape, press F8 to convert it to a symbol. Choose Movie Clip as the symbol and name the symbol ball_mc. One thing to remember here is that you will want to select Export to Actionscript and that you have have choosen the registration to be center. This will allow the particle to be more easily managed when you know that the origin is at the center of the object.

  2. Animate

    Next you will want to animate the the particle. Here we will animate the beach ball to fall from the top of our stage to the bottom of our stage. The first step is to create a new movie clip symbol and name it "particle".

  3. Drag and drop the ball_mc movie clip that you had made earlier into the "particle" symbol.

    Add a new layer and call it "actions"

    On the first fram of the actions layer place the following code:

    var particle:ball_mc;
    
    //delay of half a second
    var particleTimer:Timer = new Timer(500); 
    var alphaRate:Number = .02;
    
    particleTimer.addEventListener(TimerEvent.TIMER, createParticles);
    
    function createParticles(event:TimerEvent):void
    {
    	particle = new ball_mc();
    	
    //randomizes the particle along the x-axis
    	particle.x = Math.random() * 350;
    	
    //adds particle to the stage
    	addChild(particle); 
    	particle.addEventListener(Event.ENTER_FRAME, animateParticle);
    }
    function animateParticle(evt:Event):void
    {	
    
    //moves particle along the y-axis
    	evt.target.y ++; 
    	
    //decreases the alpha as the particle moves downward
    }
    
    //starts the particles
    particleTimer.start();