1
votes

I'm new to Flash development so please forgive the simplicity of this question...

I'm developing a simple Flash animation using Flash Professional CS5 and I'm writing some ActionScript code. I noticed there's a choice between using different versions of ActionScript.

Wondering what the key differences are between 2.0 and 3.0...?

4

4 Answers

1
votes

If your new to the language, go with the latest version. The chances of running across a browser with an outdated player are very small, and the standard embed pattern will notify the user anyway. There are way too many differences to list, but AS3 was, to me, a huge upgrade, in both the language and the player. There is simply no good reason to write anything in AS2. JMHO.

1
votes

AS3 is a significantly faster and better language than 2.0, and whenever possible, that's what you should be using. There's very few instances, like some ad companies or Flash Lite where I believe you're still required to use AS2, but as a new user, you should avoid it like the plague. They just give you the option because of those edge cases where you'd have to use it, Adobe does not want you using AS2.

0
votes

ActionScript 3.0 is based on a draft of ECMAScript 4. At first glance it has more of a resemblance to Java than JavaScript (unlike AS2). ActionScript 3.0 is very much a class inherited language and designed around OOP principles. AS2 also has classes but prototypes feature strongly (although I am a little unclear on this area).

AS3 is also a strict typed language. Before you could write code such as:

var a = 12;

and you still can with AS3, the difference is if you were to write:

var a:int = 12;

with AS3 you will get type checking (helping to keep errors at compile time rather than run time). This can also result in a performance increase. Speaking of performance increases, AS3 runs on the AVM2 which significantly increase speed.

There are also a whole host of other features added to AS3. A much improved event system, better XML handling, the ability to load and save to local (FP10), the ability to use Pixel Bender (FP10).

You probably won't notice a huge difference if your doing mainly animations with some code, but still, it makes sense to go with AS3, especially if you find yourself getting more involved with it later on.

0
votes

Adobe's AS2 to AS3 migration page lists the changes in the language - it'll be useful if you're translating AS2 code to AS3.