简体   繁体   中英

how to use .swc file in flex project

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 f lex-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 eg 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 ?

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

文件夹层次结构

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

属性

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM