3 Replies Latest reply on Dec 13, 2009 11:53 PM by ehusar

    setItemAt on ArrayCollection

    ehusar

      I am trying to change the value of any item in an arrayCollection. For example....

       

      private var productArray:ArrayCollection = new ArrayCollection( [
                      { fruit: "Red", count: 32 },
                      { fruit: "Blue", count: 47 },
                      { fruit: "Yellow", count: 62 },
                      { fruit: "Green", count: 35 } ]);

       

      productArray.setItemAt({fruit:"Purple", count:20}, 0);  //  this gives an error of Acccess of undefined property productionArray

       

      Can't seem to figure out the setitemAt() after looking at the manual and searching for examples.  How can I change the values in an existing ArrayCollection?

       

      Thanks.