I will not go and explain too much in this post because an example sometimes is worth more than a thousand lines of explanation.

Currently I'm working on an application to manage restuts from several applications. It's being developed in FlexBuilder3Beta (eclipse plugin) together with Zinc. Adobe Air was also an option, but the applications are still being developed in AS2, so we could not use Adobe Air there. Most of the times I create a loader swf that loads the main application swf. Like that, I can put the loader swf in my Zinc exe which loads the main swf. If you compile your main application swf, you don't need to package it again in a Zinc exe. With ant, I compile the Flex project and then start the Zinc exe.

Compiling my Flex project with ant goes like this

XML:
  1. <target name="Build Swf And Start Zinc">
  2.         <mxmlc
  3.             file="eva.mxml"
  4.             output="${DEPLOY_DIR}/evaZinc.swf"
  5.             keep-generated-actionscript="true"
  6.             locale="nl_BE"
  7.         >
  8.             <load-config filename="${FLEX3_SDK}/frameworks/flex-config.xml"/>
  9.             <!-- Default Configuration File (Talk about that in another post) -->
  10.             <source-path path-element="${FLEX3_SDK}/frameworks"/><!-- Path to Flex SDK you are using -->
  11.             <sp path-element="../locale/{locale}"/><!-- Path to the locales -->
  12.             <!-- List of SWC files or directories that contain SWC files. -->
  13.             <compiler.library-path dir="${FLEX3_SDK}/frameworks/libs" append="true">
  14.                 <include name="*" />
  15.             </compiler.library-path>
  16.             <compiler.library-path dir="${EVAFRAMEWORKSWC}" append="true"><!-- A framework library for my project -->
  17.                 <include name="EvaFrameWork.swc" />
  18.             </compiler.library-path>
  19.             <compiler.library-path dir="${MDMSWC}" append="true"><!-- If you are using MDM Zinc -->
  20.                 <include name="mdm.swc" />
  21.             </compiler.library-path>
  22.         </mxmlc>
  23.         <antcall target="zinc.start.exe"/><!-- Calling target to start Zinc exe -->
  24.     </target>

Starting the Zinc Exe

XML:
  1. <target name="zinc.start.exe">
  2.         <exec executable="${DEPLOY_DIR}/evaZincLoader.exe" dir="${DEPLOY_DIR}\"/>
  3.     </target>

The main disadvantage here is that debugging is quite harder when launching your application from the Zinc exe. I haven't been able to put a debug version of the swf in an Zinc exe and having the FlexBuilder listening to the debug-swf. If I find some time, I'll have a look at this. Now if an error occurs, the application just stops and you get absolutely no info on what's happening. Now I just create an SOSLogger in my application and look in the SOSWindow to the traces to find out what's happening. If I run it on Mac, I also get my logs on my pc.

My EvaZincLoader.mxml looks like this

XML:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application
  3.     xmlns:mx="http://www.adobe.com/2006/mxml"
  4.    
  5.     creationComplete="creationCompleteHandler()"
  6.    
  7.     layout="absolute"
  8.    
  9.     width="100%"
  10.     height="100%"
  11. >
  12.     <mx:Script>
  13.         <![CDATA[
  14.             import mdm.Application;
  15.            
  16.             private function creationCompleteHandler():void
  17.             {
  18.                 mdm.Application.init(this);
  19.                 this.mySWFLoader.source = mdm.Application.path + "evaZinc.swf";
  20.             }
  21.            
  22.         ]]>
  23.     </mx:Script>
  24.    
  25.     <mx:SWFLoader
  26.         id="mySWFLoader"
  27.         width="100%"
  28.         height="100%"
  29.         scaleContent="true"
  30.         autoLoad="true"
  31.     />
  32. </mx:Application>