0

I noticed that the resulting swf file of an mxmlc compilation is missing classes that are not used but still given to the compiler via the -source-path option.

How can this be avoided?

Also, how does the compiler find out which classes are not used?

clamp
  • 33,000
  • 75
  • 203
  • 299

1 Answers1

2

If you want the unused classes to be included, using an import on those classes should be sufficient. Make sure you include the import in a class that is being used.

Add the compiler flag "link-report filename" generates a report to see what classes are included.

  • It is starting from the main source file. – Robin van den Bogaard Sep 24 '14 at 13:00
  • ok, but what if i want to use some classes with reflection? or what if i compile a library which has no main source file? – clamp Sep 24 '14 at 13:01
  • libraries get compiled not with mxmlc but with compc, this accepts a "include-classes" parameter to include all classes needed. – Robin van den Bogaard Sep 24 '14 at 13:03
  • intresting! i see compc.jar is only 476 bytes large. so i guess it is just starting mxmlc with special parameters. – clamp Sep 24 '14 at 13:08
  • You might be interested in these articles: [Using mxmlc, the application compiler](http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fcc.html) and [Using compc, the component compiler](http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fd2.html) – Robin van den Bogaard Sep 24 '14 at 13:09