All entries for Thursday 26 April 2007

April 26, 2007

Adobe Flex is rather good

Writing about Flex Course – Day One from [Ux]

I have just attended a three day Adobe training course on the new Flex Rich Internet Application development tool (with Symbiosis of Leamington). I really am very impressed. Developing sophisticated applications with good UI, data access and run-anywhere capability is now very easy indeed.

Here’s an example. It does a Sitebuilder keyword search (for either “showcases” or “gadget_store”) and populates a data grid with the results. You can click on a page title to open the page.

This may take a while to load the data – i need to add a spinner! Flash 9 required.

In this case I am using the Flex HTTPService to load the data as JSON. The JSON component then converts it to an Array. I convert the “items” array within that array into an ArrayCollection (better than an array), and then bind that data structure to the data grid. Further tweaks are required to turn the Item column into a clickable link.

Here’s the code that does the binding once the data has loaded…

arr = (JSON.decode(rawData) as Array);
var dp:ArrayCollection = new ArrayCollection(arr[0].items);
grid.dataProvider = dp;

That would all be possible in HTML with Prototype javascript. But in Flex it would only take perhaps ten minutes to build. Flex uses the powerful and familiar Eclipse IDE, with almost all of the features and tools that I use for Java development, including debugging and cvs. In addition, there is a visual design tool. Use it to arrange UI components on the page, then switch to developer mode, and edit the code behind the components.

With components for video, images, forms, charts, data access etc, the possibilities are great.