Although ActionScript was originally conceived as a simple tool for controlling animation, it has since evolved into a sophisticated programming language for creating rich applications for the web, mobile devices, and the local desktop environment.
With the launch of ActionScript 3 (AS3) under the new Adobe monopoly (used by Flex, AIR, and Flash), the language has most certainly stepped forward as a more serious member of the Object Orientated Programming (OOP) family. AS3 is more heartedly geared towards class–based programing (ie compiling your code as external classes within packages rather than with reams and reams of code placed on keyframes within the Flash IDE timeline, which wasn’t compulsory, but a very common practice nonetheless), while at the same time requiring greater cogniscence of the built–in classes one uses. In tenaciously moving toward better OOP practices, AS3 brings with it, among other things, a lot more consistency in its treatment of events and object instances.
As a self–taught Flash programmer with no prior programming knowledge of any kind, my current transition from ActionScript 2 (AS2) to AS3, has been dogged by what I have come to realise are very bad habits and spurious understandings of what is actually going on underneath my timeline–placed code.
In gearing myself for the move to AS3, I have had to delve into the full conceptual paradigm of OOP the good old fashioned way: Reading, reading and more reading, while resisting the urge to implement my new knowledge piecemeal (as this has been the cause of all my past and current bad coding habits). Put simply, the arrival of AS3 has highlighted how the piecemeal provenance of my Flash programming thus far has made my understanding of what the SWF compiler is actually doing with my code very flimsy, to say the least. This flimsiness has most significantly manifested itself in event scope and data or object type manipulation errors, which on many occasions have nearly resulted in my MacBook undergoing flying lessons, base–jumper style (sans parachute).
However, having just slated the extent of my knowledge as it stood before my recent endeavours to properly learn OOP and AS3, it has been exciting to discover a number of areas in which my previously self–styled conceptualisation has in fact held strong, albeit with some different terms of reference.
It is for this very reason that I recommend reading a number of different sources on the same subject matter to anyone in the same boat as me. How one author chooses to describe something may be a lot more helpful to your learning curve than another author’s description. Also, different descriptive approaches can help cement your understanding; making sense of only loosely grasped concepts that were previously lacking conclusiveness in your mind. Lastly, multiple sources are important because OOP is very duplicitous in nature, and, as such, opinions differ on the best way to go about skinning your chosen cat (such as, choosing between composition or inheritance within your packages).
In terms of my modus operandi for getting to grips with AS3, my starting point has principally been Colin Moock, whose book Essential ActionScript 3.0 has proved worth every penny of its cost thus far. From areas highlighted in the book, I then do supplementary online searches to gain additional perspective. This approach has served me well thus far, as I doggedly decided that I needed a more comprehensive (‘from–the–beginning’) approach in upgrading to AS3, in order to break away from my AS2 mindset and my not–so–great coding habits.
However, having said all of this, here are some useful online references that are helpful for anyone looking to make the transition a bit more speedily than my more exhaustively pedantic approach:
Tips for learning ActionScript 3.0 by Emmy Huang
Tips for migrating your Flash applications to ActionScript 3.0 by Dan Carr.
Even though the upgrade to AS3 may be frustrating and time consuming at times (especially since AS3 does not compile any legacy code), I am sure anyone migrating their old AS2 timeline code into neat packages and classes will find there is a large amount of structural enjoyment and satisfaction that comes out of the process. The more I get into creating my own custom classes within the AS3 model, the more fun I am starting to have while doing even the most basic of things, simply because one is presented with a newfound level of control that can be quite intoxicating.