Flash in the Peg

26 March 2008

Review of Learning ActionScript 3.0

Filed under: ActionScript, Book Review — darren @ 9:19 pm

For many designers and developers who use Adobe Flash, the introduction of ActionScript 3 was met with some trepidation. The perceived increase in the complexity of ActionScript 3 code compared to ActionScript 2 - including the belief that you must use Object-Oriented Programming to use AS3 - has led some to decide to stick with AS2. This is unfortunate, as AS3 has a number of advantages over AS2. While AS3 is somewhat more complex than AS2, it is not prohibitively so, and the time required to bring oneself up to speed with AS3 is well rewarded.

Learning ActionScript 3.0, by Rich Shupe and Zevan Rosser is, overall, a great introduction to AS3. The chapters are well organized, with a quick run-through of some familiar ActionScript concepts and code. If you’ve written any ActionScript before, you can skip this part, or skim through it just for some reassurance that not everything in AS3 is completely different from what you already know.

The subsequent chapters cover major aspects of ActionScript programming, ranging from graphics to sound and video to loading pretty much any sort of data. For example, the new display list in AS3 is thoroughly and clearly explained; as somebody still relatively new to AS3 I found this to be a pretty significant change to the way I think about Flash, so I appreciated how well the authors covered this part of AS3. And if you think that everything in AS3 only got more complicated, this book is worth it alone for the chapter on working with XML. These and other topics are explained clearly and thoroughly. The authors are both teachers at New York’s School of Visual Arts, and their experience as educators shows through in their writing.

A neat aspect of the book is how it gradually transitions you into thinking about Object-Oriented Programming. For many people, the thought of having to do this with AS3 can be pretty scary. Initially, the code samples are meant to be placed right on the timeline. But part way in you get a primer on OOP. The book explains the concepts behind OOP very well, and gives the right amount of information - enough to get you going, but not so much that you’ll get scared off at the thought of OOP. The code samples are no longer on the timeline, and suddenly you’re working with object-oriented code, and it makes sense.

Those who are already familiar with AS2 will probably get the most out of Learning ActionScript 3.0. If you’re new to programming, and not just new to ActionScript, then this probably won’t end up as the primary book you’ll use to learn how to code. For example, topics that would normally get their own chapters in a ‘learn how to code’ book, such as variables, get only a section of a chapter by way of introduction. If you’ve already done some coding, this will be enough to reassure you that not everything is significantly different in AS3, but if you’re new to programming, you might want something that spends a little more time on the basics.

In addition, the book would have benefitted from another round of proofing. There were a few typos that, although minor, were a bit of a distraction. The typos that I came across were pretty minor - nothing that you won’t immediately notice, but it’s too bad that they’re there in the first place. And to be fair, I think I noticed only about a half-dozen throughout the book. (By the by, the errata page at the book’s companion web site is much more complete than the page on O’Reilly’s web site.)

Obviously, if the most significant criticism I can make of this book is that there were a few too many typos for my liking, I think it’s a very good book. If you’re looking to make the jump into ActionScript 3 coding, Learning ActionScript 3.0 is a great place to start your education.

21 October 2007

Book Review: Foundation ActionScript 3 Animation: Making Things Move

Filed under: ActionScript, Book Review, Flash — darren @ 10:47 am

Foundation ActionScript 3.0 Animation: Making Things Move is a new edition of Keith Peters’ Foundation ActionScript Animation. The main difference, implicit in the title, is that the code in the new edition has been updated to use ActionScript 3 in Adobe Flash CS3 Professional.

If you’re familiar with Keith Peters and the tutorials on his bit-101 blog, you’ll have some idea of the kinds of things covered in this book. Creating animation with ActionScript is all about math, and this book dives right in. Peters’ writing style is clean and direct. Even if you’re not comfortable with math, difficult concepts are explained clearly and simply. I already have other books on my shelf devoted just to physics and trigonometry, but “Making Things Move” comes very close to replacing those altogether by with its effective explanations of the concepts behind the code.

After the introductory chapters, which include an AS3 primer (more on that below), Peters begins by covering the most basic type of animation. Subsequent chapters build on the foundation created by the previous chapters. As new concepts and formulas are introduced, what started out as a simple ball moving across the screen becomes something much more sophisticated. In a relatively short period of time, you’ll have multiple objects zipping around the stage, colliding and interacting with one another. Seeing those basic elements repeated and tweaked helps reinforce what you learned earlier on.

This edition follows the same well-structured format as the previous edition. Each chapter covers just the right amount of material, so you never feel like you’re taking in too much at a time. Like any good book on programming, it encourages and rewards a leisurely pace. Simply running the sample code to see what it does before moving on to the next section will teach you something, but it won’t exhaust what you can get out of this book. Peters points out where you can experiment with the code, suggesting values that you can change to see what effect it has on the animation. Playing around with the sample code will deepen your understanding of what’s happening, so it’s worth taking your time.

As I mentioned earlier, the book opens with a short primer on ActionScript 3.0. If you’re at all familiar with Object-Oriented Programming in ActionScript 2, the primer does a nice job of bringing you sufficiently up-to-date with what’s new/different in AS3 to help you get the most out of the book. If you’ve never done any OOP with ActionScript before, the chapter provides enough information to get you going, and you can use the framework Peters provides and concentrate on the animation.

(If you are familiar with AS2, and don’t see yourself making the jump to AS3 in the very near future, I’d recommend that you buy this book instead of the version specifically for AS2. The principles are the same, and the code can be ported to AS2. Plus, when you finally do start working with AS3, you’ll be ready to go.)

Besides what you’ll learn directly, this book is valuable for the ideas and inspiration it provides. I didn’t get very far into the book before I was adapting the code to work in my own projects, and also thinking of games and user interface elements that I could build around some of the concepts in the book. Just one such idea can repay your investment of time and money. All in all, if you have any interest in using ActionScript for animation, this book belongs in your library.

Powered by WordPress