Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Menu state audio issue


joe2movies
 Share

Recommended Posts

I have an issue with the audio when first start the game in the menu state. The audio doesn't play.  But after I start playing the game from another state and return to the menu state it works fine.  When i test in android phone it doesn't work properly, but when I test emulator it seems to work fine.

I use phonegap to build the app.  Below is the code to my menu state

var menuAudio = null;

var menuState = {
   create: function () {

     this.menuAudio = game.add.audio('cheering');
     this.menuAudio.loop = false;                  
     this.menuAudio.volume = 1;       
     this.menuAudio.play();   

     var favButton = this.game.add.button(370,780,"favFolder",this.favMovies,this);
     favButton.anchor.setTo(0.5,0.5);               

   },
   favMovies: function(){   
      if (this.menuAudio != null) {
    this.menuAudio.destroy();
      } 

      game.state.start("difficulty");

   }
}
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...