[]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);
}
}
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);
}
}
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
nevercai
赞同来自:
区别于AS3,js访问成员都必须加上this.