Flex Remembered
- April 2nd, 2008
- Posted in Appcelerator . Development . javascript
- Write comment
I just had the absolutely horrible experience pleasure of using Flex again.  For details why, check Appcelerant in the next few days.  However, there were a few things that I couldn’t help but get off my chest.
- The documentation sucks, especially for their command line tools.  I will readily admit that this is partially my fault, but I don’t quite understand the relationship between ActionScript, MXML and Flex. I spent about a day just getting bogged down in figuring out what I need to get things done. Â
- Related to above, there aren’t enough good examples.  At least on pages that are easily accessible for free, there wasn’t very much actual code that was helpful.  Most of what I was presented with, I couldn’t make heads or tails of.
- Flex/Flash (Flesh?)Â is actually quite good when you want to do something visually snazzy. Â It should be used in these cases.
- ActionScript is adequate when you don’t know Javascript.  However, it is piss poor when you get accustomed to the power stemming from javascript’s dynamic nature.  It’s not long before you really start to miss things such as being able to bind variables to a function that will be called by an event handler. Â
- c.verticalScrollPolicy = ScrollPolicy.off; c.horizontalScrollPolicy = ScrollPolicy.off;Â Are the most crucial lines when it comes to developing in Flex. Â Otherwise, Flex will put ugly scrollbars oneverything.
- The Flex-Ajax Bridge is really cool. While this does suffer from the same documentation pitfall as Flex proper, the bridge is really neat.  The biggest benefit is that it allows a developer to use Flex for it’s strengths (snazzy visuals, scrollbars, etc) and use something else for the rest.
- You can’t index a Flash Movie.  If it’s not on Google, it doesn’t exist. Â
Flex is not something that I want to use everyday, nor something that I would use to build a significant potion of a website. Â It’s useful for little visual effects and flashy things. Â Otherwise, you’re better off learning how to use CSS. Â The web is still the best technology for delivering web applications.
This is my blog about programming. For random stuff, checkout my
Are you sure this can’t be done? It looks like ActionScript has closures, so this should be possible, even if it requires adding a bunch of type-declarations.
Not positive. When I googled it, I didn’t find anything altogether helpful.
Flex (like Java, its closest relative) requires a lot of upfront intellectual investment before you can become productive. And since it is strongly typed, compiled, and somewhat verbose (also like Java), you need an IDE to stay productive (which means ponying up for Flex Builder). As far as not being able to find examples goes, I’ve never had any problems figuring out what I needed from some determined Googling and searching the (again verbose) documentation. What were you trying to do exactly? But other than those first two warts, there is a ton of power in the Flash Player VM, and there comes a point where the browser is no longer viable as an application platform when compared to the Flash player. Thanks to you good people at Appcelerator, that point is getting pushed further out, but it’s time to saddle up with Flex when you need a desktop-like feel for your application.
Kevin,
My major issue was that I had some trouble figuring out the correct flags for the compiler. I was able to get what I needed through googling and looking at the files that were downloaded, but it would be nice to see a link for the documentation next to the download. Other other issue I had is finding the right livedoc for the question I’m trying to answer, but that’s probably just a familiarity issue. After looking at the flex site without an specific application goal in mind, there’s definitely some good content there, so I’ll concede that point (somewhat).
My major issue with flex is that it’s not all that great for developing applications, because it depends on support from vendors (see iPhone, Apple). When using HTML/CSS/JS you can deliver your application to any device with a webbrowser. It might suck, but you can get it on there. The same cannot be said of Flash.
Even when Flash is available, is performance is iffy. The player is getting slower at the same time that browsers are making huge leaps in Javascript processing speed. Safari 3 and FF3 are FAST. With means older computers and newer, but slow, devices like the asus eeepc can be quite usable machines.
And your final point is just wrong. Flex can only go where HTML/CSS/JS can go. It’s Air, Prism, and Fluidthat are blurring the lines between desktop and internet applications.
If you have any further Flex documentation issues I might be able to save you some headaches as I wrestle with it daily – feel free to message me on the Appcelerator dev network if you feel like it might be helpful. And if you haven’t already, you may want to check out the Cairngorm micro-architecture for Flex if you’re looking for a better way to do event handling.
Being tied to the Flash player is a liability. No argument there. And not being indexable by a search engine blows if your app is document/resource-centric and can benefit from being searchable by folks who don’t know they are looking for content on your site.
On the performance question, I have heard the same things about Safari and FF3 – I am sure those browsers will start closing the gap on client side performance. But ActionScript compiled for the Flash Player is currently and will remain faster than interpreted JavaScript, plus the AMF3 protocol is waaaay faster than Ajax in getting data over the wire and works easily with a Flex RemoteObject service.
And when I say ‘desktop-like’, I am speaking in terms of a fluid, graphically intense user interface. ‘Little effects and flashy things’, I think you called them – sometimes those are a big deal in your application. A good example of this is – thanks to Flex/Flash, the smooth animation, stylish controls, and responsiveness to user interaction is relatively easy to pull off. Could you write an app like kuler with DHTML, CSS, and JavaScript? I bet you could get close, but you could also stab yourself in the eye with a pencil. Both courses of action would be as dumb as they are painful.
I love writing apps for the browser for the reasons you mentioned in both your post and reply, but I am a firm believer in choosing the right tool for the job. Flex/Flash has its place on the web when applications require the big graphical guns.
In the post above, I was trying to link to kuler but forgot to close the tag. I meant to write the following:
A good example of this is kuler