
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Package Access and the Classpath
|
245
and the class name is uppercase). For example, in Chapter 17, we’ll create a class
named Logger and place it in a package named logger. The fully qualified class refer-
ence is:
logger.Logger
Here, we can see the capitalization conventions for packages and classes really pay
off. At a glance, we know that logger is the package because it starts with a lower-
case “l” and that Logger is the class because it starts with a capital “L.”
Note that the package path for our example SpaceShip class is:
game.vehicles.SpaceShip
not
game.vehicles.Vehicle.SpaceShip
That is, don’t attempt to include the superclass name in the fully qualified name for a
subclass. A package names tells the compiler where to find the subclass’s .as file and
has no bearing on the subclass’s inheritance relationship to the superclass (which is
established via extends).
Package Access and the Classpath
In order for a .fla file to access a class in a package, the root directory of the package
must reside within the classpath. The classpath is simply the list of directories (paths)
on your hard drive in which the compiler looks for classes. Entries in the classpath
can be added globally for all documents (the global classpath) or on a per-.fla file
basis (a document classpath).
By default, ...