我从这个开源项目Loading Spinner中找到了以下代码片段
public function Spinner() {
super();
addEventListener(FlexEvent.CREATION_COMPLETE, handleCreationComplete);
}
private function handleCreationComplete(e:FlexEvent):void {
removeEventListener(FlexEvent.CREATION_COMPLETE, handleCreationComplete);
if (autoPlay) {
play();
}
}
为什么需要 removeEventListener 行?这是否意味着一个 creationComplete 事件将被触发超过 1 次?