<< 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 .
I am going to take a very broad view of computer animation in this and the next few lessons. A program that causes visual images to change over time produces what I am referring to an animation.
Such visual changes can take on many different forms. Perhaps the most common form of animation is the movement (change in position) of an object over time. However, animation can involve a change in any visualattribute of an object over time, such as changes in position, color, size, opacity, orientation, etc.
Major differences
There are some major differences between writing animation code in ActionScript and writing animation code in Java, C++, and C#.
Those differences generally have to do with the strong tie between the execution of ActionScript code and the Flash Player. (In some cases, references to the Flash Player in this lesson may also apply to Adobe Air.)
To understand how to write animation code in ActionScript, you must first understand a little about the Flash Player.
Why is it called a player?
There is a good reason that the Flash Player is referred to as a player . In many ways, it resembles a DVD player or a VCR player. What I mean by that isthat the Flash Player extracts a series of visual images from memory and displays those images sequentially with a (hopefully) fixed time interval between the display of one image and the display of the next image inthe sequence.
The scene is displayed once during each frame
We can't know exactly what happens at the lowest levels of the software and the display hardware. However, from the viewpoint of the ActionScript programmer,the scene described by the images stored in memory is displayed over and over even if it isn't changing.
Frames
Each new display of the scene is referred to as a frame . As you will see later, it is possible for the ActionScript programmer to simply accept thedefault rate at which frames are displayed, or to execute code to set the frame rate to something other than the default rate.
Not the case in Java, C++, and C#
The inherently strong tie between the images stored in memory and the sequential and repetitive display of those images by the Flash Player does notexist in Java, C++, or C# (although it can be simulated ) .
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with actionscript' conversation and receive update notifications?