Categories
Articles

Actionscript 3 Language Features

Actionscript 2 (AS 2) is great! Actionscript 3 (As 3) is even better. Some of the benefits you might find pleasing include:

Runtime exception reporting

This allows the developer to see runtime failures in the code. Actionscript 2 fails silently when running to protect the user from seeing developer intended error messages.

EMCAScript for XML (E4X)

This basically means XML handling is built into the language. You can avoid parsing XML into object trees as it is automatic.

Regular Expressions

At last fast manipulation and processing of string. No more loops to trim spaces for example.

New Primitive Types

Number is the data type in AS 2.0. With AS 3.0 you have int for example that will take advantage of faster CPU math processing features.

Decomposed Display API

The display API is not soley dependent on the bulging MovieClip class. A lighter Sprite class is available. As well there is a Shape class to remove all that vector drawing code. So for basic vector shape UI items you can use the Sprite and Shape class and drop the overhead of the MovieClip class.

Event Handling is part of the Language

In AS 2.0 we needed to use additional code to register event listener. This was found deep in the Component documentation as the EventDispatcher and Delegate classes. In AS you had to build the equivalent of these for your projects and use the Function class methods for the call backs as one technique.