Classes And Packages - Adobe FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual

Migrating applications to flex 2
Table of Contents

Advertisement

Abbreviations
ActionScript 3.0 contains fewer abbreviations in method and property names. The names are
as descriptive as possible. For example, the
method is now
.
mapPt()
mapPoint()
Some abbreviations are still used in ActionScript 3.0. For example, the
method
getBounds()
was not changed to
because it is shorter but just as descriptive.
getBoundaries()
In some cases, the use of abbreviation was preferred. For example, the
method was changed to
because the term
getBoundsOfCharacter()
getBoundsOfChar()
char is used in many other places in the API, such as
.
String.charAt
Consistent use of prefixes
Prefixes on member variables in ActionScript 3.0 have been removed. For interfaces, the prefix
"I" has been added; for example IEventDispatcher. Class names do not have prefixes.
The prefixes "is" and "has" are used on methods and accessors that test conditions. They ask a
question of the framework. For example,
asks "Is this an XML name?". As a
isXMLName()
result, "is" and "has" prefixes are used only for reading properties and not writing.
The prefix "use" may be used to indicate a Boolean property that can be modified. For
example,
.
useHandCursor()
Type annotations
All variables and methods now have type annotations, and those type annotations are as
precise as possible. The Object type is only used when there is no reasonable alternative, or
where attempting to strongly type the value makes the language more difficult to use. For
more information on type annotations, see
"Typing" on page
32.
The this keyword
The use of the
keyword has been made more consistent. It now refers to the instance of
this
the class that the current method is in.

Classes and packages

This section describes changes to the way you write classes, interfaces, and packages in
ActionScript.

Classes and packages

25

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex 2

Table of Contents