API Documentation for: 1.0.0
Show:

Types Class

Defined in: Types:41
Module: PreloadJS

Defines the load types that PreloadJS supports by default. This is typically used when passing a type override to a LoadQueue.

Example

    queue.loadFile({src:"https://somecdn/wfossn3", type:createjs.Types.IMAGE});

You can also use the string value:

    queue.loadFile({src:"https://somecdn/wfossn3", type:"image"});

Item Index

Properties

Properties

BINARY

String static

Defined in BINARY:59

Available since 0.6.0

The preload type for generic binary types. Note that images are loaded as binary files when using XHR.

Default: binary

CSS

String static

Defined in CSS:69

Available since 0.6.0

The preload type for css files. CSS files are loaded using a <link> when loaded with XHR, or a <style> tag when loaded with tags.

Default: css

FONT

String static

Defined in FONT:80

Available since 0.9.0

The preload type for font files.

Default: font

FONTCSS

String static

Defined in FONTCSS:90

Available since 0.9.0

The preload type for fonts specified with CSS (such as Google fonts)

Default: fontcss

IMAGE

String static

Defined in IMAGE:100

Available since 0.6.0

The preload type for image files, usually png, gif, or jpg/jpeg. Images are loaded into an <image> tag.

Default: image

JAVASCRIPT

String static

Defined in JAVASCRIPT:110

Available since 0.6.0

The preload type for javascript files, usually with the "js" file extension. JavaScript files are loaded into a <script> tag.

Since version 0.4.1+, due to how tag-loaded scripts work, all JavaScript files are automatically injected into the body of the document to maintain parity between XHR and tag-loaded scripts. In version 0.4.0 and earlier, only tag-loaded scripts are injected.

Default: javascript

JSON

String static

Defined in JSON:125

Available since 0.6.0

The preload type for json files, usually with the "json" file extension. JSON data is loaded and parsed into a JavaScript object. Note that if a callback is present on the load item, the file will be loaded with JSONP, no matter what the LoadQueue/preferXHR:property property is set to, and the JSON must contain a matching wrapper function.

Default: json

JSONP

String static

Defined in JSONP:138

Available since 0.6.0

The preload type for jsonp files, usually with the "json" file extension. JSON data is loaded and parsed into a JavaScript object. You are required to pass a callback parameter that matches the function wrapper in the JSON. Note that JSONP will always be used if there is a callback present, no matter what the LoadQueue/preferXHR:property property is set to.

Default: jsonp

MANIFEST

String static

Defined in MANIFEST:151

Available since 0.6.0

The preload type for json-based manifest files, usually with the "json" file extension. The JSON data is loaded and parsed into a JavaScript object. PreloadJS will then look for a "manifest" property in the JSON, which is an Array of files to load, following the same format as the loadManifest method. If a "callback" is specified on the manifest object, then it will be loaded using JSONP instead, regardless of what the LoadQueue/preferXHR:property property is set to.

Default: manifest

SOUND

String static

Defined in SOUND:165

Available since 0.6.0

The preload type for sound files, usually mp3, ogg, or wav. When loading via tags, audio is loaded into an <audio> tag.

Default: sound

SPRITESHEET

String static

Defined in SPRITESHEET:187

Available since 0.6.0

The preload type for SpriteSheet files. SpriteSheet files are JSON files that contain string image paths.

Default: spritesheet

SVG

String static

Defined in SVG:197

Available since 0.6.0

The preload type for SVG files.

Default: svg

TEXT

String static

Defined in TEXT:207

Available since 0.6.0

The preload type for text files, which is also the default file type if the type can not be determined. Text is loaded as raw text.

Default: text

VIDEO

String static

Defined in VIDEO:176

Available since 0.6.0

The preload type for video files, usually mp4, ts, or ogg. When loading via tags, video is loaded into an <video> tag.

Default: video

XML

String static

Defined in XML:218

Available since 0.6.0

The preload type for xml files. XML is loaded into an XML document.

Default: xml