What is Flex? Why Use It?
       by Devin Columbus aka dColumbus  |  9 March 2008

There seems to be some confusion as to why anyone would bother using Flex. I can understand this to a degree since I felt the exact same way when I first heard about Flex. But logically, there must be a reason why Adobe decided to continue it as one of their products; and that is exactly what I plan to explain here.

In a nutshell, Flex was designed in order to give Flash Developers an edge when developing Rich Internet Applications (RIAs). Although RIAs can be built from within Flash, there are various limitations, especially when it come to a developers time. Iím not going to get into the specifics, but as you become familiar with Flex, youíll begin to understand why this is.

What makes a up a Flex Application?
A Flex application at itís very basic level is a Flash .swf file embedded in a generated HTML file. Since Flex outputs itís data as a .swf, this allows you to utilize everything that Flash Player is famous for; dynamic animations, sound and video handling, and of course, the Flash Drawing API. The HTML that Flex spits out has the necessary JavaScript code in order to detect whether the user has the Flash Player installed, or whether they need to update to the current player.

One of the major reasons why Flex is becoming more and more popular is because it utilizes ActionScript 3.0. In fact, developers weíre creating AS 3.0 applications in Flex even before AS 3.0 was released for Flash Developers. But, since Flash CS3 was released, AS 3.0 has become the new standard, and for me at least, is why developing in Flex has become even more exciting.

How is a Flex Application created?
One important thing to note, is that the Flex environment does not use a Timeline. This does not mean that it is limited. Rather, Flex has been developed more for programmers and less for designers. It ends up meeting somewhere in the middle, which is exactly where I found myself as a Designer/Programmer, whatever. Again, this will become apparent as you begin actually developing in Flex.

You design a Flex Application by selecting pre-defined visual components (i.e. Button, ComboBox, ListBox, DataGrid, etc) that youíre most likely familiar with from Flash. If youíve never used components before, theyíre wonderful. Although some will tell you that you can create far smaller (in size) components by developing them on your own, and while that may actually be true, the pre-defined components work well and are highly customizable Ė especially the latest set released with Adobe Creative Suite 3:

[ an example of a few controls arranged in Flex Builder 3 ]

You then arrange your components on the stage in a orderly, easy to use, manageable user interface. There are various Containers that allow you to align your components however youíd like. As an example of one of these containers, there is one named the VBox. This Container tells everything that lives within it to align vertically to one another Ė extremely usefully when developing Forms.

Youíll then use be able to use styles and skins that will customize the entire look and feel of your application. CSS Formatting and the complete customization of the visual components (as I mentioned above) will make your Flex Application stand out above the rest.

Now that you have your visuals in place and you like the way your application looks, you can start to utilize ActionScript 3.0. A/ssign event handlers and create or import ActionScript functions or classes to make your Flex Application live up to itís full potential. This will allow you to react to what the user does and to events that are generated by Flex itself. Also, and this is a HUGE also, youíre able to connect to ColdFusion and other Flex Data/Communication Services. Remember this one thing when youíre contemplating whether or not Flex is right for you: Flex and ColdFusion are meant for each other.

Now itís time to publish your application and present it to your client or the world.
Honestly, there is so much more that could have been elaborated on in this article, but thatís what the later tutorials are there for. This was meant as an introduction or sorts to Flex in a Flash world. If you havenít given it a shot, why not test it out for yourself. Until more tutorials are released here on Kirupa.com, please visit the following links in order to satisfy your curiosity.

Download the latest Flex Builder 3:

The Adobe Flex Developers Center:

The Official Adobe Flex Overview:

If you have any questions, feel free to post them on the kirupa.com Forums.

Devin Columbus aka dColumbus



kirupa.com's fast and reliable hosting provided by Media Temple.