pixi.loaders.JsonLoader

type
class
extends
pixi.utils.EventTarget
metadata
:native
"PIXI.JsonLoader"

Constructor

new(url : String, ?crossorigin : Bool)
parameters
url {String} The url of the JSON file
[crossorigin] {Bool} Whether requests should be treated as crossorigin
The json file loader is used to load in JSON data and parse it When loaded this class will dispatch a 'loaded' event If loading fails this class will dispatch an 'error' event

Instance Variables hide inherited show inherited

ajaxRequest : Dynamic

XDomainRequest for cross origin

baseUrl : String

read-only The base url of the json file

crossorigin : Bool

Whether the requests should be treated as cross origin

json : Dynamic

Parsed json response

loaded : Bool

read-only Whether the data has loaded yet

url : String

The url of the json file

Instance Methods hide inherited show inherited

addEventListener(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget

dispatchEvent(eventName : String, ?data : Dynamic) : Bool

inherited from pixi.utils.EventTarget

emit(eventName : String, ?data : Dynamic) : Bool

inherited from pixi.utils.EventTarget
parameters
eventName {String} The name of the event.
data {Dynamic}
returns
{Bool} Indication if we've emitted an event.
Emit an event to all registered event listeners.

listeners(eventName : String) : Array<Dynamic>

inherited from pixi.utils.EventTarget
parameters
eventName {String} The events that should be listed.
returns
{Array} An array of listener functions
Return a list of assigned event listeners.

load() : Void

Loads the JSON data

off(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} The event we want to remove.
callback {Function} The listener that we need to find.
Remove event listeners.

on(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} Name of the event.
callback {Functon} Callback function.
Register a new EventListener for the given event.

once(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} Name of the event.
callback {Function} Callback function.
Add an EventListener that's only called once.

removeAllEventListeners(eventName : String) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} The event you want to remove all listeners for.
Remove all listeners or only the listeners for the specified event.

removeEventListener(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget