[swfmill] The <call> tag and HaXe / AS3

András Parditka andras at michaeltristram.com
Wed Apr 9 06:34:57 PDT 2008


Hello everyone,

All the examples containing the <call> tag seem to refer
to MTASC. Is the <call> tag usable with HaXe if you target
Flash 9?

I've tried to find answer to this in the mailing list
archives and in the available documentation, but could not
find one. I have also tried doing it a few ways, but
without success.

I've set up a little test project:

1.
Main.hx: (Just draws a black, 100x100px rectangle using script.)
----------------------------------------------------------------
import flash.display.Sprite;
import flash.Lib;

class Main
{
    public static var mySprite:Sprite;
   
    public static function main()
    {
        mySprite = new Sprite();
        Lib.current.addChild(mySprite);
       
        mySprite.graphics.beginFill(0x000000);
        mySprite.graphics.drawRect(0, 0, 100, 100);
        mySprite.graphics.endFill();
    }
}

2.
I use:
haxe -swf haxe.swf -swf-version 9 -swf-header 1024:640:25:ffffff -main Main

3.
mill.xml: (Should include the HaXe-generated swf, and call the
main() method of the Main class.)
--------------------------------------------------------------
<?xml version='1.0' encoding='UTF-8'?>

<movie version="9" width="1024" height="640" framerate="25">
    <background color="#ff0000"/>
        <frame>
            <library>
                <clip id="mainApp" import="haxe.swf" />
            </library>
            <place id="mainApp" name="mainApp" x="0" y="0" depth="1" />
            <call object="Main" method="main"></call>
        </frame>
</movie>

4.
I use: (swfmill-0.2.12)
swfmill simple mill.xml mill.swf

Sadly, the black rectangle does not appear, which suggests the
call to Main.main() not taking place.
Am I doing something wrong?

Thank you in advance,
Andras



More information about the swfmill mailing list