At work, there has been a lot of discussion over using either Flex or Flash for projects that need to be done quickly. We are a small design shop of about 20 developers and designers, with a dedicated design team of about 8 people.
Our production manager insists that Flash is the way to go because there are many ActionScript 2 users in the group, and he insists that Flex is just too complicated for our team. The Flash team has won and Flex is now looked with disdain. I find this an unfortunate misunderstanding of the technology. Given that I was never able to participate in this dialog, this is my rebuttal.
Here is my list of reasons developing in Flex is more productive in Flash:
1. Ability to source control – Flex uses the MXML-based format, which is friendlier for programmers. Since a lot of our studio team is on CS3, it means a lot more coordination is needed to synchronize code between people. FLA is a binary format. Flex is a text-based format friendly to source control systems like svn and git. For suzuki.ca, we had 8 developers working on the same code base in Flex without any problems. For Reebok, we had 4 people working on the same project in Flash, yet ran into conflicts and had to manually marge some of our binaries.
2. BlazeDS: Our shop uses a lot of Grails. With Grails, there is a plugin called the Flex Plugin, which allows us to hot compile our Flex files into the deployment server and use Continous integration tools with them. As people keep checking in different files, we can run simple flexunit tests on them to see that they are still valid. Since the Flash compiler is close source, you would have to go through many hacky alternatives to have this level of integration.
3. High level components: Flex takes html components like tables ( grids ) and labels, but also introduces a robust set of components available only with external libraries like YUI and Dojo / Dijit. With Flash, you can really only rely on a textarea component positioned absolutely. With Flex, you can position these elements anywhere on the screen based on a coordinate system. It’s like HTML without all the cross-browser compatibility hacks. Using Flash, you would have to import external component libraries for things like tabs, accordions and navigation panes. With Flex, this is all standard and well-thought out so you don’t have to go through this hassle. No need to license shady third party components to get work done.
4. Browser Integration and Navigation: One of the most challenging aspects of Flash is the incorporation of URLs to dictate the content dictated. With Flex’s BrowserManager component, a flex file can react and influence the generation of URL parameters quickly and efficiently.
5. Native XML Support: Our usual solution involved a lot of content passed back and forth between the server and the flex client. We have chosen to use the content negotiation ability in Grails to return and update server data. Flex allows you to bind data quickly to visual components via a technology called e4x. e4x allows you to take a xml node, say myNode.@name, and bound it to a flex inputfield like ( my syntax is a little rusty because our Flex projects have dried up ). This is extremely powerful. It allows you to do things like inline table filtering and heavy data search without making various trips to the server. It is one of the most powerful, and sadly underused features of this framework.
6. Web Services Support: We use a lot of web services in our apps, and one of the nice things about flex is the built in HTTPService methods that are available as mxml tags. This allows us to quickly load data from REST-sources without much coding. In fact, our remote data acquisition code is usually less than 20 lines.
7. Better CSS Support: Flex uses a CSS syntax that is very similar / identical to the CSS used in HTML. This means that embedding images and adding things like page positioning and drop shadows is very simple. Moreover, Flex provides a technique called Scale-9, which allows you define boundaries around a button, so that you don’t have to skin them again. In Flash, you would have to make each button a symbol. In Flex, you just apply a class. Imagine how much time is saved for CSS skinners just by generating these buttons dynamically.
9. Flash is still an option: Many people like the production manager I mentioned, do not understand that Flash and Flex share a similar underlying model. You can both include movies made in Flash inside Flex applications and have them communicate with each other normally, or put them inside a sandbox. All the Flash graphics api methods are available to Flex components. You can still code transitions in tweener. Choosing to use Flex does not make all your Flash richness go away, it simply provides another tool so that you can choose the best one to use.
10. Better Debuggers: Flex builder is a real Integrated Development Environment based on Eclipse. Flash movie debugging is a joke. If you are writing a lot of actionscript, Flex Builder allows you to inspect your code quickly and identify errors without much effort. WIth Flash, you rely on dummy tools like Flash Tracer and print statements. It’s primitive and ugly. There is a tremendous amount of development effort that can be saved on projects with Flex.
11. Desktop integration: Flex has AIR, which is a runtime that allows you to extend your Flex apps into the desktop. This can be an incredible selling tool for your application, as it means that your code gets to be re-used and extended across platforms easily and seamlessly. Flash, not so much.
Resorting to a Flash only solution will only increase development time, as the wheel will need to be re-invented over and over again to accomplish many simple things that Flex does quickly and elegantly. Unfortunately, there are people that simply do not understand this technology and insist of building everything in Flash.
I am tired of screaming and shouting about this. And it’s very frustrating because you see that there is a better, more elegant solution to a lot of problems being faced in your own team, but you are helpless in solving them because there is just no understanding of this stuff. I’m frustrated and angry. Please explain to me why only Flash must be used. I have no answers.