[SOLVED] Need work example hxd.Res.initPak()


#1

Hello!
I need to load a large amount of graphics into the JS application and therefore the option of compiling inside the JS code is inconvenient, too heavy JS code comes out. I’m trying to use hxd.Res.initPak() to load resources as a separate file. The file itself is collected through Build.hx. I rename the result-file and write it next to the JS file. But the program does not see it at startup, probably looking for it in the local or embedded file system. Can I fix my example or show you how to work correctly with initPak() ?
Thank you all in advance!

Example project.

Error:
uncaught exception: Error: TODO [WebSpace15.js:44507:9](file:///M:/haxe/WebSpace15_pak/bin/WebSpace15.js)
loadPak file:///M:/haxe/WebSpace15_pak/bin/WebSpace15.js:44507
main file:///M:/haxe/WebSpace15_pak/bin/WebSpace15.js:260


#2

The solution was found, it was necessary to use “new hxd.fmt.pak.Loader(s2d)”, and res-files will be downloaded over the network: res.pak, res0.pak, etc. The progress bar will be displayed on the S2D.