THE PASZ.COM BLOG

Saturday, February 24, 2007

My FlexBuilder 2 Review

With ActionScript 3 and the Flash 9 player, Adobe has taken their Flash platform forward by a quantum leap. Flash is now a serious solution -- some would say the superior solution -- for developing browser-based applications. It is now possible to do Flash programming entirely using standards-based languages: UIs can be laid out using a dialect of XML, and the ActionScript language has been completely renovated and made compliant with a recent draft of the ECMAScript specifications. Pretty much the only thing you can't do is interact directly with the user's desktop PC (but this is coming soon with Apollo).

I've spent a lot of time exploring open source Flash development options (OK, you can call me stingy), but I finally decided to take the plunge and purchase FlexBuilder 2, Adobe's high-end IDE. FlashDevelop was my tool of choice for ActionScript 2 work, but their current solution for writing ActionScript 3 is imperfect, and there's no indication when their next major release will be out.

After playing around with FlexBuilder for a few days, I am very pleased with the product. The Design Mode is surprisingly good. I was able to lay out components extremely quickly. In fact, the auto-alignment functionality is an improvement over what's in Flash 8. It's really satisfying to be able to drop a button into a layout and "nudge" it into the right place without having to fiddle with exact pixel values. Customizing controls is also easy... at least in so far as making minor adjustments to borders and colors. Designing a UI that does not look "flex-like" I'm sure will be a lot more work.

The two major ingredients of the Flex development process are MXML files and ActionScript classes. I expect that becoming comfortable with MXML will be a major hurdle for Flash 8/AS2 developers. It turns out these two things are one and the same; once I made the connection that MXML ends up compiled down to ActionScript the whole framework started to make a lot more sense.

The changes to the ActionScript language take some getting used to, but are much-needed. Many inconsistencies that have built up over the years have been eliminated. For example, MovieClip properties no longer have an underscore before the property name. In general, things have been made more object-oriented and legacy features of the language have been eliminated. A detailed list of the changes can be found here.

The coding support in FlexBuilder is on par with FlashDevelop. So far my favorite new coding feature is that the editor adds in "import" statements for you automatically when you declare a variable using that data type. I love clever things like that.

The FlexBuilder 2 IDE is based on the Eclipse platform, which is an extremely powerful and extensible framework upon which just about any kind of IDE can be built. Unfortunately, Eclipse is a double-edged sword. On the plus side, it provided Adobe's developers with many excellent features right out of the box, including CVS integration. Unfortunately, there are some aspects of Eclipse that are quite arcane, and are sure to be off-putting for less experienced developers. Open the Preferences dialog box and you'll be overwhelmed by numerous inscrutable options related to "Perspectives" and "Workspaces". Also, for some bizarre reason, Eclipse has never supported Word Wrap. Even on a large monitor, this can be irritating because ideally you'll wan to have Flex and the browser window visible at the same time.

Another drawback of Eclipse is that it is a serious resource hog -- typically eating up 300MB RAM on my system. That said, my aging 3.2 ghz Pentium PC with 1 gig of RAM is able to run the program perfectly acceptably.

I was disappointed that FlexBuilder cannot launch an SWF file within the IDE itself, but instead you need to launch in a web browser. FAMES already demonstrated that it is possible to run an SWF within Eclipse, so hopefully someone will develop a plug-in for this, but I would have expected it to work out of the box. Also, you can't pipe trace messages into the IDE. Instead they're logged to a text file. Fortunately, there is a plug-in for Firefox that displays traces in the browser.

The documentation is quite good. I was pleasantly surprised to find that my boxed copy included an informative 200-page "Getting Started" guide. For the most part I was able to find what I needed in the Help -- and I definitely needed it! The one thing I would have liked would have been more information for ActionScript 2 developers transitioning to Flex, especially related to using MXML.

Flex is designed for professional developers first. Those not comfortable with OOP, or those who haven't dealt with a complex IDE like Eclipse, are going to face serious obstacles. However, for programmers who already have significant experience with Flash, Java or .Net, it is pretty close to heaven.

Pro: The most powerful Flash development environment ever.
Con: High barrier to entry.
Final Score: 4/5

An Interesting Analysis of Apollo

Weblycan has a long, detailed, very thoughtful post about Apollo from a business and marketing perspective. It's well worth reading. Yes, I have to admit I am, just like a lot of people, very excited about the public beta that's just around the corner. It's one of the reasons I've been diving into Flex so heavily.

Friday, February 23, 2007

Flash Workflow

I posted these comments on FlashCoders, but I thought I'd share them here as well:

I hardly ever use the Flash IDE, unless it's to make a minor adjustment to something the designer did, or add an instance name. I've found it best to set up workflow where the artists do all the design in the IDE and then deliver the final FLAs and SWFs in an "Assets" folder. I build the application in FlashDevelop/MTASC and load in all the assets using the MovieClipLoader Class.

I centralize all code in .as files, but I also allow the designers to put their own code in their FLAs if they want to. Usually they can do this without stepping on my toes. This is the beauty of Flash. In some cases, their FLA becomes a prototype, and I'll end up migrating their code into a Class, but other times that's not necessary.

I've avoided Compnonents (with a capital C) because they're too difficult to customize, though I expect Flex will change my opinion on this. However, everything I build tries to be very modular or component-like.

The other thing I've found extremely useful is to put global settings that a designer might want to tweak in some kind of external file, usually XML. For example, timing info for animation. This way, they can tweak variables without having to recompile the App. in MTASC.

Thursday, February 22, 2007

Beginning to see the light...

My FlexBuilder arrived at noon (thanks for the quick shipping, Amazon) and I've spent the better part of the afternoon delving into its mysteries. I think I can finally say that I get it. There is an enormous wealth of potential that's available through Flex. Overall, it's been incredibly fun, and the idea of going back to doing AJAX stuff doesn't seem so appealing.

The part of Flex that still seems the most foreign is definitely MXML. It's very easy to fall into the habit of doing everything via ActionScript, but I'm trying to force myself to embrace the new paradigm. To this end, Twalling has posted some extremely helpful comments on this thread in the FlashDevelop forums.

By the way, SOS Logger, is a great way to trace output from your MTASC and now Flex Apps. This site has the files you need to integrate SOS with a Flex app:
http://soenkerohde.com/2006/11/06/flexas3-logging-with-sos/

Wednesday, February 21, 2007

Finally Ordered FlexBuilder

I broke down and finally ordered Flex 2. After my demo expired, I spent some time using the FlashDevelop solution (and here is the best tutorial for setting it up), but was never fully satisfied. I'm sure FlashDevelop 3 will be a huge improvement, but I can't afford to wait for it to be finished, since I expect moving forward, a lot of my upcoming projects will be Flex/AS3. Also I've got Flex360 and the "Apollo Camp" coming up next month. (Tickets are still available for the latter.)

Amazon had the best price I could find ($459.98) when you factor in their free shipping.

Sunday, February 18, 2007

Web Dev Podcasts

I listen to a ton of podcasts, but have only found a couple good one related to coding. (maybe I haven't looked hard enough...) The Ajaxian podcast is a standout -- they have gotten some great interviews on there. Also, the new The Flex Show has a lot of potential.