I've recently been working on a complete rewrite of the AssetManager, and it's now in a state I'd like to show it to you.
It's available in the new starling.assets package, but currently only in this feature branch called 'new-asset-manager'.
To make the transition easier, I'm keeping the old one around in the 'utils' package for now, but will mark it as 'deprecated'.
The new version has an interface that's very similar to the old one, but is much easier to extend. Here are a few of the new features:
(1) You can write your own asset loaders, which are subclasses of 'AssetFactory'. For example, you could write a factory that unzips a couple of files or parses a custom file format you need.
(2) You can add your own asset types — an asset type is now simply a String, and you could e.g. add an asset type for your "GameConfig" objects, or whatnot.
(3) Instead of the somewhat bulky way of using events for errors, the "loadQueue" method now simply contains an "onError" callback.
(4) And instead of a single "onProgress" callback in which you needed to check if the ratio was 1.0, there's now a proper "onComplete" callback, too.
(5) You can bulk-unload a complete group of assets, if you want. [This works via nesting AssetManagers (i.e. add one AssetManager to another) - a sample of this will follow.]
(6) The whole thing should be clearer and easier to understand. I recommend you look at the existing subclasses of "AssetFactory" to see how easy it is to create factories, for example.
This is something that I originally planned to do as part of the Starling 2.0 release. However, the AssetManager is a tricky beast, because it has to do a lot of things and be very flexible, so it took me a while until I was finally happy with the architecture. Good things take a while! 😉
I'll write lots of documentation on the whole thing soon, of course. But anyone who likes to dig in and give it a try — by all means, do it! I'd be happy about any feedback!