Search code examples
actionscript-3actionscriptflashmxmlc

mxmlc load-externs is ignored


I develop an ActionScript 3 project using FlashDevelop 4. I have a main SWF holding all the code. I want to export some of the main SWF code into modules.

I created a module to hold the separated logic (by extending ModuleBase).

I don't want the module SWF to reference anything that is available in the main SWF so i ran the main SWF compilation with -link-report and got a report.xml file holding all the main SWF references.

I tried to compile the module (mxmlc) while excluding any class or library in the main SWF using the load-externs=report.xml option.

The compilation gave me an error saying that some libraries references are missing, but the error message referenced classes that are suppose to be included only in the main SWF. I checked the report.xml file and it does show that these classes are referenced.

I tried to run the compilation in 3 different ways and always got the same result:

  1. Using the build current file in FlashDevelope and giving the file a header of the command that should be ran.
  2. Using command line (windows).
  3. Using Ant build script.

Does anyone have any idea why this could happen? I would be happy to supply more information about my problem if it helps anyone guide me to a solution.

Thanks for the help!


Solution

  • It turns out that it did not ignore the load-externs.

    The load-externs excluded some of the libraries and therefor these libraries were not found during compile time.

    I solved the problem by adding the libraries path to the compilation. This was done by addind the flag: -l+=lib\