# Explicitly and implicitly importing classes

You create instances of a class you've defined using the `new` operator, in the same way you create instances of built-in ActionScript objects, like the MovieClip or XML object. In order to use a class you've defined, the following must be true:

- The ActionScript file that contains the class definition must be in a classpath folder, or subfolder therein.
- The name assigned to the class must include the full package (folder) path. If a class file is in a top-level classpath folder, then the full package path is simply the class name.

    // In pkg1/myclass.as
    class pkg1.myclass { ... }

For more information about classpath folders and packages, see "About classpath folders" on page 142.

Classes are imported as they are referenced by the compiler, so that if the code being compiled references a class that hasn't been defined yet, that class will be found and compiled first.