8 Replies Latest reply on Aug 3, 2009 1:21 PM by Flex harUI

    mxmlc Ant Task - Module Loading Problem

    msc_santu Level 1



      I am facing Module Loading Problem.  One of our Group Member guided me the solution for this problem.


      i created special class "SharedCode.as" and i placed all common classes instance in that class.  I created SWF for the SharedCode.as and i am loading that SWF after creationComplete of the Application.

      The solution is working fine.  In order to complie code, i followed the below script.


      @echo off
      echo "Creating swf for application"
      mxmlc --link-report appclasses.rpt ModuleCodeSharingSolution.mxml
      echo "Creating swf for Shared Code"
      mxmlc --link-report shrclasses.rpt --load-externs appclasses.rpt SharedCode.as
      echo "Creating First Module"
      mxmlc --load-externs=appclasses.rpt --load-externs=shrclasses.rpt MyDataGridView.mxml
      echo "Creating Second Module"
      mxmlc --load-externs=appclasses.rpt --load-externs=shrclasses.rpt MyDataGridView2.mxml

      Now i am facing the problem with ANT Script.  I am unable to convert the above Batch file to ant script.

      I am developing a huge application with modules.  So, i have to use mxmlc ANT Task for creating the EAR file for my application.

      Currently i am using the below specified mxmlc ant task(where XXXXXXXXX represent path or filename).  But i am getting error.


      <mxmlc file="XXXXXXXXXX.mxml" output="XXXXXXXXXX.swf" actionscript-file-encoding="XXXXXXXXXX" keep-generated-actionscript="false" incremental="false"


      context-root="XXXXXXXXXXXX" load-externs="XXXXXXXXXX/MainApp.rpt"




      <load-config filename="XXXXXXXX"/>

      <source-path path-element="XXXXXXXXXX"/>

      <compiler.source-path path-element="XXXXXXXXXXX"/>

      <compiler.source-path path-element="XXXXXXXXXXXXXXX"/>


      <compiler.include-libraries dir="XXXXXXXXXXXX" append="true">

      <include name="XXXXXXXXXXX" />







      D:\testscript\build\build.xml:177: Attribute "load-externs" was already specifie
      d for element "mxmlc".


      Please help how to create ant task with multiple load-externs.