#

API Docs for: 1.6.0
Show: Inherited Protected Private Deprecated

# EventTarget Class

Defined in: `src/pixi/utils/EventTarget.js:10`
Module: PIXI

Adds event emitter functionality to a class

- Index
- Methods
- Properties

## Item Index

### Methods

- addEventListener
- dispatchEvent
- removeAllEventListeners
- removeEventListener

### Properties

- listeners

## Methods

### `addEventListener`

(

- `type`
- `listener`

)

Defined in `src/pixi/utils/EventTarget.js:32`

Adds a listener for a specific event

#### Parameters:

- `type` String

  A string representing the event type to listen for.

- `listener` Function

  The callback function that will be fired when the event occurs

### `dispatchEvent`

(

- `event`

)

Defined in `src/pixi/utils/EventTarget.js:55`

Fires the event, ie pretends that the event has happened

#### Parameters:

- `event` Event

  the event object

### `removeAllEventListeners`

(

- `type`

)

Defined in `src/pixi/utils/EventTarget.js:101`

Removes all the listeners that were active for the specified event type

#### Parameters:

- `type` String

  A string representing the event type which will have all its listeners removed

### `removeEventListener`

(

- `type`
- `listener`

)

Defined in `src/pixi/utils/EventTarget.js:80`

Removes the specified listener that was assigned to the specified event type

#### Parameters:

- `type` String

  A string representing the event type which will have its listener removed

- `listener` Function

  The callback function that was be fired when the event occured

## Properties

### `listeners`

Object

Defined in `src/pixi/utils/EventTarget.js:24`

Holds all the listeners