phaser icon indicating copy to clipboard operation
phaser copied to clipboard

Problem with preloaded audio assets when exiting and re-opening game

Open mkristo opened this issue 11 years ago • 1 comments

I've noticed some weird behavior when exiting game and re-opening the game while having preloaded audio assets.

I'm getting:

Uncaught TypeError: Cannot read property 'isSoundDecoded' of null

originating from the following code-snippet from Sound.js:

//  Does the sound need decoding?
if (this.game.cache.isSoundDecoded(this.key))

It seems like Phaser doesn't setup/clear the cache properly when re-opening the game.

Thanks for a great framework!

EDIT: Removed faulty conclusions previously added. Calling cache.destroy() did not solve the issue.

mkristo avatar Apr 07 '15 13:04 mkristo

This was an issue with the application code, not with Phaser at all. Sorry about that, guys!

mkristo avatar Apr 07 '15 13:04 mkristo