From cf70cb9c40c02764cb24895e21724ab94e1f2c20 Mon Sep 17 00:00:00 2001 From: VisualSj Date: Fri, 24 Jul 2015 17:41:01 +0800 Subject: [PATCH] Issue #12940: Fixed a bug that is removing SimpleAudio play --- .../script/studio/parsers/timelineParser-2.x.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js b/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js index c8ab968f48..d7a65c13b3 100644 --- a/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js +++ b/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js @@ -1177,15 +1177,13 @@ */ parser.initSimpleAudio = function(json, resourcePath){ + var node = new ccs.ComAudio(); var loop = json["Loop"] || false; - var volume = json["Volume"] || 0; - cc.audioEngine.setMusicVolume(volume); - //var name = json["Name"]; - + //var volume = json["Volume"] || 0; + //cc.audioEngine.setMusicVolume(volume); + node.setLoop(loop); loadTexture(json["FileData"], resourcePath, function(path, type){ - cc.loader.load(path, function(){ - cc.audioEngine.playMusic(path, loop); - }); + node.setFile(path); }); };