Time for action – Creating a library
We will use SWFMILL to create a SWF file containing all our assets.
After that, we will instruct the haXe compiler to embed this SWF file in the one it is going to produce.
Creating a library can be made quite easily with SWFMILL using a XML language to describe it. Let's have a look at an XML file that will allow us to embed one image as a clip:
<?xml version="1.0" encoding="utf-8"?> <movie width="60" height="20" framerate="20" frames="1" as3="1" version="9"> <frame> <library> <clip id="Ship" import="image/ship.jpg"/> </library> </frame> </movie>
Note that this clip will have the linkage ID as Ship
and is the image located at image/ship.jpg
(this is relative to the current working directory when we will run SWFMILL).
Note that one can also have bitmap tags and sound tags (there are also others available, but we won't use them).
After having created this file, you can open a terminal and execute SWFMILL as...