views:

26

answers:

1

Is it possible to use a Document class that is above the FLA in the directory structure?

If so, please explain how.

This is how I currently have my directory structure:

[d] site
 │
 ├─[d] as3
 |  |
 |  ├─ Site.as        //Document class for site.fla
 |  ├─ SectionA.as    //Document class for section_a.fla
 |  └─ SectionB.as    //Document class for section_b.fla
 |    
 ├─ site.fla
 ├─ section_a.fla
 └─ section_b.fla

I'd like to do this:

[d] site
 │
 ├─[d] as3
 |  |
 |  ├─ Site.as        //Document class for site.fla
 |  ├─ SectionA.as    //Document class for section_a.fla
 |  └─ SectionB.as    //Document class for section_b.fla
 | 
 ├─[d] swf
 |  |
 |  ├─ section_a.fla //Document class for this is above it in the directory structure
 |  └─ section_b.fla //Document class for this is above it in the directory structure
 |
 └─ site.fla

Thanks!

+1  A: 

Sure this is possible. You just need to add the directory to your class-paths list in your Fla.

(on PC) Go to File > Publish Settings.

Then click the Settings button beside the ActionScript version dropdown.

Add your class directories by clicking the little plus sign (+) button. You can manually type the relative path, or click the little target button to browse for the directory. In you case you can just manually enter - ./as3/ as your class path

Just a note. It is best practice to put your classes in a sub-directory, but this directory is usually called src. And usually you publish your SWF(s) to a directory called bin.

TandemAdam
@TandemAdam - Thank-you for pointing out best practice. After I read your answer, I found this link http://www.warmforestflash.com/blog/2009/10/folder-structure-and-project-organization-best-practices/ and have restructured my site. It is much more manageable now.
letseatfood