Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 76

Programming actionscript 3.0
Table of Contents

Advertisement

There are also several identifiers that are sometimes referred to as future reserved words. These
identifiers are not reserved by ActionScript 3.0, though some of them may be treated as
keywords by products that incorporate ActionScript 3.0. You might be able to use many of
these identifiers in your code, but Adobe recommends that you do not use them because they
may appear as keywords in a subsequent version of the language.
abstract
char
export
long
throws
virtual
Constants
ActionScript 3.0 supports the
Constants are properties with a fixed value that cannot be altered. You can assign a value to a
constant only once, and the assignment must occur in close proximity to the declaration of
the constant. For example, if a constant is declared as a member of a class, you can assign a
value to that constant only as part of the declaration or inside the class constructor.
The following code declares two constants. The first constant, MINIMUM, has a value
assigned as part of the declaration statement. The second constant, MAXIMUM, has a value
assigned in the constructor.
class A
{
public const MINIMUM:int = 0;
public const MAXIMUM:int;
public function A()
{
MAXIMUM = 10;
}
}
var a:A = new A();
trace(a.MINIMUM); // 0
trace(a.MAXIMUM); // 10
76
ActionScript Language and Syntax
boolean
debugger
float
prototype
to
volatile
statement, which you can use to create constants.
const
byte
double
goto
short
transient
cast
enum
intrinsic
synchronized
type

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents