O'Reilly logo

haXe 2 by Benjamin Dasnois

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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). ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required