#

API Docs for: 1.5.0
Show: Inherited Protected Private Deprecated

# AtlasLoader Class

Extends EventTarget
Defined in: `src/pixi/loaders/AtlasLoader.js:5`
Module: PIXI

The atlas file loader is used to load in Atlas data and parse it When loaded this class will dispatch a 'loaded' event If loading fails this class will dispatch an 'error' event

## Constructor

### `AtlasLoader`

(

- `url`
- `crossorigin`

)

Defined in `src/pixi/loaders/AtlasLoader.js:5`

#### Parameters:

- `url` String

  the url of the JSON file

- `crossorigin` Boolean

- Index
- Methods
- Properties

## Item Index

### Methods

- addEventListener
- dispatchEvent
- load
- onAtlasLoaded
- onError
- onLoaded
- removeAllEventListeners
- removeEventListener

### Properties

- listeners

## Methods

### `addEventListener`

(

- `type`
- `listener`

)

Inherited from EventTarget: `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`

)

Inherited from EventTarget: `src/pixi/utils/EventTarget.js:55`

Fires the event, ie pretends that the event has happened

#### Parameters:

- `event` Event

  the event object

### `load`

()

Defined in `src/pixi/loaders/AtlasLoader.js:29`

Starts loading the JSON file

### `onAtlasLoaded`

() private

Defined in `src/pixi/loaders/AtlasLoader.js:43`

Invoke when JSON file is loaded

### `onError`

() private

Defined in `src/pixi/loaders/AtlasLoader.js:180`

Invoke when error occured

### `onLoaded`

() private

Defined in `src/pixi/loaders/AtlasLoader.js:162`

Invoke when json file has loaded

### `removeAllEventListeners`

(

- `type`

)

Inherited from EventTarget: `src/pixi/utils/EventTarget.js:96`

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`

)

Inherited from EventTarget: `src/pixi/utils/EventTarget.js:77`

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

Inherited from EventTarget: `src/pixi/utils/EventTarget.js:24`

Holds all the listeners