New SWF Linker

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

New SWF Linker

Nicolas Cannasse
Hi list,

The SVN version of haXe is now capable of handling multiple -swf-lib
parameters, which required quite a big rewrite of the SWF linker.

Important changes wrt previous versions behavior :

- the feature which allowed to use Flash8/AVM2 SWF in a Flash9 project
and have haXe automatically create flash.display.MovieClip classes
corresponding to exported linkage names has been dropped so far. It
might come back if we found it's actually needed

- with current implementation, AS3 classes found in -swf-lib SWFs have
priority over the ones (re)defined in haXe code, so you can no longer
redefine a class which is inside the SWF

- various things might break with preloaders. Let's talk about what
could be a good way to write preloaders in haXe since it's good time for
this.

Right now, in order to access AS3 classes located inside the SWF
libraries, you will still have to declare "extern" haXe stubs. The next
goal is to have the typer to be able to directly generate the class
definition from the SWF. This way we will (almost) have SWC input support.

I would be interested in people testing the new SWF linker with their
projects, and reporting if they have something broken. See attached haxe
compiler binary for Windows. People which want to test on OSX/Linux can
build from the SVN version.

Best,
Nicolas


--
haXe - an open source web programming language
http://haxe.org

haxe.zip (973K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Chris Hecker
Yay!

Chris

On Thursday, April 1, 2010, Nicolas Cannasse <[hidden email]> wrote:

> Hi list,
>
> The SVN version of haXe is now capable of handling multiple -swf-lib parameters, which required quite a big rewrite of the SWF linker.
>
> Important changes wrt previous versions behavior :
>
> - the feature which allowed to use Flash8/AVM2 SWF in a Flash9 project and have haXe automatically create flash.display.MovieClip classes corresponding to exported linkage names has been dropped so far. It might come back if we found it's actually needed
>
> - with current implementation, AS3 classes found in -swf-lib SWFs have priority over the ones (re)defined in haXe code, so you can no longer redefine a class which is inside the SWF
>
> - various things might break with preloaders. Let's talk about what could be a good way to write preloaders in haXe since it's good time for this.
>
> Right now, in order to access AS3 classes located inside the SWF libraries, you will still have to declare "extern" haXe stubs. The next goal is to have the typer to be able to directly generate the class definition from the SWF. This way we will (almost) have SWC input support.
>
> I would be interested in people testing the new SWF linker with their projects, and reporting if they have something broken. See attached haxe compiler binary for Windows. People which want to test on OSX/Linux can build from the SVN version.
>
> Best,
> Nicolas
>
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Julien CASTETS
Awesome!

That's THE feature I was waiting for!
Thanks Nico!

Julien

2010/4/1 Chris Hecker <[hidden email]>:

> Yay!
>
> Chris
>
> On Thursday, April 1, 2010, Nicolas Cannasse <[hidden email]> wrote:
>> Hi list,
>>
>> The SVN version of haXe is now capable of handling multiple -swf-lib parameters, which required quite a big rewrite of the SWF linker.
>>
>> Important changes wrt previous versions behavior :
>>
>> - the feature which allowed to use Flash8/AVM2 SWF in a Flash9 project and have haXe automatically create flash.display.MovieClip classes corresponding to exported linkage names has been dropped so far. It might come back if we found it's actually needed
>>
>> - with current implementation, AS3 classes found in -swf-lib SWFs have priority over the ones (re)defined in haXe code, so you can no longer redefine a class which is inside the SWF
>>
>> - various things might break with preloaders. Let's talk about what could be a good way to write preloaders in haXe since it's good time for this.
>>
>> Right now, in order to access AS3 classes located inside the SWF libraries, you will still have to declare "extern" haXe stubs. The next goal is to have the typer to be able to directly generate the class definition from the SWF. This way we will (almost) have SWC input support.
>>
>> I would be interested in people testing the new SWF linker with their projects, and reporting if they have something broken. See attached haxe compiler binary for Windows. People which want to test on OSX/Linux can build from the SVN version.
>>
>> Best,
>> Nicolas
>>
>>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

jlm@justinfront.net
In reply to this post by Nicolas Cannasse
Can someone send me a mac zip, I will test it works with commercial  
flash site I have, or am developing which include sandy3d and  
away3dlite builds, I have not had lots of luck compiling from svn so I  
am reluctant to spend time on that, but would be happy to temp replace  
my haXe folder with the new version and verify if code still works,  
sounds like it will.

> - the feature which allowed to use Flash8/AVM2 SWF in a Flash9  
> project and have haXe automatically create flash.display.MovieClip  
> classes corresponding to exported linkage names has been dropped so  
> far. It might come back if we found it's actually needed

I have ment to test if swishmax assets could be used with haXe, I  
think that this sort of make that impossible?  Which seems a shame.


Cheers

;j

On 1 Apr 2010, at 16:59, Nicolas Cannasse wrote:

> Hi list,
>
> The SVN version of haXe is now capable of handling multiple -swf-lib  
> parameters, which required quite a big rewrite of the SWF linker.
>
> Important changes wrt previous versions behavior :
>
> - the feature which allowed to use Flash8/AVM2 SWF in a Flash9  
> project and have haXe automatically create flash.display.MovieClip  
> classes corresponding to exported linkage names has been dropped so  
> far. It might come back if we found it's actually needed
>
> - with current implementation, AS3 classes found in -swf-lib SWFs  
> have priority over the ones (re)defined in haXe code, so you can no  
> longer redefine a class which is inside the SWF
>
> - various things might break with preloaders. Let's talk about what  
> could be a good way to write preloaders in haXe since it's good time  
> for this.
>
> Right now, in order to access AS3 classes located inside the SWF  
> libraries, you will still have to declare "extern" haXe stubs. The  
> next goal is to have the typer to be able to directly generate the  
> class definition from the SWF. This way we will (almost) have SWC  
> input support.
>
> I would be interested in people testing the new SWF linker with  
> their projects, and reporting if they have something broken. See  
> attached haxe compiler binary for Windows. People which want to test  
> on OSX/Linux can build from the SVN version.
>
> Best,
> Nicolas
>
> <haxe.zip>--
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Philipp Klose-2
In reply to this post by Nicolas Cannasse
Nicolas Cannasse wrote:
> Right now, in order to access AS3 classes located inside the SWF
> libraries, you will still have to declare "extern" haXe stubs. The
> next goal is to have the typer to be able to directly generate the
> class definition from the SWF. This way we will (almost) have SWC
> input support.
Revision 3195:
Log message
allow direct access and completion with classes defined in swf libs

So now we have swf import. I tried it with the as3core lib and it worked
very nicely. Great!


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Nicolas Cannasse
Philipp Klose a écrit :
> Nicolas Cannasse wrote:
>> Right now, in order to access AS3 classes located inside the SWF
>> libraries, you will still have to declare "extern" haXe stubs. The
>> next goal is to have the typer to be able to directly generate the
>> class definition from the SWF. This way we will (almost) have SWC
>> input support.

Everything now works pretty well with SVN version ;)

There is not yet SWC input support but if you use for example
Papervision3D SWC, unzip and use the library.swf as -swf-lib input, you
will be able to run it with the following code :

-----------
import flash.display.Sprite;
import flash.events.Event;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.materials.ColorMaterial;

class Test extends org.papervision3d.view.BasicView {

     var plane:Plane;

     function new() {
         super();
        var material = new ColorMaterial();
        material.doubleSided = true;
        material.fillColor = 0xFF0000;
        material.fillAlpha = 1.0;
        plane = new Plane( material, 300, 300, 1, 1 );
        scene.addChild( plane );
     }

     private function render(event:Event) {
         plane.rotationX += 4.35; plane.rotationY += 6.55;
plane.rotationZ += 0.55;
        singleRender();
     }

     static function main() {
        var t = new Test();
        var mc = flash.Lib.current;
        mc.addChild(t);
        mc.stage.addEventListener(Event.ENTER_FRAME, t.render);
     }

}
---------

Completion works well (no need for --gen-hx-classes) so the two
remaining features are SWC format input support and the ability to only
link a part of a library (currently the whole library is always included)

Enjoy !

Nicolas


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Blue Sans douze
Hi list.

Nicolas, you're saying that completion is working well without --gen-hx-classes. Which IDE are you using ? With FlashDevelop, I can't have completion with -lib or -swf-lib...

I'm using FlashDevelop RC2, maybe that's why it doesn't work.

2010/4/2 Nicolas Cannasse <[hidden email]>
Philipp Klose a écrit :

Nicolas Cannasse wrote:
Right now, in order to access AS3 classes located inside the SWF libraries, you will still have to declare "extern" haXe stubs. The next goal is to have the typer to be able to directly generate the class definition from the SWF. This way we will (almost) have SWC input support.

Everything now works pretty well with SVN version ;)

There is not yet SWC input support but if you use for example Papervision3D SWC, unzip and use the library.swf as -swf-lib input, you will be able to run it with the following code :

-----------
import flash.display.Sprite;
import flash.events.Event;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.materials.ColorMaterial;

class Test extends org.papervision3d.view.BasicView {

   var plane:Plane;

   function new() {
       super();
       var material = new ColorMaterial();
       material.doubleSided = true;
       material.fillColor = 0xFF0000;
       material.fillAlpha = 1.0;
       plane = new Plane( material, 300, 300, 1, 1 );
       scene.addChild( plane );
   }

   private function render(event:Event) {
       plane.rotationX += 4.35; plane.rotationY += 6.55; plane.rotationZ += 0.55;
       singleRender();
   }

   static function main() {
       var t = new Test();
       var mc = flash.Lib.current;
       mc.addChild(t);
       mc.stage.addEventListener(Event.ENTER_FRAME, t.render);
   }

}
---------

Completion works well (no need for --gen-hx-classes) so the two remaining features are SWC format input support and the ability to only link a part of a library (currently the whole library is always included)

Enjoy !

Nicolas



--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Nicolas Cannasse
Blue Sans douze a écrit :
> Hi list.
>
> Nicolas, you're saying that completion is working well without
> --gen-hx-classes. Which IDE are you using ? With FlashDevelop, I can't
> have completion with -lib or -swf-lib...
>
> I'm using FlashDevelop RC2, maybe that's why it doesn't work.

You need haXe SVN version (not the one I sent on the list) + an IDE that
support haXe-based completion (either FD2 + haxeFD plugin or latest FD3).

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Justin Donaldson
I have to admit, I thought this was a hoax yesterday.  :)

I suppose the only thing left is to add vax library linker + completion support:
http://en.wikipedia.org/wiki/Punched_card

just scan each card, place the images in the assets directory, and use the -punch compiler switch to point to the directory.

On a serious note, this is working very nicely.  Fantastic feature!

Best,
-Justin

On Fri, Apr 2, 2010 at 9:51 AM, Nicolas Cannasse <[hidden email]> wrote:
Blue Sans douze a écrit :

Hi list.

Nicolas, you're saying that completion is working well without --gen-hx-classes. Which IDE are you using ? With FlashDevelop, I can't have completion with -lib or -swf-lib...

I'm using FlashDevelop RC2, maybe that's why it doesn't work.

You need haXe SVN version (not the one I sent on the list) + an IDE that support haXe-based completion (either FD2 + haxeFD plugin or latest FD3).


Nicolas

--
haXe - an open source web programming language
http://haxe.org



--
Justin Donaldson
PhD Candidate, Informatics
Indiana University
http://www.scwn.net
aim: iujjd
twitter: jjdonald

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Franco Ponticelli
In reply to this post by Nicolas Cannasse
Very powerfull features and a giant leap forward for AS3 developers.
Thank you Nicolas.

Franco.

On Fri, Apr 2, 2010 at 2:51 PM, Nicolas Cannasse <[hidden email]> wrote:
Blue Sans douze a écrit :

Hi list.

Nicolas, you're saying that completion is working well without --gen-hx-classes. Which IDE are you using ? With FlashDevelop, I can't have completion with -lib or -swf-lib...

I'm using FlashDevelop RC2, maybe that's why it doesn't work.

You need haXe SVN version (not the one I sent on the list) + an IDE that support haXe-based completion (either FD2 + haxeFD plugin or latest FD3).


Nicolas

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

hosey hosey
I am assuming there are no optimizations done to the linked swf.  So here is the crack pipe:
Have it extract the swf to haxe source.  Apply some automated shnazzy dazzies to the source and compile the whole thing with Haxe.

Ok, if nobody responds, I understand.

On a side note: Awesome work


On Fri, Apr 2, 2010 at 7:07 AM, Franco Ponticelli <[hidden email]> wrote:
Very powerfull features and a giant leap forward for AS3 developers.
Thank you Nicolas.

Franco.


On Fri, Apr 2, 2010 at 2:51 PM, Nicolas Cannasse <[hidden email]> wrote:
Blue Sans douze a écrit :

Hi list.

Nicolas, you're saying that completion is working well without --gen-hx-classes. Which IDE are you using ? With FlashDevelop, I can't have completion with -lib or -swf-lib...

I'm using FlashDevelop RC2, maybe that's why it doesn't work.

You need haXe SVN version (not the one I sent on the list) + an IDE that support haXe-based completion (either FD2 + haxeFD plugin or latest FD3).


Nicolas

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Bruno Garcia
In reply to this post by Nicolas Cannasse
On 04/02/2010 06:23 AM, Nicolas Cannasse wrote:

> Philipp Klose a écrit :
>> Nicolas Cannasse wrote:
>>> Right now, in order to access AS3 classes located inside the SWF
>>> libraries, you will still have to declare "extern" haXe stubs. The
>>> next goal is to have the typer to be able to directly generate the
>>> class definition from the SWF. This way we will (almost) have SWC
>>> input support.
>
> Everything now works pretty well with SVN version ;)
>
> There is not yet SWC input support but if you use for example
> Papervision3D SWC, unzip and use the library.swf as -swf-lib input, you
> will be able to run it with the following code :

Awesome!! This has been my #1 on my haXe wishlist by far. Soon it will
be so easy for AS3 developers to switch to haXe that there will be no
excuse not to :)

Thank you very much for your work.

Bruno

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Robert Sköld
In reply to this post by Nicolas Cannasse
I wanted to try out the SVN version and the new SWF linker, but I get this error while compiling haxe:

File "genswf.ml", line 408, characters 2-198:
Error: The record field label hlf_trys is not mutable

I'm on OSX 10.6.3, running ocaml 3.11.1.

thanks,

bob

On Apr 2, 2010, at 15:23 , Nicolas Cannasse wrote:

> Philipp Klose a écrit :
>> Nicolas Cannasse wrote:
>>> Right now, in order to access AS3 classes located inside the SWF libraries, you will still have to declare "extern" haXe stubs. The next goal is to have the typer to be able to directly generate the class definition from the SWF. This way we will (almost) have SWC input support.
>
> Everything now works pretty well with SVN version ;)
>
> There is not yet SWC input support but if you use for example Papervision3D SWC, unzip and use the library.swf as -swf-lib input, you will be able to run it with the following code :
>
> -----------
> import flash.display.Sprite;
> import flash.events.Event;
> import org.papervision3d.objects.primitives.Plane;
> import org.papervision3d.materials.ColorMaterial;
>
> class Test extends org.papervision3d.view.BasicView {
>
>    var plane:Plane;
>
>    function new() {
>        super();
> var material = new ColorMaterial();
> material.doubleSided = true;
> material.fillColor = 0xFF0000;
> material.fillAlpha = 1.0;
> plane = new Plane( material, 300, 300, 1, 1 );
> scene.addChild( plane );
>    }
>
>    private function render(event:Event) {
>        plane.rotationX += 4.35; plane.rotationY += 6.55; plane.rotationZ += 0.55;
> singleRender();
>    }
>
>    static function main() {
> var t = new Test();
> var mc = flash.Lib.current;
> mc.addChild(t);
> mc.stage.addEventListener(Event.ENTER_FRAME, t.render);
>    }
>
> }
> ---------
>
> Completion works well (no need for --gen-hx-classes) so the two remaining features are SWC format input support and the ability to only link a part of a library (currently the whole library is always included)
>
> Enjoy !
>
> Nicolas
>
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Nicolas Cannasse
Robert Sköld a écrit :
> I wanted to try out the SVN version and the new SWF linker, but I get this error while compiling haxe:
>
> File "genswf.ml", line 408, characters 2-198:
> Error: The record field label hlf_trys is not mutable
>
> I'm on OSX 10.6.3, running ocaml 3.11.1.

It has been correctly commited but seems like it's not updated on your
computer. Remove ocaml/swflib and install again.

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Michael Baczynski-2
In reply to this post by Nicolas Cannasse
thanks for adding the feature, this is very cool!

however it seems something is broken with haxe.rtti.Generic with the
latest SVN version since I'm getting #1024 errors (something like
VerifyError: Error #1014: Class
de.polygonal.ds::DLL_de_polygonal_motor2_collision_nbody_LinkedProxy
could not be found.) It might not be related with -swf-lib and so I
tried to compile older revisions but anything below r3193 fails to
compile using the install.ml. any ideas? still trying to isolate the issue.

michael


On 01.04.2010 17:59, Nicolas Cannasse wrote:

> Hi list,
>
> The SVN version of haXe is now capable of handling multiple -swf-lib
> parameters, which required quite a big rewrite of the SWF linker.
>
> Important changes wrt previous versions behavior :
>
> - the feature which allowed to use Flash8/AVM2 SWF in a Flash9 project
> and have haXe automatically create flash.display.MovieClip classes
> corresponding to exported linkage names has been dropped so far. It
> might come back if we found it's actually needed
>
> - with current implementation, AS3 classes found in -swf-lib SWFs have
> priority over the ones (re)defined in haXe code, so you can no longer
> redefine a class which is inside the SWF
>
> - various things might break with preloaders. Let's talk about what
> could be a good way to write preloaders in haXe since it's good time
> for this.
>
> Right now, in order to access AS3 classes located inside the SWF
> libraries, you will still have to declare "extern" haXe stubs. The
> next goal is to have the typer to be able to directly generate the
> class definition from the SWF. This way we will (almost) have SWC
> input support.
>
> I would be interested in people testing the new SWF linker with their
> projects, and reporting if they have something broken. See attached
> haxe compiler binary for Windows. People which want to test on
> OSX/Linux can build from the SVN version.
>
> Best,
> Nicolas
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

victor / tokiop
Nicolas, thanks a lot for this addition it is a great feature(/future) !
could compile from svn and reproduce your papervision test (magic !).

-----

Like Michael i then got errors when trying with prefuse.flare library:
- VerifyError: Error #1053: Remplacement illégal de creationCompleteHandler dans mx.core.Container.
- VerifyError: Error #1014: La classe mx.core::Container est introuvable.
- VerifyError: Error #1014: La classe mx.core::LayoutContainer est introuvable.
- VerifyError: Error #1014: La classe mx.core::Container est introuvable.
- VerifyError: Error #1014: La classe mx.containers::Canvas est introuvable.

This was with last night svn, just including the flare library. Mabe there is special initialisation to do when using such libraries ? Couldn't trace anything to see what is happening because it seem to block before "main".

victor

Le 3 avr. 10 à 15:13, Michael Baczynski a écrit :
however it seems something is broken with haxe.rtti.Generic with the latest SVN version since I'm getting #1024 errors (something like VerifyError: Error #1014: Class de.polygonal.ds::DLL_de_polygonal_motor2_collision_nbody_LinkedProxy could not be found.) It might not be related with -swf-lib and so I tried to compile older revisions but anything below r3193 fails to compile using the install.ml. any ideas? still trying to isolate the issue.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker

Nicolas Cannasse
In reply to this post by Michael Baczynski-2
Michael Baczynski a écrit :
> thanks for adding the feature, this is very cool!
>
> however it seems something is broken with haxe.rtti.Generic with the
> latest SVN version since I'm getting #1024 errors (something like
> VerifyError: Error #1014: Class
> de.polygonal.ds::DLL_de_polygonal_motor2_collision_nbody_LinkedProxy
> could not be found.) It might not be related with -swf-lib and so I
> tried to compile older revisions but anything below r3193 fails to
> compile using the install.ml. any ideas? still trying to isolate the issue.

Not sure exactly what's going wrong, since the genswf9 has not been
changed since r3187 (better "cast" implementation).

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker - compile from svn problem

go2ghana
  Hi,
still couldn't solve my compilation problem with current svn version:

File "genswf.ml", line 818, characters 15-29:
Unbound value Extc.input_zip
Error while running ocamlopt -c -I ../ocaml -I ...

Cordially,
Axel

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker - compile from svn problem

Nicolas Cannasse
Axel Huizinga a écrit :
>  Hi,
> still couldn't solve my compilation problem with current svn version:
>
> File "genswf.ml", line 818, characters 15-29:
> Unbound value Extc.input_zip
> Error while running ocamlopt -c -I ../ocaml -I ...

Update latest install.ml from haxe.org

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: New SWF Linker - compile from svn problem

Robert Sköld
In reply to this post by go2ghana
I had the exact same error message, because I had some old dependencies. Like Nicolas said, get the updated install.ml and it should work.

Or, if you're on OS X, I've updated my homebrew formula to use the official repositories. There's some install instructions here: http://sofaware.org/post/390985249/homebrew-is-the-new-macports

Good luck!


On Apr 5, 2010, at 10:33 , Axel Huizinga wrote:

> Hi,
> still couldn't solve my compilation problem with current svn version:
>
> File "genswf.ml", line 818, characters 15-29:
> Unbound value Extc.input_zip
> Error while running ocamlopt -c -I ../ocaml -I ...
>
> Cordially,
> Axel
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
12