就以back为例子 抛出主要是通过this.event(SportsResultView.BACK)抛出
var SportsResultView = (function () {
function SportsResultView() {
ChapterView.__super.call(this);
this.init();
}
Laya.class(SportsResultView, 'SportsResultView', SportsResultViewUI);
var __proto = SportsResultView.prototype;
__proto.init = function () {
var Event = laya.events.Event;
this.btnBack.on(Event.CLICK, this, function () {
this.event(SportsResultView.BACK)
})
}
SportsResultView.BACK = "back"
return SportsResultView
})()
下面是接收 先通过 this.view = new SportsResultView(); 实例化对象 通过on接收事件
var SportsResultScene = (function () {
function SportsResultScene() {
SportsResultScene.__super.call(this);
this.init();
}
Laya.class(SportsResultScene, 'SportsResultScene', PaoYa.Scene);
var __proto = SportsResultScene.prototype;
__proto.init = function () {
this.view = new SportsResultView();
this.view.on(SportsResultView.BACK, this, this.sportResultBack);
this.view.on(SportsResultView.SHARE, this, this.sportResultShare);
}
return SportsResultScene
})()