Macromedia flex 2-migrating applications to flex 2 Manual De Usuario
Classes and packages
25
Abbreviations
ActionScript 3.0 contains fewer abbreviations in method and property names. The names are
as descriptive as possible. For example, the
as descriptive as possible. For example, the
mapPt()
method is now
mapPoint()
.
Some abbreviations are still used in ActionScript 3.0. For example, the
getBounds()
method
was not changed to
getBoundaries()
because it is shorter but just as descriptive.
In some cases, the use of abbreviation was preferred. For example, the
getBoundsOfCharacter()
method was changed to
getBoundsOfChar()
because the term
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.
“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,
question of the framework. For example,
isXMLName()
asks “Is this an XML name?”. As a
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,
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
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
.
The this keyword
The use of the
this
keyword has been made more consistent. It now refers to the instance of
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.
ActionScript.