User Guide

Terminology 25
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);
Data types
describe the kind of information a variable or ActionScript element can contain. The
built-in ActionScript data types are String, Number, Boolean, Object, MovieClip, Function, null,
and undefined. For more information, see About data types” on page 34.
Events are actions that occur while a SWF file is playing. For example, different events are
generated when a movie clip loads, the playhead enters a frame, the user clicks a button or movie
clip, or the user types on the keyboard.
Event handlers are special actions that manage events such as mouseDown or load. There are two
kinds of ActionScript event handlers: event handler methods and event listeners. (There are also
two event handlers,
on() and onClipEvent(), that you can assign directly to buttons and movie
clips.) In the Actions toolbox, each ActionScript object that has event handler methods or event
listeners has a subcategory called Events or Listeners. Some commands can be used both as event
handlers and as event listeners and are included in both subcategories. For more information on
event management, see “Handling Events” on page 167.
Expressions are any legal combination of ActionScript symbols that represent a value. An
expression consists of operators and operands. For example, in the expression
x + 2, x and 2 are
operands and
+ is an operator.
Functions are blocks of reusable code that can be passed parameters and can return a value. For
more information, see “Creating functions” on page 61.
Identifiers are names used to indicate a variable, property, object, function, or method. The first
character must be a letter, underscore (
_), or dollar sign ($). Each subsequent character must be a
letter, number, underscore, or dollar sign. For example,
firstName is the name of a variable.
Instances are objects that contain all the properties and methods of a particular class. For
example, all arrays are instances of the Array class, so you can use any of the methods or properties
of the Array class with any array instance.