CocosCreator - pass up events (bubbling)

/**
* Distribute event into the event flow.
* This.node.dispatchEvent (new cc.Event.EventCustom ( "name", whether passed up))
* True: passed up, passed to the parent node.
* False: passed down
*/
var e = new cc.Event.EventCustom ( "event name string", true)
e.detail = {
  name:" data"
}
this.node.dispatchEvent(e)

Guess you like

Origin www.cnblogs.com/500m/p/11372022.html