I have a need to use custom class objects as a DataGrid dataprovider. After wrestling with flash.utils.describeClass() I gave up and found two other methods for binding my custom objects to a DataGrid.
First here is a look at the sample MXML app I put together.

Same object bound two different ways
Click here to run this demo in a new window.
In the first grid the DataGrid gets a column per object property.
var dp_horizontal:Array = ArrayUtil.toArray( myCustomObj );
grid_1.dataProvider = dp_horizontal.valueOf();
In the second grid, I run my custom object through a helper function to create an ArrayCollection containing NAME, VALUE pairs for each object property.
/**
* Convert a class object into an ArrayCollection to be used
* as a DataProvider
*/
private function objectToDataProvider( obj:Object ):ArrayCollection
{
// our DataProvider
var dp:ArrayCollection = new ArrayCollection();
// get object class info
var info:Object = mx.utils.ObjectUtil.getClassInfo( obj );
// split the class property list into Array
var propsA:Array = String( info.properties ).split(',');
// loop over class properties grabbing value and filling up dp
for( var xx:int = 0; xx <= propsA.length-1; xx++)
{
dp.addItem( { name : propsA[ xx ], value : obj[ propsA[ xx ] ] } );
}
return dp;
}
I’m currently using this helper function to bind the result of WebORB.NET data calls to a DataGrid for testing. This code could really be used by any type of object though.
Hope this helps somebody else.
Tags: actionscript, ArrayCollection, ArrayUtil, as3, class, DataGrid, dataProvider, flex, object, ObjectUtil, reflection
Posted in actionscript, adobe, flex, tips and tricks | No Comments »
Chat is @ Thursday Feb 11th, 11:30am MST
Jun Heider and myself will be talking to the 360|Flex guys tomorrow about our session. It’s actually going to be a back-to-back mega session comparing the latest and greatest on both the Flash Platform and the Silverlight Platform.
Come check it out and feel free to ask questions…although for the good stuff you’ll have to wait until our talks. 
Here’s the full details: http://www.360flex.com/blog/2010/02/360flex-speaker-chat-eric-fickes-and-jun-heider/
I hope to see you online tomorrow or at 360 Flex in March.

I'm speaking at 360 Flex 2010
Tags: 360flex, adobe, adobeconnect, chat, conference, flex, jun heider, speaker
Posted in .net, C#, adobe, coldfusion, database, development, flex, flexbuilder | No Comments »
Today I was using Alert.show() while building a RadioButtonGroup change handler and noticed something interesting.
If you use your mouse to change the values of a RadioButtonGroup, Alert.show() will behave like a proper modal dialog.
However, if you use your keyboard’s arrow keys to toggle the values, the focus remains with your RadioButtonGroup.
The lesson here is since the focus remains with my RadioButtonGroup, you can continue to change the values all you want via keyboard.
In my situation, I kept receiving Alert.show()s, instead of one.
Try it for yourself.
First click on a RadioButton below, and notice that the Alert.show() keeps you from clicking on the RadioButtonGroup until you OK the prompt.
Now try the same thing again using your keyboard. If you do it enough times, the prompts will cover up the stage completely.

Tags: actionscript, alert, alert.show, flex, keyboard, RadioButtonGroup
Posted in adobe, flex, tips and tricks | No Comments »
Here’s a simple Flex soundboard with the Arnold prank phone calls.
If you haven’t heard these prank calls yet, what are you waiting for? Get flash 9 if you don’t already have it, then get ready to LYFAO!
Launch the arnold soundboard in a new window
Tags: arnold, flex, gator lodge, hooters, prank phone calls
Posted in adobe, comedy, flash, flex, fun, random | No Comments »