You can add a library like Starling to the source-path
or library-path
in the compilerOptions
section of asconfig.json.
"compilerOptions": {
"source-path": [
"path/to/starling/src",
"src"
]
}
In the example above, I'm assuming that your project's source files are in src. Replace path/to/starling/src with the actual path to Starling's source directory on your computer.
Alternatively, if you prefer to add the .swc file for Starling instead of the source folder, you can do it like this:
"compilerOptions": {
"source-path": [
"src"
],
"library-path": [
"path/to/starling.swc"
]
}
The various fields in the compilerOptions
section correspond to command line options that you'd pass to mxmlc or compc, if you were running them in a terminal.
For instance, here's a more complete asconfig.json file:
{
"compilerOptions": {
"source-path": [
"path/to/Starling-Framework/src",
"src"
],
"output": "bin/Project.swf"
},
mainClass: "MyProject"
}
It would result in this command to mxmlc:
mxmlc --source-path+=src --source-path+=path/to/starling/src --output=bin/MyProject.swf src/MyProject.as
I seem to recall that Flash Builder was usually pretty good at using roughly the same names in its various settings dialogs as the compiler options they configured. In the Flash Builder project settings, I think that you had to add the Starling source or .swc in sections labeled Source Path and Library Path, for instance.
For reference, the following page lists all of the various options supported in asconfig.json files:
https://github.com/BowlerHatLLC/vscode-as3mxml/wiki/asconfig.json