Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 113

Programming actionscript 3.0
Table of Contents

Advertisement

Dynamic classes generally return the value
code external to a class attempts to access a private property. The following table shows that
an error is generated only when the dot operator is used to access a private property in strict
mode:
dot operator (.)
bracket operator ([])
The
attribute, which is new for ActionScript 3.0, makes a property visible to
protected
callers within its own class or in a subclass. In other words, a protected property is available
within its own class or to classes that lie anywhere below it in the inheritance hierarchy. This is
true whether the subclass is in the same package or in a different package.
For those familiar with ActionScript 2.0, this functionality is similar to the
in ActionScript 2.0. The ActionScript 3.0
attribute in Java, but differs in that the Java version also permits access to callers
protected
within the same package. The
method that your subclasses needs but that you want to hide from code that is outside the
inheritance chain.
The
attribute, which is new for ActionScript 3.0, makes a property visible to callers
internal
within its own package. This is the default attribute for code inside a package, and it applies to
any property that does not have any of the following attributes:
public
private
protected
a user-defined namespace
The
attribute is similar to the default access control in Java, although in Java there
internal
is no explicit name for this level of access, and it can be achieved only through the omission of
any other access modifier. The
the option of explicitly signifying your intent to make a property visible only to callers within
its own package.
static attribute
The
attribute, which can be used with properties declared with the
static
keywords, allows you to attach a property to the class rather than to instances of the
function
class. Code external to the class must call static properties using the class name instead of an
instance name.
undefined
Strict mode
compile-time error
undefined
protected
attribute is useful when you have a variable or
protected
attribute is available in ActionScript 3.0 to give you
internal
instead of generating an error when
Standard mode
undefined
undefined
private
attribute is also similar to the
attribute
,
, or
var
const
Classes
113

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents