1 Reply Latest reply on Feb 19, 2007 5:57 PM by ntsiii

    xml arrayCollection

    darrylfrith
      I have a function that works with the following test data:

      [Bindable] private var data_ac:ArrayCollection = new ArrayCollection ([
      {pageloads: '20', url: ' http://www.domain_a.com', date: '28', date_display: 'Jan 17' },
      {pageloads: '50', url: ' http://www.domain_b.com', date: '20', date_display: 'Jan 29' },
      {pageloads: '30', url: ' http://www.domain_c.com', date: '10', date_display: 'Feb 9' },
      {pageloads: '10', url: ' http://www.domain_d.com', date: '5', date_display: 'Feb 14' },
      {pageloads: '0', url: ' http://www.domain_e.com', date: '1', date_display: 'Feb 18' }]);

      What I need though is to convert my real data from my xml into an ArrayCollection like the one above. This is how I'm retrieving the xml:

      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*" creationComplete="get_pageloads.send()" height="510" width="478">
      <mx:Script><![CDATA[
      import mx.rpc.events.ResultEvent;
      [Bindable] private var data_result:Object;
      private function show_data(evt:ResultEvent):void {
      data_result = evt.result;
      }
      ]]></mx:Script>
      <mx:HTTPService id="get_pageloads" url="./came_frm.php" useProxy="false" method="POST" result="show_data(event)">
      <mx:request xmlns="">
      </mx:request>
      </mx:HTTPService>

      Can someone help me creating the arrayCollection?