当我尝试使用addChild()
我的摇滚之一 1-5加上widerock时,我遇到了这个错误。
TypeError:错误 #2007:参数 child 必须为非空。atflash.display::DisplayObjectContainer/addChild() atsquareslide_fla::MainTimeline/loop()[squareslide_fla.MainTimeline::frame1:10]
您可以在下面看到我到目前为止所写的内容。
import flash.events.Event;
import flash.events.TouchEvent;
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
stage.addEventListener(Event.ENTER_FRAME,loop);
function loop(e:Event)
{
rock1.rotation +=10;
rock2.rotation +=10;
rock3.rotation +=10;
rock4.rotation +=10;
rock5.rotation +=10;
widerock.rotation +=10;
rock1.y +=10;
rock2.y +=10;
rock3.y +=10;
rock4.y +=10;
rock5.y +=10;
widerock.y +=10;
if (rock1.y >= 872.9)
{
rock1.y = -46.75;
}
if (rock2.y >= 872.9)
{
rock2.y = -84.75;
}
if (rock3.y >= 872.9)
{
rock3.y = -69.75;
}
if (rock4.y >= 872.9)
{
rock4.y = -230.9;
}
if (rock5.y >= 872.9)
{
rock5.y = -230.9;
}
if (widerock.y >= 872.9)
{
widerock.y = -547.8;
}
}