Class: Loader

Creap. Loader

Class related to loader.


new Loader()

Create loader.

Source:

Methods


load(path, callback)

Asynchronously load js file.

Parameters:
Name Type Description
path string | array.<string>

File path(s).

callback function

Callback when the file loaded.
Context 'this' in callback is Creap.Loader.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Loader

loadContent(data, callback)

Asynchronously load js file built by animate CC and create instance of Creap.Content.

var loader = new Creap.Loader();
var data = {
    name: 'contentA', path: './content.js', lib: 'lib', root: 'root', images: 'images', ss: 'ss', basePath: './'}
};
loader.loadContent(data, function(contents) {
    contents.contentA.createJson();
});

This code is equivalent to the following code.

var loader = new Creap.Loader();
loader.load('./content.js', function() {
    var contentA = new Creap.Content('lib', 'rep', 'images', 'ss', './')
    contentA.createJson();
});
Parameters:
Name Type Description
data LoadContentData | array.<LoadContentData>

Content data(s).

callback function

Callback when the file loaded.
Context 'this' in callback is Creap.Loader.

Since:
  • 1.1.0
Source:
See:
Returns:

Return a itself (can use method chaining).

Type
Creap.Loader

loadCSV(data, callback, encode)

Asynchronously load csv file(s).

Parameters:
Name Type Description
data LoadCSVData | array.<LoadCSVData>

CSV data(s).

callback function

Callback when the file loaded.
Context 'this' in callback is Creap.Loader.

encode Creap.encoding

Callback when the file loaded.

Since:
  • 1.1.2
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Loader