Do you use \bin, \lib, \src? This is Open Mike, a series of discussion posts to throw the cat amongst the pigeons. These posts are all about you — we want to hear your opinions, ideas, and thoughts. This post, I suspect, will be polarizing… let’s hear how you organize your project files.
Daniel Apt’s Quick Tip showed us how to organize our Flash projects’ files into different directories. But there’s still the matter of where they should all go.
Which Files Go Where?
A typical Flash project is going to involve most or all of these file types:
- FLA
- SWC
- SWF
- AS
- HTML
- JS
- JPG, PNG
- MP3, WAV
- XML
- …and maybe more.
How do you arrange your folder structure to store all of these files?
(Note: sometimes a file’s type won’t determine its ideal location; a JPG will probably go in different folders depending on whether it’s to be embedded in the SWF or dynamically loaded at runtime.)
What About When Building For Different Targets?
How do you set up your folders when you’re creating different builds for different purposes?
For example, you might have separate ‘debug’ and ‘deploy’ builds, or builds targeting different platforms or browsers.
Where Do You Keep APIs and Libraries?
A lot of the tutorials on this site use TweenMax. Do you have a single folder containing all the APIs and libraries you use often, set as a global classpath in your IDE? Or do you copy each library to your current project’s folder?
The latter seems wasteful, but the former has risk: if you overwrite a library with a new version, it may cause old code to stop working.
How Do You Structure Your Classpaths?
Traditionally, AS3 classpaths were structured so that they contained the creator’s domain name. For example, if you owned http://yourdomain.com/, you’d structure your classpath like so:
\com\yourdomain\projectName\ClassName.as
This way, the package definition would look like this:
package com.yourdomain.projectName
…and the import statement would look like this:
import com.yourdomain.projectName.ClassName;
The idea is, since you own your domain name, and you have control over which project names are used, you can stop two different libraries having the same classpaths.
But it’s becoming more and more common to see this convention rejected in favour of arbitrary (and often shorter) classpaths. Is it worth sacrificing brevity for the sake of preventing two different classes having the same package?

1.
===
I use the file structure, defined in by Flex as basis, and go on like this:
/src
/assets
/gfx
/snd
/etc
/data (xml etc.)
/com
/digitaleavantgarde
/model
/view
/component
/my project class files
/locales
/en_us
/de
/embedded
/gfx
/snd
/etc
2.
====
Sadly, I don’t have a cool strategy for that & am looking forward for the other comments.
3.
====
I have a dev folder in my Dropbox account and in them three folders: frameworks, librarys and templates. While Templates are prestructured out-of-the-box projects (e.g. a basic Pure MVC Setup), the other ones contain content (like the framework itself or different libraries).
I then add this to my classpath, directly in my dropbox account. Thus I can use the same stuff on different computers (e.g. home & work)
4.
====
Exactly: \com\yourdomain\projectName\ClassName.as
Oh no, my line breaks and margins broke :(
Should be like this:
/src/assets/gfx
/src/assets/snd
/src/assets/etc
/src/data (xml etc.)
src/com/digitaleavantgarde/model
src/com/digitaleavantgarde/view
src/com/digitaleavantgarde/controller
src/com/digitaleavantgarde/my project class files
/src/locales
/src/locales/en_us
/src/locales/de
/embedded/gfx
/embedded/snd
/embedded/etc
I use in the project folder:
_classes
_src
img\*.jpg
xml\*.xml
php\*.php
flv\*.flv
snd\*.mp3
index.html
index.swf
This way I have all the assets at one location, and when (me or the user I made this for) never has issues uploading the package. He has only one simple instruction:
Upload everything but folders who begin with a underscore.
HTH
This is the proper way:
bin/ all the ouput swfs
I keep all the external loading assets in the bin folder too
bin/assets/xml
bin/assets/images
bin/assets/etc
src/ all my packages and source files. The main class is always at root level. Rest in packages.
libs/ all the libraries I use e.g com.greensock.*
src-external/ here is my UI fla files. Usually just one.
Thats it=)
I don’t there is a correct or wrong it really depends on how you work and what your comfortable with. What every works for you is usually best the only thing that is important is the transfer between devlopers it should be ease for other developers to understand everything and important the project.
For me it like so
/bin
/lib
/src
/bin has all the output files SWF and an assets folder which has all my assets there is a folder per type IE xml will have all my xml files.
/lib has my external libs. IE SWC files and source like Away3D and so on
/src has the project files following domain structure com/almogdesign/
I try to keep it simple and have everything separated, a lot of developers have there libs, in the source folder I always thought that having all your lib in the same place as you code is a bit confusing.