Skip to content

Build an ActionScript project in Visual Studio Code

Josh Tynjala edited this page Nov 27, 2017 · 52 revisions

The ActionScript & MXML extension for Visual Studio Code supports building SWF files for Adobe AIR and Flash Player, and it can also build Apache FlexJS applications that run in web browsers without a plugin.

To build a project in Visual Studio Code, you will need to configure your workspace's SDK and to create an asconfig.json file for one of the supported project types.

Prerequisites

Install the asconfigc utility from npm. This requires Node.js version 6 or newer.

npm install -g asconfigc

Visual Studio Code will run asconfigc, which reads the project's asconfig.json file and run the compiler from your workspace's SDK using the specified options.

Quick build

Go to the Tasks menu and select Run Build Task...

Alternatively, use the Ctrl+Shift+B keyboard shortcut (or Command+Shift+B on macOS).

A list of available tasks for ActionScript projects will appear, and you can choose between a debug or release build.

Screenshot of compile tasks for ActionScript in Visual Studio Code

If you don't see these tasks, you may have forgotten to create an asconfig.json file for your project.

The extension will run the compiler from your workspace's SDK using asconfigc.

In the following section, you'll learn how to make one of these options into the default build task so that you don't need to select one every time.

Set the default build task

If a default build task is set, it runs automatically with the Ctrl+Shift+B keyboard shortcut (or Command+Shift+B on macOS).

  1. Go to the Tasks menu and select Configure Default Build Task.

  2. From the list of available tasks, choose ActionScript: compile debug build

  3. The document similar to the following will open in your editor:

    {
    	// See https://go.microsoft.com/fwlink/?LinkId=733558
    	// for the documentation about the tasks.json format
    	"version": "2.0.0",
    	"tasks": [
    		{
    			"type": "actionscript",
    			"debug": true,
    			"group": {
    				"kind": "build",
    				"isDefault": true
    			}
    		}
    	]
    }
  4. Above the line where it says "type": "actionscript", insert the following field:

    "identifier": "build-debug",

    You can use this identifier later to tell Visual Studio Code to build the project before launching the debugger.

  5. To build your project, press Ctrl+Shift+B (or Command+Shift+B on macOS). You will no longer be prompted to choose between a debug and release build.

Release builds and all other tasks

After you've made compiling a debug build your default task, you may still occasionally need to run other tasks, such as compiling a release build or packaging an Adobe AIR application. To see the complete list of tasks again, go to the Tasks menu and choose Run Task....

Further Reading

Clone this wiki locally