Archive for September, 2007

Flash or Flex or Both?

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.
  • Games.
  • 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.

Bored to code in Flex 2

Well, to day I already coded real productive projects 2 month with Flex Builder 2. I began to feel bored.

First of all, Flex builder 2 is not so mature product yet from a Flash developer’s perspective (compare to Flash IDE). Flex Builder 3 suppose to be. Flex 2 is perfect something for traditional Java developers, they code quite a lot data-driven application and less time to work on UI, and not so curious about ‘Flash’ user experience. But for Flash developers, Flex 2 SDK is somehow a ‘formatted’ framework, you don’t have too much freedom the way when you coding in Flash CS3.

Struggle with SDK ‘bugs’ and searching/googling solution in a huge collection of documentations and Flex 2 SDK source code. As an experienced Flash coder, quite often I suppose a method of a Flex class should function this way, but no, yes often, not same as you wished. Sometime I could find a solution what I want to, maybe searching flexcoders, maybe go over Flex documentations, maybe check one or two classes of SDK source code. But when I couldn’t figure it out (wouldn’t have too much time to debug/check source code), I feel painful.

Bad feeling of code architecture. In Flash CS3, starting with a single Document class (root), I could have one or several trees of classes and everything easily to find. When to load a local configuration file, when to call remote server, when to draw Sprites, when get response from server and what should do based on it, synchronized or asynchronous. But in Flex it’s not everything in your hand. A mxml component will build its children itself, you have to find where you want to insert your functions into. A fresh Flex application could still clear although, after they were modified in design mode from time to time, mixed with several states, sometime its hard to find where the component is and I lost where to insert functions in my mxml files.

No strong community support especially Flex+Flash developers, not much really perfect Flex example projects(at least I didn’t see something really good as Flash). As far as I know, most of Flash developers came from designers, most of Flex developers came from hard code community such as Java coders, and, most of Flash developers today, I guess, still working on AS2. Also, I don’t know who’s on the top list of Flex developers. There’re a couple of Flex/AS3 books in Amazon, but not good enough though. What I think a Flex application should be? Well, if you make an application simliar with iPhone in Flex, I will say that’s a perfect one. I cannot do that, I don’t have time to be relax and code what I like to freely.