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: <added Windows Vista, removed Windows 2000; 6/7/07>

To determine the location of the Configuration folder, use fl.configDirectory or fl.configURI, as shown in the following examples:

// store directory to a variable 
var configDir = fl.configDirectory;
// display directory in the Output panel
fl.trace(fl.configDirectory);

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 that appear on the Commands menu), Effects (for timeline effects), JavaScript (for scripts used 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, effects, 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 effect or extensible tool, you have to close and restart Flash, or else use the fl.reloadEffects() or fl.reloadTools() command. However, if you used a script to add an extensible tool to the Tools panel and you then edit the script, you must 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 three locations where you can store command, effect, and tool files so they can be accessed in the authoring environment.

If a JSFL file has other files that go with it, such as XML files, they should be stored in the same directory as the JSFL file.


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00003800.html