MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 27

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Constants
are elements that don't change. For example, the constant
same meaning: it indicates the Tab key on a keyboard. Constants are useful for comparing values.
Constructors
are functions that you use to define 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 radius:Number
private var circumference:Number
// constructor
function Circle(radius:Number) {
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 constructors for the built-in Array class and the custom
Circle class:
my_array:Array = new Array();
my_circle:Circle = new Circle();
Data types
describe the kind of information a variable or ActionScript element can hold. The
ActionScript data types are String, Number, Boolean, Object, MovieClip, Function, null, and
undefined. For more information, see
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
kinds of ActionScript event handlers: event handler methods and event listeners. (There are also
two event handlers,
on()
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.
Expressions
are any legal combination of ActionScript symbols that represent a value. An
expression consists of operators and operands. For example, in the expression
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
Identifiers
are names used to indicate a variable, property, object, function, or method. The first
character must be a letter, underscore (
letter, number, underscore, or dollar sign. For example,
Instances
are objects that belong to a certain class. Each instance of a class contains all the
properties and methods of that class. For example, all movie clips are instances of the MovieClip
class, so you can use any of the methods or properties of the MovieClip class with any movie
clip instance.
"About data types" on page
and
onClipEvent()
"Creating functions" on page
), or dollar sign (
_
34.
mouseDown
, that you can assign directly to buttons and movie
51.
). Each subsequent character must be a
$
is the name of a variable.
firstName
always has the
Key.TAB
or
. There are two
load
,
and
x + 2
x
Terminology
are
2
27

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents