titmael Posted April 4, 2014 Share Posted April 4, 2014 Hi, when I use game.destroy() it nukes the game but not completely, I have some JS errors when I use a key I did bind on the game (spacebar, up, down ...) :Uncaught TypeError: Cannot read property 'disabled' of null (phaser.js:20317) I'm using Phaser v2.0.2 "Ghealdan" - Built: Fri Mar 28 2014 01:30:50 Thank for your help Link to comment Share on other sites More sharing options...
titmael Posted April 6, 2014 Author Share Posted April 6, 2014 up Link to comment Share on other sites More sharing options...
adamyall Posted April 6, 2014 Share Posted April 6, 2014 I assume you are using signal binding like onDown?I have set up a fiddle that sets up an onDown binding to do console logging when "1" is pressed. I'm getting (different) errors as well when I delete the game. I have even added quite a few lines to try and unbind the keys, but it doesn't seem to work. It might come down to the fact that "nuking" the game isn't really an ideal situation. Anyway, I think you are on to something. http://jsfiddle.net/adamholdenyall/KP2GS/3/ Link to comment Share on other sites More sharing options...
bmceldowney Posted April 7, 2014 Share Posted April 7, 2014 I think I see the problem. This is what the Phaser.Input.stop() method looks like: /** * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. * * @method Phaser.Keyboard#stop */ stop: function () { this._onKeyDown = null; this._onKeyUp = null; window.removeEventListener('keydown', this._onKeyDown); window.removeEventListener('keyup', this._onKeyUp); },I'll bet you that if those listeners get nulled out after they are removed instead of before then this method will work as intended. adamyall 1 Link to comment Share on other sites More sharing options...
rich Posted April 8, 2014 Share Posted April 8, 2014 Yup this is in 2.0.3-dev (thanks to your contribution iirc ) Link to comment Share on other sites More sharing options...
titmael Posted April 9, 2014 Author Share Posted April 9, 2014 Thanks guys for your help, I'll be watching for the next release Link to comment Share on other sites More sharing options...
Recommended Posts