beautypg.com

Saving jsfl files – Adobe Extending Flash Professional CS5 User Manual

Page 24

background image

2

EXTENDING FLASH PROFESSIONAL

Introduction

Last updated 5/2/2011

You can also create a JSFL file by selecting commands in the History panel. Then click the Save button in the History
panel or select Save As Command from the panel menu. The command (JSFL) file is saved in the Commands folder
(see

Saving JSFL files

” on page 2). You can then open the file and edit it the same as any other script file.

The History panel provides some other useful options as well. You can copy selected commands to the Clipboard, and
you can view JavaScript commands that are generated while you are working in Flash.

To copy commands from the History panel to the clipboard:

1 Select one or more commands in the History panel.

2 Do one of the following:

Click the Copy button.

Select Copy Steps from the panel menu.

To view JavaScript commands in the History panel:

Select View

> JavaScript in Panel from the panel menu.

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:

Windows® 7™:

boot drive\Users\username\AppData\Local\Adobe\Flash CS5 or CS5.5\language\Configuration\

Windows® Vista™:

boot drive\Users\username\Local Settings\Application Data\Adobe\Flash CS5 or CS5.5\language\Configuration\

Windows XP:

boot drive\Documents and Settings\username\Local Settings\Application Data\Adobe\Flash CS5 or
CS5.5
\language\Configuration\

Mac

OS® X:

Macintosh HD/Users/username/Library/Application Support/Adobe/Flash CS5 or CS5.5/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

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); 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 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.

This manual is related to the following products: