2 Replies Latest reply on Jun 25, 2007 8:46 AM by DavidBPrice

    arraycollection removeall not working

      Good Day
      For some reason the removeall() function is not working for my arraycolleciton.

      static public var _data:arraycollection;

      static public function _load():void{
      _data.removeAll(); //supposed to empty _data if it has been previously populated

      _data = new ArrayCollection(_dates.toArray()); //populates/repopulates _data with dates from the _date ac

      //the rest of the code calls http services to upload xml and populate the _data ac with numbers by day
      //for certain categories (eg: # of Orders)


      This works great for the initial load

      But if I call the _load function again it doesn't replace the ac...the information is added to the _data ac

      For example, if there were 10 orders for march first, when I load the program it will reflect 20070301 = 10

      However, if I click the "UPDATE" button (which calls the _load() function), the screen is updated with 20070301 = 20 instead of 20070301 = 10.

      If I click "UPDATE" again it reflects 30, again 40, etc...

      even though I have the removeall() stipulation in there to empty the array before calling the http services.

      How can I get the _data arraycollection to empty before calling the webservices again?