804
Terminology
Caching
refers to information that is reused in your application, or information that is stored
on your computer so it can be reused. For example, if you download an image from the
internet, it’s often cached so you can view it again without downloading the image data.
Callback functions
are anonymous functions that you associate with a certain event. A
function calls a callback function after a specific event occurs, such as after something finishes
loading (
onLoad()
) or finishes animating (
onMotionFinished()
). For more information and
an examples, see
“Writing anonymous and callback functions” on page 208
.
Characters
are letters, numerals, and punctuation that you combine to make up strings.
They are sometimes called
glyphs
.
Classes
are data types that you can create to define a new type of object. To define a class,
you use the
class
keyword in an external script file (not in a script you are writing in the
Actions panel).
Classpath
refers to the list of folders in which Flash searches for class or interface definitions.
When you create a class file, you need to save the file to one of the directories specified in the
classpath, or a subdirectory within that. Classpaths exist at the global (application) level, and
at the document level.
Constants
are elements that don’t change. For example, the constant
Key.TAB
always has
the same meaning: it indicates the Tab key on a keyboard. Constants are useful for
comparing values.
Constructor functions
(or
constructors
) are functions that you use to define (initialize) the
properties and methods of a class. By definition, constructors are functions within a class
definition that have the same name as the class. For example, the following code defines a
Circle class and implements a constructor function:
// file Circle.as
class Circle {
private var circumference:Number;
// constructor
function Circle(radius:Number){
this.circumference = 2 * Math.PI * radius;
}
}
The term
constructor
is also used when you create (instantiate) an object based on a particular
class. The following statements are calls to the constructor functions for the built-in Array
class and the custom Circle class:
var my_array:Array = new Array();
var my_circle:Circle = new Circle(9);
Summary of Contents for FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Page 1: ...Learning ActionScript 2 0 in Flash...
Page 8: ...8 Contents...
Page 18: ...18 Introduction...
Page 30: ...30 What s New in Flash 8 ActionScript...
Page 66: ...66 Writing and Editing ActionScript 2 0...
Page 328: ...328 Interfaces...
Page 350: ...350 Handling Events...
Page 590: ...590 Creating Interaction with ActionScript...
Page 710: ...710 Understanding Security...
Page 730: ...730 Debugging Applications...
Page 780: ...780 Deprecated Flash 4 operators...
Page 830: ...830 Index...