2 Replies Latest reply on Nov 16, 2007 2:03 PM by GeorgeWS

    Remove Items from ArrayCollection

    GeorgeWS Level 1
      I have an ArrayCollection. Its has 2 fields per record (qCUSN05, qCATG53). I then add 9 records but there are 3 fields per record(qBRAND53, qCUSN05, qCATG53). So its like this:

      public function addComp2():void{
      myChart2.addItem({qBRAD53:"VODKA", qCUSN05:myPours2[0].Vodka, qCATG53:01});
      myChart2.addItem({qBRAD53:"TEQUILA" ,qCUSN05:myPours2[0].Tequila, qCATG53:05});
      myChart2.addItem({qBRAD53:"RUM", qCUSN05:myPours2[0].Rum, qCATG53:06});
      myChart2.addItem({qBRAD53:"GIN", qCUSN05:myPours2[0].Gin, qCATG53:03});
      myChart2.addItem({qBRAD53:"WHISKEY", qCUSN05:myPours2[0].Whiskey, qCATG53:02});
      myChart2.addItem({qBRAD53:"SCOTCH", qCUSN05:myPours2[0].Scotch, qCATG53:04});
      myChart2.addItem({qBRAD53:"BRANDY", qCUSN05:myPours2[0].Brandy, qCATG53:07});
      myChart2.addItem({qBRAD53:"TRIPLE", qCUSN05:myPours2[0].Triple, qCATG53:08});
      myChart2.addItem({qBRAD53:"VERMOUTH", qCUSN05:myPours2[0].Vermouth, qCATG53:09});
      }

      I use the myChart2 to display a PieChart. It all looks really good except there are 2 records for each category. Im thinking if I could remove the first 9 records I would be perfect.

      How do you remove the records that dont have qBRAD53 defined or just the first 9 records. (just a note there are 9 categories Vodka, Gin, Rum etc) my pie shows 18 slices and 9 have the Category words (Vodka, Gin, Rum, etc) and 9 just say "undefined" so getting rid of the first 9 would be perfect.

      Thanks

      George