Skip to content

Create a new ActionScript project in Visual Studio Code that targets Apache Royale

Josh Tynjala edited this page Jan 14, 2022 · 9 revisions

Learn to set up a project in Visual Studio Code to create an Apache Royale application that can be deployed to the web.

Development Setup

  1. Install the ActionScript & MXML extension for Visual Studio Code.

  2. 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.

  3. 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.

  4. Create a file named asconfig.json in the root directory of your project, and add the following content:

    {
    	"compilerOptions": {
    		"targets": [
    			"JSRoyale"
    		],
    		"source-path": [
    			"src"
    		]
    	},
    	"mainClass": "Main"
    }
  5. Create directory named src.

  6. Inside src, create a file named Main.mxml, and add the following code:

    <?xml version="1.0" encoding="utf-8"?>
    <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    	xmlns:js="library://ns.apache.org/royale/express">
    	<js:initialView>
    		<js:View>
    			<js:Label text="Hello World" x="100" y="100"/>
    		</js:View>
    	</js:initialView>
    </js:Application>

Next Steps

Clone this wiki locally