strouthas Posted May 7, 2018 Share Posted May 7, 2018 Hello, I am trying to build an AnimatedSprite by loading a .json exported from Flash CS6 and using the following code: var t1frames = []; for (var i = 0; i < 120; i++) { var val = i; if (i < 100) val = '0' + i; if (i < 10) val = '00' + i; t1frames.push(PIXI.Texture.fromFrame('tracker10' + val)); } var tracker1 = new PIXI.extras.AnimatedSprite(t1frames); as you can understand the json frame ids are 'tracker10000' up to 'tracker10119' The above code works fine in Chrome, Edge, IE11 and Opera, but in Firefox throws 'Error: The frameId "tracker10000" does not exist in the texture cache' By checking the debugger I found the following: message : "Error trying to parse loaded json: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data" which drives me crazy. I am attaching the .json here in case someone has any ideas. Thank you! tracker1.json Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 8, 2018 Share Posted May 8, 2018 Which web-server do you use? Are you sure that your CORS is right? App got a error instead of json, look into connection/network Quote Link to comment Share on other sites More sharing options...
strouthas Posted May 8, 2018 Author Share Posted May 8, 2018 Thanks for replying. I am running IIS locally in my PC, but I 've found what was wrong. Flash saved the json file as UTF8 and Firefox didn't like it. I converted to ANSI and worked like a charm! I should add a reply here, I am sorry. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 8, 2018 Share Posted May 8, 2018 UTF8 is fine if it doesnt have BOM I think your file had BOM. Its fine! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.