By default, the global classpath contains one absolute path and one relative path. The absolute
path is denoted by $(LocalData)/Classes in the Preferences dialog box. The location of the
absolute path is shown here:
•
(Windows 2000 or Windows XP) \Documents and Settings\user\Local Settings\
Application Data\Macromedia\Flash MX 2004\language\Configuration\Classes
•
(Windows 98) \Windows\Application Data\Macromedia\Flash MX 2004\ language\
Configuration\Classes
•
(Macintosh OS X) Hard Drive/Users/Library/Application Support/Macromedia/
Flash MX 2004/language/Configuration/Classes
Note: Do not delete the absolute global classpath. Flash uses this classpath to access built-in
classes. If you accidentally delete this classpath, see
information on how to reinstate it in the classpath list.
The relative path portion of the global classpath is denoted by a single dot (.) and points to the
current document directory. Be aware that relative classpaths can point to different directories,
depending on the location of the document being compiled or published.
The document-level classpath applies only to FLA files and is set in the Publish Settings dialog
box for a particular FLA file (File > Publish Settings > Flash > ActionScript 2.0 Settings). The
document-level classpath is empty by default. When you create and save a FLA file in a directory,
that directory becomes a designated classpath directory.
When you create classes, in some cases you might want to store them in a directory that you then
add to the list of global classpath directories: 1) If you have a set of utility classes that all your
projects use; 2) If you have a particular class on which you want to Check Syntax within the
external AS file (Flash Professional only). This would prevent losing custom classes if you ever
uninstall and reinstall Flash, in case the default global classpath directory is deleted and
overwritten and any classes stored in that directory would be lost.
For example, you might create a directory such as the following for your custom classes:
•
(Windows 2000 or Windows XP) \Documents and Settings\user\Local Settings\
Application Data\Macromedia\My_Flash MX 2004\Classes
•
(Windows 98) \Windows\Application Data\Macromedia\My_Flash MX 2004\Classes
•
(Macintosh OS X) Hard Drive/Users/Library/Application Support/Macromedia/
My_Flash MX 2004/Classes
Then, you would add this path to the list of global classpaths (see
on page
270).
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.
"Modifying the classpath" on page 270
"Modifying the classpath"
Understanding the classpath
for
269
Need help?
Do you have a question about the FLASH MX 2004-USING ACTIONSCRIPT IN FLASH and is the answer not in the manual?
Questions and answers