[] laya.display.Text对象的event事件监听无效?
DEMO地址
http://jsbin.com/naxucicovo/edit?html,output
找到原因了
txt.text = '123'; //会调用EVENT.CHANGE事件
// txt.changeText('change text'); //不会调用event.change事件
事件绑定必须写成
txt.on(Laya.Event.CHANGE, this, function () {
alert('文本进行了修改!');
});
之前少了Laya
http://jsbin.com/naxucicovo/edit?html,output
找到原因了
txt.text = '123'; //会调用EVENT.CHANGE事件
// txt.changeText('change text'); //不会调用event.change事件
事件绑定必须写成
txt.on(Laya.Event.CHANGE, this, function () {
alert('文本进行了修改!');
});
之前少了Laya
没有找到相关结果
已邀请:
1 个回复
cuixueying
赞同来自: