0

I have two ActionScript projects in Flash Builder 4.5. The second project needs to use some of the actionscript files in the first project. Is there a way to do this without duplicating those files in the second folder? Is library project the answer? Any details appreciated.

2 Answers 2

2

I use Library projects for this type of sharing. It works well.

Create a new library project

File -> New -> Flex Lilbrary Project

Any files that you want to be shared can go into that project. I tend to organize it by folder, depending on what the classes do. (example: Views, Models, DTOs, Utilities, etc).

The output will be a SWC file in the bin folder.

Manually referencing the library project

If you aren't actively developing the library project, you can build it and drop it into the libs folder and use the classes like you normally would.

If you are like me and you are constantly working on the library projects, then I like to set it up so that the projects actually reference each other in a way that changes to the library project don't require a manual step.

Automatically referencing the library project

In the project that wants to reference the library project, do the following:

  1. Go to Project Properties -> Flex Build Path -> Add SWC Folder
  2. Add /LibraryProjectName/bin
  3. Go to Project Properties -> Project References
  4. Select the library project

That's it

Once you set it up this way, you can share files via the library project. I do this all the time. Reasons you might want to do this:

Library Project: MyProject.Behavior Web Project: MyProject.Web Mobile Project: MyProject.Mobile Desktop Project: MyProject.Desktop Administrator Desktop Project: MyProject.Administrator Testing: MyProject.Specs

As you can see, I can have several projects that all use the same behavior (models, views, etc).

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks Brian, can you briefly describe how to set it up?
For example, do I move the files intended to be shared into the library folder (any specific directory?), or just reference their current path in the library, etc.?
@ggkmath There you go... a full writeup :)
Hi Brian, thanks for taking the time to write the above description. I followed it just now and it works beautifully. I couldn't find anything as clear and concise elsewhere.
0

you can make a library project, and add this output library file into library of used project, and add this library used project by adding library in Eclipse.

Making library project sample: http://cookbooks.adobe.com/post_Creating_a_Flex_Library_Project_in_Flash_Builder-17629.html

Or

you can share reference of the library project by adding reference project in Eclipse, it works fine to me.

HTH.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.