views:

468

answers:

5

I'm familiar with most of the Flash vs. Flex comparisons out there and most of them present some version of "Flex is better for RIA's while Flash is better for design work".

Yet isn't it entirely possible to write elaborate RIA's using the URLLoader class + server side code? In this regard, I'm unclear as to what Flex offers aside from a set of handy user controls.

The reason I ask is that I'm starting a fairly complex Flash piece that needs to take a lot of round-trips to the DB. I'm hoping to avoid introducing a new framework into the equation but don't want to get bit by performance, scaling issues down the road.

Thanks.

T

+3  A: 

If all you need above basic Flash is to make HTTP requests to get data from the server, by all means, go ahead and use URLLoader.

Use Flex when:

  1. You do want that nice GUI library. (This can be as simple as a desire to use Flex's automatic layout facilities, like VBoxes.)
  2. You want to compile your app from the command line, like traditional software. (This is independent of the Flex framework. The Flex SDK build tools can also build plain old AS3 projects.)
  3. You want to build your application in a traditional software development IDE, Flex/Flash Builder, rather than the graphics and animation centric Flash Professional environment.
  4. Your UI is better declared in MXML than built graphically in Flash Professional.
Warren Young
I really don't understand peoples infatuation with #2. Almost any program with a GUI these days have IDE's that obfuscate command-line crap. Including anything on the Mac, 90% of stuff built in visual studio, and basically any game. Furthermore, any command line option is available as a regular old GUI option anyway. That's a very weak argument.
Jasconius
command-line allows for more flexibility when creating a build script (maven, etc.)
Zack
In my particular case, it's because one of the web apps I'm responsible for has pieces implemented in Flex and pure AS3, but is otherwise a traditional HTML/JS app. This app is already being built with Makefiles before being packaged up for deployment on web servers. It makes sense to just check the *.as and *.mxml files into the source repo and generate *.swf files from them along with everything else that goes into building this site. The alternative would be that I'd have to remember to launch some IDE on a separate machine from the package build machine whenever *.as or *.mxml changed.
Warren Young
Arguments #2 and #3 are strange. Using Flex has rather little to do with IDE preference, I've been doing pure as-projects using mxmlc for years, yet I almost never use Flex.
grapefrukt
A: 

If you're going to be making a lot of round trips to the DB, I think it would be a good idea to consider Flex since you'll be able to use the faster and less verbose AMF protocol rather than HTTP/RESTful protocols, which are generally slow and 'heavyweight.'

Hooray Im Helping
+1  A: 

Yes, I guess it would be possible to write RIAs using the URLLoader class + server side code - but Flex makes it easier to write them.

[Bindable]
I believe one of the major features that makes RIA development easier with Flex is data binding.

For example, you can easily assign httpservice.lastResult to the dataProvider of a DataGrid and forget about it. In Flash, you need to manually parse each time complete event is fired and recreate the dataProvider - while this might sometimes be efficient in terms of performance and memory management (provided we design it well), it takes some effort as compared to Flex's way of doing it with a one-liner.

Classes like XMLListCollection and ArrayCollection also makes things easier with flex.

Amarghosh
A: 

Flex provides a pretty decent set of UI controls, which saves enormous time when dealing with large amounts of data. Have you ever built a control in Flash? It's tough to do right and bug free. So that's the #1 reason.

Also Flex, and especially Flash Builder 4, have features existing and upcoming that better interface with data sources of all types..

Flash is meant for presentation/visual/pretty stuff. Flex is meant for data.

Jasconius
+1  A: 

Flash is meant for presentation/visual/pretty stuff. Flex is meant for data.

I beg to differ!

With the Flex SDK you can develop "pure" AS3 code that would do and look the exact same way that something you'd do with the Flash IDE. Flex is an AS3 framework made for developing RIA's but first of all it's an AS3 framework.

Lots of Flex developers were using Flash before Flex/FlexBuilder came out. I just think that if you're into "pure" development and don't need all of the Flash IDE's drawing tools, you'll feel much more confortable with a text editor and the flex sdk.

I use URLLoader in my flex code sometimes, and other times I use RemoteObject or HTTPService, I don't think there's any rule for that.

just_a_dude