Hi guys
how do you load the js files that are being downloaded from assetsmanager?
can you show me the actual code for this thanks…
My game is also using downloadable js files from assetsmanager.
First of all, the files that have been downloaded from AssetsManager will be saved to writable path + assets’ path taken from the manifest file. So make sure you’ve specified a path that will only be used for all the js files (i.e. “Scripts/xxx.js”).
[inside manifest file]
{
"assets": {
"Scripts/xxx.js": {
"md5": "e5b4fc82........"
}
},
...
}
Then add that path to the search paths on the AppDelegate.
/* ---- add search paths on AppDelegate.cpp ---- */
std::string writablePath = cocos2d::FileUtils::getInstance()->getWritablePath();
std::vector<std::string> searchPaths;
searchPaths.push_back(writablePath + "/Scripts/");
cocos2d::FileUtils::getInstance()->setSearchPaths(searchPaths);
hey thanks 
is this mean that the exact path where the assets are save is in PATH = writable path + assets key?
this key here
then ill append it to the file utils search path?
hehe sorry just a new bie here in cocos2d…
btw i am using cocos2dx-js 
thank you man 
yes AssetsManager will save it there.
anyway sorry I write the code on C++ because I used C++ for my game’s core and JS for ui scripting, and else
thanks sir
I have one last question…
what is the purpose of the searchPath in the manifest file?
and can i see the format of your manifest file? just the format hehe
I didn’t quite understand your questions here but I will tell you what I did for my assets downloading process. First I specify some folders to gather the javascript files that will be downloaded using AssetsManager which in my case I specify three folders to host different roles of javascript files: UIScripts, FormulaScripts, and UnitScripts. Then I create the manifest file that will write the specified path in the assets path inside the manifest file. The manifest will be something like this
{
"assets": {
"UIScripts/menuA.js": {
"md5": "........"
},
"UIScripts/menuB.js": {
"md5": "......."
},
"FormulaScripts/formulaA.js": {
"md5": "......."
},
"FormulaScripts/formulaB.js": {
"md5": "......."
},
"UnitScripts/unitA.js": {
"md5": "......."
},
"UnitScripts/unitB.js": {
"md5": "......."
},
... (and so on)
},
...
}
Then I have to set a collection of search paths so that FileUtils can find the specified resources. In my case I have to add three search paths each for UIScripts, FormulaScripts and UnitScripts.
And this case is just for scripts, I have another manifests to handle image and also sound assets as well.