This guide gets you from zero to a first AS3 -> Haxe conversion.
- Java runtime (to execute
converter.jar) - Node.js and npm
- Haxe dependencies managed by Lix
npm i lix
npx lix download
npx haxe build.hxmlExpected output: converter.jar.
Example:
my-project/
as3-src/
lib/
playerglobal.swc
config.json
{
"src": "as3-src",
"hxout": "haxe-out",
"swc": [
"lib/playerglobal.swc"
]
}Use forward slashes (/) in paths even on Windows.
For most projects, add this field to copy the compatibility runtime:
"copy": [
{ "unit": "compat", "to": "haxe-out/compat" }
]java -jar converter.jar config.jsonThe converter will:
- Parse
.asfiles undersrc - Type and rewrite code
- Write
.hxfiles intohxout - Copy non-AS assets from
srcintodataout(orhxoutwhendataoutis not set)
- Run converter
- Fix unsupported AS3 constructs or add targeted rewrites
- Re-run converter
- Compile generated Haxe project
- Use Config reference for all options
- Use Examples for practical templates
- Use Troubleshooting for common failures