I\'m trying to recreate a modernized version of this tutorial here - but I\'m having problems building and referencing a SWC file for inclusion in my Flash Builder project.
To build a SWC file you need to create a Library Project. You can find detailed instructions in the "About library projects" article in the Flash Builder documentation.
To use a SWC file in a Flex Project, just copy it into the libs
folder of that project.
I don't know for Flash Builder, but in Flash Develop, you just have to right click on the swc file you want in the project files list panel, and click on "add to library".
You can build a swc from Flash Builder by creating a Library project as Emanuil also answered already. Normally, all classes that are in the source path of the library project will end up in the swc and those classes are then usable in another project that has the swc in its library path.
Another way of creating a swc is by using Flash, publishing not only to a swf but to a swc too (it's a checkbox in publish settings). Then all library items that have "Export for ActionScript" checked and a class name, will end up in the swc for use in another project.
You reference classes from the swc exactly the same as you would reference a class in your own source path:
// this should be the package and class name of the class you need:
// not the name of the swc it comes from!
import some.package.name.ClassFromSWC;
...
new ClassFromSWC();
Hope this helps...
Use Flex Library Project to create SWC like the comment above. There are many ways to include external code to your project.
_ Copy to libs folder since default build path included that folder.
_ Project Properties > Action script Build Path > Add SWC to add an SWC file which could locate anywhere in your file system.
_ Project Properties > Action script Build Path > Add Project to include your Flex Library Project, in case the project is under development, so that you don't need to export SWC file and copy it into your application project every time the library changes.
To add a swc to Flash Builder, follow these steps: