About the Actions panel and Script window

You can embed Flash scripts in your FLA file or store them as external files. It's a good idea to store as much of your ActionScript code in external files as possible. This makes it easier to reuse code in multiple FLA files. Then, in your FLA file, create a script that uses #include statements to access the code you've stored externally. Use the .as suffix to identify your scripts as ActionScript (AS) files. (If you are writing custom class files, you must store them as external AS files.)

Note: ActionScript code in external files is compiled into a SWF file when you publish, export, test, or debug a FLA file. Therefore, if you make any changes to an external file, you must save the file and recompile any FLA files that use it.

When you embed ActionScript code in your FLA file, you can attach code to Frames and to objects. Try to attach embedded ActionScript to the first frame of the Timeline whenever possible. That way, you won't have to search through a FLA file to find all your code; it is centralized in one location. Create a layer called "Actions" and place your code there. That way, even if you do place code on other Frames or attach it to objects, you'll have to look at only one layer to find it all.

To create scripts that are part of your document, you enter ActionScript directly into the Actions panel. To create external scripts, use your preferred text editor or, in Flash Professional, you can use the Script window. When you use the Actions panel or Script window, you are using the same ActionScript editor, and are typing your code in the Script pane at the right side of the panel or window. To reduce the amount of typing you have to do, you can also select or drag actions from the Actions toolbox to the Script pane.

To display the Actions panel, do one of the following:

(Flash Professional only) To display the Script window, do one of the following: