javascripteaseljscreatejspreloadjs

Delaying preloadjs for fixed time for testing


Is there a way in preloadjs to delay the loading of resources by say 2 seconds just for testing purpose to see the animation in action. As in localhost the files are loaded very quickly.

Thanks in advance.


Solution

  • The best solution would be to use a network throttling tool to simulate low bandwidth. For example, you can do this in Chrome 38 devtools.

    If you really wanted to do it in code, it would be trivial to simply delay the start of the load. Something like:

    var queue = new createjs.PreloadJS();
    queue.loadManifest({ ... }, false); // false: don't load immediately
    setInterval(function() { queue.load(); }, 2000); // start in 2s