Hi,
In AS2 I would populate a datagrid by setting an object (returned from a coldfusion query using flash remoting) to the dataprovider. In AS3 I can only seem to populate from an array. Eg the following doesn't work:
Code:
// aDg is a datagrid
private function getSitesResultListener(e:Event):void
{
trace(e.target.getSitesResult); // [object Object]
addChild(aDg);
aDg.dataProvider = new DataProvider(e.target.getSitesResult);
}
/* The above give the following error:
TypeError: Error: Type Coercion failed: cannot convert [object Object] to Array or DataProvider.
at fl.data::DataProvider/fl.data:DataProvider::getDataFromObject()
at fl.data::DataProvider$iinit()
at Base/::getSitesResultListener()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at classes::RemoteConn/::sitesResponder()
*/
Am I right in thinking that the AS3 datagrid no longer accepts an object as it's dataprovider?
If so, is there a way around this? If anyone can offer some advice or point me to a tuturial of populating the cs3 datagrid from a query it would be appreciated (the only tutorials I can find describe how to populate from a manually created array or an xml file).
Thanks
Robin.