Brown's Flex 2 with ActionScript 3.0 an unfortunate disappointment

Looking for a new Flex book to recommend to my readers, I picked up a copy of the Essential Guide to Flex 2 and ActionScript 3 by Charles E. Brown. Until today, I’ve been more than happy with Flash books published by Friends of ED. This book comes in at nearly five hundred pages, but to be honest, I could only read the first hundred and fifty pages before I wanted to stop. Each of the five chapters I read left me wondering if the author wanted to focus on absolute newbie programmers or more experienced developers transitioning from other languages. Even worse, a lot of information was misleading enough to be considered downright wrong.

Chapter 1 starts with an introduction to Rich Internet Applications and ends with the installation of Flex Builder, the ColdFusion Extensions, and Flex Data Services. It’s a general starting point that I would expect from any book about Flex. The second chapter gives the reader the real first look at Flex. This is the point where one must explain a technology to those unfamiliar, and an author needs to properly represent what he or she is teaching. Unfortunately, as the following explanation reveals, Brown leads the reader in the wrong direction from the beginning:

The Flex application framework has its very own tier structure…. At the very top is MXML and ActionScript 3.0. This is quite significant because it means Flex is using the two most popular tools in web design: XHTML and object-oriented programming (OOP).

First of all, MXML isn’t XHTML. I can only hope the author meant XML. However, I wonder if he meant to make a comparison between MXML and HTML so that web designers and developers would have a point of reference. Ultimately, he says that Flex “is using” XHTML, which is true in that an HTML-based webpage will host the SWF, but this has no connection to the MXML at all. Additionally, he mentions that Flex uses object-oriented programming through ActionScript 3. While completely true, the connection between AS3 and OOP has no relationship to the connection between MXML and XHTML. Some might tell me that I’m looking too closely into the details here, but for someone who has never encountered Flex, the initial description needs to be concise and accurate. Consider the following revision that I made. I believe it leaves the reader with a clearer picture of Flex while actually including many of the different interpretations I considered above:

At the very top is MXML and ActionScript 3.0. This is quite significant because it means Flex is using the two most popular tools in web design: the markup format XML and object-oriented programming through ECMAScript, the same standard on which JavaScript is based.

As I mentioned, I had trouble determining the audience at which this book is targeted. Being so large, and brimming with code samples, I would expect a more technical audience. However, the author constantly compares Flex to very design-centric features of Flash Authoring and other Macromedia products, and I imagine a Java or .NET developer would have trouble wading through these types of things.

The early examples and descriptions seem to assume very little programming knowledge on the part of the reader, and Brown explains, in great detail, every new change and addition he makes. He goes as far to tell the reader exactly how the tag structure of XML must work before he writes his first bit of MXML. Very few developers will have no knowledge of XML, and the introduction of such a basic data format seems even stranger when he adds a highlighted block aimed at transitioning developers a page or two later. He says, “If you have ever done Java programming, an analogy can be drawn to the main method.” Let me add, by the way, that this comparison notes that the main Application MXML file is like the main method. While true, in an odd sort of way, comparing the main container, written in a markup language whose purpose is to layout subcomponents within more containers, to the entry-point of a Java application is one of the stranger things I read in this book. At the moment I read it, I was just starting to think (again) that the book’s focus was on designers (who aren’t likely to be writing Java applications).

Ultimately, the book fails from a lack of focus and too much extra content. Several of the first examples detail the same steps (including screenshots) for creating a new Flex project. As mentioned previously, the author explains the most basic concepts, like the structure of XML, while adding pointers for developers who would most likely have gotten bored and skipped the early content anyway. Finally, imprecise comparisons muddy the waters and could probably cause a lot of confusion. I can not recommend Flex 2 with ActionScript 3.0 because I believe Flex should be presented in a very different manner.

About Josh Tynjala

Josh Tynjala is a frontend developer, open source contributor, bowler hat enthusiast, and karaoke addict. You might be familiar with his project, Feathers UI, an open source user interface library for Starling Framework that is included in the Adobe Gaming SDK.

Discussion

  1. sander

    I also bought the book because I assumed it was focused on more experienced developers. I’ve looked in it once and now it’s collecting dust somewhere in my room. So people if you are experienced in as 2.0, java etc DONT BUY this book.

  2. Tim

    I guess the author isn’t completely off when describing MXML as XHTML since XHTML is built on top of XML, but definitely the first time I’ve heard the two in the same sentence. Maybe it would be more appropriate to consider MXML a sibling of XHTML since they are both based on XML?

    “By adding semantic constraints, more specific markup languages can be build on top of XML, among them XHTML”

    http://en.wikipedia.org/wiki/XML

    Definitely not the way I’d describe MXML though.

  3. Vince

    I also bought the book and i have read the first hundred pages. Like you i noticed the xhtml/mxml issue but it doesn’t really annoy me. I come from design rather than development and i found this book very clear (of course java comparison don’t speak to me… but since Colin Moock’s books i am used to this kind of comparison) and quite well written. Since english is not my primary language this last point is important for me.

  4. Josh Tynjala

    I should note that the XHTML/MXML comparison isn’t the only issue I encountered. It is one of many that bothered me, and I just happened to share that one as an example.

  5. ianM

    I didn’t think it was that bad. As a long time programmer I was looking more for a quick example of all the main techniques which I think I got. I could gloss over the ooutline descriptions and just look at particular techniques that I was interested in. I had a few annoyances with it though. It was a bit strange going from ArrayLists to the power of e4x and then not using it in the rest of the book. The examples were detailed in the code listings initially but petered out later. I also went to the website for updates but nothing is there yet. Too early maybe.

    I still like to look at books rather than buy blind from Amazon, so with any of this type of programming book, I would advise programmers to see if it suits them. It is easy to read, as a plus point.

  6. ianM

    I have read more of this than the Actionscript cookbook, which I found a bit boring and more difficult than resortng to Google for code snippes.

  7. Pingback: Developers will swear by Programming Flex 2 » Zeus Labs