public function tweenGuide1(image:Image):void
{
image.x = 0;
image.y = 0;
image.scale(1,1);
Tween.to(image,{scaleX:0.5,scaleY:0.5},600,null,new Handler(this,tweenGuide,[image]),500);
}
public function tweenGuide1(image:Image):void
{
Tween.to(image,{x:100,y:100},600,null,new Handler(this,tweenGuide1,[image]),500);
}
********************************************【End】************************************************
这样写好像就会报上面这个错,把_guideImage当参数传给tweenGuide1,然后再传给tweenGuide。测了很久,我把image改成_guideImage就不会报错了。还待观察
******************************************【改过之后】***********************************************
private var _guideImage:Image;
public function main():void
{
_guideImage = new Image();
_guideImage.source = Loader.getRes("source/png/ui/1/guideImg.png");
2 个回复
nieyiwei
赞同来自:
public function main():void
{
_guideImage = new Image();
_guideImage.source = Loader.getRes("source/png/ui/1/guideImg.png");
tweenGuide1(_guideImage );
Tween.clearAll(_guideImage);
_guideImage.destroy(true);
_guideImage.dispose();
_guideImage = null;
}
public function tweenGuide1(image:Image):void
{
image.x = 0;
image.y = 0;
image.scale(1,1);
Tween.to(image,{scaleX:0.5,scaleY:0.5},600,null,new Handler(this,tweenGuide,[image]),500);
}
public function tweenGuide1(image:Image):void
{
Tween.to(image,{x:100,y:100},600,null,new Handler(this,tweenGuide1,[image]),500);
}
********************************************【End】************************************************
这样写好像就会报上面这个错,把_guideImage当参数传给tweenGuide1,然后再传给tweenGuide。测了很久,我把image改成_guideImage就不会报错了。还待观察
******************************************【改过之后】***********************************************
private var _guideImage:Image;
public function main():void
{
_guideImage = new Image();
_guideImage.source = Loader.getRes("source/png/ui/1/guideImg.png");
tweenGuide1();
Tween.clearAll(_guideImage);
_guideImage.destroy(true);
_guideImage.dispose();
_guideImage = null;
}
public function tweenGuide1():void
{
_guideImage.x = 0;
_guideImage.y = 0;
_guideImage.scale(1,1);
Tween.to(_guideImage,{scaleX:0.5,scaleY:G0.5},600,null,new Handler(this,tweenGuide),500);
}
public function tweenGuide():void
{
Tween.to(_guideImage,{x:100,y:100},600,null,new Handler(this,tweenGuide1),500);
}
Laya_XS
赞同来自:
_guideImage = new Image();
_guideImage.source = Loader.getRes("source/png/ui/1/guideImg.png");
tweenGuide1();
Tween.clearAll(_guideImage);
_guideImage.destroy(true);
_guideImage.dispose();
_guideImage = null;
你应该在动画播放完的回调里执行:
_guideImage.destroy(true);
_guideImage.dispose();
_guideImage = null;
就不会报你这个错误了