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

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

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.

I was able to get it to work like this:

	var loader = new hxd.net.BinaryLoader("build/res.pak");
	loader.onLoaded = (data) -> {
		var pak = new hxd.fmt.pak.FileSystem();
		pak.addPak(new hxd.fmt.pak.FileSystem.FileInput(data));
		hxd.Res.loader = new hxd.res.Loader(pak);

		// Now make sure you only use resources like below in the callback:
		hxd.Res.myfile.toTexture();
	}
	loader.load();