For example, you might create a directory such as the following for your custom classes:
Windows: Hard Disk\Documents and Settings\user\custom classes.
Macintosh: Hard Disk/Users/user/custom classes.
Then, you would add this path to the list of global classpaths (see
on page
241).
When Flash attempts to resolve class references in a FLA script, it first searches the document-
level classpath specified for that FLA file. If Flash doesn't find the class in that classpath, or if
that classpath is empty, it searches the global classpath. If Flash doesn't find the class in the
global classpath, a compiler error occurs.
To modify the document-level classpath:
1.
Select File > Publish Settings to open the Publish Settings dialog box.
2.
Click the Flash tab.
3.
Click the Settings button next to the ActionScript Version pop-up menu.
4.
You can either manually type a file path or you can click the Browse to Path button to
browse to the directory you want to add to the classpath.
To edit an existing classpath directory, select the path in the Classpath list, click the
Browse to Path button, browse to the directory you want to add, and click OK.
To delete a directory from the classpath, select the path in the Classpath list, and
click the Remove Selected Path (-) button.
For more information on packages, see
How the compiler resolves class references
When Flash attempts to resolve class references in a FLA script, it first searches the document-
level classpath specified for that FLA file. If the class is not found in that classpath, or if that
classpath is empty, Flash searches the global classpath. If the class is not found in the global
classpath, a compiler error occurs.
In Flash Professional, when you click the Check Syntax button while editing an ActionScript
file, the compiler looks only in the global classpath; ActionScript files aren't associated with
FLA files in Edit mode and don't have their own classpath.
"About packages" on page
About working with custom classes in an application
"Using a global classpath"
228.
243
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?
Questions and answers