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

Migrating applications to flex 2
Table of Contents

Advertisement

Capitalization of identifiers
The ActionScript 3.0 naming conventions match the Flex application model and the
ECMAScript standard. All identifiers are in "camel case." This means that an identifier's
characters are in lowercase, except that the first letter of each word in the identifier is
capitalized. For example, ExternalInterface.
Class names are fully capitalized using camel case. The first letter of a class name is always a
capital letter. Names of nested classes start with a capital letter, just like any other class name.
Members of classes, with the exception of nested classes, start instead with a lowercase letter.
For instance,
.
addChildAt()
Package names are not capitalized at all. For instance, flash.display and flash.external.
Acronyms in class name identifiers are fully capitalized, even if the letters of the acronym are
adjacent to another capitalized word in the identifier. For example, URLRequest and
IMEEvent.
For members of classes, acronyms are fully capitalized, except when the acronym is the first
word of the identifier. When this occurs, the acronym is entirely in lowercase. For example,
and
. When the acronym is a subsequent word, it is fully capitalized. For
swfVersion
url
example,
and
.
loaderURL()
navigateToURL()
Constants are one place where we do not use camel case. The entire identifier should be in
uppercase, with underscores separating each word. For instance, MouseEvent.CLICK. The
rule is similar to Java and ECMAScript conventions.
Package reorganization
Some packages have been changed to make the classes within them located in a more intuitive
place. In addition, special care was taken to avoid having too many packages in the Flash
Player API. If the ActionScript packages were too granular, you would have a hard time
finding the classes you want to use. For some examples, see
"Global functions" on page
34.
Accessors
Like C#, ECMAScript 4 supports using accessors. Accessors were also a feature of
ActionScript since Flash Player 6. Instead of hand-coding the
and
methods,
getX()
setX()
developers can declare a property in such a way as to be interpreted as an accessor. Getting or
setting the value of this accessor property invokes the associated get or set function.
Usability improvements
23

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex 2

Table of Contents