How to optimize SWF load time for HTML5?

The SWF gets processed into individual images and data files. For a larger game with many embedded SWFs, the initial load time is higher compared to Flash. With Flash there is one big SWF generated while with OpenFL there are images created for all the SWFs.

Is it possible to generate a single sprite sheet for each SWF so that there are less HTTP requests for HTML5?

Are there any other optimizations that can be applied? I mean OpenFL specific. Gzip, minify, caching are already done.


Web servers should use gzip when transferring content, there are solutions that could be created to download assets as a binary blob, and extract assets separately after that point, but I’ve been concerned about runtime CPU performance, especially on mobile. Lime assets are designed where we could come up with another asset format and introduce that in the tools pretty seamlessly without changing APIs.

One option is to, if you use multiple SWFs, not enable preload="true", and use Assets.loadLibrary on demand, before you need each one. This doesn’t change the total loading time, but will offload the loading time until later in the application, so it doesn’t feel as significant

The suggested approach of handling it in lime to load sprite sheets worked for us. Our game mostly targets the desktop browsers hence it’s fine to go with this approach.

The delayed loading makes sense and will be used for non critical assets which are needed later in the game.

Thanks for the help !! :slight_smile: