Jump to content

Texture.fromFrame weird Firefox behavior


strouthas
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...