var Global = require("Global"); var UIHelper = require("UIHelper"); cc.Class({ extends: cc.Component, properties: { _headInfo:null, }, // LIFE-CYCLE CALLBACKS: onLoad () { UIHelper.addButtonListener(this.node.getChildByName("Mask"), this.node, "hideSelf", "onClicked"); }, onClicked :function(event){ UIHelper.playButtonEffect("close"); if(event.target.name == "Mask"){ this.node.active = false; } }, });