0

获得对 arrayCollection 的引用并像这样添加事件侦听器:

collection.addEventListener(CollectionEvent.COLLECTION_CHANGE, onCollectionChange);

没关系。现在,其他一些组件确实具有相同的引用,并且正在向该集合添加项目并从该集合中删除项目。每次调用处理程序时:

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!');
  }
}

有人知道为什么删除的项目不在“项目”中吗?

提前致谢!

4

1 回答 1

0

听起来这可能是一个错误。尝试使用更新的 SDK 版本,或查看https://bugs.adobe.com/jira/

于 2010-05-31T02:25:07.560 回答