Earth Day Flash Animation.
Loading Flash movie...
Download source project earthday.zip
Click on the ground to plant more trees. You can plant trees in the spring only!
- Launch Alligator and choose "Blank document"
- Set movie size to 700 x 340 pixels
- Set background of the frame to blue and delay to Stop
- Create the master tree, draw a new sprite, name it "tree". You may copy it from the project or draw your own tree
- Create the ground, draw a rectangle, convert it to curve and bend the top edge
- To create the sun draw a circle and apply yellow radial gradient to it.
- To create clouds draw an ellipse, convert it to curve and reshape it, apply light blue gradient to it
- Convert the cloud to sprite and apply long frame time (for example 35 seconds). Apply vertical movement to the cloud. Duplicate the sprite few times and change delay time so clouds appear randomly.
- Put actionscript to Frame 1 of the main movie
var trees = new Array();
maxtrees = 0;
trees[i]._xscale = trees[i]._xscale +1;
trees[i]._yscale = trees[i]._yscale +1;
setInterval(grow_trees,1000); runs grow_trees() function every 1000 miliseconds (1 second)
- Apply onClick action to the ground element:
trees[maxtrees] = tree.duplicateMovieClip(
trees[maxtrees]._x = _root._xmouse;
trees[maxtrees]._y = _root._ymouse;
maxtrees = maxtrees + 1;
maxtrees is the total number of trees
if(tree._currentframe<40) lets the user to plant trees only during spring
this creates a new tree and positions the new tree in front of other trees, higher _ymouse converts to higher so called Flash depth
_root._xmouse, _root._ymouse this is the current mouse position