keelbo
keelbo

Reputation: 19

How to load assets with priority using preloadjs?

I want to load assets using priority. I wrote an abstract class which will handle the preloadjs queue using priority.

Is there any better way to achieve this?

Upvotes: 0

Views: 297

Answers (1)

Vipin Kumar
Vipin Kumar

Reputation: 6546

Have a look at documentation of LoadQueue.js.

Here it is mentioned to use maintainScriptOrder property, like below.

     *      var queue = new createjs.LoadQueue();
     *      queue.setMaxConnections(3); // Set a higher number to load multiple items at once
     *      queue.maintainScriptOrder = true; // Ensure scripts are loaded in order
     *      queue.loadManifest([
     *          "script1.js",
     *          "script2.js",
     *          "image.png", // Load any time
     *          {src: "image2.png", maintainOrder: true} // Will wait for script2.js
     *          "image3.png",
     *          "script3.js" // Will wait for image2.png before loading (or completing when loading with XHR)
     *      ]);

Upvotes: 1

Related Questions