1 Reply Latest reply on Jun 22, 2007 11:26 AM by aprildavid

    How to creat array collection

    aprildavid

      Following is the xml file I received:
      <?xml version="1.0" encoding="utf-8" ?>
      - <resultset>
      <about>Test Query</about>
      - <chartformat>
      <xaxis>ts</xaxis>
      <yaxis>value</yaxis>
      <displayName>Line chart performance</displayName>
      <title>Line Chart</title>
      </chartformat>
      <row>1000:1:1,1000,1001:1:1,1001,1002:1:1,1002,1003:1:1,1003,1004:1:1,1004,1005:1:1,1005,1 006:1:1,1006,1007:1:1,1007,1008:1:1,1008,1009:1:1,1009,1010:1:1,1010</row>
      </resultset>

      Line data is in <row>, in the format of time:value.

      I split it in as String. Then How I can generate a ArrayCollection in the format of:
      public var aapl:ArrayCollection = new ArrayCollection([
      {ts: "1000:1:1", value: 1000},
      {ts: "1001:1:1", value: 1001},
      {ts: "1002:1:1", value: 1002}
      ]);
      ts and value should be dynamically generated based on <xais> and <yaxis> in the XML file I received.




      Mark this message as the answer.