Flex: Problem with CollectionEvent on ArrayCollection
got a reference to an arrayCollection and add event listener like this:
collection.addEventListener(CollectionEvent.COLLECTION_CHANGE, onCollectionChange);
that´s fine. Now some other component does have the same reference and is adding items to and removing items from that collection. Each time the handler is called:
private function onProjectPersonsChange(event:Event):void
{
if (event.kind == CollectionEventKind.ADD)
{
//do something
}
else if (event.kind == CollectionEventKind.REMOVE)
{
//do something
//here is the problem: event.items.length = 0
}
else
{
trace('CollectionEvent: kind not handled!');
}
}
Does somebody know why the removed item is no开发者_如何学JAVAt in 'items'?
Thanks in advance!
Sounds like it could be a bug. Try using a newer SDK version, or check https://bugs.adobe.com/jira/
精彩评论