View getTimeCode.as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Converts the amount of milliseconds into a string based time code. | |
* @param milliseconds | |
* @param delimiter | |
* @param withHours | |
* @return The time code as a string. | |
*/ | |
function getTimeCode( milliseconds:Number, delimeter:String = ":", withHours:Boolean = false ):String | |
{ | |
var posHours:Number = Math.floor( milliseconds / 1000 / 60 / 60 ); |
View PseudoAntProcess.as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run( buildFile:File, targetName:String, parameters:Array = null ):void | |
{ | |
var file:File = new File( "C:/windows/system32/cmd.exe" ); | |
var args:Vector.<String> = new Vector.<String>(); | |
args.push( "/c" ); | |
args.push( "ant" ); | |
if( parameters ) | |
{ |
View gist:458254
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.Bitmap; | |
import flash.display.Sprite; | |
public class CenteredImage extends Sprite | |
{ | |
private var _image:Bitmap; | |
public function CenteredImage( image:Bitmap ) |
View ant-exec-pseudo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<target name="compile"> | |
<exec executable="C:/sdk/flex/4.1/bin/mxmlc.exe" dir="${basedir}"> | |
<arg line="${basedir}/Project.as"/> | |
<arg line="-output=${basedir}/bin/project.swf"/> | |
<arg line="-source-path+=${basedir}/src"/> | |
<arg line="-library-path+=${basedir}/lib"/> | |
</exec> | |
</target> |
View gist:464694
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<taskdef resource="flexTasks.tasks" classpath="${basedir}/ant/flexTasks.jar"/> | |
<target name="compile"> | |
<mxmlc file="${basedir}/src/Project.as" output="${basedir}/bin/Project.swf" debug="true"> | |
<source-path path-element="${basedir}/src" /> | |
<compiler.library-path dir="${basedir}/lib" append="true"> | |
<include name="*.*"/> | |
</compiler.library-path> | |
</mxmlc> | |
</target> |
View gist:464799
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<target name="compile"> | |
<java jar="${FLEX_HOME}/lib/mxmlc.jar" dir="${FLEX_HOME}/frameworks" fork="true" failonerror="true"> | |
<arg value="${basedir}/src/Project.swf" /> | |
<arg value="-output=${basedir}/bin/Project.swf" /> | |
<arg value="-source-path=${basedir}/src" /> | |
<arg value="-library-path+=${basedir}/lib" /> | |
</java> | |
</target> |
View gist:464846
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- identify properties file --> | |
<property file="build.properties" /> | |
<!-- identify environment variables --> | |
<property environment="env" /> | |
<!-- Add the ant-contrib tasks --> | |
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${resources.dir}/ant-contrib.jar" /> | |
<!-- Set up FlexUnit Ant tasks --> |
View gist:464853
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Set's the FLEX_HOME property based on a command line parameter or environment variable. --> | |
<target name="init"> | |
<if> | |
<equals arg1="${FLEX_HOME}" arg2="$${FLEX_HOME}" /> | |
<then> | |
<if> | |
<equals arg1="${env.FLEX_HOME}" arg2="$${env.FLEX_HOME}" /> | |
<then> | |
<fail message="Variable FLEX_HOME does not exist. Set an environment variable or pass Ant a parameter like so: ant -DFLEX_HOME='/sdk/flex/4.1' compile-swf" /> | |
</then> |
View gist:464860
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Cleans up the project compile output. --> | |
<target name="clean-bin"> | |
<delete dir="${bin.dir}" failonerror="false" includeemptydirs="true" /> | |
<mkdir dir="${bin.dir}" /> | |
</target> | |
<!-- Cleans up the test output. --> | |
<target name="clean-test"> | |
<delete dir="${test.bin.dir}" failonerror="false" includeemptydirs="true" /> | |
<mkdir dir="${test.bin.dir}" /> |
View gist:464872
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Compiles the project into a SWF. --> | |
<target name="compile-swf" depends="init,clean-bin"> | |
<java jar="${env.FLEX_HOME}/lib/mxmlc.jar" dir="${env.FLEX_HOME}/frameworks" fork="true" failonerror="true"> | |
<arg value="${debug.compile.target}" /> | |
<arg value="-output=${debug.compile.output}" /> | |
<arg value="-source-path=${src.dir}" /> | |
<arg value="-library-path+=${lib.dir}" /> | |
<arg value="-static-link-runtime-shared-libraries=true" /> | |
<arg value="-incremental=true" /> | |
<arg value="-verbose-stacktraces=true" /> |
OlderNewer