ColdFusion Flash Forms To Flex 2
Flex 2So with all the giving from Adobe and the CF community going around I decided to post the Ant build script I wrote for automatically compiling Flex 2 applications from within Eclipse.
To use the script:
- copy the source into a build.xml file in your project folder
- edit the properties at the top of the file to point to your sdk install directory, debug flash player, the input mxml file and the output swf file
- right click the file and choose "Run As" > "External Tools"
- create two new "Ant Build" configurations, one called "build" and the other called "run"
- now in the targets tab of the build configuration make sure only the build target is checked
- in the targets tab of the run configuration make sure only the run target is checked
Once the setup is done you can run the build commands using the 'Alt+Shift+x q' shortcut.
<?xml version="1.0"?>
<project name="Flex2 build script" default="build" basedir=".">
<property name="installdir" value="/Flex2SDK"/>
<property name="libdir" value="${installdir}/lib"/>
<property name="mxmlc" value="${libdir}/mxmlc.jar"/>
<property name="src" location="customer.mxml"/>
<property name="swf" location="customer.swf"/>
<property name="player" location="${installdir}/player/debug/SAFlashPlayer.exe"/>
<target name="init">
</target>
<target name="build" depends="init">
<antcall target="compile"/>
</target>
<target name="compile">
<java jar="${mxmlc}" fork="true" failonerror="true">
<classpath>
<fileset dir="${libdir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<jvmarg value="-Dapplication.home=${installdir}"/>
<jvmarg value="-ea"/>
<jvmarg value="-DAS3"/>
<jvmarg value="-DAVMPLUS"/>
<jvmarg value="-Xms32m"/>
<jvmarg value="-Xmx756m"/>
<jvmarg value="-Dsun.io.useCanonCaches=false"/>
<arg value="-incremental"/>
<arg file="${src}"/>
</java>
</target>
<target name="run">
<exec executable="${player}" dir="${basedir}" spawn="true">
<arg value="${swf}"/>
</exec>
</target>
</project>



Loading....