我在一个函数中有这个代码片段,该函数检查舞台上是否存在对象并将其删除:
public function closeContent(e:MouseEvent):void {
removeChild(txt);
removeChild(ldr.content);
removeChild(_closeButton);
container_mc.visible = false;
statusText.text="";
if (contains(submitButton)) {
removeChild(submitButton);
}
if (contains(saveinfoButton)) {
removeChild(saveinfoButton);
}
}
我试图改变但总是得到这个stage
错误this
root
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller