# Import .as files from subdirectories

**URL:** <https://forum.kirupa.com/t/import-as-files-from-subdirectories/323987>\
**Category:** flash\
**Created:** [July 27, 2011, 8:55am UTC](https://forum.kirupa.com/t/import-as-files-from-subdirectories/323987 "2011-07-27T08:55:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![molkman](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@molkman](https://forum.kirupa.com/u/molkman)\
**Post date:** [July 27, 2011, 8:55am UTC](https://forum.kirupa.com/t/import-as-files-from-subdirectories/323987/1 "2011-07-27T08:55:04Z")

</div>

Hello,  
my Flash project is beginning to get out of hand because there are too many .as files and I would like to organize them in folders. But I don’t know how I need to import them properly.

I put them in a folder called “levels”, in there is a Level.as and five specific files that extend the Level class, Ground0.as to Ground5.as.

I put the folder name levels as the package name, so for example the Level.as file begins as following

```auto
package levels{
    import flash.display.*;
    import flash.events.*;
    public class Level extends MovieClip {

```

and in my Document Class (“MainClass”), I tried to import the folder “levels”

```auto
package {
    import flash.display.*;
    import flash.events.*;
    import flash.utils.*;
    import flash.ui.Keyboard;
    import levels.*
    public class MainClass extends MovieClip {

```

but calling the classes that are in the subdirectory “levels” simply doesn’t work. Do I need to do something else or call the classes in a different way?

Thank you.
