[flexcoders] Re: array of arrays and XML

2006-10-26 Thread jnewport
Thanks Gordon that did it.  

Final outcome:  var numData:Number = hitData.item[@ + strRegDataSrc];






--- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote:

 You use square-bracket syntax to access a child tag or an attribute
 whose name you don't know at compile time: hitdata.item[@ + someVar].
 If someVar is revenue, then hitdata.item[@revenue] is the same as
 [EMAIL PROTECTED], in the same way that when o is a plain Object
 o[foo] is the same as o.foo.
 
  
 
 - Gordon
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of jnewport
 Sent: Monday, October 23, 2006 8:47 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: array of arrays and XML
 
  
 
 Well the reason is because when trying to get to the
 hitdata.item.(object) I cause problems when using XML. Since
 everything in my app is dynamic I cannot hardcode the hitdata.item
 statements in my dataTipformat function. So I cannot use
 [EMAIL PROTECTED] or [EMAIL PROTECTED] I have tried
 hitdata.item.(@ + someVar), but it doesn't work. I would be more
 than happy to use XMLlist or XMLListCollection, but it causes problems
 with hitdata and other thingsseems to cause more work later on
 though it saves me from having to turn it into an ArrayCollection.
 
 If you can tell me how to make XMLlist work using hitData.item
 statement I would be greatful.
 
 Thanks, J
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , Douglas Knudsen
 douglasknudsen@ wrote:
 
  Curious, why convert to ArrayCollection at all? you can pass XML
 direct to
  a chart. Any Class supporting the dataProvider attribute can except
 any
  Collection.
  
  DK
  
  On 10/23/06, Tracy Spratt tspratt@ wrote:
  
   Use for..in loop.
  
  
  
   See the examples:
  
   http://livedocs.macromedia.com/flex/2/langref/XMLList.html
 http://livedocs.macromedia.com/flex/2/langref/XMLList.html 
  
  
  
   Tracy
  
  
   --
  
   *From:* flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 ] *On
   Behalf Of *jnewport
   *Sent:* Friday, October 20, 2006 4:56 PM
   *To:* flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
   *Subject:* [flexcoders] Re: array of arrays and XML
  
  
  
   Thanks for the quick response.
  
   I know its possible to loop over the XMLList, but I am not sure how
 to
   do it. I have used the XMLListCollection, but then when I try to use
   the XMLListCollection as a data provider I have use the @ symbol
 as
   you suggested below.
  
   Using the @ cause more problems because when try to make my app
   dynamic I have to try things like [EMAIL PROTECTED]) and it gets
   messy when I have to try to capitalize things like
   [EMAIL PROTECTED]({somevar}).
  
   So if you could help with how to loop through the XMLList it would
   make my code much cleaner.
  
   Thanks, J
  
   --- In flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com  flexcoders%40yahoogroups.com,
 Tracy
   Spratt tspratt@ wrote:
   
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: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com  flexcoders%40yahoogroups.com
 [mailto:
   flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 flexcoders%40yahoogroups.com] On
Behalf Of jnewport
Sent: Thursday, October 19, 2006 12:13 PM
To: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com  flexcoders%40yahoogroups.com
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

[flexcoders] Re: array of arrays and XML

2006-10-24 Thread jnewport
Well the reason is because when trying to get to the
hitdata.item.(object) I cause problems when using XML. Since
everything in my app is dynamic I cannot hardcode the hitdata.item
statements in my dataTipformat function. So I cannot use
[EMAIL PROTECTED] or [EMAIL PROTECTED]  I have tried
hitdata.item.(@ + someVar), but it doesn't work.  I would be more
than happy to use XMLlist or XMLListCollection, but it causes problems
 with hitdata and other thingsseems to cause more work later on
though it saves me from having to turn it into an ArrayCollection.

If you can tell me how to make XMLlist work using hitData.item
statement I would be greatful.

Thanks, J

--- In flexcoders@yahoogroups.com, Douglas Knudsen
[EMAIL PROTECTED] wrote:

 Curious, why convert to ArrayCollection at all?  you can pass XML
direct to
 a chart.  Any Class supporting the dataProvider attribute can except any
 Collection.
 
 DK
 
 On 10/23/06, Tracy Spratt [EMAIL PROTECTED] wrote:
 
   Use for..in loop.
 
 
 
  See the examples:
 
  http://livedocs.macromedia.com/flex/2/langref/XMLList.html
 
 
 
  Tracy
 
 
   --
 
  *From:* flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] *On
  Behalf Of *jnewport
  *Sent:* Friday, October 20, 2006 4:56 PM
  *To:* flexcoders@yahoogroups.com
  *Subject:* [flexcoders] Re: array of arrays and XML
 
 
 
  Thanks for the quick response.
 
  I know its possible to loop over the XMLList, but I am not sure how to
  do it. I have used the XMLListCollection, but then when I try to use
  the XMLListCollection as a data provider I have use the @ symbol as
  you suggested below.
 
  Using the @ cause more problems because when try to make my app
  dynamic I have to try things like [EMAIL PROTECTED]) and it gets
  messy when I have to try to capitalize things like
  [EMAIL PROTECTED]({somevar}).
 
  So if you could help with how to loop through the XMLList it would
  make my code much cleaner.
 
  Thanks, J
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
Tracy
  Spratt tspratt@ wrote:
  
   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: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
[mailto:
  flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On
   Behalf Of jnewport
   Sent: Thursday, October 19, 2006 12:13 PM
   To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
   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.
  
 
  
 
 
 
 
 -- 
 Douglas Knudsen
 http://www.cubicleman.com
 this is my signature, like it?







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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 



RE: [flexcoders] Re: array of arrays and XML

2006-10-24 Thread Tracy Spratt












Use bracket notation. 



Instead of: 

hitdata.item.(@ + someVar)



try:

hitdata.item.([@ + someVar[)



Tracy









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of jnewport
Sent: Monday, October 23, 2006
11:47 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: array of
arrays and XML











Well the reason is because when trying to get to the
hitdata.item.(object) I cause problems when using XML. Since
everything in my app is dynamic I cannot hardcode the hitdata.item
statements in my dataTipformat function. So I cannot use
hitdata.item.@name or hitdata.item.@revenue. I have tried
hitdata.item.(@ + someVar), but it doesn't work. I would be
more
than happy to use XMLlist or XMLListCollection, but it causes problems
with hitdata and other thingsseems to cause more work later on
though it saves me from having to turn it into an ArrayCollection.

If you can tell me how to make XMLlist work using hitData.item
statement I would be greatful.

Thanks, J

--- In [EMAIL PROTECTED]ups.com,
Douglas Knudsen
douglasknudsen@... wrote:

 Curious, why convert to ArrayCollection at all? you can pass XML
direct to
 a chart. Any Class supporting the dataProvider attribute can except any
 Collection.
 
 DK
 
 On 10/23/06, Tracy Spratt
[EMAIL PROTECTED] wrote:
 
  Use for..in loop.
 
 
 
  See the examples:
 
  http://livedocs.macromedia.com/flex/2/langref/XMLList.html
 
 
 
  Tracy
 
 
  --
 
  *From:* [EMAIL PROTECTED]ups.com
[mailto:[EMAIL PROTECTED]ups.com]
*On
  Behalf Of *jnewport
  *Sent:* Friday, October 20, 2006 4:56 PM
  *To:* [EMAIL PROTECTED]ups.com
  *Subject:* [flexcoders] Re: array of arrays and XML
 
 
 
  Thanks for the quick response.
 
  I know its possible to loop over the XMLList, but I am not sure how
to
  do it. I have used the XMLListCollection, but then when I try to use
  the XMLListCollection as a data provider I have use the @
symbol as
  you suggested below.
 
  Using the @ cause more problems because when try to make
my app
  dynamic I have to try things like [EMAIL PROTECTED]someVar) and it
gets
  messy when I have to try to capitalize things like
  [EMAIL PROTECTED]e({somevar}).
 
  So if you could help with how to loop through the XMLList it would
  make my code much cleaner.
 
  Thanks, J
 
  --- In [EMAIL PROTECTED]ups.com
flexcoders%40yahoogroups.com,
Tracy
  Spratt tspratt@ wrote:
  
   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]ups.com
flexcoders%40yahoogroups.com
[mailto:
  [EMAIL PROTECTED]ups.com
flexcoders%40yahoogroups.com] On
   Behalf Of jnewport
   Sent: Thursday, October 19, 2006 12:13 PM
   To: [EMAIL PROTECTED]ups.com
flexcoders%40yahoogroups.com
   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.
  
 
  
 
 
 
 
 -- 
 Douglas Knudsen
 http://www.cubicleman.com
 this is my signature, like it?







__._,_.___





--
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

RE: [flexcoders] Re: array of arrays and XML

2006-10-24 Thread Gordon Smith












You use square-bracket syntax to access a child
tag or an attribute whose name you don't know at compile time:
hitdata.item[@ + someVar]. If someVar is revenue, then hitdata.item[@revenue]
is the same as [EMAIL PROTECTED],
in the same way that when o is a plain Object o[foo] is the same as
o.foo.



- Gordon











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of jnewport
Sent: Monday, October 23, 2006
8:47 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: array of
arrays and XML











Well the reason is because when trying to get to the
hitdata.item.(object) I cause problems when using XML. Since
everything in my app is dynamic I cannot hardcode the hitdata.item
statements in my dataTipformat function. So I cannot use
hitdata.item.@name or hitdata.item.@revenue. I have tried
hitdata.item.(@ + someVar), but it doesn't work. I would be
more
than happy to use XMLlist or XMLListCollection, but it causes problems
with hitdata and other thingsseems to cause more work later on
though it saves me from having to turn it into an ArrayCollection.

If you can tell me how to make XMLlist work using hitData.item
statement I would be greatful.

Thanks, J

--- In [EMAIL PROTECTED]ups.com,
Douglas Knudsen
douglasknudsen@... wrote:

 Curious, why convert to ArrayCollection at all? you can pass XML
direct to
 a chart. Any Class supporting the dataProvider attribute can except any
 Collection.
 
 DK
 
 On 10/23/06, Tracy Spratt [EMAIL PROTECTED] wrote:
 
  Use for..in loop.
 
 
 
  See the examples:
 
  http://livedocs.macromedia.com/flex/2/langref/XMLList.html
 
 
 
  Tracy
 
 
  --
 
  *From:* [EMAIL PROTECTED]ups.com
[mailto:[EMAIL PROTECTED]ups.com]
*On
  Behalf Of *jnewport
  *Sent:* Friday, October 20, 2006 4:56 PM
  *To:* [EMAIL PROTECTED]ups.com
  *Subject:* [flexcoders] Re: array of arrays and XML
 
 
 
  Thanks for the quick response.
 
  I know its possible to loop over the XMLList, but I am not sure how
to
  do it. I have used the XMLListCollection, but then when I try to use
  the XMLListCollection as a data provider I have use the @
symbol as
  you suggested below.
 
  Using the @ cause more problems because when try to make
my app
  dynamic I have to try things like [EMAIL PROTECTED]someVar) and it
gets
  messy when I have to try to capitalize things like
  [EMAIL PROTECTED]e({somevar}).
 
  So if you could help with how to loop through the XMLList it would
  make my code much cleaner.
 
  Thanks, J
 
  --- In [EMAIL PROTECTED]ups.com
flexcoders%40yahoogroups.com,
Tracy
  Spratt tspratt@ wrote:
  
   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]ups.com
flexcoders%40yahoogroups.com
[mailto:
  [EMAIL PROTECTED]ups.com
flexcoders%40yahoogroups.com] On
   Behalf Of jnewport
   Sent: Thursday, October 19, 2006 12:13 PM
   To: [EMAIL PROTECTED]ups.com
flexcoders%40yahoogroups.com
   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.
  
 
  
 
 
 
 
 -- 
 Douglas Knudsen
 http://www.cubicleman.com
 this is my signature, like it?







__._,_.___





--
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

RE: [flexcoders] Re: array of arrays and XML

2006-10-23 Thread Tracy Spratt












Use for..in loop.



See the examples:

http://livedocs.macromedia.com/flex/2/langref/XMLList.html



Tracy











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of jnewport
Sent: Friday, October 20, 2006
4:56 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: array of
arrays and XML











Thanks for the quick response. 

I know its possible to loop over the XMLList, but I am not sure how to
do it. I have used the XMLListCollection, but then when I try to use
the XMLListCollection as a data provider I have use the @ symbol as
you suggested below.

Using the @ cause more problems because when try to make my app
dynamic I have to try things like [EMAIL PROTECTED]someVar) and it gets
messy when I have to try to capitalize things like
[EMAIL PROTECTED]e({somevar}).

So if you could help with how to loop through the XMLList it would
make my code much cleaner. 

Thanks, J

--- In [EMAIL PROTECTED]ups.com,
Tracy Spratt
[EMAIL PROTECTED] wrote:

 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]ups.com
[mailto:[EMAIL PROTECTED]ups.com]
On
 Behalf Of jnewport
 Sent: Thursday, October 19, 2006 12:13 PM
 To: [EMAIL PROTECTED]ups.com
 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 
   
 

  




__,_._,___






Re: [flexcoders] Re: array of arrays and XML

2006-10-23 Thread Douglas Knudsen



Curious, why convert to ArrayCollection at all? you can pass XML direct to a chart. Any Class supporting the dataProvider attribute can except any Collection. DKOn 10/23/06, 
Tracy Spratt [EMAIL PROTECTED] wrote:





















Use for..in loop.



See the examples:

http://livedocs.macromedia.com/flex/2/langref/XMLList.html




Tracy











From: 
flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] 
On Behalf Of jnewport
Sent: Friday, October 20, 2006
4:56 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: array of
arrays and XML











Thanks for the quick response. 

I know its possible to loop over the XMLList, but I am not sure how to
do it. I have used the XMLListCollection, but then when I try to use
the XMLListCollection as a data provider I have use the @ symbol as
you suggested below.

Using the @ cause more problems because when try to make my app
dynamic I have to try things like [EMAIL PROTECTED]) and it gets
messy when I have to try to capitalize things like
[EMAIL PROTECTED]({somevar}).

So if you could help with how to loop through the XMLList it would
make my code much cleaner. 

Thanks, J

--- In flexcoders@yahoogroups.com,
Tracy Spratt
[EMAIL PROTECTED] wrote:

 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: flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com]
On
 Behalf Of jnewport
 Sent: Thursday, October 19, 2006 12:13 PM
 To: flexcoders@yahoogroups.com
 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.













-- Douglas Knudsenhttp://www.cubicleman.comthis is my signature, like it?

__._,_.___





--
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 
   
 

  




__,_._,___



[flexcoders] Re: array of arrays and XML

2006-10-20 Thread jnewport
Thanks for the quick response.  

I know its possible to loop over the XMLList, but I am not sure how to
do it. I have used the XMLListCollection, but then when I try to use
the XMLListCollection as a data provider I have use the @ symbol as
you suggested below.

Using the @ cause more problems because when try to make my app
dynamic I have to try things like [EMAIL PROTECTED]) and it gets
messy when I have to try to capitalize things like
[EMAIL PROTECTED]({somevar}).


So if you could help with how to loop through the XMLList it would
make my code much cleaner.  

Thanks, J

--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of jnewport
 Sent: Thursday, October 19, 2006 12:13 PM
 To: flexcoders@yahoogroups.com
 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 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/