Cocos Creator API

1.4.x

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

Event.EventCustom

Extends Event
Module: cc

The Custom event

Properties

detail Object

A reference to the detailed data of the event

type String

Inherited from Event:

The name of the event (case-sensitive), e.g. "click", "fire", or "submit".

bubbles Boolean

Inherited from Event:

Indicate whether the event bubbles up through the tree or not.

target Object

Inherited from Event:

A reference to the target to which the event was originally dispatched.

currentTarget Object

Inherited from Event:

A reference to the currently registered target for the event.

eventPhase Number

Inherited from Event:

Indicates which phase of the event flow is currently being evaluated. Returns an integer value represented by 4 constants:

  • Event.NONE = 0
  • Event.CAPTURING_PHASE = 1
  • Event.AT_TARGET = 2
  • Event.BUBBLING_PHASE = 3 The phases are explained in the [section 3.1, Event dispatch and DOM event flow] (http://www.w3.org/TR/DOM-Level-3-Events/#event-flow), of the DOM Level 3 Events specification.

NO_TYPE String readOnly

Inherited from Event:

Code for event without type.

NONE Number readOnly

Inherited from Event:

Events not currently dispatched are in this phase

CAPTURING_PHASE Number readOnly

Inherited from Event:

The capturing phase comprises the journey from the root to the last node before the event target's node see http://www.w3.org/TR/DOM-Level-3-Events/#event-flow

AT_TARGET Number readOnly

Inherited from Event:

The target phase comprises only the event target node see http://www.w3.org/TR/DOM-Level-3-Events/#event-flow

BUBBLING_PHASE Number readOnly

Inherited from Event:

The bubbling phase comprises any subsequent nodes encountered on the return trip to the root of the hierarchy see http://www.w3.org/TR/DOM-Level-3-Events/#event-flow

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

Methods

EventCustom
(
  • type
  • bubbles
)
EventCustom

name type description
type String

The name of the event (case-sensitive), e.g. "click", "fire", or "submit"

bubbles Boolean

A boolean indicating whether the event bubbles up through the tree or not

returns:

type: EventCustom

setUserData
(
  • data
)

Sets user data

name type description
data Any

getUserData ( ) Any

Gets user data

returns:

type: Any

getEventName ( ) String

Gets event name

returns:

type: String

Event
(
  • type
  • bubbles
)
Event

Inherited from Event:

name type description
type String

The name of the event (case-sensitive), e.g. "click", "fire", or "submit"

bubbles Boolean

A boolean indicating whether the event bubbles up through the tree or not