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 に答える