Skip to content

Create a new ActionScript project in Visual Studio Code that targets the Feathers SDK

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

Learn to set up a project in Visual Studio Code to create a Feathers SDK application that can run on Adobe AIR or Flash Player.

Development Setup

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

  2. Install the Feathers SDK.

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

  4. Set your workspace's SDK to the Feathers SDK that you installed.

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

    {
    	"compilerOptions": {
    		"source-path": [
    			"src"
    		],
    		"output": "bin/Main.swf"
    	},
    	"mainClass": "Main"
    }

    An Adobe AIR project that targets desktop should set config to "air" instead, and a mobile project should set config to "airmobile". Additionally, you should specify the path to your AIR application descriptor (which we'll create in a moment). Here's an example for an AIR desktop project:

    {
    	"config": "air",
    	"compilerOptions": {
    		"source-path": [
    			"src"
    		],
    		"output": "bin/Main.swf"
    	},
    	"mainClass": "Main",
    	"application": "src/Main-app.xml"
    }
  6. Create directory named src.

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

    <?xml version="1.0"?>
    <f:Application xmlns:f="library://ns.feathersui.com/mxml"
    	xmlns:fx="http://ns.adobe.com/mxml/2009">
    	<f:Label text="Hello World" x="100" y="100"/>
    </f:Application>
  8. If you are building an AIR application, then create an AIR application descriptor file named Main-app.xml inside src. AIR application descriptors may be configured with many more elements, but you can use the following simple content as a starting point:

    <?xml version="1.0" encoding="utf-8" ?> 
    <application xmlns="http://ns.adobe.com/air/application/24.0"> 
    	<id>com.example.Main</id> 
    	<versionNumber>0.0.0</versionNumber> 
    	<filename>Main</filename> 
    	<name>Main</name> 
    	<initialWindow>
    		<content>[Path to content will be replaced by Visual Studio Code]</content> 
    		<visible>true</visible>
    		<renderMode>direct</renderMode>
    	</initialWindow>
    </application>

    Be sure to update the version number in the namespace http://ns.adobe.com/air/application/24.0 to match the version of Adobe AIR that you are targeting.

Next Steps

Clone this wiki locally