[haXe] Accessing mx libraries from Haxe

Simon Collins haxe at scollins.fastmail.fm
Fri Sep 22 12:16:54 CEST 2006


Hi Gabriele,

When playing with Flex prior to writing the tutorial I ran into the same 
issue that you did with the dollar signs - haXe doesn't like them. I 
just removed those fields from the extern classes for the classes I 
needed. I suspect those fields arent part of the public interface as you 
suggest so you could probably write a script to remove them.

I think you'd be better using the free Flex2 SDK rather than writing a 
haXe script to convert MXML to haXe classes. From a quick look at the 
generated AS3 classes they're quite involved. Plus even if you create 
the script you still are dependent on having the Flex2 implementation 
classes that the generated code calls upon.

Hope that helps,

Simon

Gabriele Farina wrote:
> I read the article and I started to build a script that extracts all 
> the classes from the Flex 2 SWCs and saves them into Haxe classes 
> (using --gen-hx-classes).
> I saw in some generated sources that  the dollar ($) character is used 
> before all the methods or properties that have been declared as 
> mx_internal into AS3 sources. I never used Flex 2 so I don't know if 
> fields preceded by a $ are considered private and used only internally 
> by the framework or can be used by the users. In the first case they 
> can be safely removed from the haxe files, instead I should find a way 
> to expose them (I think Haxe does not support $ into identifiers, 
> right?).
>
> Someone could help me to understand If I have to remove those 
> definitions or find a way to expose them ?
>
> Secondly I'd like someone with Flex 2 to send me the intermediate AS3 
> files build by the mxml compiler (using 
> -compiler.keep-generated-actionscript a), just to understand if I can 
> create an haxe script that translates mxml files to haxe classes so we 
> can avoid using Flex 2.
>
> Gabriele
>
> p.s: sorry for my coursed english but I'm in a hurry!
>
>
> --haXe - an open source web programming language
> http://haxe.org




More information about the Haxe mailing list