We present four engaging AS3 animations based on mathematical patterns. Click each screen shot to open a Flash movie. Download source code from the link below.
- Download all source files corresponding to this effects: pflowers.zip
Download the zip package linked above for the complete, cutomizable source code.
Description of Animations
All four animations are instances of the custom FlowersDisplay AS3 class. They differ by the family of parametric curves that is used, coloring of the petals, and the ColorTransform that causes fading effects. Download the code from the link above to play and customize the code.
The constructor of the class takes six parameters, all optional:
The parameters stand for: the width and the height of the display, the number of the family of curves that runs 1 to 4 as there are four preprogrammed families to choose from. If you are mathematically inclined, you can easily add more families. The paremeters rmin and rmax correspond to the minimum and the maximum radius of each flower. The radius is chosen randomly as each flower appears but rmin and rmax provide the range from which the radius is chosen. The last parameter is the delay (in number of frames) between two consecutive flowers to appear.
Each instance of FlowersDisplay has two public properties that determine the color of the background and the speed with which flowers fade:
Default: 2. The higher fadeIndex, the slower fade.
How to Customize Color Effects
It becomes clear when you take a peek into the FlowersDisplay class. You can play with the property:
This is the ColorTransform set in the constructor that causes fading of the flowers.
To change color schemes, look into the function
The most closely related is our recent tutorial:
You will find there another example how to use BitmapData.draw method to draw DisplayObjects to a Bitmap. This is the technique behind our animations.