ActionScript 3.0 Conversion Chronicles - Part 1: An Introduction to AS3 Migration
Page 1 of 2
Set for printing
Were you ever confused, frustrated or dismayed by a project where you had
to convert from ActionScript 1 or 2 and migrate it up to ActionScript 3.0?
Finding the right information, the right tips and the right approach can be
challenging when you're under the gun and need a solution, fast. This series
will guide you through some simple formulas and techniques to convert and migrate
legacy Flash ActionScript 1 and 2 code and techniques to ActionScript 3.0.
In this introductory article, before getting into specific strategies and techniques, we'll take a look at some of the issues you may be facing when tasked with converting a project from AS1 or AS2 to AS3.
Converting Legacy ActionScript
Before we delve into specific techniques, let's start off this series by listing just a few hurdles you may have to overcome in converting or updating a legacy project from ActionScript 1 or 2 to ActionScript 3. We won't go into detail enumerating the differences between these versions of ActionScript, for that would present a greater task than the scope of this article series. Many items in the list below can apply to converting both AS1 and AS2.
Migrating ActionScript 1.0
- No datatyping means you will have to add type information.
- Reserved keywords must be re-referenced to avoid compiler conflicts.
- Button and MovieClip scripts do not exist in AS3, so these must be converted into frame script or class files associated with library assets.
- Extending "built-in" via prototypes must be extended via class inheritance, and prototyped pseudo-class structures will need to be converted to true classes.
- Text variables will need to be re-referenced as instance names, as there is no such thing in AS3.
- Legacy MovieClip-specific methods for display object manipulation will need to come in line with the reworked Display DOM.
- Many global top-level methods have been moved and reworked into class structures consistent with new and updated capabilities such as the Display DOM and the Event DOM, and will need to be updated.
- Core datatypes such as XML have been added, requiring a re-referencing of legacy XML node-based programming to the AS3 E4X syntax, or a re-referencing of legacy code to work with the AS3 implementation of legacy XML which has been migrated to the XMLNode class.
- Variable scope may need to be upgraded to AS3 method closure-based referencing.
- Some events, such as onRollOut and onDragOut, do not have direct equivalents in the AS3 Event model, and will need to migrated to closest matches or AS3 equivalents created from lower-level events.
- Many properties have remained the same, but underscore prefixing for properties is gone in AS3.
- Some Flash Player-specific hacks and workarounds are no longer necessary, or do not work in ActionScript 3.0, since it uses a different virtual machine in the Flash Player.
Page 1 of 2 1
2
Next

Download Support Files
Keywords
AS1, AS2, AS3, conversion, migration, legacy, actionscript