374
USING FLASH CS4 PROFESSIONAL
ActionScript
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.
The
External Library path
specifies the location of SWC files that contain code used for compiler error definitions. This
path can be used to load external code resources in SWC format so that the classes within them can be used at runtime.
When you compile a SWF, the SWC files in the External Library path are not added to the SWF file, but the compiler
verifies that they are in the locations you specified. The External Library path is most often used for runtime shared
libraries. For more information about runtime shared libraries, see “
Working with runtime shared assets
” on page 162.
For more information about loading external code at runtime, see
Programming ActionScript 3.0
.
For each type of resource path, you can specify more than one path for Flash 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
.
To set the application-level classpath:
1
Choose Edit Preferences (Windows) or Flash
> Preferences (Macintosh) and click the ActionScript category.
2
Click the ActionScript 2.0 Settings button and add the path(s) to the Classpath list
Set the source path for ActionScript 3.0
To set the document-level source path:
1
Select File
> Publish Settings, and click Flash.
2
Verify that ActionScript 3.0 is selected in the ActionScript Version pop-up menu, and click Settings. Your Flash
Player version must be set to Flash Player 9 or later to use ActionScript 3.0.
3
Specify the frame where the class definition should reside in the Export Classes in Frame text field.
Updated 5 March 2009