Jump to content
Larry Ullman's Book Forums

Array From Xmllist


DuPreez
 Share

Recommended Posts

I want to convert an XMLList into an Array (not an ArrayCollection). I do understand that an ArrayCollection is actually only a wrapper around an Array & at the heart of an ArrayCollection is in fact an Array.

At this stage I can convert the XMLList into an ArrayCollection like so:

testInfo = event.result.node; // testInfo is an XMLList

myData = new ArrayCollection(mx.utils.ArrayUtil.toArray(testInfo.LoadType)); // myData is an ArrayCollection.

 

Testing (component implementation), the only way I’ve been able to access the content (stripped of start & end XML tags) is like so:

In a combobox: <mx:ComboBox dataProvider="{myData.getItemAt(0)}" />

or in a List: <mx:List dataProvider="{testInfo}" labelField="LoadType"/>

If I use <mx:ComboBox dataProvider="{myData}"/> without the getItemAt(0)-part, the start & end XML tags are still included. Why???

 

The reason I want an Array is to ultimately use it in a PieSeries to bind to perWedgeExplodeRadius.

I'm using Flex 4 with FlashBuilder IDE.

 

Thanks.

Link to comment
Share on other sites

 Share

×
×
  • Create New...