I have this XML (Flash/AS3):
<channel>
<title>...</title>
<description>...</description>
<item><summary>...</summary><detail>...</detail></item>
<item><summary>...</summary><detail>...</detail></item>
...
</channel>
I want to create a DataProvider containing the elements (for use in a datagrid).
I thought this would work:
var items:XML = new XML(evt.target.data); //url loader event listener 'complete'
trace(items..item is XMLList); // true
myDP = new DataProvider(items..item);
But I get this error:
TypeError: Error: Type Coercion failed: cannot convert
<item><summary>...</summary><detail>...</detail></item>
<item><summary>...</summary><detail>...</detail></item>
...
to Array or DataProvider.
at fl.data::DataProvider/getDataFromObject()
at fl.data::DataProvider()
What am I doing wrong?