我想检查一个孩子是否存在,如果它确实删除了它。如果不做其他事情......我还计划为更多的孩子做检查......
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown3);
function onKeyDown3(event:KeyboardEvent):void
{
if( event.keyCode == Keyboard.BACK )
{
if (over.stage){
event.preventDefault();
removeChild(over);
gotoAndPlay(350, "Scene 1");
}else {
event.preventDefault();
gotoAndPlay(346, "Scene 1");
}
}
}
我试过了,但它不起作用。但我认为它基本上显示了我想做的事情,但如果是为了其他孩子的话,还有更多其他事情。“结束”只是一个电影剪辑
错误:
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/setChildIndex()
at Bike_safety_fla::MainTimeline/onKeyDown1()[Bike_safety_fla.MainTimeline::frame146:17]
at runtime::ContentPlayer/sendKeyUpDown()
at runtime::SimulatedMobileDeviceContentPlayer/onBack()