You can loop over the XMLList and build that ArrayCollection.

 

Alternatively, you could use an XMLListCollection and do:

var xlcBills:XMLListCollection = new XMLListCollection(myXMLBillsList.month.bill)

…no loop required.  A labelField spec might be:@name or @Amount.

 

I don’t do charts yet so you are on your own there.

 

Tracy

 


From: [email protected] [mailto:[email protected]] On Behalf Of jnewport
Sent: Thursday, October 19, 2006 12:13 PM
To: [email protected]
Subject: [flexcoders] array of arrays and XML

 

Hoping to figure this out. What I am trying to do is get a result like
this (ArrayCollection).

public var expenses:ArrayCollection = new ArrayCollection([
{Expense: "Taxes", Amount: 106976},
{Expense: "Rent", Amount: 147776},
{Expense: "Car", Amount: 79554},
{Expense: "Gas", Amount: 39252},
{Expense: "Food", Amount: 128351}

from this XML:

<list>

<month monthname="Jan-04" income="14000263" average="80052">
<bill name="Taxes" Amount="106976" customers="25670"/>
<bill name="Rent" Amount="147776" customers="25670"/>
<bill name="Car" Amount="79554" customers="25670"/>
<bill name="Gas" Amount="39252" customers="25670"/>
<bill name="Food" Amount="128351" customers="25670"/>
</month>

</list>

Then use it to plot data on a piechart. I am pulling the xml in via a
httpservice. So I am guessing I need to iterate through the xml and
create an arrayCollection of arrays? But I can't figure that out.
Then how to use the Expenses:arrayCollection as a piechart dataprovider.

Thanks in advance.

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to