2
votes

I have some flex/AS3 code (from a 3rd party) which I must alter to fit my needs. I am constrained to use FlashDevelop due to my budget - which means the 3rd party are unwilling to offer much support (they used FlashBuilder)

The solution is made of approximately 10 "sub" projects, most of which use the spark.swc and spark_rb.swc in their library

These 10 projects are compiled into .swc using the Export SWC plugin. Each "sub" project compiles succesfully.

I then in use those .swc files in a main project.

I have tried every combination of adding the spark.swc and the spark_rb.swc to the "sub" projects library ("include referenced classes", "include completely", "not included") and similarly every combination of adding the "sub" .swcs to the main - and still I get compile errors, when building the main project similar to:

Error: Symbol 'en_US$components_properties' is multiply defined in
C:\flex_sdk_4.1.0.16076A\frameworks\locale\en_US\spark_rb.swc$locale/en_US/components.properties 
and C:\Path\To\Folder\SubProject1.swc(en_US$components_properties)

I have not included either spark.swc or spark_rb.swc in the library of the main project.

How should I be using .swc files that share .swc code? Or - am I asking the wrong question, and should be doing something different?

1
spark_rb.swc is already included in your SDK by default, why would you want to include that again in your library project? - Dennis Jaamann
Not including it means I get multiple errors like: C:\Path\To\folder\src\com\blah\uilogger\components\LoggingSkinnableComponent.as(9): col: 49 Error: The definition of base class SkinnableComponent was not found. (LoggingSkinnableComponent extends SkinnableComponent) - scudsucker

1 Answers

0
votes

That setup is okay, what you need to do is avoid compiling into your library the classes that are already included in other libraries while exporting them.

I don't know how to do this in Export SWC thing for FlashDevelop, but in Ant it is pretty easy (or even command line if you prefer):

  1. Generate a link-report (-link-report=report.xml) while compiling your app: It will contain info on what is compiled in you main SFW.
  2. Compile all sub projects with -load-externs=report.xml: this way the classes already included in the main SFW will not be compiled in sub export file.

You can read more about it here: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d1f.html#WS2db454920e96a9e51e63e3d11c0bf64277-7ffa

Hope that helps.