Skip to content

Instantly share code, notes, and snippets.

View mimshwright's full-sized avatar

Mims H. Wright mimshwright

View GitHub Profile
@mimshwright
mimshwright / FlexAntTaskDefs.xml
Created November 13, 2009 00:25
Flex ant task defs helper
<!-- Add this snippet to your build.xml to get flex ant tasks to work without having to copy the jar into the ant/lib folder -->
<!-- Optional: define these two values in your build.properties file. -->
<!--The version of the Flex SDK you are using. -->
<property name="flex.sdkVersion" value="3.4.0" />
<!-- The home directory for flex on your computer. -->
<property name="flex.path" location="/Applications/Adobe\ Flex\ Builder\ 3\ Plug-in" />
<!-- The Location of FlexSDK on your Computer -->
<property name="flex.sdkPath" location="${flex.path}/sdks/${flex.sdkVersion}"/>
<target name="incrementalBuild">
<property name="incremental" value="true" />
<antcall target="build" />
</target>
<target name="build" description="Compiles the source into a SWC library file.">
<echo>Compiling library. Incremental build = ${incremental}</echo>
<compc output="${project.output.binaryPath}/${outputName}.swc" incremental="${incremental}">
<source-path path-element="${project.sourcePath}" />
<library-path dir="${project.libraryPath}" includes="*" />
@mimshwright
mimshwright / compcBuildSample.xml
Created November 14, 2009 00:14
sample ant task using compc
<!--
The Location of your Application Classes on your Computer
NOTE: This Path should be reletive to the build.xml file.
NOTE: ${basedir} is an ant property that represents the directory holding the build.xml file
-->
<property name="project.sourcePath" location="${basedir}/src"/>
<property name="project.libraryPath" location="${basedir}/libs"/>
<!-- The Location you wish to output to on your Computer -->
<property name="project.output.binaryPath" location="${basedir}/bin"/>
@mimshwright
mimshwright / mxmlcBuildSample.xml
Created November 14, 2009 00:21
sample ant task using mxmlc
<!--
The Location of your Application Classes on your Computer
NOTE: This Path should be reletive to the build.xml file.
NOTE: ${basedir} is an ant property that represents the directory holding the build.xml file
-->
<property name="project.sourcePath" location="${basedir}/src"/>
<property name="project.libraryPath" location="${basedir}/libs"/>
<!-- The Location you wish to output to on your Computer -->
<property name="project.output.binaryPath" location="${basedir}/bin"/>
@mimshwright
mimshwright / asdocSample.xml
Created November 14, 2009 00:28
sample ant using asdoc
<property name="project.sourcePath" location="${basedir}/src"/>
<property name="project.libraryPath" location="${basedir}/libs"/>
<property name="project.output.docsPath" location="${basedir}/docs"/>
<!-- Point this to the binary path in the SDK folder that you're using. -->
<property name="flex.binaryPath" location="${FLEX_HOME}/bin">
<target name="docs" description="Compiles the asdocs in the source code into HTML.">
<exec executable="${flex.binaryPath}/asdoc" failonerror="true" description="Compiles the asdocs">
@mimshwright
mimshwright / svnTaskSample.xml
Created November 14, 2009 00:52
svn task sample
<!-- path to the svnant libraries. -->
<path id="svnant.classpath">
<fileset dir="${project.libraryPath}/ant/svnant">
<include name="*.jar"/>
</fileset>
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
<!-- Update to the latest version of the source -->
<target name="svnUpdate">
@mimshwright
mimshwright / build.properties
Created November 14, 2009 01:00
build.properties example
# The version of the Flex SDK you are using.
flex.sdkVersion=3.4.0
# The home directory for flex on your computer.
flex.path=/Applications/Adobe Flex Builder 3 Plug-in
# Your name
developer.name=Mims H. Wright
@mimshwright
mimshwright / build.xml
Created November 14, 2009 01:05
check for build.properties
<!-- Check for the build.properties file and force the user to create one before compiling. -->
<available file="build.properties" filePath="." property="customBuildPropertiesExist" />
<fail unless="customBuildPropertiesExist" message="You must create a file called 'build.properties' with your local settings in order to use ant with this project." />
<property file="build.properties" />
<echo message="Successfully loaded properties." />
@mimshwright
mimshwright / InteractivePNGTest.as
Created November 26, 2009 02:38
getOpaqueBounds() function added to InteractivePNG
/**
* Returns a rectangle around the opaque area of the png.
*
* @author Mims H. Wright
*/
public function getOpaqueBounds():Rectangle {
if (_bitmapForHitDetection==null)
drawBitmapHitArea();
var left:uint = 0;
@mimshwright
mimshwright / ResourceStringUtil.as
Created December 8, 2009 19:18
ResourceStringUtil
package com.mimswright.flex.utils
{
import mx.resources.ResourceManager;
/**
* A utility for string related functions within.
*
* @author Mims H. Wright
*/
public class ResourceStringUtil