1 Reply Latest reply on Jan 18, 2011 6:41 AM by jfb00

    Create New Arraycollection() with string values? Help!!!!!

    pjsaranjob Level 1

      I am using the following httpservice.

       

      ----------START HTTPSERVICE----------

              <s:HTTPService id="getData"
                             method="GET"
                             resultFormat="e4x"
                             result="getData_resultHandler(event)"
                             fault="getData_faultHandler(event)"/>

      ----------END HTTPSERVICE----------

       

      ----------START RESULT HANDLER----------

                  private function getData_resultHandler(event:ResultEvent):void
                  {
                      documentValues=new XML(event.result)
                  }

      ----------ENDRESULT HANDLER----------

       

      and getting the below xml as the result

       

      ----------START RESULT----------

      - <project id="E20D61181E67B65C80257816004DE53E">
      - <projectdetails>
      <projectname>sdsds</projectname>
      <plannedstartdate>22/01/2011</plannedstartdate>
      <plannedenddate />
      <actualstartdate />
      <actualenddate />
      <estimatedeffort />
      <actualeffort />
      <projectstatus>Pending</projectstatus>
      <intprojectstatus>2</intprojectstatus>
      </projectdetails>
      - <activities>
      - <![CDATA[
      {
      activitynumbers:1,
      activitynames:Activity1,
      activityplannedstartdates:new Date(2011,01,01),
      activityplannedenddates:new Date(2011,01,02),
      activityactualstartdates:new Date(2011,01,03),
      activityactualenddates:new Date(2011,01,04),
      activityestimatedefforts:1,
      activityactualefforts:3
      },
      {
      activitynumbers:2,
      activitynames:Activity2,
      activityplannedstartdates:new Date(2011,02,01),
      activityplannedenddates:new Date(2011,02,02),
      activityactualstartdates:new Date(2011,02,03),
      activityactualenddates:new Date(2011,02,04),
      activityestimatedefforts:2,
      activityactualefforts:4
      }
      ]]>
      </activities>
      </project>
      ----------END RESULT----------

      And I want to create a arraycollection using values between <activities> tag.

      I tried the following syntax

      [Bindable]
      private var myDP:ArrayCollection=new ArrayCollection(documentValues.activities);

      [Bindable]
      private var myDP:ArrayCollection=new ArrayCollection(this.documentValues.activities);

      [Bindable]
      private var myDP:ArrayCollection=new ArrayCollection(documentValues.activities.toString());

      [Bindable]
      private var myDP:ArrayCollection=new ArrayCollection(this.documentValues.activities.toString());...............etc


      But this is not working. Can anybody help on how to achieve this?