pistacchio Posted September 24, 2015 Share Posted September 24, 2015 Hi,I think that I've done everything correctly, but in the following simple code (take from a much larger project) onLoadStart and onLoadComplete don't work. The game is running locally with python SimpleHTTPServer. Any help? Thanks // SPLASH SCREEN STATEGame.Splash = function (game) {};Game.Splash.prototype = { preload: function () { this.load.image('images', 'static/img/images.png'); }, create: function () { var self = this; this.load.onLoadStart.add(function () { debugger; }, this); this.load.onLoadComplete.add(function () { debugger; }, this); }}var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', null, false, false);game.state.add('Splash', Game.Splash);game.state.start('Splash'); Link to comment Share on other sites More sharing options...
rich Posted September 24, 2015 Share Posted September 24, 2015 By the time 'create' is called all of the Loader processes have completed, so no events will fire. You need to move your event handles inside the preload method. Link to comment Share on other sites More sharing options...
pistacchio Posted September 24, 2015 Author Share Posted September 24, 2015 Thanks, this worked. I had the event listeners set in create() because I found it in this example: http://phaser.io/examples/v2/loader/load-events Link to comment Share on other sites More sharing options...
rich Posted September 24, 2015 Share Posted September 24, 2015 That example is showing how to load assets outside of the preload function. Link to comment Share on other sites More sharing options...
Recommended Posts