Terminology
11
Terminology
As with all scripting languages, ActionScript uses its own terminology. The following list provides
an introduction to important ActionScript terms:
Boolean
is a
true
or
false
value.
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 a script file.
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.
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 18
.
Events
are actions that occur while a SWF file is playing. For example, different events are
generated when a movie clip loads, 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. 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
Developing Flex Applications
.
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 41
.
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...