各位大神,小弟使用 Cocos Code Ide 开发 html5版本的游戏
代码:var Layer = ccs.uiReader.widgetFromJsonFile(“res/publish/IndexUi_1.json”);
在 debug模式下可以正常运行
用google浏览器和火狐无法正常使用,JS报错内容内容为:uncaught exception: Please load the resource first : res/publish/IndexUi_1.json
resource.js 代码如下
var res = {
HelloWorld_png : “res/HelloWorld.png”,
CloseNormal_png : “res/CloseNormal.png”,
CloseSelected_png : “res/CloseSelected.png”,
Cocos2dJson : “res/publish/IndexUi_1.json”,
};
var g_resources = ];
for (var i in res) {
g_resources.push(res*);
}
这样资源已经加载过了吧 但为什么还是提示:uncaught exception: Please load the resource first : res/publish/IndexUi_1.json