Hi guys,
I'm trying to port the instructions at
http://old.haxe.org/doc/flash/preloader to our (pretty extensive) Haxe project. I got the preloader frame working, but for some reason, I need to turn dead code elimination off in the final step, where the preloader class and the SWC get compiled into a single SWF. Without the '-dce no' flag, I get runtime exceptions on Type.getClass and Type.createInstance not existing, but also some of our own functions. The classes themselves don't seem to be missing. This means that even the standard DCE implementation (and not even the full kind) breaks the SWF.
I'm still able to enable full DCE when creating the SWC, so the loss isn't huge. Even so, with a minimal preloader class, the SWF is still about 20 KB larger than the SWC. Because we are dealing with load time requirements, every kilobyte counts for us. This makes Haxe's preloader implementation unsuitable at this point.
I should note that we already compile a few SWCs into the SWC that eventually gets compiled into the preloading SWF. However, Type.getClass is used several times in the main Haxe codebase that makes up the final SWC, so it really doesn't make sense to me that it would be eliminated.
Does anyone have an idea what could be going on? Can I get more feedback from the DCE somehow?
Thanks,
Tim