i’ve been developing games in Flash since version 4 in 2000. Back then, they had recently added scripting to the program, which had been primarily focussed on animation and design. The original Actionscript author said that he created the scripting language with Lego in mind. This was pretty clear from the Flash 4 coding interface. Instead of typing code, you just chose lines of script from a list and filled in the blanks, like variable names and values. It was an experienced programmer’s nightmare, but i was not an experinced programmer. For me it was a great introduction to programming, which had baffled me since i was a young kid trying to learn AmigaBASIC so that i could make video games about my favourite Muppets.
Flash 9 and Actionscript 3 have been available for about a year now. At my last job, despite a commitment to Sarbanes-Oxley compliance, the folks controlling the budget were very slow to upgrade our software. It was a full year past the release date before we upgraded to Flash 8, despite the massive workload reduction we demonstrated thanks to the new movieclip bitmap filters. (With Flash 7, if we wanted an animated character with a uniform outline, we’d have to create that outline by hand for every frame of animation).
It was the same story when Flash 9 arrived. The jump from Actionscript version 2 to Actionscript version 3 is significant, but my company was in no hurry to ensure that everyone kept their skills current. i could have learned it on my own on evenings and weekends, but that would have left me little time to run and jump and play.
This is not a book review. i haven’t read the 800-odd pages to give the book a fair enough shake. i have, however, read Moock’s other Essential Actionscript books nearly cover to cover. What i appreciated about those books is missing from this one. Moock has always made the reader feel at ease and comfortable with whatever he’s teaching, easing us into the pool inch by inch. Sure, there are some uncomfortable moments – like when the icy water hits your babymaker – but for the most part, if you follow along and don’t wade in over your head, Moock will have you swimming before you know it.
With Essential Actionscript 3, Colin Moock pushes you into the churning ocean from a helicopter during a thunderstorm in the blackness of night and asks you to collect shiny marbles on the sea floor with no oxygen tank.
The analogy wears kind of thin at this point, but you get the idea. While his other books are adequate intro programming books, this one requires a much more solid basic understanding from the reader. Moock spends the first chapter exhausting the ins and outs of namespaces (“packages” in AS 3) without so much as a “Hello world”. Geez, Moock – would it hurt to spend a little time on foreplay?
i don’t know how much of this is his fault. AS3 does require a lot more initial setup than anything you’ve ever coded before, if you come from a Flash-only background like i do. And he’s clearly been mandated by Adobe to write the book flexibly enough for readers using Flash, Flex, or mxmlc (included in the free Flex SDK). That can’t be easy. (All mentions of Adobe AIR are cursory and appear to have been added at the last minute, as the book was going to print.)
i’m not sure he nailed it this time. i’ve read other books where, despite the amount of setup code required to compile that new programmers will have a hard time with, the author says “You won’t understand what any of this means, but just write it down for now so that we can get our ‘Hello World’ program running.” i think i prefer that approach. Moock takes too much time here explaining every little detail with razor precision while largely leaving new Actionscript users in the dust.
(Incidentally, i had the same problem while reading the documentation for Moock’s Unity Server. Too eggheaded and abstract, as though he’s slowly losing his ability to parcel his knowledge out to us plebes. When i reviewed SmartFox Server and saw friendly methods like “Add Room”, and “List Players”, i was relieved. We ended up using SmartFox for our MMOG project.)
Are you experienced?
But what about us Actionscript old-timers? Is AS 3 really different enough to warrant a panic?
My gut feeling is “no”, but it depends on how much time you spent taking advantage of Actionscript 2’s pickier principles.
One thing that “real” programmers hate about Actionscript is how fluid and forgiving it is. Strong typing wasn’t really introduced until AS2, where you could tell the programming environment what types of variables you were using so that it could find errors for you earlier, instead of surprising you while your program is in the middle of its schtick.
AS 2, however, was permissive. You didn’t have to strong type your variables. The compiler would still perform automatic data conversions on type mismatches. It enabled you to use classes, but didn’t force you. AS 2 was like the girl up the street who talked big about being chaste and untouchable, but she’d totally let you get to third base if you paid for her movie ticket.
AS 3 is more like the girl you marry. It plays hard-to-get, but the commitment you spend learning its idiosyncracies will serve you well for many years, until you divorce and take up with a much younger, fitter programming language that the kids call “new mommy”.
i have no idea how i managed to weave so much sexuality into a discussion about Actionscript. Suffice it to say that strong typing your variables is a pain in the ass and will make you type more slowly until you get used to it. Adopting OOP methodologies will take a long damned time if you’ve never had to do it – this is the challenge i’m facing. In particular, the best practice of creating special “get” and “set” methods to change private instance variables makes me grit my teeth. Add to this the fact that for most of my projects – small web games with 2- and 3- week production cycles – full OOP implementation is overkill.
The good news is that playing by the newer, more strict AS3 rules will prep Flash coders for learning other languages like the C family. i tried to learn C# while making light use of the (then) new AS2 principles, and i found that i didn’t have enough OOP experience to make sense of it. One loop in your code? What kind of crazy talk is that? In Flash, every item on the screen has its own loop! Yeehaw!
Although i have not even used it myself, i highly recommend learning to develop in Flex. Abstracting code from your design layer is a key component in learning what “real” programming is all about, and i find it’s one of the hardest things for Flash born-and-bred coders to do. Beyond that, the Flash IDE stinks for programming. Keeping track of multiple AS files without proper code hinting is a dealbreaker for me. When i build my first AS3 project, which will launch by the end of the month, i’ll use Flex.
Now pardon me – i have to go pick up personal hygiene products for AS3 before the drug store closes.