0

My code:

var queue = new createjs.LoadQueue(false);
    queue.on('complete', onComplete, this);
    queue.on('error', onError, this);
    queue.on('progress', onProgress, this);

    queue.loadManifest([
        { src: "images/ground.json", id: "1", type: createjs.Types.SPRITESHEET, crossOrigin:true }
      ]);
    
    function onComplete(event) {
        console.log('Complete', event);

        init();
    }

    function onError(event) {
        console.log('Error', event);
    }

    function onProgress(event) {
        console.log('General progress', Math.round(event.loaded * 100));
    }

with this json:

{
"images": ["images/HauptmenuOhneButtons.png"],
"frames": [
    [0, 0, 1920, 1080], 
],
"animations": {
    "background": [0]
}
}

my structure is:

  • index.html
  • images/ground.json
  • images/HauptmenuOhneButtons.png

I get the Error FILE_LOAD_ERROR.

HELP!

Matthias Ma
  • 103
  • 1
  • 6
  • Can you dig into the error? Or better, check out the debugger, and see what the network request looks like. PreloadJS could do a better job surfacing/exposing the browser error. This could be a number of things, none of which are identifiable from your sample, which looks fine. – Lanny Apr 22 '18 at 18:32
  • 1
    Thanks for you repsonse. I checked the network errors in the browser and i found nothing. So it was definetely a reading problem with the json and the preloadjs. See my answer. – Matthias Ma Apr 23 '18 at 02:02

1 Answers1

1

OK, your JSON File has to be PERFECT!

check every comma!! No commas after your last frame or animations.

{
    "images": ["images/HauptmenuOhneButtons.png"],
    "frames": [
        [0, 0, 1920, 1080] 
    ],
    "animations": {
        "background": [0]
    }
}
Matthias Ma
  • 103
  • 1
  • 6