Adobe Flex & Flex Builder 3

Written by: Pawel Rembisz in Product Reviews, Web Technology

What is Flex?

Flex is a cross platform framework used in the development of Rich Internet Applications (RIA’s).  Flex RIA’s are delivered in an SWF format, mainly used by Adobe Flash, which stores all the components and code used in the application.

The Flex framework is open source and can be downloaded from the Adobe website in the form of an SDK (Software Development Kit).  Adobe also provides the Flex Builder, which comes with a GUI and has working views for coders and designers, as well as tools to speed up the development process.

How Flex Works

The graphical interface of an RIA is built with an XML based markup language called MXML, in where components can be easily added and customized.

A simple search text field with a button would look like this in MXML:

<mx:Label text=”Search:”/>

<mx:TextInput id=”searchTextField” enter=”search()”/>

<mx:Button label=”Search” click=”search()”/>

The search text field, label and button would usually be contained in a Box container and have properties similar to those of an HTML table.

<mx:HBox width=”400″ height=”150

horizontalAlign=”center

paddingBottom=”5” paddingLeft=”5” paddingRight=”5” paddingTop=”5

horizontalScrollPolicy=”off” verticalScrollPolicy=”off>

One neat feature in Flex is that data entered into a text field can be instantly validated using validation components provided such as:

<mx:PhoneNumberValidator  id=”phoneValidator” source=”{phoneTextField}” property=”text” />

<mx:EmailValidator id=”emailValidator” source=”{emailTextField}” property=”text” />

Interactivity can also be added via ActionScript, the Flash native programming language.

<![CDATA[

private function search():void {

var searchText:String = searchTextField.text;

// perform search

}

After the RIA has been compiled, any MXML and ActionScript code, as well as any components, are compiled into a single binary SWF file.  A Flash player installer is also included (although using SWFObject would give you more options and control when embedding SWF files into an HTML page).

You can also integrate calls to AMFPHP services from your Flex application, further extending functionality.

What’s Next?

Watch out for Flex 4 coming out in late 2009! A beta will probably be available in the summer, but you can try the alpha currently in production from the Adobe Open Source website: http://opensource.adobe.com/.

Useful Resources:

Flex Developer Center

http://www.adobe.com/devnet/flex/

Home of Flex SDK

http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK

Developer Documentation

http://opensource.adobe.com/wiki/display/flexsdk/Developer+Documentation

Flex 4

http://opensource.adobe.com/wiki/display/flexsdk/Gumbo

Some samples of Flex RIA’s

Shopping Cart

http://examples.adobe.com/flex2/inproduct/sdk/flexstore/flexstore.html

Restaurant Finder

http://examples.adobe.com/flex2/inproduct/sdk/restaurant/finder.html

Flickr Application

http://taggraph.com/everybody

Stock Graphing Application

http://help.stockfetcher.com/sfhelp/?topicid=100328

Google Maps Extended

http://blog.flexcommunity.net/?p=49

No related posts.

Comments are closed.