As a language it can export the same code to AVM2 (and AVM1 I think) bytecode, and JavaScript (and C++ etc.) - but it doesn't do any emulation of Flash's APIs (I'm pretty sure). You have to code to whatever platform you are targetting. It's kind of like Joa's Project Hiddenwood in that way (based on a cursory look at it), except it compiles from HaXe instead of Java. HaXe also has their own Stage3D shader language, which is neat.

There's also Jangaroo, which actually does have a Flash API that is built on core HTML tech (the display list is written in AS3 using AS3 based HTML/JS wrapper classes), and compiles from AS3 to JS. You don't have to use the Flash APIs with Jangaroo though, and can code directly to some Javascript API if you wanted to - you can also access the Jangaroo AS3 classes from JavaScript directly. Pretty neat, but it can be difficult to set up. If you don't pack the Flash API libs, Jangaroo comes with a super svelte (4KB) runtime to do the AS3 language emulation (property access/inheritance/etc), and the generated JavaScript runs crazy fast, and can even be edited (even if you would never code like that directly).

Kevin N.


On 11/29/11 11:04 AM, Merrill, Jason wrote:
Thinking of starting to learn haXe to produce OOP apps and export as Javascript 
for HTML 5 apps. Checked it out years ago, but decided against it since it was 
not part of the normal ecosystem and would have to be sharing code with 
non-haXe AS3 developers. But not thinking of the future, I am more interested 
in it given what's happening with Adobe and HTML5. Anyone done that and does it 
work well for that?  Can you have a single source base and export for AS3 apps 
and Javascript for HTML 5 or are there caveats?

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to