-
-
Notifications
You must be signed in to change notification settings - Fork 40
Create a new ActionScript project in Visual Studio Code that targets the classic Apache Flex SDK
For Apache FlexJS, see Create a project that targets the FlexJS framework instead. The instructions below explain how to create a project for the classic Apache Flex SDK that runs on the Adobe Flash runtimes only.
-
Install the NextGen ActionScript 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 the Apache Flex SDK that you installed.
-
Create a file named
asconfig.json
at the root of your project, and add the following content:{ "config": "flex", "compilerOptions": { "output": "bin/Main.swf" }, "files": [ "src/Main.mxml" ] }
An Adobe AIR project that targets desktop should set
config
to"air"
instead, and a mobile project should setconfig
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": { "output": "bin/Main.swf" }, "application": "src/Main-app.xml", "files": [ "src/Main.mxml" ] }
-
Create directory named
src
. -
Inside
src
, create a file namedMain.mxml
, and add the following code:<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <s:layout> <s:BasicLayout/> </s:layout> <s:Label text="Hello World" horizontalCenter="0" verticalCenter="0"/> </s:Application>
Note: An Adobe AIR project that targets desktop should used
WindowedApplication
instead ofApplication
. -
If you are building an AIR application, then create an AIR application descriptor file named
Main-app.xml
insidesrc
. 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 asconfigc]</content> <visible>true</visible> </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.
- Adobe AIR (Mobile)
- Adobe AIR (Desktop)
- Adobe Flash Player
- Apache Royale
- HTML and JS (no framework)
- Node.js
- Feathers SDK
- Adobe Animate
- Classic Flex SDK
- Library (SWC)
- Royale Library (SWC)