Migrating applications from Flex 2 to Flex 3

Migrating from Flex 1.x to Flex 2 was — how can I put it — painful. We scrubbed the APIs to make them consistent; as a result, many properties, methods, events, and even some constants changed, and sometimes changed again. We added and removed classes and interfaces. Heck, we even changed the capitalization of “Void” to “void”. In addition, the underlying language went from ActionScript 2.0 to ActionScript 3.0. There was no shortage of tasks for updating apps from 1.x to 2.

This time around, however, the APIs have already been through the scrubbing and many of the issues have been ironed out. Most of the migration duties you’ll encounter will be related to updated features, like:

Localization — The l10n system has changed alot (for the better!). It’s now much simpler to implement, and it supports runtime locale-switching. You can use the same properties files, but you might have to rewrite the way they are accessed. Check out the localization doc.

Style properties — A number of style properties have changed to support the new subcomponent style feature.

Deep linking – This is a new feature, but if you were using the HistoryManager class, you really should switch to using the BrowserManager class to do all your browser/Flex app communication.

Compiler and configuration args — A few compiler arguments have changed. If you use config file or ant tasks to do your compilation, you might have to modify your files.

Here are some resources that should help with migration issues:

  • Deprecated elements in the Language Reference — A list of all the class elements that are now deprecated. The compiler will also warn you about these when you try to compile, but you can get a sense of what has changed from this list.
  • Backwards compatibility — This includes a list of differences between the configuration files for SDK 2.0.1 and SDK 3, as well as a list of the changes to the framework.
  • Understanding Flex 3 Migration Issues on Joan Lafferty’s blog: Part 1 and Part 2

It’s also important to realize that with Flex Builder 3, you can compile your apps against the new compiler (version 3), or against any version of the compiler that you have installed. This way, if your code does not use any of the new features and you don’t want to migrate yet, but you want to use Flex Builder 3, then you can without any issues. Of course, there’s doc on that, too.