Skip to main content
Participant
August 30, 2010
Question

Unused classes gets compiled into swf

  • August 30, 2010
  • 1 reply
  • 789 views

I am building a swc [MY.swc] component with compc. It is suppose to contain base functionality for MY.swf

I need to include another (third party) swc [OTHER.swc] into my own swc. This other swc has a reference to mx.core.mx_internal and I suspect that it is this reference that in the end, when I compile MY.swf, results in that all mx classes (mx.*) and all spark classes (spark.*) is included in MY.swf (seen when decompiling)

The difference in size between MY.swf with/without OTHER.swc is ~180kB.

The only difference (when decompiling) MY.swc with/without OTHER.swc is that the first has a reference to mx.core.mx_internal

Here is the compc part from my ANT task:

<compc output="MY.swc">

<include-sources dir="${project.root}/${SRC_ROOT}" includes="*" />

<library-path dir="${project.root}/${LIBS_DIR}" includes="*" />

</compc>

Do you know if there is a problem with compiling a swc into another swc?

Any other ideas why all mx and spark classes are included?

Thanks!

This topic has been closed for replies.

1 reply

SnallfotAuthor
Participant
August 30, 2010

Should add that if I build a swf directly from OTHER.swc (and use the same classes that i do in MY.swc) the result is a much smaller file. So the problem doesn't seem to be in OTHER.swc

SnallfotAuthor
Participant
August 31, 2010

I solved my own problem:

Needed to set append flag (in library-path) to false when building MY.swf

<compiler.library-path dir="${project.root}" append="false">
  <include name="${LIBS_DIR}" />
</compiler.library-path>

Have not yet figured out exacly why, but it resulted in that the unused classes were not compiled.