views:

315

answers:

3

OK I have a few classes I have made or found on the web that I plan to use in multiple projects, I would rather store these classes in a central location instead of copy+pasting them into each project.

my Flex projects have their own workspaces inside the path Flex/WorkSpaces/< workSpaceName >

If I wanted to put another folder inside the Flex directory and have the packages be com.mydomain.whatever

What folder structure would I need to make, and how would I make the code accessible to my projects?

Thanks!

+2  A: 

You can import entire projects in FB3. Take a look at the documentation.

It is always better to use packages. Keep the src organized as follows:

com

|__ johnisaacks

         |_____ utils
         |_____ components
                       |____ video
         |_____ assets
          ....
dirkgently
+1  A: 

What I would normally do is create a new library project and store those classes in that project.

To link that library project to your current project you would only have to add it to the library path of the current project (Project Properties -> Flex/ActionScript Build Path -> Library Path tab).

mrm
+1  A: 

Go into the Project Properties, Choose Build Path. In the Source Path tab, you can add folders containing ActionScript files from anywhere on the file system. In the Library Path tab you can add individual SWCs or folders containing multiple SWCs.

An example (for Windows, but it should be similar on a Mac):

Let's say you have a folder C:/Development/classes where you keep all the "shared" source files that you reuse across projects. In that folder, you want to keep one of your classes, com.example.MyClass. You should use this folder structure:

C:/Development/classes/com/example/MyClass.as

joshtynjala