[]为何对sp的监听事件没有反应呢?

var xxx:Laya.Sprite = new Laya.Sprite();
xxx.graphics.drawRect(0,0,100, 100,"#ffffff");
xxx.size(100, 100);
xxx.mouseEnabled = true;
xxx.x = (Laya.stage.width - xxx.width) / 2;
xxx.y = (Laya.stage.height - xxx.height) / 2;
Laya.stage.addChild(xxx);
xxx.on(Laya.Event.CLICK, this, this.onXXX);

private onXXX() {
   console.debug("Hello");
}
已邀请:

cuixueying

赞同来自:

最好给个可以运行的例子吧,以上代码是没有问题的!

要回复问题请先

商务合作
商务合作