MACROMEDIA FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Bedienungsanleitung Seite 24

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 184
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 23
24 ActionScript 2.0 to 3.0
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
Socket.isConnected() were converted to accessors,
but retained the “is” or “has” prefix. For example, a method called methods would be
converted to the
Socket.isConnected property.
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
TextField.align property could be set to the strings left, center, or right.
ActionScript 3.0 generally uses integer constants instead of strings. Integer constants are
declared as
public static const members of a class, usually with type uint. The naming
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.
Seitenansicht 23
1 2 ... 19 20 21 22 23 24 25 26 27 28 29 ... 183 184

Kommentare zu diesen Handbüchern

Keine Kommentare