Set the location of actionscript files (cs5) – Adobe Flash Professional CC 2014 v.13.0 User Manual
Page 631

When you use ActionScript 3.0, a SWF file may have a top-level class associated with it. This class is called the document class. When the SWF
is loaded by Flash Player, an instance of this class is created to be the SWF file's top-level object. This object of a SWF file can be an instance of
any custom class you choose.
For example, a SWF file that implements a calendar component can associate its top level with a Calendar class, with methods and properties
appropriate to a calendar component. When the SWF is loaded, Flash Player creates an instance of this Calendar class.
1. Deselect all objects on the Stage and in the Timeline by clicking a blank area of the Stage. This displays the Document properties in the
Property inspector.
2. Enter the filename of the ActionScript file for the class in the Document Class text box in the Property inspector. Do not include the .as
filename extension.
Note: You can also enter the Document Class information in the Publish Settings dialog box.
Set the location of ActionScript files (CS5)
To use an ActionScript class that you’ve defined, Flash Professional must locate the external ActionScript files that contain the class definition. The
list of folders in which Flash Professional searches for class definitions is called the classpath for ActionScript 2.0 and the source path for
ActionScript 3.0. Classpaths and source paths exist at the application (global) and document level. For more information about classpaths, see
Classes in
” in Learning ActionScript 3.0.
You can set the following ActionScript locations in Flash Professional:
ActionScript 2.0
Application level (available to all AS2 FLA files):
Classpath (set in ActionScript preferences)
Document level (available only to the FLA file that specifies this path):
Classpath (set in Publish Settings)
ActionScript 3.0
Application level (available to all AS3 FLA files):
Source path (set in ActionScript preferences)
Library path (set in ActionScript preferences)
External library path (set in ActionScript preferences)
Document level (available only to the FLA file that specifies these paths):
Source path (set in Publish Settings)
Library path (set in Publish Settings)
Document class (set in Document Property inspector)
The Library path specifies the location of pre-compiled ActionScript code which resides in SWC files you have created. The FLA file that specifies
this path loads every SWC file at the top level of this path and any other code resources that are specified within the SWC files themselves. If you
use the Library path, be sure none of the compiled code in the SWC files is duplicated in uncompiled AS files in the Source path. The redundant
code will slow down compilation of your SWF file.
You can specify more than one path for Flash Professional to look in. Resources found in any of the paths specified will be used. When you add
or modify a path, you can add absolute directory paths (for example, C:/my_classes) and relative directory paths (for example, ../my_classes or
".").
Set the classpath for ActionScript 2.0
To set the document-level classpath:
1. Select File > Publish Settings, and click Flash.
2. Verify that ActionScript 2.0 is selected in the ActionScript Version pop-up menu, and click Settings.
3. Specify the frame where the class definition should reside in the Export Frame for Classes text field.
4. To add paths to the classpath list, do any of the following:
To add a folder to the classpath, click the Browse to Path button
, browse to the folder to add, and click OK.
To add a new line to the Classpath list, click the Add New Path button. Double-click the new line, type a relative or absolute path, and
click OK.
To edit an existing classpath folder, select the path in the Classpath list, click the Browse to Path button, browse to the folder to add, and
click OK. Alternatively, double-click the path in the Classpath list, type the desired path, and click OK.
To delete a folder from the classpath, select the path in the Classpath list and click the Remove Selected Path button .
624