Fix CocosDenshionTest playMusic won't work under android system

Fix click setNotificationNode button in SceneTest then return to main menu the animation is still play on screen
This commit is contained in:
XiaoFeng 2016-03-03 16:47:05 +08:00
parent 462f4f4c0a
commit ce555f68de
2 changed files with 7 additions and 2 deletions

View File

@ -231,7 +231,11 @@ var soundId = null;
var playMusic = function () {
cc.log("play background music");
audioEngine.playMusic(MUSIC_FILE, false);
var musicFile = MUSIC_FILE;
if (cc.sys.os == cc.sys.OS_ANDROID) {
musicFile = "res/"+musicFile;
}
audioEngine.playMusic(musicFile, false);
};
var stopMusic = function () {

View File

@ -103,7 +103,8 @@ var SceneTestLayer1 = cc.Layer.extend({
director.pushScene(new cc.TransitionSlideInT(1, scene));
},
onQuit:function (sender) {
onExit:function (sender) {
cc.director.setNotificationNode(null);
}
//CREATE_NODE(SceneTestLayer1);