1. Get SVN. You will need a good Subversion client to keep up with the latest code. Of course you can grab the zipped files from the site's homepages but then you will have to continuously look back at the site for updates, then download the whole thing over and over again rather than just updating only the updated files from SVN. Now, if you are looking for something for production use, you may want to stick with the downloaded zips for a stable build. For Mac, I would recommend Versions as a good SVN client.
2. Grab the latest code. Using your SVN client, download the latest version of the OpenSource Flex SDK, LiquidGear, and Papervision3D. Use the urls below:
2. Grab the latest code. Using your SVN client, download the latest version of the OpenSource Flex SDK, LiquidGear, and Papervision3D. Use the urls below:
In this example we will save save the sources to the following directories:
- Flex SDK
/Users/nitrog7/flex - LiquidGear
/Users/nitrog7/LiquidGear/lg - Papervision3D
/Users/nitrog7/Papervision/
3. Setup Environment. Make sure your ANT_HOME and JAVA_HOME are defined and run the following command to build your files:
You can also look at, http://opensource.adobe.com/wiki/display/flexsdk/Build+and+Test, for more information.
4. Create a build.xml file. This file will save all our settings on compiling our AS3 code.
ant -q main checkintests
You can also look at, http://opensource.adobe.com/wiki/display/flexsdk/Build+and+Test, for more information.
4. Create a build.xml file. This file will save all our settings on compiling our AS3 code.
- FLEX_ROOT - The directory you saved your flex trunk. (/Users/nitrog7/flex)
- APP_ROOT - The directory where your source files reside.
- DEPLOY_ROOT - If you would like to deploy in a directory other than your source, update this property.
- LG_DIR - Directory you saved the LiquidGear library. (/Users/nitrog7/LiquidGear)
- PV_DIR - Directory you saved the Papervision3D library. (/Users/nitrog7/Papervision)
- LG_NAME - Name your Flash file. This name will be used as the source name and output name. Do not use spaces or extensions.
- LG_SOURCE - If the source file differs from the LG_NAME, you may change it here.
- LG_OUTPUT - If the output file differs from the LG_NAME, you may change it here.
- LG_CREATOR - Your name. Give yourself some credit.
- LG_PUBLISHER - Your company.
<project name="Test" basedir=".">
<taskdef resource="flexTasks.tasks" classpath="/Users/nitrog7/flex/ant/lib/flexTasks.jar"/>
<property name="FLEX_HOME" value="/Users/nitrog7/flex"/>
<property name="APP_ROOT" value="/Users/nitrog7/Sites/tmp"/>
<property name="DEPLOY_DIR" value="${APP_ROOT}"/>
<property name="LG_DIR" value="/Users/nitrog7/LiquidGear/lg"/>
<property name="PV_DIR" value="/Users/nitrog7/Papervision"/>
<property name="LG_NAME" value="Test"/>
<property name="LG_SOURCE" value="${LG_NAME}.as"/>
<property name="LG_OUTPUT" value="${LG_NAME}.swf"/>
<property name="LG_CREATOR" value="Giraldo Rosales"/>
<property name="LG_PUBLISHER" value="Nitrogen Design"/>
<target name="Flash">
<mxmlc file='${APP_ROOT}/${LG_SOURCE}' output="${DEPLOY_DIR}/${LG_OUTPUT}" actionscript-file-encoding="UTF-8" keep-generated-actionscript="false" incremental="true">
<target-player>9.0.45</target-player>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<source-path path-element="${LG_DIR}"/>
<source-path path-element="${PV_DIR}"/>
<metadata>
<creator name="${LG_CREATOR}"/>
<publisher name="${LG_PUBLISHER}"/>
</metadata>
<optimize/>
<show-actionscript-warnings/>
</mxmlc>
</target>
</project>
4. Compile. Run the following command in your terminal:
ant -buildfile /Users/nitrog7/Sites/tmp/build.xml Flash
Each time you edit your AS files, you just need to run the one line above to recompile your code. should take only a few seconds each time depending on the size of your code.
You should have your Test.swf file in your output directory and everything is good to go. Also another note. It is known that When you compile a new, blank Flex project, the resulting SWF ends up builky (over 200kb). If you are just compiling a new, empty AS3 file, this method will produce small SWFs (about 4kb).
To trace your code you can use an AIR app called Alcon.
0 comments:
Post a Comment