1 Reply Latest reply on Mar 28, 2008 12:46 PM by breez11

    Add item to arrayCollection

    breez11 Level 1
      When my xml response invokes the result handler of my httpService call I assign the xml a array collection. I want to take two values from my array collection and then add that item to the same array collection.


      this is my attempt
      ////////////////////////////////////////////////////////////////////////////////

      private function resultHandler(event:ResultEvent):void{
      traffic = srv.lastResult.Output.Data;
      for (var i:int = 0; i<traffic.length; i++){
      var o:Object = {hLabel: traffic .month + ", "+ traffic.year};
      traffic.addItem(o);
      }
      initLabel = "hLabel";
      }




      Sample of the xml
      ///////////////////////////////////////////////////////////////////////////
      <Output>
      <Data>
      <p_down>13958276439153</p_down>
      <w_down>11901611245209</w_down>
      <offload>0.543951</offload>
      <month>1</month>
      <year>2008</year>
      </Data>
      <Data>
      <p_down>21937057393026</p_down>
      <w_down>30824944591118</w_down>
      <offload>0.431553</offload>
      <month>2</month>
      <year>2008</year>
      </Data>
      <Data>
      <p_down>4269002389086</p_down>
      <w_down>6118369033772</w_down>
      <offload>0.410242</offload>
      <month>3</month>
      <year>2008</year>
      </Data>
      </Output>