[]LAYA js 1.7.12 Tween 使用时回调时 core报错

在线的演示代码中添加了回调函数,执行没有问题,在下载的js包集成中,使用完全一样的代码,提示
Uncaught TypeError: handler.run is not a function
at Tween.__proto.complete (laya.core.js:9423)

9423 :handler && handler.run();

你们自己试试吧。。为啥要。&&run()
已邀请:

Vivapercuore

赞同来自:

暂时的解决方案是,用一个和执行时间参数一样的settiimeout来执行回调

Monica - 知识达人

赞同来自:

能否提供一个有问题的例子呢?我们看下

Vivapercuore

赞同来自:

this.body = new Laya.Animation();
this.body.loadAtlas(config[this.type].imgBang, Laya.Handler.create(this, this.onLoad));
this.body.width = config[this.type].width
this.body.height = config[this.type].height


onLoad(){
Tween.to(this.body, { x: (config[this.type].width / 2) + 10, y: (config[this.type].heightp / 2) + 45 }, 500,callback)
}

callback

赞同来自:

你的callback 是一个Function?? 根据api callback必须是一个
to(target:*, props:Object, duration:int, ease:Function = null, complete:Handler = null, delay:int = 0, coverBefore:Boolean = false):Tween

Tween.to(this.body, { x: (config[this.type].width / 2) + 10, y: (config[this.type].heightp / 2) + 45 }, 500,Laya.Handler.create(this, this.callback))

 

要回复问题请先

商务合作
商务合作