我想通过单击按钮向我的 Flash 鱼缸添加更多鱼..我尝试了此代码,但单击按钮后我的鱼动画没有动画..我正在使用动作脚本 3 ..
function fl_MouseClickHandler_2(event:MouseEvent):void
{
// Start your custom code
// This example code displays the words "Mouse clicked" in the Output panel.
trace("Mouse clicked");
addChild(f3);
addChild(eat) ;
addChild(hello) ;
addChild(f2) ;
addChild(f1) ;
// End your custom code
}
f1,f2,f3,eat,你好是我的鱼..
这是我的无限滚动代码..所有的鱼都在单独的层中..所以对于每一层我都放了这个代码..只需更改实例名称和函数。
f3.addEventListener(Event.ENTER_FRAME, fnewm);
function fnewm(evt:Event)
{
if(f3.x + f3.width <= 0) //movieclip is outside left side of stage
{
//set new position
f3.x = stage.stageWidth;
}
else
f3.x -= 5;
}