What is colourFilter, sizeFilter and selectedItem? You should be using item. That is the object passed into the filter function. Set a breakpoint in the filter function and see what properties item has. Once you know, you can write a function to test those properties.
--- In [email protected], "munene_uk" <munene.anth...@...> wrote: > > Thanks for the reply...how would the above example work for criteria that > comes dynamically through xml data? ive tried this code below on my two combo > boxes with id's of colourFilter and sizeFilter respectively... > > private function filterData():void > { > > xmlData2.filterFunction = applyColourAndSizeFilter; > xmlData2.refresh() > Alert.show(xmlData2.length.toString()); > > } > public function applyColourAndSizeFilter(item:Object):Boolean > { > > if(colourFilter.selectedItem == "All colours" && > sizeFilter.selectedItem =="All sizes" ) > { > return true; > > } > > else > { > return item.colour == colourFilter.selectedItem && > item.sizes == sizeFilter.selectedItem; > > } >

