logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
Creativity
Family Travel
Southwest USA
Irish Culture
Home Finance
Comedy Movies
Romance Novels


dailyclick
All times in EST

Full Schedule
g
g Flash and Animation Site

BellaOnline's Flash and Animation Editor

g

Random Movement Organic Flash Template


FlashR CS5.5 has many time saving templates that supply the code most frequently used in Flash projects and the code is easily customized. In this tutorial, we will examine the Random Movement Organic Template which I recently used to create an animation of spiders swarming over the stage. You will find this template when you start a new project.

  1. From the Welcome screen, choose Animation from the Create from Template list on the left.

  2. From the list of Animation templates choose Random Movement Organic.

  3. The bare bones template has three layers.

    On the top layer are some instructions.

    On the next layer are eight particles (movie clips), which are our bugs, in a row across the bottom of the stage.

    On the bottom layer we have the solid colored rectangle which turns our stage charcoal black.

    The instructions tell us to double-click on a bug and check out the ActionScript that will run the animation. Let's do that.

    Once you double-click a bug, you will be on the Particle timeline. We are now inside the workings of one particle or bug. With the first frame of the Actions layer selected, open the Actions panel.

  4. As you can see, we have four variables.

    var speed:Number = 6;

    var myRotation:Number = 0;
    var ychange:Number;
    var xchange:Number;

    The speed variable controls the speed of the bugs moving over the stage. By default it is set to 6 and when we preview the animation the bugs move fairly fast. But let's up the number to 16 and preview. Now the bugs are really running around.

    The other three variables work together within a function, along with some random math calculations, to make the bugs run all over the stage instead of together as a unit. Let's take a look at the fl_moveParticle function.

    First, we get a random number for how much to rotate the bug from its current position. This will not move the bug but only rotate it in place.

    Next we get random numbers for moving the bug to a new X and Y location on the stage.

    But we have to make sure that the bug doesn't go off the stage. So we use a few if statements to confirm that the bug is within the width and height boundaries of the stage. If not, then we move the bug back onto the stage. Of course, you will want to customize the maximum width and height to match the dimension of your own stage.

    Finally, we add the new random numbers to the bug's current x and y positions and we change the bug's current degree of rotation to the new random myRotation.

Once you get the animation fine tuned, you can replace the default bugs with your own bug movie clip. Each bug on the stage is an instance of the same Particle movie clip. The default bug does not move it's legs but you can add this secondary animation to your own bug.

Join us in the Flash forum. | Join us in the Digital Art and Design forum.

|


Add Random+Movement+Organic+Flash+Template to Twitter Add Random+Movement+Organic+Flash+Template to Facebook Add Random+Movement+Organic+Flash+Template to MySpace Add Random+Movement+Organic+Flash+Template to Del.icio.us Digg Random+Movement+Organic+Flash+Template Add Random+Movement+Organic+Flash+Template to Yahoo My Web Add Random+Movement+Organic+Flash+Template to Google Bookmarks Add Random+Movement+Organic+Flash+Template to Stumbleupon Add Random+Movement+Organic+Flash+Template to Reddit



 



RSS | Related Articles | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the Flash and Animation Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2014 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Diane Cipollo for details.

g


g features
Craft Product Template - Background Layer

Craft Product Template Layers

Craft Product Trailer Design Elements

Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2014 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor