Skip to content

Build an ActionScript project in Visual Studio Code

Josh Tynjala edited this page Jan 14, 2022 · 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 Royale 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.

Built-in tasks for ActionScript projects

The extension integrates with Visual Studio Code's task system to provide a number of tasks to build your application.

Go to the Terminal 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 (you may see some additional tasks for Adobe AIR too):

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. Or you may have accidentally saved it in the wrong location.

You may choose to compile a debug or release build of your project.

When you select a task, Visual Studio Code will run the compiler from your workspace's SDK using the options specified in asconfig.json.

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 Terminal menu and select Configure Default Build Task....

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

  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. 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 Terminal menu and choose Run Task....

Further Reading

Clone this wiki locally