3 Replies Latest reply on Apr 20, 2009 6:15 AM by flex_heman

    How to convert HTTPservice result into ArrayCollection?

    TodLoch Level 1

      Hi,

      I try (without success :-( ) convert HTTPService result into ArrayCollection, and I can't manage it :-(

       

      I declare a variable myArrCol:ArrayCollection = new ArrayCollection();

       

      I specify HTTPService result as "e4x", it is returned from PHP page, and "...Alert.show(result.toString());" gives :

       

      <MainNode>

           <SubNode>

                <id>1</id>

                <desc>Ford</desc>

           </SubNode>

           <SubNode>

                <id>2</id>

                <desc>Nissan</desc>

           </SubNode>

           <SubNode>

                <id>3</id>

                <desc>Volvo</desc>

           </SubNode>

      </MainNode>

       

      How to convert it into ArrayCollection, to achieve result like produce this line of code:

      myArrCol:ArrayCollection = new ArrayCollection([{id:1, desc:"Ford"}, {id:2, desc:"Nissan"}, {id:3, desc:"Volvo"}]);

       

      Could anyone give me some tips how to do that?

       

      Best regards,