Usability Improvements - Adobe FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual

Migrating applications to flex 2
Table of Contents

Advertisement

A subclass cant have a var with the same name as one visible from the superclass, and you
can't override a var.
You must declare a type for everything or you'll get a compiler warning.
Accessing methods or properties of the target of an event object won't compile unless you
cast event.target to the type of the target. For example, event.target.foo must be changed
to MyComponent(event.target).foo.
You cannot do a for in loop on every object to see the object's properties. This only works
on dynamic objects now. An alternative is to use E4X to do object introspection.
All classes must be in a package or they will only be accessible from the current script.
You should put return types on all of your functions.
Array is a final class.
The
method is now in the flash.util.trace package.
trace()
The Timer class in flash.util replaces setInterval and setTimeout.

Usability improvements

This section describes changes to the ActionScript language that improve usability. Most
changes described here affect the syntax but do not add functionality. This section describes
general changes to the language, and not specifics, although it includes some illustrative
examples.
The goal of these usability improvements was to provide consistency. This makes the language
easier to understand and reduces the amount of time it takes developers to learn it. The less
special case rules need to be remembered, the better.
There are some places where a better developer experience was achieved by bending the rules.
For example, ActionScript 3.0 puts enumerations into inner classes. Putting all keycode
constants into an inner class of Keyboard, however, creates too verbose a language:
Keyboard.KeyCode.UP instead of Keyboard.UP. To create a better developer experience, it
was necessary to bend the rules slightly.
Some of these changes come at the price of higher migration costs, but the longer-term
benefit is a more robust language.
22
ActionScript 2.0 to 3.0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex 2

Table of Contents