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

Migrating applications to flex 2
Table of Contents

Advertisement

ActionScript 2.0 had many instances where getter and setter methods existed rather than
accessors. Now, ActionScript 3.0 uses accessors wherever possible. Unless a function has
arguments, it was converted to an accessor.
Methods that return a Boolean such as
were converted to accessors,
Socket.isConnected()
but retained the "is" or "has" prefix. For example, a method called methods would be
converted to the
property.
Socket.isConnected
Internal functionality marked private
ActionScript 3.0 includes a greater number of classes and members that are marked private.
Prior to this, maybe private members were not marked appropriately and functionality that
was intended to be used internally was exposed.
Naming conflicts with Flex classes
The Flex class library and the Flash Player API share similar class names, such as Buttons,
Images, and TextFields.
It is important that classes in the Flex classes and the Flash Player API not have the exact same
names. Even though the package system gives classes "long names" and helps partition
conflicting names away from each other, you might import many packages. If Flex and Flash
Player both have a class named Button, and you import both packages, the Flex compiler
throws ambiguity errors.
As a general rule, the Flex class library and Flash Player API do not use the same name for a
class any more.
Integer constants in enumerations
In ActionScript 2.0, enumerations were often expressed using string constants. For instance,
the
property could be set to the strings
,
, or
.
TextField.align
left
center
right
ActionScript 3.0 generally uses integer constants instead of strings. Integer constants are
declared as
members of a class, usually with type uint. The naming
public static const
should be all uppercase with underscores separating words.
Using integer constants has benefits for performance, and makes it possible for typos and
other usage errors to be detected at compile-time.
24
ActionScript 2.0 to 3.0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex 2

Table of Contents