Anyone can explain the Advantages of As3 overAs2.
ActionScript 3 is a completely object-oriented approach to the previous language versions. There are multiple reasons why AS3 is "better" than AS2, and there are probably long articles spread over the internet, but let me list some main reasons:
ActionScript 3 content is faster executed than previous versions due to the usage of the "new" ActionScript Virtual Machine 2 (AVM2), introduced with the Flash Player 9. Also it supports a lot newer things, such as 3D and E4X (for awesome native XML support). And if you are working with other OOP languages, it just makes sense to use it for Flash as well.
While ActionScript 2 is still supported, and will be supported in future, it makes less sense to continue working with it when you have the chance to switch over to AS3.
Better faster harder stronger longer!
- Better - subjective, but most who use it would agree, that AS3 is far superior to AS2 in many ways. E.g. Syntax, less quirks, standards, etc.
- Faster - runs much faster than is predecessor.
- Harder - It's true that AS3 is harder to pickup for beginners, but the language makes a lot for sense for people from a computer science/"real" programming background. This means AS3 has got a lot more respect from the programming community, so more programming orientated developments are happening.
- Stronger - More robust, and better intrinsic libraries.
- Longer - Has a longer shelf life. Does take longer to code some things than AS2 but the benefits and productivity you gain from being forced to write "proper" code, far outweighs the initial time cost.
*edited for all the haters
But of the languages have their pros and cons, but there is one thing that makes ActionScript 3 really better then ActionScript 2. The AVM2 (on which ActionScript 3 runs) is a lot faster the the old AVM1.
- AS3 is as previously mentioned, faster, thanks to the AVM2 it runs on.
- AS3 requires less hacks. Remember being forced to use delegates in AS2 to overcome scoping issues?
- AS3 is object orientated. This makes coding more clean and therefore improves efficiancy.
- AS3 has bigger libraries
- AS3 has improved compile time error checking
- AS3 gives you greater control over sound
- AS3 improves any 3D (due to the various engines which are only possible due to the speed increases)
Subjectively AS2 was painful to work on. It required many hacks, errors were hard to track down, the langauge lacked any elegance, it was slow, and its design taught people how to write hack code.