DuPreez Posted October 7, 2011 Share Posted October 7, 2011 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 More sharing options...
Larry Posted October 11, 2011 Share Posted October 11, 2011 Would this solution work for you? http://stackoverflow.com/questions/583473/how-can-i-convert-a-simple-xmllist-to-an-array-of-strings-without-a-loop Link to comment Share on other sites More sharing options...
Recommended Posts