I recently had the pleasure of attending a summit on component development for Flex2. I came into it much more as a component developer than a Flex user, so it gave me a great opportunity to learn about some of the lower level features of Flex direct from the source. Since then, I’ve been tinkering around with Flex, and while I still don’t feel as comfortable with it as I do with Flash, I do feel like I have a good grip on when and why I would use it. Being that this is a subject that a lot of Flash developers seem curious about, I decided to post my thoughts. These are my very generalized opinions as a long-time Flash developer getting into Flex 2, your mileage may vary.
Flex 1 / 1.5 never held any interest for me. Development was messy, licensing was confusing and pricing was prohibitive. I felt I was paying $15g for a layout manager, and hey, we have a few of those in our code library already. Flex 2 addressed all of those issues. The development environment is great (for the most part), and licensing and pricing has been completely redone. Flex 2 has definitely piqued my interest.
Terminology
To clarify my terminology in advance, I’m using “Flex 2” to refer to content built with the Flex framework and visual editor, and “Flash” as a more general term for Flash content not built with the Flex framework. FlexBuilder2 remains a very powerful IDE for developing AS3 only content (which is generalized as “Flash” content here). Colin and I were just discussing how there is a definite need to evolve our vocabulary to deal with these new methodologies.
My take on Flex 2
Flex 2 is an amazing tool for building a specific type of project, namely form based applications. You see, Flex is like ground beef, Flash is like the whole darn cow. While it’s completely possible to make a hamburger (form app) with the cow, it’s going to take a lot more work than if you just started with the ground beef. Try making a nice sirloin steak or some cheese with the ground beef though. Sure you could force the ground beef to look, and maybe even taste kinda like cheese, but it would be a messy hack. Flash gives you the power to do a lot more things, but you have to do them from scratch.
Flex essentially builds rich Visual Basic apps for the web – form based, data bound, layout-managed applications that all look alike. And there’s nothing wrong with that – in fact, it’s really awesome how easy it can make building applications. It’s just really hard to inject the magic that a well-built Flash project exudes. I think the coolest Flex projects will be the ones that integrate elements built in Flash to spice up otherwise relatively homogenous hamburgers. Flex will facilitate rapid development, Flash will add the creative magic (yum, cheeseburgers).
Minor frustrations
One of the things that currently frustrates me in Flex 2, and which is a problem with most highly abstracted RAD languages, is that if your project doesn’t fit well in the Flex mold, you spend 95% of your time trying to figure out how to force Flex to accommodate 5% of your functionality. I seem to run into issues like this regularly – one day laying things out and wiring data binding, two days trying to figure out how to make a custom window show up properly. A lot of this has to do with experience, but part of it is just par for the course with this type of development. Again, I think Flash can make some of this easier, by building elements for Flex from scratch instead of trying to force Flex into doing something it wasn’t meant for.
What would I use it for?
We’re definitely looking at rolling out some projects with Flex 2. Even re-writing some existing projects in it. I would never build a corporate site or game in Flex (seriously, don’t do it!), but I would definitely build a corporate intranet. I’m strongly considering moving our (rather slow moving) gModeler 2 effort into Flex, and building a bunch of custom elements in Flash.
Summary
Flex 2 is a huge step up from Flex 1/1.5, and definitely something to investigate if you’re a Flash developer building rich applications. Even if you don’t want to build applications with it, there’s a potentially large market for building components, and custom elements in Flash for Flex developers.
That’s my 2b for now. I might post again down the road after we’ve deployed some projects with Flex.
I’ve enjoyed using/experimenting with Flex 2 since the release last October and you’re right in the analogy of the cow and the ground beef. Flex has a place in RIA development because of the refined components that ship with the framework. Flash has a place as well and is usually my first choice when choosing a tool for a job. Flash has so much more of a broad scope of use but yeah, you have be willing to build a lot from scratch. Nothing wrong with that though. That is half the fun. 🙂
Mmm.. steak.
Thanks for the voice of reason. I’ve felt almost guilty about not jumping on the Flex bandwagon. True enough, it is great for what it does, but I see it as a subset of Flash, not a replacement.
I echo your sentiment. I hope that in the future we will so some applications where the experience is created with Flash/ HTML and then when you get to a form or some panel – maybe on a building or something in a flash landscape- you zoom in and the form that you fill in or the tool that you use within that piece of the project is built with Flex. ActionScript 3 is very exciting though and I expect amazing things to be cranked out of the next Flash IDE. The Flash community has always been amazing at pushing the tool to the edge- now that edge has ben pushed back- way back so that the community can get to developing jaw dropping stuff with more abilities and impact.
As Keith pointed out Flex is no more a Flash replacement than Toon Boom Studio or SWIFT3D or any other tool that allows a subset of the Flash user population to be more productive is.
My 2cents
Mani
Flash developers/designers have the opportunity to make Flex applications much richer and immersive. Having worked with both tools for a while, the best way to make a Flex application amazing is to embed SWF content from Flash authoring.
//Embed a SWF MovieClip into Flex at compile-time.
[Embed(“mySWF.swf#linkageId”)]
var mySWFMClip:Class;
The two tools provide a very productive mix to create RIA applications. The choice is Flex OR Flash but Flex AND Flash. The key is realizing that both depend on the Flash Player and thus anything is possible. Flex productivity with Flash creativity, a deadly combination.
Ted Patrick
Flex Evangelist – Adobe
CORRECTION >>> The choice is NOT Flex OR Flash but Flex AND Flash.
Grant-good post. I think this balance of when to use each and HOW to use Both at the same time will be an ongoing adveture for all of us. Ely Greenfield touches on this in his fisheye post
http://www.quietlyscheming.com/blog/2006/04/14/fisheye-component-v01/
which i thought was a good example of trying to find the balance.
” I think the coolest Flex projects will be the ones that integrate elements built in Flash to spice up otherwise relatively homogenous hamburgers.”
I feel the same way.
My mission is to bring flash to the flex environment and let people know that they dont all have to use those boring ass flex halo styles.
Besides the IDE, don’t open source implementations do about the same thing (like OpenLaszlo)? Shouldn’t a richer toolbox be Coldfusion + Flash instead? 🙂
I guess we all agree. The way to go is integrating Flash and Flex (and Flex Framework). The Problem is HOW? I have been doing some experiments in asset management and at this point I am still not able to transparently integrate components from the Flex Framework into AS 3 only projects, and using swf elements created in Flash inside Flex projects, or even AS 3 only projects is kind of a pain. In Flash I am used to draw some shape, convert it into a symbol and then simply call it from my AS code. Working with FlexBuilder you have to do this strange [Embed] thing over and over again. I am very curious about how others are solving these integration problems.
look at this : http://www.iteratif.net
Great article Grant – We use Flex and Flash together. We want to make steaks, not hamburgers. How do we do this in Flex? We make pictures of the steaks in Flash, then embed them in Flex! After using Flex 2 since Alpha, it has become apparent to me that there is nothing you can do with Flash that you can’t do in Flex 2. The difference is where you are actually developing and who is doing the developing. If a designer is developing, of course Flash is more appropriate. But if you can get the same look taking the Flash SWFs and embedding them in Flex 2, then we’ve achieved the same thing even though we are developers using Flex 2. Plus, we get the extra speed from the new AS3 VM. In the end, I believe the discussion over which is better for development will die down and all will realize that the two products are complimentary at the core. Using that strange “[Embed]” thing over and over (as Julio pointed out) is simply one of the mechanisms for making this complimentary relationship work. Cheers everyone!!!
Thanks for the article. The tricky part for me is the lack of a mac version currently. I am a long time user of Eclipse and currently have a pretty nice setup:
Eclipse 3.2 (intel build)
FDT plugin for eclipse
Subversion
Subeclipse SVN plugin
Flash 8 to compile and add art…
and man it works great! But no AS3… I am about to develop a large RIA that is very graphically intense. I want to utilize AS3…
I guess I am off to buy a Windows XP and use Boot Camp (as painful as that will be)…
Grant, although I agree with your post, it seems like you are talking from a classical Flash developer perspective. Maybe Keith and you are not the main target of the Flex productline because you both, make amazing things more eye candy but not RIA in a Enterprise TI department. I come from that background but always love Flash and the integration possibilities with J2EE backends to show data and provide more user flexibility for data visualization and interaction, but always was too complex and traditional Java developers wouldn’t want to hear about timelines and other Flash tipycal things. It always was too dificult to introduce flash authoring in TI departments, too dificult to form developers in AS tricks and tips.
Now, our landscape could change and, finaly, we have a real enterprise enviroment to develop RIAs with a programming model understandable for clasical TI developers. IMHO, This is the real playground for Flex, the place where Flash fails, and where Flash/SWF content could finaly enter in enterprise through main door, as a powerful and respected tool to build next generation of apps.
Carlos,
I’m not sure if I’m misunderstanding you comment, but it seems you are reiterating exactly what I said in this post. I am definitely talking from a Flash developer perspective (as per the title), and as I said Flex is phenomenal for RIAs, but it lacks the breadth of Flash (which seems to be the point you are making?). Integrating the two can make for some amazing “hybrid” systems.
Yes, Grant, I think the same, “Flash-Flex Hybrids” would be the best option in a lot of case to get the best of both worlds. I only want to point the great benefit for large enterprise of a product such Flex, and that we must see it first from that point of view to understand the necesity of such technology. Sorry if I was reiterating your comments.
Btw, great post about AS3 resource management. It’s a real pleasure read all your articles :).
Best,
C.
Flex is to RIA as Taylor Hicks is to music.
Short lived.
Just not enough leeway for us designers.
I look forward to seeing Flex 5. *that* version may be useful.
John T.
Iowa
The thing that got me thrilled is the fact that you can create an mxml control, place it in the folder of your actionscript namespace, and then let an AS control inherit from the mxml control. That means you can create the visual part of a new and complex layed out control and add the functionality on an inheriting class. The cool thing of using that AS control as an element in the mxml application realy made me chear 🙂 That gives a realy good separation of xml and AS.
The only problem is that, in the beta version of flex 2, the designer view doesnât show a preview of your control.
Excellent article.
I believe the up-side, as Carlos may have been after, is that the Flex environment is more familiar and inviting to developers from other languages that have traditionally disliked flash.
The down-side, however, is that it may encourage developers to only learn flex-related programming. I’ve run into this in the past where a developer is seemingly an expert at working with Macromedia components but can’t build their own from scratch or work on anyones code that doesnt make maximum use of all Macromedia components. As a consequence, a surge of Java developers now tinkering with Flex may lead to even more “Flash bashing” than before.
Am I going to hear “we dont need flash now that we have flex” in the future?
My sentiments exactly. Ever since I made my impulsive decision to buy the Flex 2 Builder with charting of course 🙂 I’ve been scratching my head and saying to myself ” now what is it that I can do with Flex2 that I can’t do with Flash???” and basically it is exactly what you said. I can build fast “ordinary” layouts and functionality with Flex2, but for any WOW appeal whatsoever, I’ve got to build it in Flash and use it in Flex2.
I would love to read an article by you or a tutorial on building custom AS3 classes for Flex2 and even some skinning articles (the kind that require flash and then are imported to Flex).
By the way, the posters Ted Patrick did are excellent, you’ve got to check them out:
http://www.flex.org/download/AS3API_01.pdf