As a user of Adobe® Flash® Professional CC, you may be familiar with
which lets you create scripts that execute at run time in Adobe® Flash® Player.
or JSAPI) described in this document is a complementary programming
tool that lets you create scripts that run in the Flash authoring
This document describes the objects, methods, and properties
use the documented commands when working in the authoring environment.
If you have a question about what a particular command does, use
other documents in Flash Help, such as Using Flash, to find
or ActionScript syntax and with basic programming concepts such
as functions, parameters, and data types.
actions in the Flash authoring environment (that is, while a user
has the Flash program open). This functionality is different from
the ActionScript language, which lets you write scripts to perform
actions in the Flash Player environment (that is, while a SWF file
commands that you might use in pages displayed in a web browser.
to help streamline the authoring process. For example, you can write
scripts to automate repetitive tasks or add custom tools to the
API, plus the Flash DOM. These added objects and their methods and
properties are described in this document. You can use any of the
only elements that make sense in the context of a Flash document
have an effect.
For more information, see C-Level Extensibility.
engine, version 1.8, which is available on the web at www.mozilla.org/js/spidermonkey/.
SpiderMonkey is one of the two reference implementations of the
that is embedded in the Mozilla browser.
in the ECMAScript (ECMA-262) edition 3 language specification and
it is fully compliant with the specification. Only the browser-specific
host objects, which are not part of the ECMA-262 specification,
Saving JSFL files
You can have JSFL scripts available within the Flash authoring
environment by storing them in one of several folders within the
Configuration folder. By default, the Configuration folder is in
the following location:
boot drive\Users\username\AppData\Local\Adobe\Flash CC\language\Configuration\
Settings\Application Data\Adobe\Flash CC\language\Configuration\
Mac OS® X:
HD/Users/username/Library/Application Support/Adobe/Flash CC/language/Configuration/
To determine the location of the Configuration folder, use fl.configDirectory or fl.configURI, as shown in
the following example:
// store directory to a variable
var configDir = fl.configDirectory;
// display directory in the Output panel
Within the Configuration folder, the following folders can contain
scripts that you can access in the authoring environment: Behaviors
(to support the user interface for behaviors); Commands (for scripts
by Script Assist to populate the user interface controls); Tools
(for extensible tools in the Tools panel); and WindowSWF (for panels
that appear in the Windows menu). This document focuses on scripts used
for commands and tools.
If you edit a script in the Commands folder, the new script is
immediately available in Flash. If you edit a script for an extensible
tool, close and restart Flash, or else use the fl.reloadTools() command.
However, if you used a script to add an extensible tool to the Tools
panel and you then edit the script, either remove and then add the
tool to the Tools panel again, or else close and restart Flash for
the revised tool to be available.
There are two locations where you can store command and tool
files so they can be accessed in the authoring environment.
For scripts that appear as items in the Commands menu,
save the JSFL file in the Commands folder in the following location:
boot drive\Users\username\AppData\Local\Adobe\Flash CC\language\Configuration\Commands
Settings\Application Data\Adobe\Flash CC\language\Configuration\Commands
Mac OS X
For scripts that appear as extensible tools in the Tools
panel, save the JSFL file in the Tools folder in the following location:
boot drive\Users\username\AppData\Local\Adobe\Flash CC\language\Configuration\Tools
Settings\Application Data\Adobe\Flash CC\language\Configuration\Tools
Mac OS X
If a JSFL file has other files that go with it, such as XML files,
store them in the same directory as the JSFL file.