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
European Travel
Action Movies
Bible Basics
Houseplants
Romance Movies
Creativity
Family Travel


dailyclick
All times in EST

Full Schedule
g
g Flash and Animation Site

BellaOnline's Flash and Animation Editor

g

Using Variables for Modular Particle System


When we began this FlashR CS3 particle system series of tutorials, we created a simple, modular function and demonstrated that we could use that function to animate three instances of the same movie clip. Since that first tutorial, we have come a long way and have built a particle system in ActionScriptTM 3. But how modular is this latest particle system? Can it be used for movie clips other than our mcSnowflake? Can we use it for a Flash movie that has a smaller or larger stage? Can we use a movie clip of a different size? Can we easily increase or decrease the maximum number of movie clips or the speed at which they fall down the stage?

Because this was a beginner's tutorial with many things to learn, the particle system was written using specific, hard coded settings for these features. But now that you have completed your particle system, we can make a few changes to the program code that will make it more modular and reuseable.

Rename the Functions

When we were only concerned with learning how to animate our snowflake movie clip, it was easier to name the function that created our snowflakes "snowflake" and the function that animated the snowflakes "snowfall". To make our program more versatile, we need to rename the functions with more generic names that still reflect the purpose of the functions.

Because this is a particle system, another name for the function that creates the snowflake can be "createParticles". Let's rename the snowflake function from "snowflake()" to "createParticles()".

At the top of the Actions panel, you will see a Find and Replace icon. Click on this icon to open the Find and Replace dialog box. In this dialog box, check the option called "Match Case" and use the following values.

Find what: snowflake()
Replace with: createParticles()

You should get a message that two were found and replaced. Repeat this step to rename the second function from "snowfall()" to "particlefall()". Again you will see two have been changed. Close the dialog box and test your movie. It still works.

Next →




Add Using+Variables+for+Modular+Particle+System to Twitter Add Using+Variables+for+Modular+Particle+System to Facebook Add Using+Variables+for+Modular+Particle+System to MySpace Add Using+Variables+for+Modular+Particle+System to Del.icio.us Digg Using+Variables+for+Modular+Particle+System Add Using+Variables+for+Modular+Particle+System to Yahoo My Web Add Using+Variables+for+Modular+Particle+System to Google Bookmarks Add Using+Variables+for+Modular+Particle+System to Stumbleupon Add Using+Variables+for+Modular+Particle+System 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
Motion Workspace - Checkbox, Dials and More

Motion Workspace - Menu, Icons and Sliders

The Motion Toolbar Tools

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