bluedot Posted July 28, 2014 Share Posted July 28, 2014 Hi, I'm having problems stopping music once started: I'm using this code: preload: this.game.load.audio('backgroundMusic', 'assets/oedipus_ark_pandora.mp3'); create: this.backgroundMusic = this.game.add.audio('backgroundMusic'); this.backgroundMusic.volume = 0.3; this.backgroundMusic.loop = true; this.backgroundMusic.play(); displayResults: this.backgroundMusic.loop = false; this.backgroundMusic.stop(); this.state.start('Results'); The problem is the music keeps playing when the state switched. Is this a bug or am I doing something wrong ? It seems to work if there's no looping set. Thanks. Link to comment Share on other sites More sharing options...
bluedot Posted July 28, 2014 Author Share Posted July 28, 2014 Arggh, I knew I should have checked first. Another developer has inserted another state change code without going through the proper one. Link to comment Share on other sites More sharing options...
Recommended Posts