It would help to see the full stack trace and the code around where it
blew up.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Corey Smaller
Sent: Wednesday, December 12, 2007 11:57 AM
To: [email protected]
Subject: [flexcoders] converting XML element to IList error

 

does anyone know what is wrong with this one:

my HTTP request returns fine into the function (e4x resultFormat) and
Adobe says IList supports XMLList but I keep getting this error. it
appears the Ilist is trying to convert XML elements and throws an
error. I get no errors when compiling, only at runtime

here is the error:
TypeError: Error #1034: Type Coercion failed: cannot convert
[EMAIL PROTECTED] element <program> to mx.collections.IList.

//<program> is the first child node in the XML

here is the function:

private function setDataProvider(event:ResultEvent) : void
{
//dataXML is an XMLList 
dataXML = (event.result.program); 
//the Alert shows the data is returning ok
Alert.show(dataXML.toString());
//dataProvider is an IList
dataProvider = new XMLListCollection(dataXML);

rowDataProvider = new ArrayCollection();
for( var i : int = 0; i < dataProvider.length; i++ )
{
rowDataProvider.addItem( { label: "Channel " + ( i + 1
) } ); 
}
}

 

Reply via email to