ActionScript 3.0 Cookbook
Authors: Joey Lott, Darron Schall, Keith Peters
Published: October, 2006
Publisher: O'Reilly Media, Inc. (http://www.oreilly.com/catalog/actscpt3ckbk/index.html)
ISBN: 0-596-52695-4
Pages: 562
Reviewed November 17, 2006
by Kirk Holbrook, Manager
Maine Flash Platform User Group
This is an excellent book. I'd recommend it to anyone using Flex 2 (and eventually Flash 9) -- especially now with the limited resources available for ActionScript 3 (AS3). There are a lot of useful examples along with coherent explanations of why the authors are programming the way they are.
The chapter on XML (chapter 20) is a must-read. It includes concise summaries of dealing with XML in AS3, which has changed significantly from AS2. Generally, XML handling is much easier in AS3, but there are some areas that can be really confusing when making the switch from AS2. This book explains most things you'll need to do with XML in AS3.
The chapter titled "Display List" (chapter 6) also contains critical information for developers coming from AS2. The rendering model in Flash Player 9 is completely re-designed -- a move away from the MovieClip class (although it's still in there) to the new DisplayObject class. The examples provided here give some important guidance on working with the various elements in rendering your project's interface.
I particularly like some of the custom classes available as a free download (of course, you should buy the book for those!). For instance, recursive arrays can be a hassle to deal with, but very useful in many projects. One of the classes includes several Array utilities -- one, in particular, that makes dealing with recursive arrays easier.
Of course, there's a lot of other great stuff in this book. I won't touch on all its greatness, but, again, I do recommend it highly.
That said, I do have a few complaints.They are not to dissuade you from buying the book, but to give the authors some feedback, in hopes that they can improve the next edition.
The authors state that this book is not intended to be an introduction to AS3. However, since it's really the first book to market on AS3, I'm sure that many AS3 developers will be looking to it for some introductory material.
The first 60 pages also seem to reinforce this impression. There are many pages devoted to basics of AS3, like creating functions and classes. Forcing these into the Cookbook scheme seems rather trite in several instances. Take, for instance, 2.5 Creating Subclasses. The Problem is stated as "You want to create a class that inherits from an existing class." And the Solution is "Write a subclass using the extends keyword." Now, if I know I want to create a class that inherits from another class, I'm pretty well along the way to knowing that I want to extend the latter. And I can probably find the answer much more readily in the Flex 2 or Flash 9 documentation. I'd rather see an appendix with documentation on the free-to-download custom classes, than 60 pages of very basic AS3.
In the interest of full disclosure, let me say that I have not read any of the Cookbook developer books lately, so some of my remarks may be a bit off base here. But it seems to me that this title falls short of the idea that I have for a Cookbook. There are a lot of good tidbits in here, like creating custom buttons and the inclusion of several custom class files, such as the already mentioned ArrayUtilities class (along with several other useful utilities classes) and the Cards class. But most of the Problems and Solutions are more like ingredients than recipes.
If I were editor of a book like this, I'd aim for more advanced Problems and Solutions that combine the various ingredients to provide a richer set of problems solved. How about solving the following Problems:
- I want to create a tile based game. How can I work with various sized grids to create a seamless experience for the user?
- I have tons of UI to place in the limits of the users' screens. What are the various ways I can maximize the user experience (view stacks, tabs, and other new containers and navigator classes in AS3)?
- I want to program card games using the
Cards class. How would I program a version of Blackjack?
- I need a reliable and reusable way to hit several web services. What's a good way to split up my code into one or more classes to make this efficient?
Perhaps the Cookbook I'm describing better fits the Hacks series from O'Reilly. Or maybe it's more of an Advanced Cookbook.
But, yes, it's extremely useful. If you're using Flex 2, or plan to use Flash 9, run out and buy a copy -- now!
|