Removing and Finding Items for an ArrayCollection in Flex

I often have to find an item in a Flex arrayCollection class and I often see other Flex developers writing for each loops or for loops to find an item, they then remove the item by its index.

The ArrayCollection already has this functionality built in and can be used as follows :

var name : ArrayCollection = new ArrayCollection();

            if ( _overlayStack.contains( module))
                _overlayStack.removeItemAt(_overlayStack.getItemIndex( module));

Posted in: Content | Permalink

Posted by Bluetube