All entries for Thursday 26 April 2007
April 26, 2007
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.items); grid.dataProvider = dp;
With components for video, images, forms, charts, data access etc, the possibilities are great.