[]Tween回调方法里如何带参数?
Tween.to(sp, {x:_x, y:_y, alpha:1}, 1000, null, Handler.create(This, function(){
sp.destroy();
}), 500);
这样写sp并不能被销毁,请问laya里沒有onCompleteParams方法吗?
sp.destroy();
}), 500);
这样写sp并不能被销毁,请问laya里沒有onCompleteParams方法吗?
要回复问题请先登录
2 个回复
cuixueying
赞同来自:
测试代码:
Complete事件你没写错,就是那么写的
ohkei - as3、as2、h5
赞同来自:
var sp:Sprite=new Sprite();
sp.graphics.drawRect(0,0,100,100,"#FF0000");
Laya.stage.addChild(sp);
Tween.to(sp,{x:300,y:300,alpha:0.5},1000,null,Handler.create(this,function():void
{
sp.destroy();
}));
}
@cuixueying ,我刚刚试了一下写1个sp确实好用,但要是放到循环里就无法销毁每一个sp啦