2 Replies Latest reply on Aug 22, 2006 5:09 PM by ntsiii

    Combining or adding to Arraycollections

      I am using HTTPService to get data 25 records at a time and then putting the data into an arraycollection. My problem is that I want the arraycollection to retain the previous data but everytime I get the next 25 records the arraycollection looses any previous data.

      Does anyone have a suggestion?

        • 1. Re: Combining or adding to Arraycollections
          It looks like you're simply assigning the new array to the dataProvider of your grid?

          When you get your new array, you should be adding these items to the existing array. You can iterate over the items of the new array and "push" them onto the previous array. You could also use the "join" method (if AS3 arrays have a join method).

          See if the above works.
          • 2. Re: Combining or adding to Arraycollections
            ntsiii Level 3
            But don't use the low level array methods lke "push()". instead, use the ArrayCollection Methods like addItem(). The low-level methods do not emit the events that will cause your controls to update, but the ArrayCollection methods will.