0

I have a flex project in which I need to as3xls library (.swc file) in my project. Now I have downloaded that swc file and included it in flex-sdk\frameworks\libs and I am able to use the .as files of that swc file.

Now If I have tried to put the swc file in my local project, for e.g. in one of my package of components and added it to the class path (using eclipse project properties -> flex build path) and tried to use it from that location but I am unable to compile the project as its not able to import the .as files.

Can anybody suggest the location where I should add the .swc file and use it in my project ?

Nirmal
  • 4,789
  • 13
  • 72
  • 114

2 Answers2

4

If you're using Flash Builder, I generally create a libs folder under the project:

folder-hierarchy

Then, reference the SWC by selecting the project Properties, ActionScript Build Path where you can either add an individual SWC or SWC Folder:

properties

Jason Sturges
  • 15,855
  • 14
  • 59
  • 80
  • I have added swc file to flex-project->libs then using eclipse -> project properties added it to the library path... still its not able to compile. – Nirmal Oct 30 '12 at 07:59
2

Check out my blog post on How to use a SWC.

Here is the important points:

There are three different ways that you can use the classes that reside in a SWC file:
* Library Path in Project Properties: This is how I use SWCs most commonly.
* Libs folder: The libs folder was introduced in Flex Builder 3. If you put a SWC into a libs folder it is automatically added to your library path, and all the classes in the SWC are available from your project
* Library Path command line argument: You can use the library path argument to the mxmlc command line compiler.

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
  • I have tried with the first approach u have suggest of "Library Path in Project Properties". With that its actually showing as a valid import (by pressing ctrl+space), but when I am building my flex project its showing error of "unknown type". – Nirmal Oct 30 '12 at 14:35
  • Try cleaning the project. If that doesn't help; then you'll have to share some code to demo the problem. – JeffryHouser Oct 30 '12 at 14:54
  • I am using as3xls library for exporting to excel, for that I have one .swc file. And that swc file contains few .as files, which I am able to import it in my project (by ctrl+space) but while building the project its throwing an error. – Nirmal Oct 30 '12 at 15:02