#

API Documentation for: NEXT
Show: Inherited Protected Private Deprecated

# Event Class

Defined in: `Event:47`
Module: CreateJS

Contains properties and methods shared by all events for use with EventDispatcher.

Note that Event objects are often reused, so you should never rely on an event object's state outside of the call stack it was received in.

## Constructor

### `Event`

(

- `type`
- `bubbles`
- `cancelable`

)

Defined in `Event:47`

#### Parameters:

- `type` String

  The event type.

- `bubbles` Boolean

  Indicates whether the event will bubble through the display list.

- `cancelable` Boolean

  Indicates whether the default behaviour of this event can be cancelled.

- Index
- Methods
- Properties

## Item Index

### Methods

- clone
- initialize
- preventDefault
- remove
- set
- stopImmediatePropagation
- stopPropagation
- toString

### Properties

- bubbles
- cancelable
- currentTarget
- defaultPrevented
- eventPhase
- immediatePropagationStopped
- propagationStopped
- removed
- target
- timeStamp
- type

## Methods

### `clone`

() Event

Defined in `clone:236`

Returns a clone of the Event instance.

#### Returns:

Event:

a clone of the Event instance.

### `initialize`

(

- `type`
- `bubbles`
- `cancelable`

)
protected

Defined in `initialize:177`

Initialization method.

#### Parameters:

- `type` String

  The event type.

- `bubbles` Boolean

  Indicates whether the event will bubble through the display list.

- `cancelable` Boolean

  Indicates whether the default behaviour of this event can be cancelled.

### `preventDefault`

()

Defined in `preventDefault:194`

Sets Event/defaultPrevented to true. Mirrors the DOM event standard.

### `remove`

()

Defined in `remove:222`

Causes the active listener to be removed via removeEventListener();

        myBtn.addEventListener("click", function(evt) {
            // do stuff...
            evt.remove(); // removes this listener.
        });

### `set`

(

- `props`

)
Event

Defined in `set:245`

Provides a chainable shortcut method for setting a number of properties on the instance.

#### Parameters:

- `props` Object

  A generic object containing properties to copy to the instance.

#### Returns:

Event:

Returns the instance the method is called on (useful for chaining calls.)

### `stopImmediatePropagation`

()

Defined in `stopImmediatePropagation:212`

Sets Event/propagationStopped and Event/immediatePropagationStopped to true. Mirrors the DOM event standard.

### `stopPropagation`

()

Defined in `stopPropagation:203`

Sets Event/propagationStopped to true. Mirrors the DOM event standard.

### `toString`

() String

Defined in `toString:257`

Returns a string representation of this object.

#### Returns:

String:

a string representation of the instance.

## Properties

### `bubbles`

Boolean

Defined in `bubbles:109`

Indicates whether the event will bubble through the display list.

Default: false

### `cancelable`

Boolean

Defined in `cancelable:118`

Indicates whether the default behaviour of this event can be cancelled via preventDefault. This is set via the Event constructor.

Default: false

### `currentTarget`

Object

Defined in `currentTarget:84`

The current target that a bubbling event is being dispatched from. For non-bubbling events, this will always be the same as target. For example, if childObj.parent = parentObj, and a bubbling event is generated from childObj, then a listener on parentObj would receive the event with target=childObj (the original target) and currentTarget=parentObj (where the listener was added).

Default: null

### `defaultPrevented`

Boolean

Defined in `defaultPrevented:137`

Indicates if preventDefault has been called on this event.

Default: false

### `eventPhase`

Number

Defined in `eventPhase:96`

For bubbling events, this indicates the current event phase:

1. capture phase: starting from the top parent to the target
2. at target phase: currently being dispatched from the target
3. bubbling phase: from the target to the top parent

Default: 0

### `immediatePropagationStopped`

Boolean

Defined in `immediatePropagationStopped:157`

Indicates if stopImmediatePropagation has been called on this event.

Default: false

### `propagationStopped`

Boolean

Defined in `propagationStopped:147`

Indicates if stopPropagation or stopImmediatePropagation has been called on this event.

Default: false

### `removed`

Boolean

Defined in `removed:167`

Indicates if remove has been called on this event.

Default: false

### `target`

Object

Defined in `target:75`

The object that generated an event.

Default: null

### `timeStamp`

Number

Defined in `timeStamp:128`

The epoch time at which this event was created.

Default: 0

### `type`

String

Defined in `type:68`

The type of event.