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

András Parditka andras at michaeltristram.com
Wed Apr 9 07:12:33 PDT 2008


Thank you for your quick answer, Mark.

The reason for creating the swf with the code first and
trying to add assets with swfmill later was that I wanted
to find out what it would involve to use swfmill's most
tempting feature (that I currently know): the ability
to include all glyphs of a font in an swf.

It now seems to me this would involve having to use HaXe
for compiling the code.

(For the Flash IDE cannot use an existing swf file as a
library, and without the ability to call a function with
swfmill, it is not possible to add the assets into the
compiled file.)

Am I right about this, or have I missed anything?

Andras

Mark Winterhalder wrote:
>>  All the examples containing the <call> tag seem to refer
>>  to MTASC. Is the <call> tag usable with HaXe if you target
>>  Flash 9?
>>     
>
> No, it's not usable for anything but AS2. <call/> is left over from
> the very early days of Swfmill, IIRC the problem was that MTASC
> compiled code executed before the SWF was fully initialized. That
> problem was fixed shortly after, and I would discourage use even with
> AS2 -- it's just not necessary anymore.
> If you just remove the <call/> tag and use haXe's -main setting
> instead, it should work, no?
>
> Mark
>
>
>
> On Wed, Apr 9, 2008 at 3:34 PM, András Parditka
> <andras at michaeltristram.com> wrote:
>   
>> 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
>>
>>  _______________________________________________
>>  swfmill mailing list
>>  swfmill at osflash.org
>>  http://osflash.org/mailman/listinfo/swfmill_osflash.org
>>
>>     
>
> _______________________________________________
> swfmill mailing list
> swfmill at osflash.org
> http://osflash.org/mailman/listinfo/swfmill_osflash.org
>   



More information about the swfmill mailing list