views:

268

answers:

2

I'm using Flash Builder 4 (the version after Flex Builder 3, so very similar to Flex Builder 3) and have a bunch of actionscript classes that I frequently need to reference. I have them in a separate folder/package to keep things clean.

I know that it's possible to create a SWC from these actionscript files. My question is how do I do it in Flash Builder 4 or Flex Builder 3. Do I need other tools? My objective is just to use the SWC in the project and keep things clean instead of dragging around all these files.

A: 

In Flex Builder 3 you can right click the projects panel and choose New -> Flex Library Project. The steps to creating a project are very similar to creating a regular project. You just link the classes you want compiled into your SWC and tell Flex Builder where to put the compiled code.

jeremynealbrown
A: 

Create a Flex Library project and put the code in the /src folder. Click on

  • project properties-> Flex Library Build Path -> Classes

to make sure all your classes are included. You can set the 'Output folder' here to point to your main project /libs folder to have it automatically build into your project or just drag the .swc manually when it's created from your 'Output folder' to the 'libs' folder of your project. Hit the [OK] button and your .swc will be created. The code is now available in your main project.

Olivier de Jonge