Saykrd Posted December 19, 2013 Share Posted December 19, 2013 So I'm currently loading this spritesheet data like this:this.load.atlas('myspritesheet', 'images/myspritesheet.png', 'images/myspritesheet.json');Which works fine in Chrome, but as soon as I try it in firefox I get this when it actually loads the file:SyntaxError: JSON.parse: unexpected character @ http://localhost:8000/js/phaser.min.js:9Which is really wierd. I validated the JSON and theres nothing wrong with it. This happens for every spritesheet I try to load, and only in Firefox. Any idea why this is? Link to comment Share on other sites More sharing options...
XekeDeath Posted December 19, 2013 Share Posted December 19, 2013 Post the json itself so we can see. Link to comment Share on other sites More sharing options...
Saykrd Posted December 19, 2013 Author Share Posted December 19, 2013 Right now, the error persists even if the JSON is as simple as this:{ "frames": [ { "filename": "myspritesheet instance 10000", "frame": { "x": 0, "y": 0, "w": 162, "h": 180 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, "w": 162, "h": 180 }, "sourceSize": { "w": 162, "h": 180 } } ], "meta": { "app": "Adobe Flash CS6", "version": "12.0.2.529", "image": "myspritesheet.png", "format": "RGBA8888", "size": { "w": 512, "h": 1024 }, "scale": "1" }} Link to comment Share on other sites More sharing options...
XekeDeath Posted December 19, 2013 Share Posted December 19, 2013 My first suggestion would be change "frames" to use {} instead of [].{ "frames": { <--- Change here... { "filename": "myspritesheet instance 10000", "frame": { "x": 0, "y": 0, "w": 162, "h": 180 }, "rotated": false, "trimmed": false, "spriteSourceSize": { "x": 0, "y": 0, "w": 162, "h": 180 }, "sourceSize": { "w": 162, "h": 180 } } }, <--- and here "meta": { "app": "Adobe Flash CS6", "version": "12.0.2.529", "image": "myspritesheet.png", "format": "RGBA8888", "size": { "w": 512, "h": 1024 }, "scale": "1" }}That is the only difference I can see between your JSON and mine... Link to comment Share on other sites More sharing options...
sfcal99 Posted December 19, 2013 Share Posted December 19, 2013 Not sure if its the same problem ... http://www.html5gamedevs.com/topic/1901-multiple-animation-not-working-in-firefox/?hl=%2Bfirefox+%2Bjson#entry13084 Link to comment Share on other sites More sharing options...
Saykrd Posted December 19, 2013 Author Share Posted December 19, 2013 Doesn't seem to help sadly. It's wierd, I can load a json by itself just fine, its just the load.atlus() call that makes it freak out. *Edit Not sure if its the same problem ... http://www.html5gamedevs.com/topic/1901-multiple-animation-not-working-in-firefox/?hl=%2Bfirefox+%2Bjson#entry13084 That might actually be it. Let me double check it... * UPDATE: Yup. That was it. Wow that drove me nuts, thanks. Link to comment Share on other sites More sharing options...
Recommended Posts