May 222011
 

The asset files that tetragon can load and process are generally called resources. These files can be graphic files, audio files, any other binary files, data files etc. They are either loaded from external single files, an external packed resource archive (also called “pak”) or files that are embedded within the application’s binary (SWF) by using the Flex compiler [Embed] meta tag.

When publishing an AIR application tetragon’s build procedure packs all resource files into a single, packed resource archive (by default called resources.pak). The files in this archive are then later read by the engine via random access which means that the engine only needs to read the required chunk from the resource pack instead of having to read the whole archive into memory first every time it needs a resource file from the pack.

The resource pack is a standard zip file that can be opened and inspected with any tool that can manage zip files. However tetragon resource packs only support Deflate and Store compression methods.

Since the AS3 API for utilizing random access is only available for AIR applications tetragon’s build procedure does not pack the resources into a resource archive when deploying for web-based Flash content. Instead it leaves them as they are – as single, uncompressed files – so that they can be quickly loaded from a web server.