Create a new ActionScript project in Visual Studio Code that targets Node.js - BowlerHatLLC/vscode-as3mxml GitHub Wiki
With Apache Royale, you aren't required to use the included framework or even necessarily target web browsers and HTML. You can also create a pure ActionScript project that gives you full access to Node.js APIs.
Development Setup
-
Install the ActionScript & MXML extension for Visual Studio Code.
-
Create a new directory for your project, and open it in Visual Studio Code.
To open a directory, select the File menu → Open... or click Open Folder button in the Explorer pane.
-
Set your workspace's SDK to Apache Royale, if this SDK hasn't been discovered automatically. Download Apache Royale here, if you don't have it yet.
-
Create a file named asconfig.json in the root directory of your project, and add the following content:
{ "config": "node", "compilerOptions": { "source-path": [ "src" ] }, "mainClass": "Main" }
-
Create directory named src.
-
Inside src, create a file named Main.as, and add the following code:
package { public class Main { public function Main() { console.log( "Hello Node " + process.version ); } } }