<< Chapter < Page Chapter >> Page >

Supplemental material

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 .

General background information

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.

Preview

Run the ActionScript program named LighteningStorm01 .

I recommend that you run the online version of this program before continuing.

If you don't have the proper Flash Player installed, you should be notified of that fact and given an opportunity to download and install the Flash Playerplug-in program.

LighteningStorm01 at startup

The program begins by displaying a scene similar to that shown in Figure 1.

Lighteningstorm01 at startup.

Missing image.
LighteningStorm01 at startup.

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.

Visual output produced by clicking the button.

Missing image.
Visual output produced by clicking the button.

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.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Object-oriented programming (oop) with actionscript. OpenStax CNX. Jun 04, 2010 Download for free at http://cnx.org/content/col11202/1.19
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Object-oriented programming (oop) with actionscript' conversation and receive update notifications?

Ask