<< Chapter < Page | Chapter >> Page > |
I recommend that you also study the other lessons in my extensive collection of online programming tutorials. You will find a consolidated index at www.DickBaldwin.com .
Things you have learned
You learned about event handling, bitmap basics, the fundamentals of image pixel processing, and using chroma key compositing to create transparentbackgrounds in earlier lessons in this series.
You also learned about drawing with the Graphics class, the fundamentals of animation and using sound in ActionScript in earlier lessons as well.
In the lesson titled Animation Fundamentals I told you that I refer to any program code that causes visual images to change over time to be animation.
Other types of animation
Although we commonly think of animation in terms of images that appear to move over time, there are many other valid forms ofanimation as well. For example, if the color of an image changes over time, that is animation. If the transparency of an image changes over time, that isanimation. If graphic objects appear and then disappear, that is animation.
In this lesson, I will explain a program that is intended to pull together much of what you have already learned and to introduce you tothis broader view of animation as well.
Run the ActionScript program named LighteningStorm01 .
I recommend that you run the online version of this program before continuing.
LighteningStorm01 at startup
The program begins by displaying a scene similar to that shown in Figure 1.
What you should see
When the scene in Figure 1 appears, the clouds should seem to be moving slowly. The overall color of the scene should be changing slowly in thebluish-green range. The moon should be moving very slowly from left to right across the screen.You should be able to barely make out a tree in the fog near the bottom center of the image and you should be able to hear the wind and the rain. The sound of the rain shouldbe continuous while the sound of the wind should come and go on a random basis.
Output produced by clicking the button
When you click the button, the scene should change to one similar to that shown in Figure 2.
The sights and sounds of a lightening bolt
You should hear a sizzle sound as a lightening bolt comes out of the sky and strikes the old tree. The shape of the lightening bolt should be random from onebutton-click to the next. Except for the motion of the moon and the shape of the tree, the details of all of the visual elements should change over time on in arandom fashion.
The flash of the lightening
The lightening bolt should light up the scene with an eerie yellowish-green glow. The overall color of the scene should change slowly and randomly while the sizzlesound is playing and the lightening bolt is visible.
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with actionscript' conversation and receive update notifications?