3 Replies Latest reply on Jul 28, 2009 10:50 AM by rfkrocktk

    [Flex 4] Application not including Spark Components

    rfkrocktk Level 1

      I'm building a module-based application where a main application SWF loads several Module SWFs to serve in the app. I have noticed a strange problem in loading the Modules. If I don't have a certain component (for example: spark.components.Panel) manually compiled into my application SWF, it will not compile in at all. I assumed that the entire Flex framework was automagically compiled into the main SWF (or in a RSL) by default.

       

      Perhaps I've set things up wrong. I am building the project with Ant, so my tasks look like this:

      <!-- compile the main application -->
      <target name="compile.main" depends="flex.setup">
           <mxmlc file="${flex.src.dir}/application.mxml" incremental="true"
                     output="${flex.main.file}" debug="true" link-report="${flex.linkreport.file}">
                <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                <load-config filename="conf/project-config.xml"/>
           </mxmlc>
      </target>
      
      <!-- compile modules -->
      <target name="compile.modules" depends="flex.setup">
           <mxmlc file="${myApp.module.file}" load-externs="${flex.linkreport.file}"
                     output="${forum.module.output.file}"
                     incremental="true"
                     debug="true">
                <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                <load-config filename="conf/project-config.xml"/>
           </mxmlc>
      </target>
      

      Both of those targets are of course pointing to a configuration file, which I have here:

       

      <?xml version="1.0"?>
      <flex-config>
           <target-player>10.0.0</target-player>
           
           <compiler>
                <source-path append="true">
                     <path-element>../src</path-element>
                </source-path>
                
                 <library-path append="true">
                      <path-element>../lib/as3commons-lang-1.0.0.swc</path-element>
                      <path-element>../lib/as3commons-logging-1.0.0.swc</path-element>
                      <path-element>../lib/as3commons-reflect-1.0.0.swc</path-element>
                      <path-element>../lib/as3corelib.swc</path-element>
                      <path-element>../lib/flexunit-4.0.swc</path-element>
                      <path-element>../lib/flexunit-lib-1.0.swc</path-element>
                      <path-element>../lib/flexunit-uirunner-4.0.swc</path-element>
                      <path-element>../lib/hamcrest-as3.swc</path-element>
                      <path-element>../lib/monsterdebugger-2.0.4.swc</path-element>
                      <path-element>../lib/spring-actionscript-core-0.8.swc</path-element>
                      <path-element>../lib/swfaddress-2.3.swc</path-element>
                 </library-path>
           </compiler>
      </flex-config>
      

       

       

      I am not having any problems or warnings in compiling the above code. Is there something I'm missing here? Do I have to manually embed the classes/swcs? I'm using Flex 4.0.0.7219.