Building Flex With Ant
Adobe, Java November 24th, 2007I 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <target name="Build Swf And Start Zinc"> <mxmlc file="eva.mxml" output="${DEPLOY_DIR}/evaZinc.swf" keep-generated-actionscript="true" locale="nl_BE" > <load-config filename="${FLEX3_SDK}/frameworks/flex-config.xml"/> <!-- Default Configuration File (Talk about that in another post) --> <source-path path-element="${FLEX3_SDK}/frameworks"/><!-- Path to Flex SDK you are using --> <sp path-element="../locale/{locale}"/><!-- Path to the locales --> <!-- List of SWC files or directories that contain SWC files. --> <compiler.library-path dir="${FLEX3_SDK}/frameworks/libs" append="true"> <include name="*" /> </compiler.library-path> <compiler.library-path dir="${EVAFRAMEWORKSWC}" append="true"><!-- A framework library for my project --> <include name="EvaFrameWork.swc" /> </compiler.library-path> <compiler.library-path dir="${MDMSWC}" append="true"><!-- If you are using MDM Zinc --> <include name="mdm.swc" /> </compiler.library-path> </mxmlc> <antcall target="zinc.start.exe"/><!-- Calling target to start Zinc exe --> </target> |
Starting the Zinc Exe
1 2 3 | <target name="zinc.start.exe"> <exec executable="${DEPLOY_DIR}/evaZincLoader.exe" dir="${DEPLOY_DIR}\"/> </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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="creationCompleteHandler()" layout="absolute" width="100%" height="100%" > <mx:Script> <![CDATA[ import mdm.Application; private function creationCompleteHandler():void { mdm.Application.init(this); this.mySWFLoader.source = mdm.Application.path + "evaZinc.swf"; } ]]> </mx:Script> <mx:SWFLoader id="mySWFLoader" width="100%" height="100%" scaleContent="true" autoLoad="true" /> </mx:Application> |
-
http://microvolnovka.com/story.php?title=natural_cure_for_hemorrhoids Michael
-
http://www.youtube.com/watch?v=usOhn0o0niw free karaoke software
-
http://www.myspace.com/cardoen admin
-
http://www.youtube.com/watch?v=6iSAUm4zS0Y teleskopy astronomiczne





