OpenFL 8.1 is here, and introduces beta support for ActionScript 3.0 as a source language!
We’d love additional feedback on how we can improve the workflow in our samples.
To get started, enter any of the samples, run npm install then npm start.
We expect to continue to work with Apache Royale until we can bring the workflow up to par with our other supported source languages on NPM (Haxe, TypeScript, ES5 JavaScript, ES6 JavaScript).
Thanks for your support, feedback and help!
OpenFL 8.1 is available on both NPM and Haxelib. Though this is primarily an NPM feature-based release, there are some minor fixes for the Haxelib release as well
If you want to target HTML5, then we support Haxe, JavaScript, TypeScript and (now) ActionScript 3.0 as input languages. This uses NPM for linking tools together.
If you want to target Flash or Adobe AIR targets (Android, iOS, Windows, macOS) then there already are Adobe-based workflows for using ActionScript 3.0.
It’s also worth mentioning you can use HTML5 + Electron to build desktop applications using all of the above languages.
Lastly, if you want to target HTML5, Flash, AIR, Android, iOS, Windows, macOS, Linux, WebAssembly, consoles and other targets using the OpenFL tools, Haxe is the only supported language today.
We just released [email protected] on NPM, which supports ActionScript 3.0, now!
You can check it out by doing the following (assuming you have NPM and Java installed):
git clone https://github.com/openfl/starling
cd starling/samples/demo_npm/as3
npm install
npm start -s
If you’re using Visual Studio Code, you should be able to open that “as3” folder and be able to use the “ActionScript & MXML” extension for a better development experience
[Error] TypeError: undefined is not an object (evaluating 'b.prototype')
v (Main.js:4:246)
全局代码 (Main.js:6:986)
[Error] ReferenceError: Can't find variable: Main
全局代码 (localhost:40)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (starling.min.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (openfl.min.js.map, line 0)
When using Release to release the official version, the above exception will be reported.
Okay, so one approach might be stage.addChild (new Main ()) instead of passing by reference. There is still more work to do here to integrate more fully with Closure Library, which Royale uses
The Haxe to JavaScript support is more solid, currently. Easier to use external code, better code output, but Apache Royale is promising. I’m working on sending issues their way as we go, so we can try to help improve the quality. I had issues using Vector.<T> due to circular dependencies, but I think a different JavaScript “emitter” for them would fix it – maybe there’s a better solution.
The compiler is written in Java, and it’s pluggable to write new language “emitters”, if someone moved their JS from Closure to, say, ES6 modules, I think that would make it a lot more useful. I also think if someone wanted, writing a Haxe emitter could (maybe) be the best AS3 -> Haxe converter ever.
The obvious difference Haxe and ActionScript (all things being the same) is Haxe’s additional features and more platform targets
I like the JS export format of Openfl-NPM (AS3) very much, because it can be divided into JS files. I don’t know if Openfl-Haxe supports this. If I use Openfl-NPM (Haxe), should it be divided into multiple JS files? Maybe I can try it.
There’s a way to use hxgenjs to separate your output into CommonJS or (optionally) ES6 modules, though a single JS file is usually good for final output