Archive for August 12th, 2007

12
Aug

Dynamically creating ActionScript cue points from FlashVars loaded using the HTTPService tag

In a previous post, “Dynamically creating ActionScript cue points from FlashVars received from the HTML container”, we looked at how to create ActionScript cue points based on variables passed in to our Flex application from the HTML template’s “FlashVars” parameter. In this post we look at a similar approach, although using the <mx:HTTPService /> tag to load cue points from an external file of name/value pairs. This example could easily be extended further to pass a variable to a server-side script which would grab cue point information from a database and pass it back into Flex either as a string of name/value pairs, or as an XML document.

Full code after the jump.

Continue reading ‘Dynamically creating ActionScript cue points from FlashVars loaded using the HTTPService tag’

12
Aug

Sorting date columns in a DataGrid

Here’s an example of sorting a column of dates in a Flex DataGrid. The dates start out as Strings (such as “04/14/1980″) so you create a custom sortCompareFunction on that DataGrid column which converts the strings to dates so Flex will sort the dates in sequential order (as oppsed to string order). Hope that helps somebody out there.

I also created a little tooltip on the date column which shows the dates in a somewhat more readable form (”April 14 1980″) using the DataGridColumn object’s showDataTips and dataTipFunction properties.

Full code after the jump.

Continue reading ‘Sorting date columns in a DataGrid’