Zipped Assets

Daniel Sperl
Unzip individual assets right while they are loaded
assets, zip, AssetManager


This extension requires Starling 2.4 (or the latest head revision) with its new AssetManager. Furthermore, it only works with AIR (not in the Flash Player).

Some assets, especially JSON and XML files, can take up quite a lot of disk space. That can increase the install size of an app or game significantly.

Fortunately, though, many of those assets also compress very well when zipped – let's exploit that! With this extension, you can compress individual assets as zip-files and let them be decompressed by the AssetManager.


First, use a ZIP-tool of your choice to compress the relevant assets. Each zip file must contain one (and only one!) asset. Make sure to add the “.zip” extension to the complete original filename, e.g.

  data.json =>
  font.xml =>
Don't blindly zip each and every file. For example, zipping doesn't make JPG, PNG or ATF files any smaller, so you'll just make the load process take more time.

In your app or game, you need to use the custom ZippedAssetManager class that's part of this extension. I recommend you simply add the respective file directly to your game code; then instantiate it like this:

var assets:AssetManager = new ZippedAssetManager();

When that's done, you use your AssetManager just like before, both for zipped and unzipped files.


There's only one thing missing; this extension depends on the FZip library to do the hard work. Download the swc library from here and add it to your project, as well.

Happy zipping!


  • 2018/04/18: First public version

Source Code

If you are using Gist, you can add the source code of your extension easily with the following code. Just replace the number in parenthesis with the Gist ID.

User Comments

Feel free to edit this part of the page if you want to add information that's lacking in the above description.
Questions are better asked in the forum, though.

  extensions/zipped-assets.txt · Last modified: 2018/04/18 13:01 by daniel
Powered by DokuWiki