Adobe FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual page 27

Migrating applications to flex 2
Table of Contents

Advertisement

Using classes
This section describes changes to ActionScript classes.
Access modifiers
The new
access modifier refers to a different namespace in each package definition,
internal
and is not defined outside of a package definition (that is, in global code).
If a class in a package isn't marked
cannot be accessed by classes in other packages; this is the same as the
Java. Accessing internal classes from outside of the package causes a ReferenceError at run
time.
If you do not put any namespace (public, private, internal, or user-defined) on a declaration,
the Flex compiler throws a warning.
The following table summarizes the access modifiers:
Access Modifier
private
public
protected
internal
Inside a package, the default access specifier is
access specifier is
public
Class identifiers
The form ClassIdentifiers:ClassIdentifiers.Identifier has been deprecated and results in a
compile-time warning. It is equivalent to declaring the class name Identifier in the package
ClassIdentifiers. For example:
class P.A {}
package P {
class A {}
}
super()
You can only use a
super()
statement anywhere else in a program. Previous versions of ActionScript allowed
super()
statements to be used anywhere in a class (except in a static method).
super()
or
public
Description
Only accessible to the class.
Accessible from anywhere.
Private to classes and subclasses.
Private to other classes in the package.
.
// ActionScript 2.0
// ActionScript 3.0
statement inside a constructor. It is a syntax error to use a
, then it defaults to
private
. Outside of a package, the default
internal
. The class
internal
modifier in
protected
Classes and packages
27

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex 2

Table of Contents