Sarah,
You might really benefit from an intro class in java at a local tech
college. Its so much easier to pick up these details from a solid
understanding of Object Oriented languages. the syntax in actionscript and
java are very similar and so it makes the parallel very strong. It is what I
did to learn because it would have taken me forever to learn the same info
through reading forums. Basically, to answer your question, you want to
arrange your code in very logical collections, called packages. most people
will use the src directory to store their classes and usually do it in a
manner such that the domain name is in the package description. The com
folder is not for communication, but the top level of the domain name. if
you worked for affug, your first folder under src would be com, with a
subfolder named affug, and then collections of related code, like services.
then you could call the package to import it with com.affug.services, the
package statement indicates the probable domain of the code origin. if you
used other utility code from adobe, it would go under the com directory and
you would import it the same way, com.adobe.utils
-src
  - com
       - affug
            - services
       - adobe
            - utils

jed


On Fri, Oct 23, 2009 at 3:50 PM, Sarah Davidson <[email protected]> wrote:

> Charlie,
>
> This is exactly one thing I'm looking for!
>
> Design pattern not the same thing. noted. :) I had asked someone else for
> help and they told me to look that up which didn't yield anything helpful -
> just arguments.
>
> In the com.mydomain folder do you just dump all of the as and mxml in
> there? You don't further sort/group them into folders of what they might be
> for or anything? I've seen references to the com.mydomain folders, but I
> don't remember any of them saying why it's named that way so I wasn't sure
> about it.
>
> Thank you again!! Now to figure out my second problem.
>
> Sarah
>
>
> On Fri, Oct 23, 2009 at 2:51 PM, Charlie Hubbard <
> [email protected]> wrote:
>
>> Ok here's roughly how I setup my folder structure for a project (again,
>> for future reference, folder structure is not a design pattern).  As noted
>> in other replies this isn't a standard, and lots of people will have other
>> opinions about the perfect layout.  There are some rules you have to follow
>> (like actionscript packages have to be nested folders), but other than that
>> it's what works for your project. This is from the perspective of a Flex
>> project.  Doing AIR projects there are other things to consider (database,
>> support files, etc).
>>
>> project_root
>>    bin-debug       [1]
>>    bin-release     [2]
>>    html-template [3]
>>    src                [4]
>>       com
>>          mydomain
>>             Class1.as
>>             Class2.as
>>             ...
>>             ClassN.as
>>       assets     [5]
>>          images
>>          css
>>          fonts
>>    lib             [6]
>>    tests         [7]
>>    doc           [8]
>>    build.xml   [9]
>>
>> [1] compiler debug output from FlexBuilder goes here.  FlexBuilder creates
>> this for you so not to worry.
>> [2] compiler release output from FlexBuilder goes here.  FlexBuilder
>> creates this for you so not to worry.
>> [3] HTML template used for running in FlexBuilder and possibly your site.
>>  FlexBuilder creates this for you so not to worry.
>> [4] action script and mxml go here.  Typically you'll put your
>> actionscript in some package like com.mydomain
>> [5]  assets folder holds my css, icons, and any fonts (if I have those)
>> [6] Any dependant SWCs I keep in lib.  FlexBuilder usually adds this to my
>> project for me.
>> [7] All unit test code goes here (again following the package structure
>> layout).
>> [8] Any project documentation, or AS doc I put there (optional)
>> [9] My build file I use with Ant to build my project from the command
>> line, and automated builds.
>>
>> HTH
>> Charlie
>>
>> On Thu, Oct 22, 2009 at 10:21 PM, Sarah Davidson <[email protected]>wrote:
>>
>>> Hi.... this is the first time I've tried this and I'm just beginning with
>>> Flex. Please excuse what may seem like silly questions :)
>>>
>>> For most things I have been trying to do, I have been able to find
>>> solutions online or in my books, but the one thing that I can't find any
>>> good and consistent information on is organizing everything. All the
>>> examples work with just one file. So far there are two things that I'm
>>> trying to figure out (since my project has lots of files):
>>>
>>>    - A folder structure (design pattern?). I want to be tidy.
>>>    - A place to put all my WebServices so I don't have to copy different
>>>    pieces to every single component. Is there a way to do some kind of 
>>> include
>>>    that references a file that lists all my services?
>>>
>>> Thank you!
>>>
>>>
>>
>


-- 
Jed Schneider
706-207-4458
twitter.com/jedschneider

Reply via email to