Last year lots of Flash developers wouldn’t think Flex 2 is suitable for web applications – longer loading time because of the size of Flex framework. Things changing at least recently, some big companies began to use Flex applications on their website officially, Yahoo!, Philips. I guess it partly because Adobe promised them before announcing the Flex caching solution inside Flash player. So here comes a question, Flash or Flex, or both?
Creative Flash CS3 is sitting inside creative products list of Adobe, while Flex focus on enterprise solutions. It’s clear when you design/develop with Flash CS3, you have the most creative and freedom to do everything. A simple reason is, Flex actually a house of Flash, a framework with a big collection of Flash classes. In the meaning of creative, you can do everything with Flash CS3 what Flex 2 can do. In Flex 2 you could also change components style, use bitmap images and Flash swfs to change skins and make them much friendly and beautiful. Though you have to do these with cautions in Flex – Flex has its own structures, listeners, display layers, rules.
Development Speed Last year when Adobe announced Flex 2, it was said ‘Flex is Fast’. Yes, make a Flex application within 5 minutes, make something magic with several classes, and you could change style and skins easily. In real productive projects, it’s true for talent Java developers, while not true for Flash developers. Why? For Java developers, with Flex they don’t have to learn Flash drawing/timeline techniques, they can easily move Java code into Flex projects, and soon a nice business application, better then user interface with Java, styling and skinning, transitions and effects, and get benefits of high acceptance of Flash player, how cool and how fast it is! But for Flash developers, why not the same? Simply, it depends. Flash developers will compare Flex applications to Flash web applications that talent designers made, will think about how to make better and perfect user experiences, how to make a beautiful transition that designers hope, will think this is not perfect enough I want to change, will have a favor to work with Flash player API classes, will like to customize Flex components here and there. And how to? If lucky you find a solution by searching google and Flexcoders mail list, or you have to find dig functions/events that you couldn’t find from examples of documents or books, worse you call some mx_internal properties, or push additional listeners for something because of ‘private’ properties you have no right to change and dig their values, the worst, stop and wait somebody do that. A question is: why life is so hard in Flex? It SHOULD be several lines only to change in Flash AS3 classes but in Flex it have to go over more steps and more hours? Honestly, if not so curious the way of Flash designers/developers, Flex applications could be faster than code in Flash(still depends, customers/managers may not satisfied, you have to make those hard parts happen). Be sure to walk on the road of Flex, you can be faster than walking on wild land, and, stop before the red sign.
Performance Although Flex was optimized quite much with Adobe’s own techniques, Flex will at least use more memory, extra listeners, extra resources that might useless for current project. When I opened more than 5 tabs of Flex applications in Firefox, in some case performance became a problem. Maybe they could be changed to ‘silent’ – close listeners, clear garbages when browser window is changed to inactive. Testing Flex is a Flash framework – tested. So you can get benefits from Flex, and save testing time and testers. If you want to make components in Flash the same Flex framework doing – I tried to do some of them before – wasting time. You have no much dedicated time and testers that Adobe engineers had.
So, Flash or Flex? I think these are for Flash only projects:
- Simple, clear structure, more creative.
- No much standard forms, controls.
More likely Flex:
- Bunch of forms, standard controls.
- Stable and functions more important than eyes candy.
How about Both? Flex of course has limitations of creative. Surely some projects need them work together, and get benefits from both side. There could be several methods to use them:
- Flash application to load Flex application on runtime, better user experience with Flash power and flexible.
- Flex application to load Flash application, some sort of.
- Flash UIMovieClip to be used inside Flex, works as a component.
- Flash CS AS3 classes extends UIComponents inside Flex, load symbols from Flash SWF file. I thought it’s hard before I tried this the first time, but find not so much.