I have been vexed for some time about closing a gap I have felt with, you, my audience (4th wall is hereby broken). I diligently pursue making my content, thoughts, and works accessible to those who do not have a computer science or math background. I do look for ways to encourage or inspire the hobbyist programmer and present Flash to those that might not even know a programming language – I do have code samples and downloadable source on this site. My mission for this blog was to be a journal of my projects, ideas, experiences, and share my discoveries along the way. I do not intend to create an instruction manual, teach programming, or provide game development materials – at least not in blog form (its chronological nature just doesn’t lend well to a course of study or reference guide). However, since I can now convince people to pay me to program in Flash, I can certainly put you on the path to master this platform.
I recognize that I am several leagues away from the beginning programmer, or even a programmer acclimating to a graphics rendering engine.
By the time I happened across Flash I had already learned several programming languages and worked with a couple game engines, which I guess I should also mention – I am primarily interested in building games. I still have a tattered looking copy of Flash 8 ActionScript Bible (ISBN: 978-0-471-77197-5) heavily bookmarked: working with dates and times, event handling, programming tweens, adding MovieClip objects to the scene programmatically, determining if objects overlap and converting coordinate spaces, writing filters, working with text and html, and implementing sound.
In reviewing these books I am attempting to evaluate both the utility for the naïve Flash student and unique insights for the advanced crowd. I still claim that the best way to learn is by doing, getting your hands dirty and trying to build things, but when you are pioneering new territory I have often found books to be the best and most reliable resource (and why not browse them when your company has a wide selection available for your convenience).
They are; however, just books – they are not magically transformative experiences that will mutate you into a Flash guru. Be realistic! You should be looking for something to form a solid foundation of knowledge that you can expand upon, and hopefully inspire that expansion. If there was a tome capable of creating super beings that could craft the next Gears of War, Zelda, Super Mario Bros, Medal of Honor, League of Legends, or Farmville at a whim – odds are that it would be selling for more than $50. It is rational to believe that there are materials out there that can elevate your flash skills or game programming knowledge to get you over the tipping point so that you can build your own games.
In no particular order…
How to cheat in Adobe Flash CS5
Just because I am a programmer there is still utility to gain from reading a book about the art side of things; especially when the book is written by an artist and animator actively working ‘in the trenches’. Game development is a very communal and cross disciplinary activity. Even if you never plan to create any original art assets you should know the basics of the artistic development pipeline, what is easy for them to build, and what is difficult. Most of the time you are on a team with diverse and specialized talents, you should always be trying to direct your efforts for the most efficient role to tackle each challenge. For example, there is a new deco tool in CS5 that just generates some nice effects like fire, smoke, and even lightening – which could save loads of programmer time implementing a particle system or any technical solution to accomplish that kind of effect. If it looks good and saves time it is win-win.
I really enjoy how direct, honest, open, and how well laid out this book was in its construction. All of its lessons were choreographed as full two page spreads so you are not fumbling with turning pages while you are trying to practice. The author, Chris Georgenes, shares his entire methodology and pipeline. He often starts with paper and pencil, scanning, and then tracing his work; or starting with basic two dimensional ovals or rectangles that he will morph, distort, push, pull, skew, and join into more complex objects.
While his forte is exporting animation for television spots, it also had some discussions on optimization and using Flash for other mediums. I have been using the ‘trace bitmap’ function for years, but this book let me pick up on a new trick ‘optimize curves’ (Modify -> Shape -> Optimize to open the panel – and it has a preview!), and it has already paid dividends in my work.
There were also some clever approaches on all of the ways you could implement a shadow for your artwork. One of which was a drop shadow filter with the ‘hide object’ property set. This is probably a bit expensive, but easy way to handle keeping a shadow in sync with an animated object (if you were going for a high end shadow instead of just a simplified blob). It was definitely an enlightening moment where previously I didn’t see a real use for an option Adobe provided us with.
He has some great links from some of his flash technical presentations and articles:
http://my.adobe.acrobat.com/p46515568 (screen capture of his desktop while he works)
I was even a bit stunned at his savviness when I read the example using the spray paint tool linked to a custom rigged grass model, to elegantly fill a scene with a lush animated landscape. Again, might be too much overhead for a game (maybe you could squeeze it into a cut scene), but I will never look at the spray can tool the same way again.
You are not going to find any ActionScript in this book other than the simplistic event handling, and loading that an artist or designer could handle. The focus obviously is not programming but art and animation. It was nice to read a book created by a ‘doer’, learning from someone that has worked with flash every day for a very long time. As opposed to the normal fare you find that feels like Adobe Propaganda selling us help extensions that should come with the product or written by a professional book writer. Flash, and games in general, is really about art and technology coming together, and it was a worthwhile read for the insights into the artistic realm of production.
Adobe Flash Professional CS5
It starts off with a ‘grandmother granularity’ level of instruction of the flash professional application. It was a little mind-numbing to walk through every last art tool and menu panel, as well as how to open and close files in their ‘jumpstart’. This might be the book for you if you need that level of hand holding, but they really do not make any attempt to liven it up with goals, objectives, or when this information might be relevant to you. It is not going to be an experience of learning by doing. It was 150 pages before you even tackle anything more sophisticated than static graphics; and page 350 before you are asked to wrap you head around the movie clip object and nested or multiple timelines. The ActionScript section certainly left something to be desired. It is just the simplistic concepts of timeline controls and button handling to make simple web page types of Flash projects.
It was a really dry, very broad sampling of Flash that really didn’t go into much depth in any one area – I am struggling to think of a real audience for this book; perhaps the person that wants to learn the application but has no goals to do anything with it? I find it hard to believe that knowing how to create custom keyboard shortcuts is more valuable to people than covering more art or programming topics. Furthermore, while the authors were older and have been using Flash since ‘the beginning’ (which was originally exciting, perhaps they are true experts), there is a feeling that they have not really kept up with the technology or no longer use it on a daily basis.
Even when you have cool things to say you can’t afford to be dull these days, this was as dry as reading a manual for self-assembled furniture as well as verbose and lacking meaningful content to boot.
Real World Flash Game Development
It assumes intermediate experience with Flash or another game development platform, its introduction states that its goal is to feel totally comfortable tackling the development of a game. This book is starting to get a little dated since it was originally written at the time CS4 was released.
It is very honest “the first thing to know about Flash is that it was never designed to develop games” in discussing the platform at large. There was a high level but excellent conversation of debugging, benchmarking, and needing to write your own libraries for sound and physics as Flash weaknesses; as well as discussing some things that Flash does really well. Latter in the book he actually walks you through writing a sound manager as well as very basic collision detection (I found his math a bit lacking in that section). A concept worth repeating is that Flash is intended to appeal to a wide and diverse audience of web developers, animators, advertisers, and standalone applications with air. You naturally end up with many paths to achieve a single objective; a big part of game development with Flash is learning which of those routes you want to avoid traveling.
There was an entire chapter on planning, which left me feeling empowered and excited to do a better and more thorough job in the future. You would be surprised how many clients, business types, and producers seem to lack any semblance of a plan – or have no idea how their perceived objective meets their goals.
There is a decent conversation on basic programming in the first section of the book. Reviewing the atomic pieces of code, data structures, and key systems including filling in the details on some of Adobe’s documentation – it had the clearest presentation of how Flash’s garbage collector works. It is a nice presentation of core programming fundamentals that you should continue to pursue and master.
There were some interesting tools and tricks. This guy is another Greensock TweenMax user, which in my experience is the best 3rd party tween engine out there (carefully read the license though, it isn’t free to use in all cases). He also goes into discussion on ‘addFrameScript’ so that you can completely remove all timeline code from MovieClips. There was some interesting audio optimizations that I want to experiment with, he claims that playing many MP3s can become taxing since they uncompress in real time and you can get performance gains from using the more memory heavy ADPCM compression for you short lengthed sounds (SFX).
He walks through the source for some very simple games, a no frills platformer, a crossword puzzle, and a sliding tile puzzle throughout the book (you expand and add to them as you learn more). He doesn’t come right out and say it, but improving or modding an existing game is one of the best ways to learn (well, if it is well written and commented). It is well worth your time to have decent toys to play with and pick apart. I will follow his suit as well and encourage you to not copy, steal, or blatantly re-release a game. There is also a great section on protecting yourself from hacking and cheaters.
This was a pretty respectable read, not perfect but very solid. Something might just be individual tastes, like he prefers using weak keys for references and I am stanchly seated in the opinion that all things should have formal destructors. The author, Chris Griffith, has a background in the advertising world, and like many of the gaming books out there seem to lack that step from hobbyist game development to writing really professional games that can scale. However, no one starts off as a super star, if you have never built a game before this will set you up with all of the basics and get you rolling with some tangible projects.
ActionScript 3.0 Game Programming University 2nd Edition
Author Gary Rosenzweig sounds like your old school game developer that had the drive and conviction to self-teach himself programming and game development from a young age; working on his passion after hours and on weekends until computers and the internet grew mainstream enough that he could start his own company and make games full time in 1996.
He is very clear that the core audience for this book is expected to already know animation and programming but want to move forward into developing games, and you should also have some familiarity with CS 5; explicitly stating that it is not geared towards first time programmers. He is a MAC user, and for the most part sticks to Flash Professional as his development platform for the book (which is probably a smart move, master Flash Professional first before tackling Flash Develop or Flash Builder or any of the other IDEs springing up).
He won me over right away with actually making his introduction a “Hello World” project. Then he continued to resonate with me for his use of checklists. Even as an expert, there are a lot of things to remember and a lot of places where you can get tripped up. There is no shame in maintaining a checklist, building and adding to it over time. Why wouldn’t you do something if it improves the quality and efficiency of your process? If it gets results, put it into practice! Here is his general walkthrough:
Publishing and Document Settings
Document class set correctly
Publish Settings – is Flash 10, AS3 set?
Class, Function, and Variable Names
Remember Case Sensitivity
Are MovieClip class files present?
Do classes extend the correct type?
Is the constructor function set to the right name?
Are you setting properties before an object is ready?
Are you cleaning up objects when you are done with them?
Are all variables well typed?
Did you remember to include all fonts?
Do you need to disable keyboard shortcuts?
Have you tested at other frame rates?
Have you tested from a server / live environment?
I actually made a formal checklist this year for code reviews, you are welcome to incorporate and nurture your own process from this example:
*Is everything typed / casted?
*Are there enough comments?
*Do things feel like they are logically in the right place / where you would expect to find them (are things well named)?
*Have extraneous import statements been removed
*Do all classes have a destructor and a toString function?
*Are all important display assets named (DisplayObject.name property set)?
*Are assets in the fla library organized in folders and named (export and linkage names should match)?
*Are there any optimizations for CPU possessing or memory (liberally use //TODO comments on sections planned to be revised)?
*Identify sections of code that might not scale well (this is a solution for 100 objects, not 100,000 objects)?
*Handle issues that could cause the code base to not fail gracefully – if something is s a show stopper it should log a complaint instead of just failing, are preventative measures being taken to deal with invalid or incomplete data, are there adequate regulations in place for user input / externally loaded data?
You are building some things and working with flash right away (programmatically adding MovieClips objects, making buttons, creating text), I see how it could feel rushed or create a slow progression environment if you have zero experience. This is partly the nature of programming. You should feel curious, you should want to tinker, pick things apart, and experiment. It is something learned best by doing. A programming book should compel and encourage you to take frequent breaks to explore the topics it presents.
After the ramp up section it is just one game example after another. I like his approach to building games, constructing the core mechanic then layering additional features like sound, animation, user interface, or expanding upon the core mechanic incrementally. Each example tends to teach new programming concepts, so you could partly think of it as learning to program with games. Some of these later lessons are things like recursion, data structures, physics, motion, and handling external data. The only drawback is perhaps pushing through an uninteresting game to learn critical topics.
Things remain pretty simplistic, the book uses many small examples from a wide selection of game types. Just be aware that advanced optimization and construction techniques are not addressed. I think that this example rich and hands on learning approach is probably the best way to teach the subject matter, but there were some places where content disappointed me.
It has become a very undesirable thing to have multiple frames on your main timeline of large applications like games, which plague all of these examples. Most of us avoid using the Timer class, it just does not have the precision that you would expect, you are much better off using the date class. I saw pretty liberal use of the ‘onEnterFrame’ event listeners which are really expensive, typically you try to structure your code so you only have one master listener – I saw one case where he had an enter frame listener on every projectile, scary stuff. I suppose it is a minor flaw that he refers to hitTestObject as bounding box in discussing collision detection. It is actually axis aligned bounding box and there is a significant difference between the two.
Again, just because I have my own particular tastes doesn’t mean I am right and he is wrong. I just feel the need to reiterate that while this might be one of the better books out there it is only the beginning. I also feel the need to make you aware that there can be a big difference from these small scale mini games and the next level of game development. If all you need to do is make something small, or just experimenting with some game concepts, or are just a hobbyist and do no care how your game runs on other systems you have significantly less overhead and performance concerns to worry about. Quick and dirty development has a place; you just need to be aware that it is dirty.
Their self-stated purpose is to provide step by step instructions for every flash feature, as well as when and how to use them; designed for readers of every skill level, except the super advanced programmer. I checked out their source code provided on the book’s website page, none of them had an external ActionScript file, I wouldn’t have thought of that as super advanced. Again, this is a really dry read, walking through every little feature and panel. I think that it is the first book that I have read that actually described clicking on the mouse in order to select things. The author of this particular book is in advertising and design, and it shows.
I thoroughly enjoyed reading the following ‘color commandment’: “Black text on a white background is popular for a reason. Any other color combination produces eyestrain after as little as one sentence.” – which was written with black ink on a grey background tip box. And he repeats himself on this subject, again on a black on grey tip section when talking about font sizes. While I find this humorous, I do appreciate his honorable attempt to impart some design and usability principles – but perhaps this book isn’t the best platform for that.
As I am sure you can imagine, this is another book that ends up being really lite on programming, the introduction to AS 3.0 isn’t until chapter 12, page 395. To his credit he does discuss how to set up separate ActionScript files, and mention that it is the proper approach for large projects, object oriented programming, and for working with more than one person; but again seems to regard it as a very advanced way to work.
Another book that teaches and describes the platform but only scratches the surface on using the platform; whether it be for games, animating, web pages, or something else. It feels like you are already expected to have that ‘other skill’ and how to employ it would be obvious. There do not seem to be many resources out there like learning to program ActionScript with CS5, or discover digital drawing and animating with Illustrator and Flash. There also seems to be very few books to transition expert programmers from another language to ActionScript.
One solid take away from this book was a decent listing of ‘Flash Guru Sites’:
http://flashthusiast.com/ (last blog post over a year ago)
http://www.keyframer.com/ (our friend from How to Cheat in Adobe Flash CS 5)
ActionScript 3.0 Quick Reference Guide
Each of the authors, David Stiller, Rich Shupe, and Jen DeHaan, have fairly compelling websites: http://www.communitymx.com/ http://www.learningactionscript3.com/ I would definitely check out this resource section of learning ActionScript 3.0: http://www.learningactionscript3.com/resources/ http://flashthusiast.com/ (Again, last blog post over a year ago)
This is another book published when CS4 was released, and its main focus is converting ActionScript 2.0 users to ActionScript 3.0, they state that it is “aimed at relatively experienced ActionScript 2.0 coders”. If you do not know ActionScript 2.0 there isn’t much point to learn it, and needing that kind of context could make things quite confusing to pick up AS 3.0 if you are new to Flash.
The book immediately jumps into AS 2.0 versus AS 3.0 referencing dynamic classes, scope concerns, the delegate class, method closures, ECMA script regulations, regular expressions, namespaces, the new event model being a Document Object Model Level 3, and the new display list structure. While I appreciate the formalness, and it was a nice change of pace from the less elite programming books, it was a lot of fancy names to start throwing around. I dislike the idea needing Google to digest a book, I remember when they were supposed to be complete and self-contained chunks of knowledge.
One thing I did appreciate was their discussion, backed up with hard data, about the speed and performance of the different virtual machines. I have noticed that Adobe seems to have a trend of releasing new features that start off running slower than existing code then it gradually speeds up. Numbers for a long time were still faster than int and uint. Dictionaries used to be really slow but have improved over time.
I like that he talks about reducing that main timeline to a single frame, working with a document class, and how us older CS3 users could never get away from inserting something like ‘var application:Main = new Main();’ on frame 1. But again, if you do not share that nostalgia, or unless you really like filtering out all the opening sentences that start “remember how we did things back in the days of AS 1.0 or AS 2.0…” it could be very distracting to learn AS 3.0 (they are very different languages).
I found it kind of lacking in some really important areas. Sure I guess you know the official terminology for the event model, but does that really help you use it. For example, in the discussion about the display list it never really describes what it is, assuming you already know how graphics are organized. Nowhere does it mention that a display list is a tree structure, or that child objects inherit coordinate space (position, rotation, and scale) and rendering properties (visible, alpha, filters) from their parents and how powerful that can be and the importance of proper organization (separating scenes with different display object containers, or in the case of games separating your user interface from the game space).
Again there are examples, but none of them are particularly deep or meaningful. You might learn all of the tools at your disposal as a programmer, but you miss out on the knowledge of when to employ different strategies and organization tactics. If you are already a competent programmer that knows ActionScript 2.0 this could be a great book for you to pick up ActionScript 3.0. Its value is significantly diminished for any other audience.
It claims to be the only book that had exclusive and unmitigated access of Adobe’s engineers during its writing and editing, with a programmer specific perspective.
Of all the books on ActionScript that I have read, this one had the best programming introduction; it really covered all of the fundamental programming concepts. Is one page on recursion really enough to convey the concept? Does knowing what inheritance is and how to use super and override make you a professional at OOP? Are you really a programmer if the only data structure you know is the native flash array? Perhaps not, but at 450 pages there is as much knowledge as you would find in any introductory programming textbook. It also includes some ActionScript 2.0 migration notes, but they are thankfully separated out from the main text.
With so much emphasis and time spent on learning the language there is not a ton of space left over for applying that knowledge you just acquired (it might seem like a less fulfilling read), but I would recommend this book to any beginner.
ActionScript 3.0 Bible
I am probably going to be a bit biased here; I actually own a copy of this book.
It won’t teach you anything about building games, but it has a great level of detail and examples that I haven’t seen in other books. I used this book as my transition from AS 2.0 to AS 3.0. It has a brief programming ramp up listing the core elements of ActionScript 3.0, but I didn’t need to learn how to program, I needed to learn AS 3.0.
There really is no ultimate book out there that covers everything, and they completely run the engagement gamut from ‘how to reference manuals’ to learning by doing with examples. I wouldn’t regard any of them as perfect or complete. If you were completely new to programming I think I would have to recommend ‘Essential ActionScript 3.0’. However, I feel the need to reiterate that a couple of pages on data structures or object oriented programming or algorithm design is no comparison to going to school and spending an entire semester devoted to those topics – it would be so easy to overlook some huge concepts. None of these books would prepare you for designing large data flows or constructing big object oriented project. Programming is something that just has to be learned from experience and examples. Despite its flaws, if you have some programming knowledge I would have to recommend ‘ActionScript 3.0 Game Programming University 2nd Edition’ if you want to start dabbling in games. Each of these books have some valuable tidbits of knowledge unique to them, and I still trust book code more than random code posted on the internet. I have yet to see any text in book form out there at the really elite levels of programming and game development specific to Flash. You might be better off mastering a more traditional language, or looking at high quality open source projects out there in other languages, and transitioning that knowledge to Flash.
Thanks for reading, and remember, we are all in this together.