[]JS里面定义一个函数,无法使用Laya.Handler.creat回调

代码运行到Laya.Handler.create时候提示onTxtLoad is undfine.请教应该怎么定义?
export default class LocalTxt{
constructor() {
LocalTxt.Instance = this;
}

onTxtLoad(aText){
console.info("dfasd");
}

initTxt(){
Laya.loader.load("res/localtxt.txt",Laya.Handler.create(this, onTxtLoad),null,Loader.TEXT);
}
}
已邀请:

nevercai

赞同来自:

这是类的成员函数,需要加上this,使用this.onTxtLoad。
区别于AS3,js访问成员都必须加上this.
 

要回复问题请先

商务合作
商务合作