Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE 11 issue: Unable to set property 'loaded' of undefined or null reference #479

Closed
caltv opened this issue Feb 25, 2014 · 3 comments
Closed

Comments

@caltv
Copy link

caltv commented Feb 25, 2014

I am seeing this error in IE 11 on Win 7 and Win 8 when I preload assets outside of the main preload() function:

SCRIPT5007: Unable to set property 'loaded' of undefined or null reference
File: phaser.min.js, Line: 9, Column: 28871

It only appears after the file has been loaded previously and the page is refreshed....it doesn't always appear ...whenever it happens the assets loaded cannot be used... The issue does not happen with Chrome/Firefox/Safari

@photonstorm
Copy link
Collaborator

Can you post a code sample please.

@caltv
Copy link
Author

caltv commented Feb 26, 2014

This is called from a sub menu after the main preload is done

game.load.audio('n', ['audio/a.mp3', 'audio/a.ogg']);
game.load.onLoadComplete.add(createGame,this);
game.load.start();

Edit: I have "game.load.audio" in a loop that loads about 10 files simultaneously, if I load them individually the error goes away in IE11

@photonstorm
Copy link
Collaborator

I'm pretty sure the problem is the way you're loading them in a loop. Phaser.Loader isn't set-up to handle simultaneous downloads (it's on the roadmap but not included yet). So the first audio file starts and gets told to call Loader.fileComplete when it finishes (which then decodes it and adds it to the cache), but before it has a chance you've started the Loader again and it's going to try and call the same callback but with a different set of data, and a different file index. I just reckon a race condition is happening and it takes a cache load to manifest.

I'm going to close this for now because I suspect the cause is simply trying to use the Loader in a way that it can't handle, but if you think otherwise feel free to re-open with a full code sample that I can run in browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants