[
  {
    "path": ".gitignore",
    "content": "src/FlexUnitApplication.mxml\nsrc/FlexUnitCompilerApplication.mxml\ntarget\nbin/FlexUnitApplication.swf\nbin-debug\nbin-release\n*.iml\n.actionScript*\n.flex*\n.Flex*\n.project\n.settings/\n.DS_Store\nlaunch\norg.eclipse.core.resources.prefs"
  },
  {
    "path": "Contribution Guidelines.md",
    "content": "#Contribution Guidelines\n\nAs developers, many of us have created our own working set of classes and functions for handling the common programming tasks we come across every day. But why reinvent the wheel? **AS3-Utils** is an attempt to gather together code from all of these disparate libraries into one place in hopes of creating a reusable, well-tested, well-documented, and freely-available unified collection. \n\nIf you have code in a personal library / pile of snippets that you'd like to add, please refer to these guidelines.\n\n##What to contribute\n\n###Flash Player Versions\n\nAS3-utils targets Flash Player 10.0+. That said, most of the snippets will work for FP 9. If there is ever a significant need for a FP9 (or 11+) version of the library, we would encourage branching or forking the project to accommodate this. \n\nPlease include the minimum Flash Player version in your ASDocs if it requires FP10 or later to compile. (See Documentation below)\n\nNothing should rely on the Flex framework (or any external libraries). \n\n###Functions vs. Classes\n\nWe've been leaning towards a *functions only* approach. This means:\n\n1. You can type `utils.foo.bar` to explore what's available in any IDE.\n\n1. You only have to import the single function you need instead of a class.\n\n1. Fewer dependencies on other pieces of the library. Less reading documents in order to use the functionality you want.\n\nIf you have a utility class that you'd like to add to the library, try breaking it into smaller functions before adding it. In other words, don't add `com.you.ArrayUtil`, instead add the functions within as standalone .as files. \n\nAs a general guideline, contributors should always favor \"snippets\" over more complex object-oriented functionality. Basically, you should be able to copy/paste the function into your own class and have it \"just work\". Anything more complex than that would need to have an argument as to why it belongs in a utils library rather than its own library. \n\nAn exception could be made for support classes that are included as internal classes but aren't accessed on their own.\n\n####Constants\n\nConstants that can be used in a general way can be added. If there is a single constant, Pi for example, you can add it as its own standalone .as file.\n\n\t// PI.as\n\tpackage utils.number {\n\t\tpublic const PI:Number = 3.141;\n\t}\n\nIf the constant value is part of an enumeration of values, you may include it in an enumeration class.\n\n\t// CommonColors.as\n\tpackage utils.color {\n\t\tpublic class CommonColors {\n\t\t\tpublic const RED:uint = 0xFF0000;\n\t\t\tpublic const GREEN:uint = 0x00FF00;\n\t\t\tpublic const BLUE:uint = 0x0000FF;\n\t\t}\n\t}\n\n###Integrating Libraries\n\nThere's a list of libraries to integrate into AS3-utils. If you'd like to pull in the utility functions from them, please do so with respect to the licenses and authors of the original code. Again, this is a snippet library rather than a collection of classes so break down the code into atomic functions with as few dependencies as possible. \n\n###Naming\n\n- Please use self-explanatory names for your functions and avoid using abbreviations. Strive for clarity over brevity. E.g. `truncateMultilineText()`, NOT `truncMLText()`\n\n- Function names should all begin with some kind of _descriptive_ verb. E.g. \n\n\t- `displayDialog()` NOT `dialog()` or `doDialog()`\n\t\n\t- `getName()` or `get name()` NOT `name()`\n\n- Predicate functions, functions that return a boolean must start with `is` (as if answering a question). E.g. `isEmptyString(value:String):Boolean` NOT `empty(value:String):Boolean`\n\n- Parameter names must be descriptive. E.g. `alignLeft(objectsToAlign:Array):void` instead of `alignLeft(a:Array):void`\n\n- Variable names must be descriptive. E.g. `var targetWidth:int = target.width` instead of `var tw:int = target.width`\n\n- Please use US English for all terms. E.g. `getColor()` not `getColour()`\n\n- Remember that in common practice the package name will not be included in people's code. Therefore, to make code more readable, avoid ambiguous names for functions and classes. Rather than relying on the package name to imply what the function does, include include it in the name of the function. E.g. \n\n\t* `convertHexStringToUint(hexString:String):uint`, NOT `convertToUint(s:String):uint`\n\t\n\t* `XMLConstants` or better yet, `XMLNodeType`, NOT `Constants`\n\t\n\t* `utils.foo.getFooAsString()`, NOT `utils.foo.toString()`\n\t\n- When in doubt, use naming conventions from ActionScript and the FlashPlayer API.\n\n###Packages\n\nHere are general guidelines for how to pick a package.\n\n* Check to see what packages already exist before creating a new one. If possible, use one of the existing packages. **Do not** use your own package names (e.g. `com.mimswright`)\n\n* If a utility function operates mainly on a particular class from the Flash Player API, use the same package name as that class. E.g. if your function deals mostly with `Sprites`, use the `utils.display` package.\n\n* If your function is related to a root-level class in the Flash API, such as `Array`, use `utils.array`. \n\n* If you have a significant set of functions that relates to a specific class within a package, you may create a new package just for that class. For example, if you have several functions that all deal with `Point`, could go in `utils.geom.point`.\n\n* If you're Peter Piper, pick a peck of pickled packages. \n\n##Deprecating and Replacing Existing Code\n\nWhat do you do if you want to contribute a piece of code that is very similar to one that already exists? \n\n* **First, always check for code that could function similarly to your code.** \n\n* If you find similar code to something you want to commit, think carefully.\n\n\t* If your code and their code do virtually the same thing the same way, suck it up and **keep the existing code**.\n\t\n\t* Only edit or replace existing code if there are tests. If there are not tests, write tests against the existing code then replace with your version. Ensure the tests still pass before committing.\n\t\n\t* Writing a note explaining why you made the change is encouraged.\n\t\n* If you find checked-in code that is a duplicate of another piece of code, keep the one that is clearer and more robust and remove the other.\n\n* You may make changes to names of functions if they are unclear or don't meet the naming requirements but in general, try not to change things around based only on your personal style.\n\n##Unit Tests\n\nNeedless to say, code should not cause any compile errors or warnings.\n\nNew code snippets must be covered by tests. Tests should demonstrate correct usage, with as many unique scenarios as the code is expected to handle. Fringe cases that may throw errors should be demonstrated if possible, e.g. passing `null` to a function that expects a parameter of type `Array`.\n\nTests should be written using FlexUnit 4.0+.\n\nIf you come across code that needs a unit test written for it, you are encouraged to write one. You will earn much karma.\n\nMore on FlexUnit and Testing on [Elad Elrom's Blog](http://elromdesign.com/blog/2010/03/10/test-driven-development-tdd-with-flexunit-4-complete-tutorial/).\n\n##Documentation\n\nPlease add [ASDoc](http://help.adobe.com/en_US/flex/using/WSd0ded3821e0d52fe1e63e3d11c2f44bb7b-7fe7.html)-style documentation to everything. Your code should have at least these tags in every function or class.\n\t\n* `@author Your Name`\n\t\n* `@param paramName Description.` if there are any params\n\n* `@return Type Description.` if not `void`\n\n* `@throws package.ErrorType Description.` if it throws an error\n\t\n* `@example <listing version=\"3.0\">code</listing>` for example code. (A good habit is write the example first, then the docs, then the tests, then the code.)\n\t\n* `@playerversion Flash 10.1` If your code will only work on a player later than 9.0\n\t\nExample code is optional for simple functions but please include a description of what the code is designed to achieve and/or why you might want to use it. Include any licensing that applies to your functions.\n\nFeel free to add docs to other people's code if there are none. \n\n##Merge Strategy\n\nSubmitters should follow these steps when contributing code to the project.\n\n__SUBMITTERS:__\n\n1. Create a fork of the project.\n\n1. Make your changes, test, and commit them.\n\n1. When you're ready to integrate the changes into the main branch, create a pull request.\n\n1. Don't merge your own pull request even if you're an admin. Instead, ask for assistance from someone else to review your pull request and merge it into the master. \n\n1. If you're an admin and are anxious with waiting for your pull request to be handled, review and pull someone else's code while you wait.\n\n__ADMINS:__\n\n1. Review the commits by checking them out to a local repository.\n\n1. Ask questions of the submitter or other admins!\n\n1. Write tests & improve docs or request that the submitter do so.\n\n1. Remember to run the test suite before merging code into master.\n\n1. You can reformat the incoming code using the `res/flex-formatter.properties` file. (Optional)\n\n1. Big changes can/should first be merged into a separate integration branch at your discretion.\n\n\n###Why not merge your own code?\n\nThis is a collection made for everyone made up of several people's personal code library. The chances of adding duplicate or idiosyncratic code is very high. Using the pull-request scheme is a great way for us to make sure all the code is being reviewed by *someone* other than the author. The more people who review code the less chance of checking in a duplicate or buggy piece of code. \n\nFurthermore, gitHub is set up to handle a distributed repository workflow very elegantly. If at any point you want to break out and work on your own personal code library, that's easy to do in your own fork. "
  },
  {
    "path": "Libraries to integrate.md",
    "content": "* Sekati - [http://code.google.com/p/sekati/](http://code.google.com/p/sekati/)\n* BumpSlide - [http://code.google.com/p/bumpslide/](http://code.google.com/p/bumpslide/)\n* as3MathLib - [http://code.google.com/p/as3mathlib/](http://code.google.com/p/as3mathlib/)\n* casaLib - [http://casalib.org/about/](http://http://casalib.org/about/)"
  },
  {
    "path": "NOTES.md",
    "content": "# as3-utils\n\n# ISSUES\n\n- parameter names are not descriptive\n- variable names are not descriptive\n- nomenclature is inconsistent\n--\tuse functional-programming names?\n--\tuse designer friendly names?\n--\tprovide aliases for common functions with multiple common names?\n- ASDocs \n-- missing tags\n-- incorrect descriptions\n-- incorrect tags\n\n# Refactoring Guidelines\n\n- predicate methods should be prefixed with is*\n\n# AUDIT\n\nThe below is the results of a quick audit of the functions available in as3-utils, and their specific issues.\n\n# ALIGN\n\nalignLeft\nalignToRectangleLeft\n    duplicates\n\nalignRight\nalignToRectangleRight\n    duplicates\n\nalign to edges\ndistribute by edges\ngrid alignment\n\nhAlign(targets:Array, hSpacing:int = 0, alignment:Alignment = Alignment.LEFT):Array\nvAlign(targets:Array, vSpacing:int = 0, alignment:Alignment = Alignment.TOP):Array\ngAlign(targets:Array, columns:int, rows:int, hSpacing:int = 0, vSpacing:int = 0, alignment:Alignment = Alignment.TOP_LEFT):Array\ngAlign = gridAlign\n\n    /**\n     * Aligns all the target DisplayObjects by their left edge to the left-most target. \n     *\n     * Similar to the Flash IDE Alignment panel. \n     */\n    alignLeft(targets:Vector.<DisplayObject>):Vector.<DisplayObject>\n    \n    /**\n     * Aligns all the target DisplayObjects by their right edge to the right-most target.\n     *\n     * Similar to the Flash IDE Alignment panel. \n     */\n    alignRight(targets:Vector.<DisplayObject>):Vector.<DisplayObject>\n\n    /**\n     * Aligns all the target DisplayObjects by their top edges to the top-most target.\n     *\n     * Similar to the Flash IDE Alignment panel. \n     */\n    alignTop(targets:Vector.<DisplayObject>):Vector.<DisplayObject>\n    \n    /**\n     * Aligns all the target DisplayObjects by their bottom edges to the bottom-most target.\n     *\n     * Similar to the Flash IDE Alignment panel. \n     */\n    alignBottom(targets:Vector.<DisplayObject>):Vector.<DisplayObject>\n\n    /**\n     * Aligns all the target DisplayObjects by their horizontal center edges to the horizontal center of the all the targets.\n     *\n     * Similar to the Flash IDE Alignment panel. \n     */\n    alignHorizontalCenter(targets:Vector.<DisplayObject>):Vector.<DisplayObject>\n\n    /**\n     * Aligns all the target DisplayObjects by their vertical center edges to the vertical center of the all the targets.\n     *\n     * Similar to the Flash IDE Alignment panel. \n     */\n    alignVerticalCenter(targets:Vector.<DisplayObject>):Vector.<DisplayObject>\n\nalignToLeftEdge(of:DisplayObject, ...targets)\n\nalignLeftEdges(...targets):Array\nalignRightEdges(...targets):Array\nalignTopEdges(...targets):Array\nalignBottomEdges(...targets):Array\nalignCenters(...targets):Array\n\ndistributeByLeftEdge(...targets):Array\ndistributeByRightEdge(...targets):Array\ndistributeByTopEdge(...targets):Array\ndistributeByBottomEdge(...targets):Array\ndistributeByHorizontalCenter(...targets):Array\ndistributeByVerticalCenter(...targets):Array\n\n# ARRAY\n\nutils.array.contains():int\n    badly named, should be something like numReferencesInArray, arrayRefCount\n    \nutils.array.copyArray()\n    remove, pointless, use array.slice() instead. \n    \nutils.array.createUniqueCopy\nutils.array.removeDuplicates\n    duplicates asx.array.unique\n    \nutils.array.arraysAreEqual\nutils.array.equals\n    duplicates\n    \nutils.array.getHighestValue\nutils.array.getLowestValue\n    use the Array constants, not magic numbers\n\nutils.array.randomize\n    too much code for what it does\n    could be faster\n\nutils.array.removeItem\nutils.array.removeValueFromArray\n    duplicates\n    \nutils.array.retainItems\n    duplicates asx.array.union\n    \nutils.array.sum\n    duplicates asx.array.sum\n\n#  ASSERT\n\nutils.assert.*\n    suggestion: use the assertions provided by hamcrest-as3 or flexunit\n    should throw an AssertionError instead of Error\n    \nutils.capabilities.getPlayerInfo\n    dubious value\n   \n#   CAPABILITIES\n    \nutils.capabilities.isMac\nutils.capabilities.isPC\n    change isMac to be !isPC\n    DRY\n\n#   COLOR\n\nutils.color.randomColor\n    implementation is whack, why convert to a Number to a String to a Number?\n\nutils.color.toGrayscale\n    which reference was used for the mix ratios?\n\n#   COOKIE\n\nutils.cookie.setCookie\n    potential global javascript namespace pollution\n    \n#   DATE\n\nutils.date.toRFC822\n    missing result examples, and appears to reference the wrong RFC number\n\nutils.date.toW3CDTF\n    missing result examples\n    \n#   DISPLAY\n\nutils.display.addTargetToParent\n    dubious value\n    uses a switch for two values\n    uses magic numbers\n    \nutils.display.Alignment\n    values should be same as key\n    move to utils.align.Alignment\n    eg BOTTOM_LEFT:String = \"BOTTOM_LEFT\"\n    \nutils.display.sumProps\n    remove\n    replace with utils.number.sum, asx.object.pluck\n\n#   ERROR\n\nutils.error.getStackTrace\n    no try-catch required\n    return new Error().getStackTrace();\n    dubious value\n\n#   EVENT\n\nutils.event.addTargetEventListener\nutils.event.removeTargetEventListener\n    dubious value\n    \n#   FRAME\n\nutils.frame.addFrameScript\nutils.frame.removeFrameScript\n    needs an appropriate error message\n    can multiple framescripts exist on a single frame?\n\n#   GEOM\n\nutils.geom.Point3D\n    move static methods to instance method, both deal with Point3D as arguments, and there are already instance methods for add, subtract, offset\n\n#   NUMBER\n\nutils.number.clamp\nutils.number.confine\nutils.number.constrain\nutils.range.resolve\n    duplicates asx.number.bound\n    replace with clamp\n\nutils.number.insertCommas\n    there is easier way to do this, using reverse, split and join\n    \nutils.number.isBetween\n    duplicates asx.number.between\n    \n#   RANGE\n \nutils.range.resolve\n    duplicates utils.number.clamp etc\n    \n#   STRING\n\nutils.string.addSlashes\n    bad name, escapeChars is more accurate\n    \nutils.string.slashUnsafeChars\n    bad name, escapeRegExpChars is more accurate\n    \nutils.string.constants\n    bad name, separate to package level or rename\n    \nutils.string.firstToUpper\n    bad name, rename to capitalize\n\nutils.string.replace\n    dubious value\n    \nutils.string.stripSlashes\n    bad name, unescapeChars\n     \n"
  },
  {
    "path": "README.md",
    "content": "# as3-utils\n\nActionScript 3 Utilities and Object Extensions provided as reusable package-level functions that solve common problems.\n\n# What have you got for me?\n\nHEAPS, too much to list here right now.\n\nOh ok here's a taste, there are umpteen utils for\n\n- array\n- color\n- conversions\n- date\n- event\n- garbage collection\n- html\n- number\n- string\n- validation\n- and [more](http://github.com/as3/as3-utils/tree/master/src/utils/).\n\n# Gimme some utils\n\nGot Git? Lets go!\n\n    $ git clone git://github.com/as3/as3-utils.git\n    $ ant\n\n# Got something to share?\n\nCheck out the [contribution guidelines](https://github.com/as3/as3-utils/blob/master/Contribution%20Guidelines.md).\n\nFork the [as3-utils project](http://github.com/as3/as3-utils) on GitHub, see the [forking guide](http://help.github.com/forking/) and then send a pull request.\n\n# Contributors\n\n- John Lindquist [@johnlindquist](http://twitter.com/johnlindquist)\n- Drew Bourne [@drewbourne](http://twitter.com/drewbourne)\n- Joel Hooks [@jhooks](http://twitter.com/jhooks)\n- Mims H. Wright [@mimshwright](http://twitter.com/mimshwright)\n- Ian McLean [@ianmclean](http://twitter.com/ianmclean)\n- [You?](https://github.com/as3/as3-utils/blob/master/Contribution%20Guidelines.md)\n\n# Giving credit where credit is due\n\nMany of these utils are copy/pasted from open-source projects from around the web. We will attribute functions to their creators (it's on our list of things to do) and we hope function authors understand that we're not trying to take credit for their work. We don't want credit, we just want a collection of great open-source utils supported by the community.\nIf you include your own code in the library, please be sure to add a credit for yourself in the comments or use an @author tag in the asDocs. \n\n# License\n\nSince many of the functions in the library are pulled or adapted from other sources, there is no single license that covers everything. However, the intent is for this code to be freely available and editable, a la the MIT license, except where otherwise noted. We've done our best to include appropriate attribution and license where required but if you see something that should not be in here, please let us know and we will remove it.\n"
  },
  {
    "path": "TODO.md",
    "content": "# TODO\n\n- combine with [asx](http://github.com/drewbourne/asx)\n- attribute all functions to proper authors\n- check utils for duplicates\n- clean package structure\n- clean parameter names to be descriptive\n- code formatting\n- build out tests\n- optimize\n- documentation\n- examples\n- replace default FlexPMD ruleset as it is awkward."
  },
  {
    "path": "build/pmd/LICENSE.txt",
    "content": "   Copyright (c) 2009, Adobe Systems, Incorporated\n   All rights reserved.\n\n   Redistribution  and  use  in  source  and  binary  forms, with or without\n   modification,  are  permitted  provided  that  the  following  conditions\n   are met:\n\n     * Redistributions  of  source  code  must  retain  the  above copyright\n       notice, this list of conditions and the following disclaimer.\n     * Redistributions  in  binary  form  must reproduce the above copyright\n       notice,  this  list  of  conditions  and  the following disclaimer in\n       the    documentation   and/or   other  materials  provided  with  the\n       distribution.\n     * Neither the name of the Adobe Systems, Incorporated. nor the names of\n       its  contributors  may be used to endorse or promote products derived\n       from this software without specific prior written permission.\n     \n   THIS  SOFTWARE  IS  PROVIDED  BY THE  COPYRIGHT  HOLDERS AND CONTRIBUTORS \n   \"AS IS\"  AND  ANY  EXPRESS  OR  IMPLIED  WARRANTIES,  INCLUDING,  BUT NOT\n   LIMITED  TO,  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A \n   PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER \n   OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,  INCIDENTAL,  SPECIAL,\n   EXEMPLARY,  OR  CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT  NOT  LIMITED TO,\n   PROCUREMENT  OF  SUBSTITUTE   GOODS  OR   SERVICES;  LOSS  OF  USE,  DATA, \n   OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n   LIABILITY,  WHETHER  IN  CONTRACT,  STRICT  LIABILITY, OR TORT (INCLUDING\n   NEGLIGENCE  OR  OTHERWISE)  ARISING  IN  ANY  WAY  OUT OF THE USE OF THIS\n   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "build.properties",
    "content": "project.name=as3-utils\n\nbuild.groupId=as3\nbuild.artifactId=as3-utils\nbuild.version=0.1\nbuild.artifact=${build.artifactId}-${build.version}\n\ntest.runner=UtilsTestRunner\ntest.runner.ext=as\n\nflexunit.version=4.1.0-33\nflexsdk.version=3.5.0.12683\nflexpmd.version=1.1"
  },
  {
    "path": "build.xml",
    "content": "<?xml version=\"1.0\"?>\n<project\n\tname=\"as3-utils\"\n\tbasedir=\".\"\n\tdefault=\"package\">\n\n\t<!--\n\t\tas3-utils\n\t\t\n\t\tusage: \n\t\t\t$ ant -v clean package\n\t\t\n\t\t@author drewbourne\n\t-->\n\n\t<!-- properties -->\n\t<property environment=\"env\" />\n\t<property file=\"build.properties\" />\n\n\t<!-- paths: existing -->\n\t<property name=\"src.loc\" location=\"${basedir}/src\" />\n\t<property name=\"test.loc\" location=\"${basedir}/test\" />\n\t<property name=\"lib.loc\" location=\"${basedir}/libs\" />\n\t<property name=\"build.loc\" location=\"${basedir}/build\" />\n\t<property name=\"build.pmd.loc\" location=\"${build.loc}/pmd\" />\n\t<property name=\"build.flexunit.loc\" location=\"${build.loc}/flexunit\" />\n\n\t<!-- paths: enumerated -->\n\t<property name=\"dist.loc\" location=\"${basedir}/target\" />\n\t<property name=\"bin.loc\" location=\"${dist.loc}/bin\" />\n\t<property name=\"doc.loc\" location=\"${dist.loc}/doc\" />\n\t<property name=\"report.loc\" location=\"${dist.loc}/report\" />\n\t<property name=\"report.flexunit.loc\" location=\"${report.loc}/flexunit\" />\n\n\t<!-- Flex SDK -->\n\t<property name=\"FLEX_HOME\" location=\"${env.FLEX_HOME}\" />\n\n\t<!-- task definitions -->\n\t<taskdef resource=\"flexTasks.tasks\"\n\t         classpath=\"${FLEX_HOME}/ant/lib/flexTasks.jar\" />\n\n\t<!-- targets -->\n\t<target\n\t\t\tname=\"clean\"\n\t\t\tdescription=\"Removes generated artifacts and directories\">\n\n\t\t<delete dir=\"${dist.loc}\" />\n\n\t</target>\n\n\t<target\n\t\t\tname=\"initialize\"\n\t\t\tdescription=\"Creates generated directories \">\n\n\t\t<mkdir dir=\"${dist.loc}\" />\n\t\t<mkdir dir=\"${bin.loc}\" />\n\t\t<mkdir dir=\"${doc.loc}\" />\n\t\t<mkdir dir=\"${report.loc}\" />\n\t\t<mkdir dir=\"${report.flexunit.loc}\" />\n\n\t</target>\n\n\t<target\n\t\t\tname=\"compile-check-if-required\"\n\t\t\tdescription=\"Checks if a compile is required\"\n\t\t\tdepends=\"initialize\">\n\n\t\t<uptodate\n\t\t\t\tproperty=\"compile.not-required\"\n\t\t\t\ttargetfile=\"${bin.loc}/${build.artifact}.swc\">\n\t\t\t<srcresources>\n\t\t\t\t<fileset dir=\"${src.loc}\">\n\t\t\t\t\t<include name=\"**/*.as\" />\n\t\t\t\t\t<include name=\"**/*.mxml\" />\n\t\t\t\t</fileset>\n\t\t\t\t<fileset dir=\"${lib.loc}\">\n\t\t\t\t\t<include name=\"**/*.swc\" />\n\t\t\t\t</fileset>\n\t\t\t</srcresources>\n\t\t</uptodate>\n\n\t</target>\n\n\t<target\n\t\t\tname=\"compile\"\n\t\t\tdescription=\"Compiles the library\"\n\t\t\tdepends=\"initialize, compile-check-if-required\"\n\t\t\tunless=\"compile.not-required\">\n\n\t\t<compc output=\"${bin.loc}/${build.artifact}.swc\"\n\t\t    target-player=\"10.0\">\n\t\t    \n\t\t\t<source-path path-element=\"${src.loc}\" />\n\n\t\t\t<include-sources dir=\"${src.loc}\">\n\t\t\t\t<include name=\"**/*.as\" />\n\t\t\t\t<include name=\"**/*.mxml\" />\n\t\t\t</include-sources>\n\n\t\t\t<library-path dir=\"${lib.loc}\" append=\"true\">\n\t\t\t\t<include name=\"*.swc\" />\n\t\t\t</library-path>\n\n\t\t\t<compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>\n\t\t</compc>\n\n\t</target>\n\n\t<target name=\"test\"\n\t        description=\"Run the test suite\"\n\t        depends=\"initialize\">\n\n\t\t<taskdef resource=\"flexUnitTasks.tasks\"\n\t\t         classpath=\"${build.flexunit.loc}/flexUnitTasks-${flexunit.version}.jar\" />\n\n\t\t<!-- Compile Test -->\n\t\t<mxmlc\n\t\t    target-player=\"10.0\"\n\t\t\tfile=\"${test.loc}/${test.runner}.${test.runner.ext}\"\n\t\t\toutput=\"${bin.loc}/${test.runner}.swf\">\n\n\t\t\t<library-path dir=\"${bin.loc}\" append=\"true\">\n\t\t\t\t<include name=\"${build.artifact}.swc\" />\n\t\t\t</library-path>\n\n\t\t\t<library-path dir=\"${lib.loc}\" append=\"true\">\n\t\t\t\t<include name=\"*.swc\" />\n\t\t\t</library-path>\n\n\t\t\t<compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>\n\t\t</mxmlc>\n\n\t\t<!-- Execute Tests -->\n\t\t<flexunit\n\t\t\t\tswf=\"${bin.loc}/${test.runner}.swf\"\n\t\t\t\ttoDir=\"${report.flexunit.loc}\"\n\t\t\t\thaltonfailure=\"false\"\n\t\t\t\tverbose=\"true\"\n\t\t\t\tlocalTrusted=\"true\" />\n\n\t</target>\n\n\t<target name=\"report\"\n\t        description=\"Generates test reports from FlexUnit, FlexPMD, FlexCPD, FlexMetrics\"\n\t        depends=\"test\">\n\n\t\t<!-- Generate readable report for FlexUnit -->\n\t\t<junitreport todir=\"${report.flexunit.loc}\">\n\t\t\t<fileset dir=\"${report.flexunit.loc}\">\n\t\t\t\t<include name=\"TEST-*.xml\" />\n\t\t\t</fileset>\n\t\t\t<report format=\"frames\" todir=\"${report.flexunit.loc}/html\" />\n\t\t</junitreport>\n\n\t\t<!-- FlexPMD config -->\n\t\t<path id=\"flexpmd.base\">\n\t\t\t<pathelement location=\"${build.pmd.loc}/as3-parser-${flexpmd.version}.jar\" />\n\t\t\t<pathelement location=\"${build.pmd.loc}/as3-parser-api-${flexpmd.version}.jar\" />\n\t\t\t<pathelement location=\"${build.pmd.loc}/as3-plugin-utils-${flexpmd.version}.jar\" />\n\t\t\t<pathelement location=\"${build.pmd.loc}/flex-pmd-files-${flexpmd.version}.jar\" />\n\t\t\t<pathelement location=\"${build.pmd.loc}/pmd-4.2.5.jar\" />\n\t\t</path>\n\n\t\t<taskdef name=\"pmd\" classname=\"com.adobe.ac.pmd.ant.FlexPmdAntTask\" classpath=\"${build.pmd.loc}/flex-pmd-ant-task-${flexpmd.version}.jar\">\n\t\t\t<classpath>\n\t\t\t\t<path refid=\"flexpmd.base\" />\n\t\t\t\t<pathelement location=\"${build.pmd.loc}/commons-lang-2.4.jar\" />\n\t\t\t\t<pathelement location=\"${build.pmd.loc}/flex-pmd-core-${flexpmd.version}.jar\" />\n\t\t\t\t<pathelement location=\"${build.pmd.loc}/flex-pmd-ruleset-api-${flexpmd.version}.jar\" />\n\t\t\t\t<pathelement location=\"${build.pmd.loc}/flex-pmd-ruleset-${flexpmd.version}.jar\" />\n\t\t\t\t<pathelement location=\"${build.pmd.loc}/plexus-utils-1.0.2.jar\" />\n\t\t\t</classpath>\n\t\t</taskdef>\n\n\t\t<taskdef name=\"cpd\" classname=\"com.adobe.ac.cpd.ant.FlexCpdAntTask\" classpath=\"${build.pmd.loc}/flex-pmd-cpd-ant-task-${flexpmd.version}.jar\">\n\t\t\t<classpath>\n\t\t\t\t<path refid=\"flexpmd.base\" />\n\t\t\t\t<pathelement location=\"${build.pmd.loc}/flex-pmd-cpd-${flexpmd.version}.jar\" />\n\t\t\t</classpath>\n\t\t</taskdef>\n\n\t\t<taskdef name=\"metrics\" classname=\"com.adobe.ac.pmd.metrics.ant.FlexMetricsAntTask\"\n\t\t         classpath=\"${build.pmd.loc}/flex-pmd-metrics-ant-task-${flexpmd.version}.jar\">\n\t\t\t<classpath>\n\t\t\t\t<path refid=\"flexpmd.base\" />\n\t\t\t\t<pathelement location=\"${build.pmd.loc}/commons-lang-2.4.jar\" />\n\t\t\t\t<pathelement location=\"${build.pmd.loc}/dom4j-1.6.1.jar\" />\n\t\t\t\t<pathelement location=\"${build.pmd.loc}/flex-pmd-metrics-${flexpmd.version}.jar\" />\n\t\t\t\t<pathelement location=\"${build.pmd.loc}/flex-pmd-ruleset-api-${flexpmd.version}.jar\" />\n\t\t\t</classpath>\n\t\t</taskdef>\n\n\t\t<!-- Executions -->\n\t\t<pmd sourceDirectory=\"${src.loc}\" outputDirectory=\"${report.loc}\" />\n\n\t\t<cpd minimumTokenCount=\"50\" outputFile=\"${report.loc}/cpd.xml\">\n\t\t\t<fileset dir=\"${src.loc}\">\n\t\t\t\t<include name=\"**/*.as\" />\n\t\t\t\t<include name=\"**/*.mxml\" />\n\t\t\t</fileset>\n\t\t</cpd>\n\n\t\t<metrics sourcedirectory=\"${src.loc}\" outputfile=\"${report.loc}/javancss.xml\" />\n\n\t</target>\n\n\t<target name=\"doc\"\n\t        description=\"Generate ASDoc for ${ant.project.name}\"\n\t        depends=\"initialize\">\n\n\t\t<!-- Generate asdocs -->\n\t\t<java jar=\"${FLEX_HOME}/lib/asdoc.jar\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg line=\"+flexlib '${FLEX_HOME}/frameworks'\" />\n\t\t\t<arg line=\"-doc-sources '${src.loc}'\" />\n\t\t\t<arg line=\"-source-path+='${src.loc}'\" />\n\t\t\t<arg line=\"-output '${doc.loc}'\" />\n\t\t\t<arg line=\"-main-title '${project.name} API Documentation'\" />\n\t\t\t<arg line=\"-window-title '${project.name} API Documentation'\" />\n\t\t</java>\n\n\t</target>\n\n\t<target name=\"package\"\n\t        description=\"Package ${ant.project.name} into a zip\"\n\t        depends=\"compile, test, report, doc\">\n\n\t\t<!-- Create distribution for binaries with docs -->\n\t\t<zip destfile=\"${dist.loc}/${build.artifact}.zip\">\n\t\t\t<zipfileset dir=\"${bin.loc}\">\n\t\t\t\t<include name=\"${build.artifact}.swc\" />\n\t\t\t</zipfileset>\n\t\t\t<zipfileset dir=\"${doc.loc}\" prefix=\"doc\" />\n\t\t</zip>\n\n\t</target>\n\n</project>\n"
  },
  {
    "path": "res/flex-formatter.properties",
    "content": "#FlexFormatter settings\n#Sat Apr 10 22:47:59 EST 2010\nASRearr_UseModifierOrder_Function=true\nActionscript.useBraceStyle=false\nASRearr_ModifierOrder_Property=<Namespace>,override,native,public,private,protected,internal,static,dynamic,final\nASRearr_UseSectionHeadersInMXML=false\nASRearr_ModifierOrder_Class=<Namespace>,override,native,public,private,protected,internal,static,dynamic,final\nASRearr_GroupGettersAndSettersWithStaticProperties=false\nASRearr_ElementSortStaticProperties=true\nASRearr_ElementStaticFunctionVisibilityOrder=public\\:true,protected\\:true,internal\\:true,private\\:true,\nMXML.attrWrapMode=52\nASRearr_UseElementStaticPropertyVisibilityOrder=true\nASRearr_SortGettersAndSettersWithAssociatedProperties=true\nASRearr_ElementSortImports=true\nASRearr_ElementOrder=Import,Include,Namespace Definition,Default Namespace,Namespace Use,Static Property,Static Function,Static Initializer,Constructor,Property,Function,\nActionscript.spacesAfterComma=1\nActionscript.advancedSpacesAroundEqualsInOptionalParameters=0\nASRearr_ElementFunctionVisibilityOrder=public\\:true,protected\\:true,internal\\:true,private\\:true,\nMXML.blankLinesAfterSpecificParentTags=0\nMXML.onlyFormatASIfCDATABlock=false\nActionscript.advancedWrappingElements=165\nActionscript.spacesBeforeComma=0\nActionscript.advancedSpacesInsideLiteralBraces=1\nActionscript.wrapArrayDeclMode=4\nASRearr_SectionHeaderMap=\\#\\n\\#Sat Apr 10 22\\:47\\:59 EST 2010\\n\nASRearr_RemoveExistingCopyrightHeaders=false\nActionscript.newLineBeforeBindableProperty=true\nFlex.useTabs=true\nASRearr_ElementSortMetatags=false\nMXML.attrsToKeepOnSameLine=4\nMXML.sortAttrMode=0\nActionscript.wrapMethodCallMode=4\nActionscript.spacesBeforeControlOpenParen=1\nActionscript.spacesAfterColons=0\nActionscript.useGlobalCRBeforeBrace=true\nActionscript.blankLinesBeforeFunctions=1\nMXML.spacesAroundEquals=0\nASRearr_AddDefaultHeaderForStaticProperties=1\nASRearr_UseModifierOrder_Class=true\nActionscript.breakLinesBeforeComma=false\nActionscript.spacesAroundAssignment=1\nASRearr_ElementSortIncludes=true\nMXML.wrapIndentStyle=1001\nActionscript.leaveExtraWhitespaceAroundVarDecls=false\nMXML.maxLineLength=200\nActionscript.putEmptyStatementsOnNewLine=true\nActionScript.metatagsOnSameLineAsTargetProperty=Bindable\nActionscript.wrapExpressionMode=4\nASRearr_UseElementStaticFunctionVisibilityOrder=true\nActionscript.spacesAroundColons=0\nASRearr_UseSectionHeaders=false\nActionscript.advancedUseSpacesAroundEqualsInOptionalParameters=true\nActionscript.useAdvancedWrapping=false\nActionscript.putOpenBraceOnNewLine=true\nMXML.blankLinesBeforeTags=0\nActionscript.blankLinesBeforeControlStatements=0\nASRearr_RemoveExistingSectionHeaders=false\nActionscript.putWhileOnNewLine=true\nActionscript.advancedCRBeforeBraceSettings=2047\nActionscript.dontIndentPackageItems=false\nActionscript.keepBlankLines=true\nMXML.keepBlankLines=true\nASRearr_BlankLinesBeforeElement=\nASRearr_UseMetatagOrder=false\nActionScript.spacesBeforeFormalParameters=0\nMXML.attrGroups=name\\=properties|sort\\=11|includeStates\\=true|wrap\\=54|attrs\\=allowDisjointSelection,allowMultipleSelection,allowThumbOverlap,allowTrackClick,autoLayout,autoRepeat,automationName,cachePolicy,class,clipContent,condenseWhite,conversion,creationIndex,creationPolicy,currentState,data,dataDescriptor,dataProvider,dataTipFormatFunction,dayNames,defaultButton,direction,disabledDays,disabledRanges,displayedMonth,displayedYear,doubleClickEnabled,emphasized,enabled,explicitHeight,explicitMaxHeight,explicitMaxWidth,explicitMinHeight,explicitMinWidth,explicitWidth,firstDayOfWeek,focusEnabled,fontContext,height,horizontalLineScrollSize,horizontalPageScrollSize,horizontalScrollBar,horizontalScrollPolicy,horizontalScrollPosition,htmlText,icon,iconField,id,imeMode,includeInLayout,indeterminate,label,labelField,labelFunction,labelPlacement,labels,layout,lineScrollSize,listData,liveDragging,maxChars,maxHeight,maxScrollPosition,maxWidth,maxYear,maximum,measuredHeight,measuredMinHeight,measuredMinWidth,measuredWidth,menuBarItemRenderer,menuBarItems,menus,minHeight,minScrollPosition,minWidth,minYear,minimum,mode,monthNames,monthSymbol,mouseFocusEnabled,pageScrollSize,pageSize,percentHeight,percentWidth,scaleX,scaleY,scrollPosition,selectable,selectableRange,selected,selectedDate,selectedField,selectedIndex,selectedRanges,showDataTip,showRoot,showToday,sliderDataTipClass,sliderThumbClass,snapInterval,source,states,stepSize,stickyHighlighting,styleName,text,text,thumbCount,tickInterval,tickValues,toggle,toolTip,transitions,truncateToFit,validationSubField,value,value,verticalLineScrollSize,verticalPageScrollSize,verticalScrollBar,verticalScrollPolicy,verticalScrollPosition,width,x,y,yearNavigationEnabled,yearSymbol,|data\\=-1|\\nname\\=xml_namespaces|sort\\=11|includeStates\\=true|wrap\\=54|attrs\\=xmlns,xmlns\\:.*,|data\\=-1|\\nname\\=events|sort\\=11|includeStates\\=true|wrap\\=54|attrs\\=add,added,activate,addedToStage,buttonDown,change,childAdd,childIndexChange,childRemove,clickHandler,clear,click,complete,contextMenu,copy,creationComplete,currentStateChange,currentStateChanging,cut,dataChange,deactivate,doubleClick,dragComplete,dragDrop,dragEnter,dragExit,dragOver,dragStart,effectEnd,effectStart,enterFrame,enterState,exitFrame,exitState,focusIn,focusOut,frameConstructed,hide,httpStatus,init,initialize,invalid,ioError,itemClick,itemRollOut,itemRollOver,keyDown,keyFocusChange,keyUp,menuHide,menuShow,middleClick,middleMouseDown,middleMouseUp,mouseDown,mouseUp,mouseOver,mouseMove,mouseOut,mouseFocusChange,mouseWheel,mouseDownOutside,mouseWheelOutside,move,nativeDragComplete,nativeDragDrop,nativeDragEnter,nativeDragExit,nativeDragOver,nativeDragStart,nativeDragUpdate,open,paste,preinitialize,progress,record,remove,removed,removedFromStage,render,resize,rightClick,rightMouseDown,rightMouseUp,rollOut,rollOver,scroll,securityError,selectAll,show,tabChildrenChange,tabEnabledChange,tabIndexChange,thumbDrag,thumbPress,thumbRelease,toolTipCreate,toolTipEnd,toolTipHide,toolTipShow,toolTipShown,toolTipStart,updateComplete,unload,valid,valueCommit,|data\\=-1|\\nname\\=styles|sort\\=11|includeStates\\=true|wrap\\=54|attrs\\=backgroundAlpha,backgroundAttachment,backgroundColor,backgroundDisabledColor,backgroundImage,backgroundSize,backgroundSkin,barColor,barSkin,borderColor,borderSides,borderSkin,borderStyle,borderThickness,bottom,color,cornerRadius,dataTipOffset,dataTipPrecision,dataTipStyleName,disabledColor,disabledIcon,disabledIconColor,disabledSkin,disbledOverlayAlpha,downArrowDisabledSkin,downArrowDownSkin,downArrowOverSkin,downArrowUpSkin,downIcon,downSkin,dropShadowColor,dropShadowEnabled,errorColor,fillAlphas,fillColors,focusAlpha,focusBlendMode,focusRoundedCorners,focusSkin,focusThickness,fontAntiAliasType,fontFamily,fontGridFitType,fontSharpness,fontSize,fontStyle,fontThickness,fontWeight,fontfamily,headerColors,headerStyleName,highlightAlphas,horizontalAlign,horizontalCenter,horizontalGap,horizontalScrollBarStyleName,icon,iconColor,indeterminateMoveInterval,indeterminateSkin,itemDownSkin,itemOverSkin,itemUpSkin,kerning,labelOffset,labelStyleName,labelWidth,leading,left,letterSpacing,maskSkin,menuStyleName,nextMonthDisabledSkin,nextMonthDownSkin,nextMonthOverSkin,nextMonthSkin,nextMonthUpSkin,nextYearDisabledSkin,nextYearDownSkin,nextYearOverSkin,nextYearSkin,nextYearUpSkin,overIcon,overSkin,paddingBottom,paddingLeft,paddingRight,paddingTop,prevMonthDisabledSkin,prevMonthDownSkin,prevMonthOverSkin,prevMonthSkin,prevMonthUpSkin,prevYearDisabledSkin,prevYearDownSkin,prevYearOverSkin,prevYearSkin,prevYearUpSkin,repeatDelay,repeatInterval,right,rollOverColor,rollOverIndicatorSkin,selectedDisabledIcon,selectedDisabledSkin,selectedDownIcon,selectedDownSkin,selectedOverIcon,selectedOverSkin,selectedUpIcon,selectedUpSkin,selectionColor,selectionIndicatorSkin,shadowColor,shadowDirection,shadowDistance,showTrackHighlight,skin,slideDuration,slideEasingFunction,strokeColor,strokeWidth,textAlign,textDecoration,textIndent,textRollOverColor,textSelectedColor,themeColor,thumbDisabledSkin,thumbDownSkin,thumbIcon,thumbOffset,thumbOverSkin,thumbUpSkin,tickColor,tickLength,tickOffset,tickThickness,todayColor,todayIndicatorSkin,todayStyleName,top,tracHighlightSkin,trackColors,trackHeight,trackMargin,trackSkin,upArrowDisabledSkin,upArrowDownSkin,upArrowOverSkin,upArrowUpSkin,upIcon,upSkin,verticalAlign,verticalCenter,verticalGap,verticalScrollBarStyleName,weekDayStyleName,|data\\=-1|\\nname\\=effects|sort\\=11|includeStates\\=true|wrap\\=54|attrs\\=addedEffect,completeEffect,creationCompleteEffect,focusInEffect,focusOutEffect,hideEffect,mouseDownEffect,mouseUpEffect,moveEffect,removedEffect,resizeEffect,rollOutEffect,rollOverEffect,showEffect,|data\\=-1|\\n\nASRearr_UseModifierOrder_Property=true\nASRearr_MoveImportsOutsideClass=true\nActionscript.maxLineLength=200\nActionscript.spacesInsideParens=0\nASRearr_ElementSortProperties=true\nActionscript.advancedSpacesInsideArrayRefBrackets=0\nActionscript.blankLinesToKeep=0\nActionscript.keepElseIfOnSameLine=true\nActionscript.blankLinesBeforeProperties=0\nActionscript.advancedWrappingEnforceMax=false\nActionscript.spacesBeforeColons=0\nActionscript.advancedWrappingPreservePhrases=true\nActionscript.alwaysGenerateIndent=false\nASRearr_UseElementPropertyVisibilityOrder=true\nMXML.parentTagsToHaveBlankLinesAddedAfterThem=\nActionscript.spacesAfterLabel=1\nASRearr_AddDefaultHeaderForProperties=1\nActionscript.wrapMethodDeclMode=4\nASRearr_UseCopyrightGeneration=false\nActionscript.useGlobalSpacesAroundColons=true\nASRearr_ModifierOrder_Function=<Namespace>,override,native,public,private,protected,internal,static,dynamic,final\nASRearr_ElementStaticPropertyVisibilityOrder=public\\:true,protected\\:true,internal\\:true,private\\:true,\nMXML.sortExtraAttrs=false\nActionscript.tabCountForHangingIndent=1\nASRearr_ElementSortFunctions=true\nASRearr_ElementPropertyVisibilityOrder=public\\:true,protected\\:true,internal\\:true,private\\:true,\nMXML.blankLinesAfterParentTags=0\nASRearr_GroupGettersAndSettersWithProperties=false\nActionscript.wrapEmbeddedXMLMode=2\nASRearr_UseElementOrder=true\nActionscript.doRearrangeWhileFormatting=false\nASRearr_UseGlobalModifierOrder=true\nActionscript.useGlobalSpacesInsideParens=false\nASRearr_MajorSectionHeader=style\\=1|width\\=60|blankLines\\=4|fillChar\\=-|text\\=|linesBefore\\=1|\nActionscript.putCatchOnNewLine=true\nASRearr_CopyrightHeader=style\\=1|width\\=80|blankLines\\=2|fillChar\\=-|text\\=   Copyright 2010\\n   All rights reserved.|linesBefore\\=1|\nASRearr_ElementSortNamespaces=true\nActionscript.putElseOnNewLine=true\nMXML.spacesBeforeEmptyTagEnd=0\nASRearr_ElementSortStaticFunctions=true\nActionscript.wrapIndentStyle=1001\nASRearr_MetatagOrder=ArrayElementType,Bindable,DefaultProperty,Deprecated,Effect,Embed,Event,Exclude,ExcludeClass,IconFile,Inspectable,InstanceType,NonCommittingChangeEvent,RemoteClass,Style,SWF,Transient,\nActionscript.braceStyle=5\nMXML.alwaysUseMaxLineLength=false\nASRearr_UseElementFunctionVisibilityOrder=true\nActionscript.spacesAroundBinarySymbolicOperator=1\nActionscript.keepSLCommentsOnColumn1=true\nActionscript.newLineBeforeBindableFunction=true\nMXML.tagsCanFormat=mx\\:List,fx\\:List,\nMXML.sortAttrData=\nASRearr_MinorSectionHeader=style\\=1|width\\=40|blankLines\\=0|fillChar\\=-|text\\=|linesBefore\\=1|\nActionscript.blankLinesBeforeClasses=1\nMXML.tagsToHaveBlankLinesAddedBeforeThem=\nMXML.useAttrsToKeepOnSameLine=false\nASRearr_UseImportOrder=true\nMXML.blankLinesBetweenSiblingTags=0\nActionscript.collapseSpacesForAdjacentParens=true\nActionscript.advancedSpacesInsideArrayDeclBrackets=1\nActionscript.advancedSpacesInsideParens=0\nActionscript.advancedWrappingGraceColumns=5\nMXML.tagsCannotFormat=mx\\:String,fx\\:String,\nMXML.attrsPerLine=1\nASRearr_ImportOrder=adobe,com,flash,mx,\nMXML.addNewlineAfterLastAttr=false\nMXML.tagsWithASContent=.*\\:add,.*\\:added,.*\\:activate,.*\\:addedToStage,.*\\:buttonDown,.*\\:change,.*\\:childAdd,.*\\:childIndexChange,.*\\:childRemove,.*\\:clickHandler,.*\\:clear,.*\\:click,.*\\:complete,.*\\:contextMenu,.*\\:copy,.*\\:creationComplete,.*\\:currentStateChange,.*\\:currentStateChanging,.*\\:cut,.*\\:dataChange,.*\\:deactivate,.*\\:doubleClick,.*\\:dragComplete,.*\\:dragDrop,.*\\:dragEnter,.*\\:dragExit,.*\\:dragOver,.*\\:dragStart,.*\\:effectEnd,.*\\:effectStart,.*\\:enterFrame,.*\\:enterState,.*\\:exitFrame,.*\\:exitState,.*\\:focusIn,.*\\:focusOut,.*\\:frameConstructed,.*\\:hide,.*\\:httpStatus,.*\\:init,.*\\:initialize,.*\\:invalid,.*\\:ioError,.*\\:itemClick,.*\\:itemRollOut,.*\\:itemRollOver,.*\\:keyDown,.*\\:keyFocusChange,.*\\:keyUp,.*\\:menuHide,.*\\:menuShow,.*\\:middleClick,.*\\:middleMouseDown,.*\\:middleMouseUp,.*\\:mouseDown,.*\\:mouseUp,.*\\:mouseOver,.*\\:mouseMove,.*\\:mouseOut,.*\\:mouseFocusChange,.*\\:mouseWheel,.*\\:mouseDownOutside,.*\\:mouseWheelOutside,.*\\:move,.*\\:nativeDragComplete,.*\\:nativeDragDrop,.*\\:nativeDragEnter,.*\\:nativeDragExit,.*\\:nativeDragOver,.*\\:nativeDragStart,.*\\:nativeDragUpdate,.*\\:open,.*\\:paste,.*\\:preinitialize,.*\\:progress,.*\\:record,.*\\:remove,.*\\:removed,.*\\:removedFromStage,.*\\:render,.*\\:resize,.*\\:rightClick,.*\\:rightMouseDown,.*\\:rightMouseUp,.*\\:rollOut,.*\\:rollOver,.*\\:scroll,.*\\:securityError,.*\\:selectAll,.*\\:show,.*\\:tabChildrenChange,.*\\:tabEnabledChange,.*\\:tabIndexChange,.*\\:thumbDrag,.*\\:thumbPress,.*\\:thumbRelease,.*\\:toolTipCreate,.*\\:toolTipEnd,.*\\:toolTipHide,.*\\:toolTipShow,.*\\:toolTipShown,.*\\:toolTipStart,.*\\:updateComplete,.*\\:unload,.*\\:valid,.*\\:valueCommit,.*\\:Script,\nActionScript.metatagsOnSameLineAsTargetFunction=Bindable\nASRearr_SortGettersAndSettersWithAssociatedStaticProperties=true\n"
  },
  {
    "path": "src/.gitignore",
    "content": "FlexUnitApplication.mxml"
  },
  {
    "path": "src/deprecated/.gitignore",
    "content": " \n"
  },
  {
    "path": "src/deprecated/confine.as",
    "content": "package deprecated\n{\n\t[Deprecated(replacement=\"utils.number.clamp\")]\n\t\n\t/**\n\t * Restricts the <code>value</code> to the <code>min</code> and <code>max</code>\n\t * @param value the number to restrict\n\t * @param min the minimum number for <code>value</code> to be\n\t * @param max the maximum number for <code>value</code> to be\n\t * @return\n\t */\n\tpublic function confine(value:Number, min:Number, max:Number):Number {\n\t\treturn value < min ? min : (value > max ? max : value);\n\t}\n}\n"
  },
  {
    "path": "src/deprecated/constrain.as",
    "content": "package deprecated\n{\n\t[Deprecated(replacement=\"utils.number.clamp\")]\n\t\n\t/**\n\t   Determines if value falls within a range; if not it is snapped to the nearest range value.\n\n\t   @param value: Number to determine if it is included in the range.\n\t   @param firstValue: First value of the range.\n\t   @param secondValue: Second value of the range.\n\t   @return Returns either the number as passed, or its value once snapped to nearest range value.\n\t   @usageNote The constraint values do not need to be in order.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.constrain(3, 0, 5)); // Traces 3\n\t   trace(NumberUtil.constrain(7, 0, 5)); // Traces 5\n\t   </code>\n\t */\n\tpublic function constrain(value:Number, firstValue:Number, secondValue:Number):Number\n\t{\n\t\treturn Math.min(Math.max(value, Math.min(firstValue, secondValue)), Math.max(firstValue, secondValue));\n\t}\n}"
  },
  {
    "path": "src/deprecated/getURL.as",
    "content": "package deprecated {\n\timport flash.net.URLRequest;\n\timport flash.net.navigateToURL;\n\n\n\n\t[Deprecated(replacement=\"utils.location.openURL\")]\n\t/**\n\t * getURL for ActionScript 3.0.  Similar\n\t * to getURL of ActionScript 2.0 in simplicity\n\t * and ease. Errors are suppressed and traced\n\t * to the output window.\n\t *\n\t * @author Trevor McCauley - www.senocular.com\n\t */ public function getURL(url:String, target:String = null):void {\n\n\t\ttry {\n\t\t\tnavigateToURL(new URLRequest(url), target);\n\t\t}\n\t\tcatch(error:Error) {\n\t\t\ttrace(\"[getURL] \" + error);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/deprecated/randomBoolean.as",
    "content": "package deprecated {\n\t[Deprecated(replacement=\"utils.boolean.randomChance\")]\n\n\n\t/**\n\t * Returns a Boolean.\n\t * Example code:\n\t *      <pre>\n\t *          RandomUtils.boolean(); // returns true or false (50% chance of true)\n\t *      </pre>\n\t * Another example code:\n\t *      <pre>\n\t *          RandomUtils.boolean(0.8); // returns true or false (80% chance of true)\n\t *      </pre>\n\t * @param chance Chance Number (0-1)\n\t * @return Float Number between min-max exclusive.\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */ public function randomBoolean(chance:Number = 0.5):Boolean {\n\t\treturn(Math.random() < chance);\n\t}\n}\n"
  },
  {
    "path": "src/deprecated/randomRangeFloat.as",
    "content": "package deprecated {\n\t[Deprecated(replacement=\"utils.number.randomWithinRange\")]\n\n\n\t/**\n\t * Returns a random float number within a given range\n\t */ public function randomRangeFloat(min:Number, max:Number):Number {\n\t\treturn Math.random() * (max - min) + min;\n\t}\n}\n"
  },
  {
    "path": "src/deprecated/randomRangeInt.as",
    "content": "package deprecated {\n\t[Deprecated(replacement=\"utils.number.randomIntegerWithinRange\")]\n\n\n\n\t/**\n\t * Returns a random int number within a given range\n\t */ public function randomRangeInt(min:Number, max:Number):Number {\n\t\treturn Math.floor(Math.random() * (max - min + 1) + min);\n\t}\n}\n"
  },
  {
    "path": "src/utils/align/alignCenter.as",
    "content": "package utils.align {\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Center align object to target.\n\t */\n\tpublic function alignCenter(item:DisplayObject, target:DisplayObject):void {\n\t\txAlignCenter(item, target);\n\t\tyAlignCenter(item, target);\n\t}\n}\n"
  },
  {
    "path": "src/utils/align/alignLeft.as",
    "content": "package utils.align\n{\n\t/**\n\t * Aligns all the target DisplayObjects by their left edge to the left-most target. \n\t *\n\t * Similar to the Flash IDE Alignment panel.\n\t * \n\t * Given the following arrangement of targets:\n\t * <code>\n\t *  t1 \n\t *       t2\n\t *    t3\n\t * </code>\n\t * \n\t * After calling <code>alignLeft([ t1, t2, t3 ])</code> the arrangment will be:\n\t * <code>\n\t *  t1\n\t *  t2\n\t *  t3\n\t * </code>\n\t * \n\t * @param targets Array of DisplayObject (or Object with an <code>x</code> property like <code>Point</code>).\n\t * @return targets Array. \n\t * \n\t * @example\n\t * <listing version=\"3.0\">\n\t * \tvar t1:Sprite = new Sprite();\n\t * \tt1.x = 5;\n\t * \n\t * \tvar t2:Sprite = new Sprite();\n\t * \tt2.x = 30;\n\t * \n\t * \tvar t3:Sprite = new Sprite();\n\t * \tt3.x = 15;\n\t * \n\t * \tvar targets:Array = [t1, t2, t3];\n\t * \talignLeft(targets);\n\t * \n\t * \ttrace(t1.x, t2.x t3.x);\n\t * \t// 5 5 5\n\t * </listing> \n\t * \n\t * @author drewbourne\n\t */\n\tpublic function alignLeft(targets:Array):Array\n\t{\n\t\tvar minX:Number = Number.MAX_VALUE;\n\t\tvar targetX:Number;\n\t\tvar target:Object;\n\t\t\n\t\tfor each (target in targets)\n\t\t{\n\t\t\ttargetX = target.x;\n\t\t\t\n\t\t\tif (targetX < minX)\n\t\t\t\tminX = targetX;\n\t\t}\n\t\t\n\t\tfor each (target in targets)\n\t\t{\n\t\t\ttarget.x = minX;\n\t\t}\n\t\t\n\t\treturn targets;\n\t}\n}"
  },
  {
    "path": "src/utils/align/alignRight.as",
    "content": "package utils.align\n{\n\t/**\n\t * Aligns all the target DisplayObjects by their left edge to the left-most target. \n\t *\n\t * Similar to the Flash IDE Alignment panel.\n\t * \n\t * Given the following arrangement of targets:\n\t * <code>\n\t *  t1 \n\t *       t2\n\t *    t3\n\t * </code>\n\t * \n\t * After calling <code>alignRight([ t1, t2, t3 ])</code> the arrangment will be:\n\t * <code>\n\t *       t1\n\t *       t2\n\t *       t3\n\t * </code>\n\t * \n\t * @param targets Array of DisplayObject \n\t * \t\t\t\t  or Object with an <code>x</code> property like <code>Point</code>\n\t * \t\t\t\t  or Object with an <code>x</code> and <code>width</code> properties like <code>Rectangle</code>.\n\t * \n\t * @return targets Array. \n\t * \n\t * @example\n\t * <listing version=\"3.0\">\n\t * \t\n\t * </listing> \n\t * \n\t * @author drewbourne\n\t */\n\tpublic function alignRight(targets:Array):Array\n\t{\n\t\tvar maxX:Number = Number.MIN_VALUE;\n\t\tvar targetW:Number;\n\t\tvar targetX:Number;\n\t\tvar target:Object;\n\t\t\n\t\tfor each (target in targets)\n\t\t{\n\t\t\ttargetW = \"width\" in target ? target[\"width\"] : 0;\n\t\t\ttargetX = target.x + targetW;\n\t\t\t\n\t\t\tif (targetX > maxX)\n\t\t\t\tmaxX = targetX;\n\t\t}\n\t\t\n\t\tfor each (target in targets)\n\t\t{\n\t\t\ttargetW = \"width\" in target ? target[\"width\"] : 0;\n\t\t\ttarget.x = maxX - targetW;\n\t\t}\n\t\t\n\t\treturn targets;\n\t}\n}"
  },
  {
    "path": "src/utils/align/alignToRectangleBottom.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t   Aligns a DisplayObject to the bottom of the bounding Rectangle.\n\n\t   @param displayObject The DisplayObject to align.\n\t   @param bounds The area in which to align the DisplayObject.\n\t   @param snapToPixel Force the position to whole pixels <code>true</code>, or to let the DisplayObject be positioned on sub-pixels <code>false</code>.\n\t   @param outside Align the DisplayObject to the outside of the bounds <code>true</code>, or the inside <code>false</code>.\n\t */\n\tpublic function alignToRectangleBottom(displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false):void\n\t{\n\t\tvar y:Number = outside ? bounds.bottom : bounds.bottom - displayObject.height;\n\t\tdisplayObject.y = snapToPixel ? Math.round(y) : y;\n\t}\n}"
  },
  {
    "path": "src/utils/align/alignToRectangleCenter.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t   Aligns a DisplayObject to the horizontal center of the bounding Rectangle.\n\n\t   @param displayObject: The DisplayObject to align.\n\t   @param bounds: The area in which to align the DisplayObject.\n\t   @param snapToPixel: Force the position to whole pixels <code>true</code>, or to let the DisplayObject be positioned on sub-pixels <code>false</code>.\n\t */\n\tpublic function alignToRectangleCenter(displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true):void\n\t{\n\t\tvar centerX:Number = bounds.width * 0.5 - displayObject.width * 0.5 + bounds.x;\n\t\tdisplayObject.x = snapToPixel ? Math.round(centerX) : centerX;\n\t}\n}"
  },
  {
    "path": "src/utils/align/alignToRectangleCenterMiddle.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t   Aligns a DisplayObject to the horizontal center and vertical middle of the bounding Rectangle.\n\n\t   @param displayObject: The DisplayObject to align.\n\t   @param bounds: The area in which to align the DisplayObject.\n\t   @param snapToPixel: Force the position to whole pixels <code>true</code>, or to let the DisplayObject be positioned on sub-pixels <code>false</code>.\n\t */\n\tpublic function alignToRectangleCenterMiddle(displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true):void\n\t{\n\t\talignToRectangleCenter(displayObject, bounds, snapToPixel);\n\t\talignToRectangleMiddle(displayObject, bounds, snapToPixel);\n\t}\n}"
  },
  {
    "path": "src/utils/align/alignToRectangleLeft.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t   Aligns a DisplayObject to the left side of the bounding Rectangle.\n\n\t   @param displayObject: The DisplayObject to align.\n\t   @param bounds: The area in which to align the DisplayObject.\n\t   @param snapToPixel: Force the position to whole pixels <code>true</code>, or to let the DisplayObject be positioned on sub-pixels <code>false</code>.\n\t   @param outside: Align the DisplayObject to the outside of the bounds <code>true</code>, or the inside <code>false</code>.\n\t */\n\tpublic function alignToRectangleLeft(displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false):void\n\t{\n\t\tvar x:Number = outside ? bounds.left - displayObject.width : bounds.left;\n\t\tdisplayObject.x = snapToPixel ? Math.round(x) : x;\n\t}\n}"
  },
  {
    "path": "src/utils/align/alignToRectangleMiddle.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t   Aligns a DisplayObject to the vertical middle of the bounding Rectangle.\n\n\t   @param displayObject: The DisplayObject to align.\n\t   @param bounds: The area in which to align the DisplayObject.\n\t   @param snapToPixel: Force the position to whole pixels <code>true</code>, or to let the DisplayObject be positioned on sub-pixels <code>false</code>.\n\t */\n\tpublic function alignToRectangleMiddle(displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true):void\n\t{\n\t\tvar centerY:Number = bounds.height * 0.5 - displayObject.height * 0.5 + bounds.y;\n\t\tdisplayObject.y = snapToPixel ? Math.round(centerY) : centerY;\n\t}\n}"
  },
  {
    "path": "src/utils/align/alignToRectangleRight.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t   Aligns a DisplayObject to the right side of the bounding Rectangle.\n\n\t   @param displayObject: The DisplayObject to align.\n\t   @param bounds: The area in which to align the DisplayObject.\n\t   @param snapToPixel: Force the position to whole pixels <code>true</code>, or to let the DisplayObject be positioned on sub-pixels <code>false</code>.\n\t   @param outside: Align the DisplayObject to the outside of the bounds <code>true</code>, or the inside <code>false</code>.\n\t */\n\tpublic function alignToRectangleRight(displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false):void\n\t{\n\t\tvar x:Number = outside ? bounds.right : bounds.right - displayObject.width;\n\t\tdisplayObject.x = snapToPixel ? Math.round(x) : x;\n\t}\n}"
  },
  {
    "path": "src/utils/align/alignToRectangleTop.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t   Aligns a DisplayObject to the top of the bounding Rectangle.\n\n\t   @param displayObject: The DisplayObject to align.\n\t   @param bounds: The area in which to align the DisplayObject.\n\t   @param snapToPixel: Force the position to whole pixels <code>true</code>, or to let the DisplayObject be positioned on sub-pixels <code>false</code>.\n\t   @param outside: Align the DisplayObject to the outside of the bounds <code>true</code>, or the inside <code>false</code>.\n\t */\n\tpublic function alignToRectangleTop(displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false):void\n\t{\n\t\tvar y:Number = outside ? bounds.top - displayObject.height : bounds.top;\n\t\tdisplayObject.y = snapToPixel ? Math.round(y) : y;\n\t}\n}"
  },
  {
    "path": "src/utils/align/getPositionToTheRightOf.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\t\n\timport utils.ratio.widthToHeight;\n\t\t\n\t/**\n\t * Gets the position to the right of an object based on its width and x position \n\t * with an optional gap.\n\t * \n\t * This is useful when you need to cause object B to appear 20px to the right of object A. \n\t * \n\t * B.x = getPositionToTheRightOf(A, 20);\n\t * \n\t * @param displayObject An object to get the position under.\n\t * @param gap An optional amount to space out the position under. \n\t */\n\tpublic function getPositionToTheRightOf(displayObject:DisplayObject, gap:int = 0):int {\n\t\treturn displayObject.x + displayObject.width + gap;\n\t}\n}"
  },
  {
    "path": "src/utils/align/getPositionUnder.as",
    "content": "package utils.align {\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Gets the position under an object based on its height and y position with an optional gap.\n\t * \n\t * This is useful when you need to cause object B to appear 20px below object A. \n\t * \n\t * B.y = getPositionUnder(A, 20);\n\t * \n\t * @param displayObject An object to get the position under.\n\t * @param gap An optional amount to space out the position under. \n\t */\n\tpublic function getPositionUnder(displayObject:DisplayObject, gap:int = 0):int {\n\t\treturn displayObject.y + displayObject.height + gap;\n\t}\n}"
  },
  {
    "path": "src/utils/align/gridAlignSpaceNumber.as",
    "content": "package utils.align\n{\n\t/**\n\t * Aligns the items in the array in a grid based on the number of rows and columns.\n\t * Uses the same spacing for all.\n\t *\n\t * @example <listing version=\"3.0\">Alignment.hAlignSpaceNum( [ clip0, clip1, clip2], 10 );</listing>\n\t *\n\t * @param items An array of items\n\t * @param rows The number of rows\n\t * @param cols The number of columns\n\t * @param spacing The spacing between items in pixels\n\t */\n\tpublic function gridAlignSpaceNumber(items:Array, rows:Number, cols:Number, spacing:Number = 0):void\n\t{\n\t\tvar col:Number = 0;\n\t\tvar row:Number = 1;\n\t\tvar yPos:Number = 0;\n\t\tvar xPos:Number = 0;\n\t\tvar maxHeightCurrentRow:Number = 0;\n\t\tvar maxHeightPreviousRow:Number = 0;\n\t\tvar n:int = items.length;\n\n\t\tfor (var i:Number = 0; i < n; i++)\n\t\t{\n\t\t\tif (row <= rows)\n\t\t\t{\n\t\t\t\titems[i].x = xPos;\n\n\t\t\t\tif (col == (cols - 1))\n\t\t\t\t{\n\t\t\t\t\txPos = 0;\n\t\t\t\t\trow++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\txPos += items[(i)].width + spacing;\n\t\t\t\t}\n\n\t\t\t\tif (col == cols)\n\t\t\t\t{\n\t\t\t\t\tcol = 0;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Get the max item height from previous row\n\t\t\t\t\t */\n\t\t\t\t\tmaxHeightPreviousRow = maxHeightCurrentRow;\n\t\t\t\t\tmaxHeightCurrentRow = items[(i)].height;\n\n\t\t\t\t\tyPos += maxHeightPreviousRow + spacing;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t/*\n\t\t\t\t\t * Calculate the max item height from previous row\n\t\t\t\t\t */\n\t\t\t\t\tmaxHeightCurrentRow = Math.max(maxHeightCurrentRow, items[(i)].height);\n\t\t\t\t}\n\t\t\t\titems[i].y = yPos;\n\n\t\t\t\tcol++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/align/gridAlignSpaceNumberGap.as",
    "content": "package utils.align\n{\n\t/**\n\t * Aligns the items in the array in a grid based on the number of rows and columns.\n\t * Uses the same spacing for all\n\t *\n\t * @example <listing version=\"3.0\">Alignment.hAlignSpaceNum( [ clip0, clip1, clip2], 10 );</listing>\n\t *\n\t * @param items An array of items\n\t * @param rows The number of rows\n\t * @param cols The number of columns\n\t * @param hGap The column width\n\t * @param vGap The row height\n\t * @param spacing The spacing between items in pixels\n\t */\n\tpublic function gridAlignSpaceNumberGap(items:Array, rows:Number, cols:Number, hGap:Number, vGap:Number, spacing:Number = 0):void\n\t{\n\t\tvar col:Number = 0;\n\t\tvar row:Number = 1;\n\t\tvar yPos:Number = 0;\n\t\tvar xPos:Number = 0;\n\n\t\tvar n:int = items.length;\n\t\tfor (var i:Number = 0; i < n; i++)\n\t\t{\n\t\t\tif (row <= rows)\n\t\t\t{\n\t\t\t\titems[i].x = xPos;\n\n\t\t\t\tif (col == (cols - 1))\n\t\t\t\t{\n\t\t\t\t\txPos = 0;\n\t\t\t\t\trow++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\txPos += hGap + spacing;\n\t\t\t\t}\n\n\t\t\t\tif (col == cols)\n\t\t\t\t{\n\t\t\t\t\tcol = 0;\n\t\t\t\t\tyPos += vGap + spacing;\n\t\t\t\t}\n\n\t\t\t\titems[i].y = yPos;\n\n\t\t\t\tcol++;\n\t\t\t}\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/align/horizontalAlign.as",
    "content": "package utils.align {\n\n\n\n\t/**\n\t * Convenient horizontal align method with optional alignment argument\n\t * @example <listing version=\"3.0\">Alignment.hAlign( [ clip0, clip1, clip2], 10 );</listing>\n\t * @param items An array of items\n\t * @param args spacing The spacing between items in pixels as either a number or array or blank\n\t */\n\tpublic function horizontalAlign(items:Array, ... args):void {\n\t\tif(args.length > 0) {\n\t\t\tif(args[0] is Array)\n\t\t\t\thorizontalAlignSpaceArray(items, args[0]);\n\t\t\tif(args[0] is Number)\n\t\t\t\thorizontalAlignSpaceNumber(items, args[0]);\n\t\t}\n\t\telse\n\t\t\thorizontalAlignNoSpace(items);\n\t}\n}\n"
  },
  {
    "path": "src/utils/align/horizontalAlignNoSpace.as",
    "content": "package utils.align\n{\n\t/**\n\t * Aligns each item horizontally to the one above it.\n\t * Uses no spacing.\n\t *\n\t * @example <listing version=\"3.0\">Alignment.hAlignNoSpace( [ clip0, clip1, clip2] );</listing>\n\t *\n\t * @param items An array of items\n\t */\n\tpublic function horizontalAlignNoSpace(items:Array):void\n\t{\n\t\tvar n:int = items.length;\n\t\tfor (var i:int = 1; i < n; i++)\n\t\t{\n\t\t\titems[i].x = items[(i - 1)].y + items[(i - 1)].width;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/align/horizontalAlignSpaceArray.as",
    "content": "package utils.align {\n\n\n\n\t/**\n\t * Aligns each item in the array to the one preceding it.\n\t * Uses the correlating position in the spacing arr for the spacing.\n\t * @example <listing version=\"3.0\">Alignment.hAlignSpaceArr( [ clip0, clip1, clip2], [ 0, 5, 30 ] );</listing>\n\t * @param items An array of items\n\t * @param spacing The array for spacing between items in pixels\n\t */\n\n\tpublic function horizontalAlignSpaceArray(items:Array, spacing:Array):void {\n\t\tvar n:int = items.length;\n\t\tfor(var i:int = 1; i < n; i++) {\n\t\t\titems[i].x = items[(i - 1)].x + items[(i - 1)].width + spacing[i];\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/utils/align/horizontalAlignSpaceNumber.as",
    "content": "package utils.align\n{\n\t/**\n\t * Aligns the items in the array horizontally to each the one preceding it in the array.\n\t * Uses the same spacing for all.\n\t *\n\t * @example <listing version=\"3.0\">Alignment.hAlignSpaceNum( [ clip0, clip1, clip2], 10 );</listing>\n\t *\n\t * @param items An array of items\n\t * @param spacing The spacing between items in pixels\n\t */\n\tpublic function horizontalAlignSpaceNumber(items:Array, spacing:Number):void\n\t{\n\t\tvar n:int = items.length;\n\t\tfor (var i:int = 1; i < n; i++)\n\t\t{\n\t\t\titems[i].x = items[(i - 1)].x + items[(i - 1)].width + spacing;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/align/interpolate.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * interpolate the DisplayObject at weight t == (0 &lt;= t &lt;= 1). a position 1 would position the object to the\n     * right-most bounds, and tx=0 would position to the left\n\t *\n\t * @param object DisplayObject to position\n\t * @param tx weight of horizontal position from 0 to 1\n\t * @param ty weight of verticle position from 0 to 1\n\t * @param width width of horizontal constraint\n\t * @param height height of the verticle constraint\n\t * @offsetX the left offset of the horizontal constraint (default = 0)\n\t * @offsetY the topmost offset of verticle constraint (default = 0)\n\t */\n\tpublic function interpolate(object:DisplayObject, tx:Number, ty:Number, width:Number, height:Number, offsetX:int = 0, offsetY:int = 0):void\n\t{\n\t\tobject.x = (width * tx) + offsetX - (tx * object.width);\n\t\tobject.y = (height * ty) + offsetY - (ty * object.height);\n\t}\n}"
  },
  {
    "path": "src/utils/align/interpolateMultiX.as",
    "content": "package utils.align\n{\n\t/**\n\t * interpolate multiple DisplayObjects at multiple weights at t == (0 less or equal t less or equal 1).  at tx=1, the position of the object would be aligned to the right-most bounds, and tx=0 would position to the left\n\t *\n\t * @param DisplayObject DisplayObject to position\n\t * @param positionArray weight array of horizontal position from 0 to 1\n\t * @param width width of horizontal constraint\n\t * @offsetX the left offset of the horizontal constraint (default = 0)\n\t */\n\tpublic function interpolateMultiX(objectArray:Array, positionArray:Array, width:Number, offsetX:int = 0):void\n\t{\n\t\tvar j:int = objectArray.length;\n\t\tfor (var i:int = 0; i < j; i++)\n\t\t{\n\t\t\tinterpolateX(objectArray[i], positionArray[i], width, offsetX);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/align/interpolateMultiY.as",
    "content": "package utils.align\n{\n\t/**\n\t * interpolate multiple DisplayObjects at multiple weights at t == (0 less or equal t less or equal 1).  at tx=1, the position of the object would be aligned to the right-most bounds, and ty=0 would position to the left\n\t *\n\t * @param DisplayObject DisplayObject to position\n\t * @param positionArray weight array of vertical position from 0 to 1\n\t * @param height width of horizontal constraint\n\t * @param offsetY the left offset of the horizontal constraint (default = 0)\n\t */\n\tpublic function interpolateMultiY(objectArray:Array, positionArray:Array, height:Number, offsetY:int = 0):void\n\t{\n\t\tvar j:int = objectArray.length;\n\t\tfor (var i:int = 0; i < j; i++)\n\t\t{\n\t\t\tinterpolateX(objectArray[i], positionArray[i], height, offsetY);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/align/interpolateX.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * interpolate the DisplayObject at weight t to the rectangle, ie, a weight of 1 would position the object to the right-most bounds\n\t *\n\t * @param DisplayObject DisplayObject to position\n\t * @param tx\n\t * @param width width of horizontal constraint\n\t * @param offsetX the left offset of the horizontal constraint (default = 0)\n\t */\n\tpublic function interpolateX(object:DisplayObject, tx:Number, width:Number, offsetX:int = 0):void\n\t{\n\t\tobject.x = (width * tx) + offsetX - (tx * object.width);\n\t}\n}"
  },
  {
    "path": "src/utils/align/interpolateY.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * interpolate the DisplayObject at weight t == (0 less or equal t less or equal 1).  a position 1 would position the object to the right-most bounds, and tx=0 would position to the left\n\t *\n\t * @param DisplayObject DisplayObject to position\n\t * @param ty weight of verticle position from 0 to 1\n\t * @param height height of the verticle constraint\n\t * @offsetY the left offset of the horizontal constraint (default = 0)\n\t */\n\tpublic function interpolateY(object:DisplayObject, ty:Number, height:Number, offsetY:int = 0):void\n\t{\n\t\tobject.y = (height * ty) + offsetY - (ty * object.height);\n\t}\n}"
  },
  {
    "path": "src/utils/align/verticalAlign.as",
    "content": "package utils.align {\n\n\n\n\t/**\n\t * Convenient vertical align method with optional alignment argument\n\t * @example <listing version=\"3.0\">Alignment.vAlign( [ clip0, clip1, clip2], 10 );</listing>\n\t * @param items An array of items\n\t * @param spacingValues spacing The spacing between items in pixels as either a number or array or blank\n\t */\n\tpublic function verticalAlign(items:Array, ... spacingValues):void {\n\t\tif(spacingValues.length > 0) {\n\t\t\tif(spacingValues[0] is Array)\n\t\t\t\tverticalAlignSpaceArray(items, spacingValues[0]);\n\t\t\tif(spacingValues[0] is Number)\n\t\t\t\tverticalAlignSpaceNumber(items, spacingValues[0]);\n\t\t}\n\t\telse\n\t\t\tverticalAlignNoSpace(items);\n\t}\n}\n"
  },
  {
    "path": "src/utils/align/verticalAlignNoSpace.as",
    "content": "package utils.align\n{\n\t/**\n\t * Aligns each item vertically to the one above it.\n\t * Uses no spacing.\n\t *\n\t * @example <listing version=\"3.0\">Alignment.valignNoSpace( [ clip0, clip1, clip2] );</listing>\n\t *\n\t * @param items An array of items\n\t */\n\tpublic function verticalAlignNoSpace(items:Array):void\n\t{\n\t\tvar n:int = items.length;\n\t\tfor (var i:int = 1; i < n; i++)\n\t\t{\n\t\t\titems[i].y = int(items[(i - 1)].y + items[(i - 1)].height);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/align/verticalAlignSpaceArray.as",
    "content": "package utils.align {\n\n\n\n\t/**\n\t * Aligns each item in the array to the one preceding it.\n\t * Uses the correlating position in the spacing arr for the spacing.\n\t * @example <listing version=\"3.0\">Alignment.valignSpaceArr( [ clip0, clip1, clip2], [ 0, 5, 30 ] );</listing>\n\t * @param items An array of items\n\t * @param spacing The array for spacing between items in pixels\n\t */\n\tpublic function verticalAlignSpaceArray(items:Array, spacing:Array):void {\n\t\tvar n:int = items.length;\n\t\tfor(var i:int = 1; i < n; i++) {\n\t\t\titems[i].y = int(items[(i - 1)].y + items[(i - 1)].height + spacing[i]);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/utils/align/verticalAlignSpaceNumber.as",
    "content": "package utils.align\n{\n\timport flash.text.TextField;\n\n\t/**\n\t * Aligns the items in the array vertically to each the one preceding it in the array.\n\t * Uses the same spacing for all.\n\t *\n\t * @example <listing version=\"3.0\">Alignment.valignSpaceNum( [ clip0, clip1, clip2], 10 );</listing>\n\t *\n\t * @param items An array of items\n\t * @param spacing The spacing between items in pixels\n\t */\n\tpublic function verticalAlignSpaceNumber(items:Array, spacing:Number):void\n\t{\n\t\tvar n:int = items.length;\n\t\tfor (var i:int = 1; i < n; i++)\n\t\t{\n\t\t\tif (items[i - 1] is TextField)\n\t\t\t{\n\t\t\t\titems[i].y = int(items[(i - 1)].y + items[(i - 1)].textHeight + spacing);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titems[i].y = int(items[(i - 1)].y + items[(i - 1)].height + spacing);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/align/xAlignCenter.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n    import flash.geom.Point;\n    import flash.geom.Rectangle;\n\n    /**\n\t * Horizontal center align object to target.\n     * Alignment algorithm taken from:\n     * http://chargedweb.com/labs/2010/07/27/alignutil_align_objects_easily/\n     * Copyright 2010 Julius Loa | jloa@chargedweb.com\n     * license:    MIT {http://www.opensource.org/licenses/mit-license.php}\n     *\n     * This algorith takes the objects rotation and scale into account.\n     */\n\tpublic function xAlignCenter(item:DisplayObject, target:DisplayObject):void\n\t{\n\t\t//item.x = int(target.width / 2 - item.width / 2);\n\n        var b:Rectangle = item.transform.pixelBounds;\n        var bp:Point = target.globalToLocal(new Point(b.x, b.y));\n        b.x = bp.x; b.y = bp.y;\n        item.x = int((target.width - b.width)/2 + item.x - b.x);\n\t}\n\n\n}"
  },
  {
    "path": "src/utils/align/xAlignLeft.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Horizontal left align object to target.\n\t */\n\tpublic function xAlignLeft(item:DisplayObject, target:DisplayObject):void\n\t{\n\t\titem.x = int(target.x);\n\t}\n}"
  },
  {
    "path": "src/utils/align/xAlignRight.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Horizontal right align object to target.\n\t */\n\tpublic function xAlignRight(item:DisplayObject, target:DisplayObject):void\n\t{\n\t\titem.x = int(target.width - item.width);\n\t}\n}"
  },
  {
    "path": "src/utils/align/yAlignCenter.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n    import flash.geom.Point;\n    import flash.geom.Rectangle;\n\n    /**\n\t * Vertical center align object to target.\n     *\n     * Alignment algorithm taken from:\n     * http://chargedweb.com/labs/2010/07/27/alignutil_align_objects_easily/\n     * Copyright 2010 Julius Loa | jloa@chargedweb.com\n     * license:    MIT {http://www.opensource.org/licenses/mit-license.php}\n     *\n     * This algorith takes the objects rotation and scale into account.\n\t */\n\tpublic function yAlignCenter(item:DisplayObject, target:DisplayObject):void\n\t{\n        var b:Rectangle = item.transform.pixelBounds;\n        var bp:Point = target.globalToLocal(new Point(b.x, b.y));\n        b.x = bp.x; b.y = bp.y;\n        item.y = int((target.height - b.height)/2 + item.y - b.y);\n\t}\n}"
  },
  {
    "path": "src/utils/align/yAlignLeft.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Vertical left  align object to target.\n\t */\n\tpublic function yAlignLeft(item:DisplayObject, target:DisplayObject):void\n\t{\n\t\titem.y = int(target.y);\n\t}\n}"
  },
  {
    "path": "src/utils/align/yAlignRight.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Vertical right align object to target.\n\t */\n\tpublic function yAlignRight(item:DisplayObject, target:DisplayObject):void\n\t{\n\t\titem.y = int(target.height - item.height);\n\t}\n}"
  },
  {
    "path": "src/utils/array/addItemsAt.as",
    "content": "package utils.array\n{\n\t/**\n\t   Modifies original Array by adding all the elements from another Array at a specified position.\n\n\t   @param tarArray: Array to add elements to.\n\t   @param items: Array of elements to add.\n\t   @param index: Position where the elements should be added.\n\t   @return Returns <code>true</code> if the Array was changed as a result of the call; otherwise <code>false</code>.\n\t   @example\n\t   <listing version=\"3.0\">\n\t   var alphabet:Array = new Array(\"a\", \"d\", \"e\");\n\t   var parts:Array    = new Array(\"b\", \"c\");\n\n\t   ArrayUtil.addItemsAt(alphabet, parts, 1);\n\n\t   trace(alphabet);\n\t   </listing>\n\t */\n\tpublic function addItemsAt(tarArray:Array, items:Array, index:int = 0x7FFFFFFF):Boolean\n\t{\n\t\tif (items.length == 0)\n\t\t\treturn false;\n\n\t\tvar args:Array = items.concat();\n\t\targs.splice(0, 0, index, 0);\n\n\t\ttarArray.splice.apply(null, args);\n\n\t\treturn true;\n\t}\n}"
  },
  {
    "path": "src/utils/array/arrayContainsValue.as",
    "content": "package utils.array\n{\n\t/**\n\t *       Determines whether the specified array contains the specified value.\n\t *\n\t *       @param arr The array that will be checked for the specified value.\n\t *\n\t *       @param value The object which will be searched for within the array\n\t *\n\t *       @return True if the array contains the value, False if it does not.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function arrayContainsValue(arr:Array, value:Object):Boolean\n\t{\n\t\treturn (arr.indexOf(value) != -1);\n\t}\n}"
  },
  {
    "path": "src/utils/array/arraysAreEqual.as",
    "content": "package utils.array {\n\t/**\n\t *       Compares two arrays and returns a boolean indicating whether the arrays\n\t *       contain the same values at the same indexes.\n\t *\n\t *       @param arr1 The first array that will be compared to the second.\n\t *\n\t *       @param arr2 The second array that will be compared to the first.\n\t *\n\t *       @return True if the arrays contains the same values at the same indexes.\n\t False if they do not.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function arraysAreEqual(arr1:Array, arr2:Array):Boolean {\n\t\tif(arr1.length != arr2.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar len:Number = arr1.length;\n\n\t\tfor(var i:Number = 0; i < len; i++) {\n\t\t\tif(arr1[i] != arr2[i]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n}\n"
  },
  {
    "path": "src/utils/array/average.as",
    "content": "package utils.array\n{\n\t/**\n\t   Averages the values in <code>inArray</code>.\n\n\t   @param inArray: Array composed only of numbers.\n\t   @return The average of all numbers in the <code>inArray</code>.\n\t   @example\n\t   <listing version=\"3.0\">\n\t   var numberArray:Array = new Array(2, 3, 8, 3);\n\t   trace(\"Average is: \" + ArrayUtil.average(numberArray));\n\t   </listing>\n\t */\n\tpublic function average(inArray:Array):Number\n\t{\n\t\tif (inArray.length == 0)\n\t\t\treturn 0;\n\n\t\treturn sum(inArray) / inArray.length;\n\t}\n}"
  },
  {
    "path": "src/utils/array/contains.as",
    "content": "package utils.array\n{\n\t/**\n\t   Finds out how many instances of <code>item</code> Array contains.\n\n\t   @param inArray: Array to search for <code>item</code> in.\n\t   @param item: Object to find.\n\t   @return The amount of <code>item</code>'s found; if none were found returns <code>0</code>.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(1, 2, 3, 7, 7, 7, 4, 5);\n\t   trace(\"numberArray contains \" + ArrayUtil.contains(numberArray, 7) + \" 7's.\");\n\t   </code>\n\t */\n\tpublic function contains(inArray:Array, item:*):uint\n\t{\n\t\tvar i:int = inArray.indexOf(item, 0);\n\t\tvar t:uint = 0;\n\n\t\twhile (i != -1)\n\t\t{\n\t\t\ti = inArray.indexOf(item, i + 1);\n\t\t\tt++;\n\t\t}\n\n\t\treturn t;\n\t}\n}"
  },
  {
    "path": "src/utils/array/containsAll.as",
    "content": "package utils.array\n{\n\t/**\n\t   Determines if Array contains all items.\n\n\t   @param inArray: Array to search for <code>items</code> in.\n\t   @param items: Array of elements to search for.\n\t   @return Returns <code>true</code> if <code>inArray</code> contains all elements of <code>items</code>; otherwise <code>false</code>.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(1, 2, 3, 4, 5);\n\t   trace(ArrayUtil.containsAll(numberArray, new Array(1, 3, 5)));\n\t   </code>\n\t */\n\tpublic function containsAll(inArray:Array, items:Array):Boolean\n\t{\n\t\tvar l:uint = items.length;\n\n\t\twhile (l--)\n\t\t\tif (inArray.indexOf(items[l]) == -1)\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}\n}"
  },
  {
    "path": "src/utils/array/containsAny.as",
    "content": "package utils.array\n{\n\t/**\n\t   Determines if Array <code>inArray</code> contains any element of Array <code>items</code>.\n\n\t   @param inArray: Array to search for <code>items</code> in.\n\t   @param items: Array of elements to search for.\n\t   @return Returns <code>true</code> if <code>inArray</code> contains any element of <code>items</code>; otherwise <code>false</code>.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(1, 2, 3, 4, 5);\n\t   trace(ArrayUtil.containsAny(numberArray, new Array(9, 3, 6)));\n\t   </code>\n\t */\n\tpublic function containsAny(inArray:Array, items:Array):Boolean\n\t{\n\t\tvar l:uint = items.length;\n\n\t\twhile (l--)\n\t\t\tif (inArray.indexOf(items[l]) > -1)\n\t\t\t\treturn true;\n\n\t\treturn false;\n\t}\n}"
  },
  {
    "path": "src/utils/array/copyArray.as",
    "content": "package utils.array\n{\n\t/**\n\t *       Creates a copy of the specified array.\n\t *\n\t *       Note that the array returned is a new array but the items within the\n\t *       array are not copies of the items in the original array (but rather\n\t *       references to the same items)\n\t *\n\t *       @param arr The array that will be copies\n\t *\n\t *       @return A new array which contains the same items as the array passed\n\t *       in.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function copyArray(arr:Array):Array\n\t{\n\t\treturn arr.slice();\n\t}\n}"
  },
  {
    "path": "src/utils/array/createUniqueCopy.as",
    "content": "package utils.array\n{\n\t/**\n\t *       Create a new array that only contains unique instances of objects\n\t *       in the specified array.\n\t *\n\t *       Basically, this can be used to remove duplication object instances\n\t *       from an array\n\t *\n\t *       @param arr The array which contains the values that will be used to\n\t *       create the new array that contains no duplicate values.\n\t *\n\t *       @return A new array which only contains unique items from the specified\n\t *       array.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function createUniqueCopy(a:Array):Array\n\t{\n\t\tvar newArray:Array = new Array();\n\n\t\tvar len:Number = a.length;\n\t\tvar item:Object;\n\n\t\tfor (var i:uint = 0; i < len; ++i)\n\t\t{\n\t\t\titem = a[i];\n\n\t\t\tif (arrayContainsValue(newArray, item))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnewArray.push(item);\n\t\t}\n\n\t\treturn newArray;\n\t}\n}"
  },
  {
    "path": "src/utils/array/equals.as",
    "content": "package utils.array\n{\n\t/**\n\t   Determines if two Arrays contain the same objects at the same index.\n\n\t   @param first: First Array to compare to the <code>second</code>.\n\t   @param second: Second Array to compare to the <code>first</code>.\n\t   @return Returns <code>true</code> if Arrays are the same; otherwise <code>false</code>.\n\t */\n\tpublic function equals(first:Array, second:Array):Boolean\n\t{\n\t\tvar i:uint = first.length;\n\t\tif (i != second.length)\n\t\t\treturn false;\n\n\t\twhile (i--)\n\t\t\tif (first[i] != second[i])\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}\n}"
  },
  {
    "path": "src/utils/array/getHighestValue.as",
    "content": "package utils.array\n{\n\t/**\n\t   Finds the highest value in <code>inArray</code>.\n\n\t   @param inArray: Array composed only of numbers.\n\t   @return The highest value in <code>inArray</code>.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(2, 1, 5, 4, 3);\n\t   trace(\"The highest value is: \" + ArrayUtil.getHighestValue(numberArray));\n\t   </code>\n\t */\n\tpublic function getHighestValue(inArray:Array):Number\n\t{\n\t\treturn inArray[inArray.sort(16 | 8)[inArray.length - 1]];\n\t}\n}"
  },
  {
    "path": "src/utils/array/getIndexOfDifference.as",
    "content": "package utils.array\n{\n\t/**\n\t   Compares two Arrays and finds the first index where they differ.\n\n\t   @param first: First Array to compare to the <code>second</code>.\n\t   @param second: Second Array to compare to the <code>first</code>.\n\t   @param fromIndex: The location in the Arrays from which to start searching for a difference.\n\t   @return The first position/index where the Arrays differ; if Arrays are identical returns <code>-1</code>.\n\t   @example\n\t   <code>\n\t   var color:Array     = new Array(\"Red\", \"Blue\", \"Green\", \"Indigo\", \"Violet\");\n\t   var colorsAlt:Array = new Array(\"Red\", \"Blue\", \"Green\", \"Violet\");\n\n\t   trace(ArrayUtil.getIndexOfDifference(color, colorsAlt)); // Traces 3\n\t   </code>\n\t */\n\tpublic function getIndexOfDifference(first:Array, second:Array, fromIndex:uint = 0):int\n\t{\n\t\tvar i:int = fromIndex - 1;\n\n\t\twhile (++i < first.length)\n\t\t\tif (first[i] != second[i])\n\t\t\t\treturn i;\n\n\t\treturn -1;\n\t}\n}"
  },
  {
    "path": "src/utils/array/getItemByKey.as",
    "content": "package utils.array\n{\n\t/**\n\t   Returns the first element that matches <code>match</code> for the property <code>key</code>.\n\n\t   @param inArray: Array to search for an element with a <code>key</code> that matches <code>match</code>.\n\t   @param key: Name of the property to match.\n\t   @param match: Value to match against.\n\t   @return Returns matched <code>Object</code>; otherwise <code>null</code>.\n\t */\n\tpublic function getItemByKey(inArray:Array, key:String, match:*):*\n\t{\n\t\tfor each (var item:* in inArray)\n\t\t\tif (item[key] == match)\n\t\t\t\treturn item;\n\n\t\treturn null;\n\t}\n}"
  },
  {
    "path": "src/utils/array/getItemByType.as",
    "content": "package utils.array\n{\n\t/**\n\t   Returns the first element that is compatible with a specific data type, clazz, or interface.\n\n\t   @param inArray: Array to search for an element of a specific type.\n\t   @param type: The type to compare the elements to.\n\t   @return Returns all the matched elements.\n\t */\n\tpublic function getItemByType(inArray:Array, type:Class):*\n\t{\n\t\tfor each (var item:* in inArray)\n\t\t\tif (item is type)\n\t\t\t\treturn item;\n\n\t\treturn null;\n\t}\n\n}"
  },
  {
    "path": "src/utils/array/getItemsByKey.as",
    "content": "package utils.array\n{\n\t/**\n\t   Returns every element that matches <code>match</code> for the property <code>key</code>.\n\n\t   @param inArray: Array to search for object with <code>key</code> that matches <code>match</code>.\n\t   @param key: Name of the property to match.\n\t   @param match: Value to match against.\n\t   @return Returns all the matched elements.\n\t */\n\tpublic function getItemsByKey(inArray:Array, key:String, match:*):Array\n\t{\n\t\tvar t:Array = new Array();\n\n\t\tfor each (var item:* in inArray)\n\t\t\tif (item[key] == match)\n\t\t\t\tt.push(item);\n\n\t\treturn t;\n\t}\n}"
  },
  {
    "path": "src/utils/array/getItemsByType.as",
    "content": "package utils.array\n{\n\t/**\n\t   Returns every element that is compatible with a specific data type, clazz, or interface.\n\n\t   @param inArray: Array to search for elements of a specific type.\n\t   @param type: The type to compare the elements to.\n\t   @return Returns all the matched elements.\n\t */\n\tpublic function getItemsByType(inArray:Array, type:Class):Array\n\t{\n\t\tvar t:Array = new Array();\n\n\t\tfor each (var item:* in inArray)\n\t\t\tif (item is type)\n\t\t\t\tt.push(item);\n\n\t\treturn t;\n\t}\n}"
  },
  {
    "path": "src/utils/array/getLowestValue.as",
    "content": "package utils.array\n{\n\t/**\n\t   Finds the lowest value in <code>inArray</code>.\n\n\t   @param inArray: Array composed only of numbers.\n\t   @return The lowest value in <code>inArray</code>.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(2, 1, 5, 4, 3);\n\t   trace(\"The lowest value is: \" + ArrayUtil.getLowestValue(numberArray));\n\t   </code>\n\t */\n\tpublic function getLowestValue(inArray:Array):Number\n\t{\n\t\treturn inArray[inArray.sort(16 | 8)[0]];\n\t}\n}"
  },
  {
    "path": "src/utils/array/getRandomElement.as",
    "content": "package utils.array {\n\timport utils.number.randomIntegerWithinRange;\n\n\t/**\n\t * Returns a random element from an array.\n\t */\n\tpublic function getRandomElement(array:Array):* {\n\t\treturn array[randomIntegerWithinRange(0, array.length-1)];\n\t}\n}"
  },
  {
    "path": "src/utils/array/randomize.as",
    "content": "package utils.array\n{\n\timport utils.number.randomIntegerWithinRange;\n\n\t/**\n\t   Creates new Array composed of passed Array's items in a random order.\n\n\t   @param inArray: Array to create copy of, and randomize.\n\t   @return A new Array composed of passed Array's items in a random order.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);\n\t   trace(ArrayUtil.randomize(numberArray));\n\t   </code>\n\t */\n\tpublic function randomize(inArray:Array):Array\n\t{\n\t\tvar t:Array = new Array();\n\t\tvar r:Array = inArray.sort(\n\t\t\tfunction(a:*, b:*):int\n\t\t\t{\n\t\t\t\treturn randomIntegerWithinRange(0, 1) ? 1 : -1;\n\t\t\t}\n\t\t\t, Array.RETURNINDEXEDARRAY);\n\t\tvar i:int = -1;\n\n\t\twhile (++i < inArray.length)\n\t\t\tt.push(inArray[r[i]]);\n\n\t\treturn t;\n\t}\n}"
  },
  {
    "path": "src/utils/array/removeDuplicates.as",
    "content": "package utils.array\n{\n\t/**\n\t   Creates new Array composed of only the non-identical elements of passed Array.\n\n\t   @param inArray: Array to remove equivalent items.\n\t   @return A new Array composed of only unique elements.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(1, 2, 3, 4, 4, 4, 4, 5);\n\t   trace(ArrayUtil.removeDuplicates(numberArray));\n\t   </code>\n\t */\n\tpublic function removeDuplicates(inArray:Array):Array\n\t{\n\t\treturn inArray.filter(\n\t\t\tfunction(e:*, i:int, inArray:Array):Boolean\n\t\t\t{\n\t\t\t\treturn (i == 0) ? true : inArray.lastIndexOf(e, i - 1) == -1;\n\t\t\t});\n\t}\n}"
  },
  {
    "path": "src/utils/array/removeItem.as",
    "content": "package utils.array\n{\n\t/**\n\t   Modifies original Array by removing all items that are identical to the specified item.\n\n\t   @param tarArray: Array to remove passed <code>item</code>.\n\t   @param item: Element to remove.\n\t   @return The amount of removed elements that matched <code>item</code>, if none found returns <code>0</code>.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(1, 2, 3, 7, 7, 7, 4, 5);\n\t   trace(\"Removed \" + ArrayUtil.removeItem(numberArray, 7) + \" items.\");\n\t   trace(numberArray);\n\t   </code>\n\t */\n\tpublic function removeItem(tarArray:Array, item:*):uint\n\t{\n\t\tvar i:int = tarArray.indexOf(item);\n\t\tvar f:uint = 0;\n\n\t\twhile (i != -1)\n\t\t{\n\t\t\ttarArray.splice(i, 1);\n\n\t\t\ti = tarArray.indexOf(item, i);\n\n\t\t\tf++;\n\t\t}\n\n\t\treturn f;\n\t}\n}"
  },
  {
    "path": "src/utils/array/removeItems.as",
    "content": "package utils.array\n{\n\t/**\n\t   Removes only the specified items in an Array.\n\n\t   @param tarArray: Array to remove specified items from.\n\t   @param items: Array of elements to remove.\n\t   @return Returns <code>true</code> if the Array was changed as a result of the call; otherwise <code>false</code>.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(1, 2, 3, 7, 7, 7, 4, 5);\n\t   ArrayUtil.removeItems(numberArray, new Array(1, 3, 7, 5));\n\t   trace(numberArray);\n\t   </code>\n\t */\n\tpublic function removeItems(tarArray:Array, items:Array):Boolean\n\t{\n\t\tvar removed:Boolean = false;\n\t\tvar l:uint = tarArray.length;\n\n\t\twhile (l--)\n\t\t{\n\t\t\tif (items.indexOf(tarArray[l]) > -1)\n\t\t\t{\n\t\t\t\ttarArray.splice(l, 1);\n\t\t\t\tremoved = true;\n\t\t\t}\n\t\t}\n\n\t\treturn removed;\n\t}\n}"
  },
  {
    "path": "src/utils/array/removeValueFromArray.as",
    "content": "package utils.array {\n\t/**\n\t *       Remove all instances of the specified value from the array,\n\t *\n\t *       @param arr The array from which the value will be removed\n\t *\n\t *       @param value The object that will be removed from the array.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function removeValueFromArray(arr:Array, value:Object):void {\n\t\tvar len:uint = arr.length;\n\n\t\tfor(var i:Number = len; i > -1; i--) {\n\t\t\tif(arr[i] == value) {\n\t\t\t\tarr.splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/utils/array/retainItems.as",
    "content": "package utils.array\n{\n\t/**\n\t   Retains only the specified items in an Array.\n\n\t   @param tarArray: Array to remove non specified items from.\n\t   @param items: Array of elements to keep.\n\t   @return Returns <code>true</code> if the Array was changed as a result of the call; otherwise <code>false</code>.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(1, 2, 3, 7, 7, 7, 4, 5);\n\t   ArrayUtil.retainItems(numberArray, new Array(2, 4));\n\t   trace(numberArray);\n\t   </code>\n\t */\n\tpublic function retainItems(tarArray:Array, items:Array):Boolean\n\t{\n\t\tvar removed:Boolean = false;\n\t\tvar l:uint = tarArray.length;\n\n\t\twhile (l--)\n\t\t{\n\t\t\tif (items.indexOf(tarArray[l]) == -1)\n\t\t\t{\n\t\t\t\ttarArray.splice(l, 1);\n\t\t\t\tremoved = true;\n\t\t\t}\n\t\t}\n\n\t\treturn removed;\n\t}\n}"
  },
  {
    "path": "src/utils/array/sum.as",
    "content": "package utils.array\n{\n\t/**\n\t   Adds all items in <code>inArray</code> and returns the value.\n\n\t   @param inArray: Array composed only of numbers.\n\t   @return The total of all numbers in <code>inArray</code> added.\n\t   @example\n\t   <code>\n\t   var numberArray:Array = new Array(2, 3);\n\t   trace(\"Total is: \" + ArrayUtil.sum(numberArray));\n\t   </code>\n\t */\n\tpublic function sum(inArray:Array):Number\n\t{\n\t\tvar t:Number = 0;\n\t\tvar l:uint = inArray.length;\n\n\t\twhile (l--)\n\t\t\tt += inArray[l];\n\n\t\treturn t;\n\t}\n}"
  },
  {
    "path": "src/utils/assert/assertArrayContains.as",
    "content": "package utils.assert\n{\n\t/**\n\t * Assert that the array contains the passed in item.\n\t */\n\tpublic function assertArrayContains(array:Array, item:*, message:String = \"\"):void\n\t{\n\t\tif (array.indexOf(item) == -1)\n\t\t{\n\t\t\tif (message == null || message.length == 0)\n\t\t\t{\n\t\t\t\tmessage = \"[Assertion failed] - this Array argument does not contain the item '\" + item + \"'\";\n\t\t\t}\n\t\t\tthrow new Error(message);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/assert/assertArrayItemsTypeOf.as",
    "content": "package utils.assert\n{\n\t/**\n\t * Assert that all items in the array are of the given type.\n\t *\n\t * @param array the array to check\n\t * @param type the type of the array items\n\t * @param message the error message to use if the assertion fails\n\t */\n\tpublic function assertArrayItemsTypeOf(array:Array, type:Class, message:String = \"\"):void\n\t{\n\t\tfor each (var item:* in array)\n\t\t{\n\t\t\tif (!(item is type))\n\t\t\t{\n\t\t\t\tif (message == null || message.length == 0)\n\t\t\t\t{\n\t\t\t\t\tmessage = \"[Assertion failed] - this Array must have items of type '\" + type + \"'\";\n\t\t\t\t}\n\t\t\t\tthrow new Error(message);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/assert/assertDictionaryKeysTypeOf.as",
    "content": "package utils.assert\n{\n\timport flash.utils.Dictionary;\n\n\t/**\n\t * Assert that the given Dictionary contains only keys of the given type.\n\t */\n\tpublic function assertDictionaryKeysTypeOf(dictionary:Dictionary, type:Class, message:String = \"\"):void\n\t{\n\t\tfor (var key:Object in dictionary)\n\t\t{\n\t\t\tif (!(key is type))\n\t\t\t{\n\t\t\t\tif (message == null || message.length == 0)\n\t\t\t\t{\n\t\t\t\t\tmessage = \"[Assertion failed] - this Dictionary argument must have keys of type '\" + type + \"'\";\n\t\t\t\t}\n\t\t\t\tthrow new Error(message);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/assert/assertHasText.as",
    "content": "package utils.assert\n{\n\timport utils.validation.isBlank;\n\n\t/**\n\t * Assert that the given String has valid text content; that is, it must not\n\t * be <code>null</code> and must contain at least one non-whitespace character.\n\t *\n\t * @param text the String to check\n\t * @param message the exception message to use if the assertion fails\n\t * @see StringUtils#hasText\n\t */\n\tpublic function assertHasText(string:String, message:String = \"\"):void\n\t{\n\t\tif (isBlank(string))\n\t\t{\n\t\t\tif (message == null || message.length == 0)\n\t\t\t{\n\t\t\t\tmessage = \"[Assertion failed] - this String argument must have text; it must not be <code>null</code>, empty, or blank\";\n\t\t\t}\n\t\t\tthrow new Error(message);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/assert/assertInstanceOf.as",
    "content": "package utils.assert\n{\n\t/**\n\t * Assert that an object is an instance of a certain type..\n\t * <pre class=\"code\">Assert.instanceOf(value, type, \"The value must be an instance of 'type'\");</pre>\n\t * @param object the object to check\n\t * @param message the error message to use if the assertion fails\n\t * @throws org.as3commons.lang.IllegalArgumentError if the object is not an instance of the given type\n\t */\n\tpublic function assertInstanceOf(object:*, type:Class, message:String = \"\"):void\n\t{\n\t\tif (!(object is type))\n\t\t{\n\t\t\tif (message == null || message.length == 0)\n\t\t\t{\n\t\t\t\tmessage = \"[Assertion failed] - this argument is not of type '\" + type + \"'\";\n\t\t\t}\n\t\t\tthrow new Error(message);\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/assert/assertIsTrue.as",
    "content": "package utils.assert\n{\n\tpublic function assertIsTrue(expression:Boolean, message:String = \"\"):void\n\t{\n\t\tif (!expression)\n\t\t{\n\t\t\tif (message == null || message.length == 0)\n\t\t\t{\n\t\t\t\tmessage = \"[Assertion failed] - this expression must be true\";\n\t\t\t}\n\t\t\tthrow new Error(message);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/assert/assertNotNull.as",
    "content": "package utils.assert\n{\n\t/**\n\t * Assert that an object is <code>null</code>.\n\t * <pre class=\"code\">Assert.isNull(value, \"The value must be null\");</pre>\n\t * @param object the object to check\n\t * @param message the error message to use if the assertion fails\n\t * @throws org.as3commons.lang.IllegalArgumentError if the object is not <code>null</code>\n\t */\n\tpublic function assertNotNull(object:Object, message:String = \"\"):void\n\t{\n\t\tif (object == null)\n\t\t{\n\t\t\tif (message == null || message.length == 0)\n\t\t\t{\n\t\t\t\tmessage = \"[Assertion failed] - this argument is required; it must not null\";\n\t\t\t}\n\t\t\tthrow new Error(message);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/assert/assertState.as",
    "content": "package utils.assert\n{\n\t/**\n\t * Assert a boolean expression to be true. If false, an IllegalStateError is thrown.\n\t * @param expression a boolean expression\n\t * @param the error message if the assertion fails\n\t */\n\tpublic function assertState(expression:Boolean, message:String = \"\"):void\n\t{\n\t\tif (!expression)\n\t\t{\n\t\t\tif (message == null || message.length == 0)\n\t\t\t{\n\t\t\t\tmessage = \"[Assertion failed] - this state invariant must be true\";\n\t\t\t}\n\t\t\tthrow new Error(message);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/boolean/randomBoolean.as",
    "content": "package utils.boolean\n{\n\t/**\n\t * Randomly returns either true or false.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function randomBoolean():Boolean\n\t{\n\t\treturn randomChance(0.5);\n\t}\n}"
  },
  {
    "path": "src/utils/boolean/randomChance.as",
    "content": "package utils.boolean\n{\n\t/**\n\t * Randomly returns true \"percent\"% of the time (where percent is a decimal between 0.0 and 1.0).\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function randomChance(percent:Number):Boolean \n\t{\n\t\treturn Math.random() < percent;\n\t}\n}"
  },
  {
    "path": "src/utils/capabilities/getPlayerInfo.as",
    "content": "package utils.capabilities\n{\n\timport flash.system.Capabilities;\n\n\t/**\n\t * Returns a player and environment info string.\n\t */\n\tpublic function getPlayerInfo():String\n\t{\n\t\tvar debugger:String = (Capabilities.isDebugger) ? ' / Debugger' : '';\n\t\tvar info:String =\n\t\t\tString(\"Flash Platform: \" + Capabilities.version + \" / \" + Capabilities.playerType + debugger + \" / \" + Capabilities.os + \" / \" + Capabilities.screenResolutionX + \"x\" + Capabilities.screenResolutionY);\n\t\treturn info;\n\t}\n}"
  },
  {
    "path": "src/utils/capabilities/isAirApplication.as",
    "content": "package utils.capabilities {\n\timport flash.system.Capabilities;\n\n\n\n\t/**\n\t * Determines if the runtime environment is an Air application.\n\t * @return true if the runtime environment is an Air application\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function isAirApplication():Boolean {\n\t\treturn Capabilities.playerType == \"Desktop\";\n\t}\n}\n"
  },
  {
    "path": "src/utils/capabilities/isIDE.as",
    "content": "package utils.capabilities {\n\timport flash.system.Capabilities;\n\n\n\n\t/**\n\t * Determines if the SWF is running in the IDE.\n\t * @return true if SWF is running in the Flash Player version used by the external player or test movie mode\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function isIDE():Boolean {\n\t\treturn Capabilities.playerType == \"External\";\n\t}\n}\n"
  },
  {
    "path": "src/utils/capabilities/isMac.as",
    "content": "package utils.capabilities\n{\n\timport flash.system.Capabilities;\n\n\t/**\n\t * Indicates whether the running OS is a Mac\n\t * @return\n\t */\n\tpublic function isMac():Boolean\n\t{\n\t\treturn Capabilities.os.toLowerCase().indexOf(\"mac os\") != -1;\n\t}\n}"
  },
  {
    "path": "src/utils/capabilities/isPC.as",
    "content": "package utils.capabilities\n{\n\timport flash.system.Capabilities;\n\n\t/**\n\t * Indicates whether the running OS is a PC\n\t * @return\n\t */\n\tpublic function isPC():Boolean\n\t{\n\t\treturn Capabilities.os.toLowerCase().indexOf(\"mac os\") == -1;\n\t}\n}"
  },
  {
    "path": "src/utils/capabilities/isPlugin.as",
    "content": "package utils.capabilities {\n\timport flash.system.Capabilities;\n\n\n\n\t/**\n\t * Determines if the SWF is running in a browser plug-in.\n\t * @return true if SWF is running in the Flash Player browser plug-in\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function isPlugin():Boolean {\n\t\treturn Capabilities.playerType == \"PlugIn\" || Capabilities.playerType == \"ActiveX\";\n\t}\n}\n"
  },
  {
    "path": "src/utils/capabilities/isStandAlone.as",
    "content": "package utils.capabilities {\n\timport flash.system.Capabilities;\n\n\n\n\t/**\n\t * Determines if the SWF is running in the StandAlone player.\n\t * @return true if SWF is running in the Flash StandAlone Player\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function isStandAlone():Boolean {\n\t\treturn Capabilities.playerType == \"StandAlone\";\n\t}\n}\n"
  },
  {
    "path": "src/utils/capabilities/isWeb.as",
    "content": "package utils.capabilities {\n\timport flash.display.DisplayObject;\n\n\n\n\t/**\n\t * Determines if the SWF is being served on the internet.\n\t * Example code:\n\t *      <pre>\n\t *          trace(isWeb(_root));\n\t *      </pre>\n\t * @param location DisplayObject to get location of\n\t * @return true if SWF is being served on the internet\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function isWeb(location:DisplayObject):Boolean {\n\t\treturn location.loaderInfo.url.substr(0, 4) == \"http\";\n\t}\n}\n"
  },
  {
    "path": "src/utils/color/HSLtoHSV.as",
    "content": "package utils.color\n{\n\t/**\n\t * Convert HSL to HSV using RGB conversions: color preservation may be dubious.\n\t */\n\tpublic function HSLtoHSV(hue:Number, luminance:Number, saturation:Number):Object\n\t{\n\t\tvar rgbVal:Object = HSLtoRGB(hue, luminance, saturation);\n\t\treturn RGBtoHSV(rgbVal.r, rgbVal.g, rgbVal.b);\n\t}\n}"
  },
  {
    "path": "src/utils/color/HSLtoRGB.as",
    "content": "package utils.color\n{\n\t/**\n\t * Convert HSL values to RGB values.\n\t * @param hue                   0 to 360.\n\t * @param luminance     0 to 1.\n\t * @param saturation    0 to 1.\n\t * @return                              Object with R,G,B values on 0 to 1 scale.\n\t */\n\tpublic function HSLtoRGB(hue:Number, luminance:Number, saturation:Number):Object\n\t{\n\t\tvar delta:Number;\n\t\tif (luminance < 0.5)\n\t\t{\n\t\t\tdelta = saturation * luminance;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdelta = saturation * (1 - luminance);\n\t\t}\n\t\treturn HueToRGB(luminance - delta, luminance + delta, hue);\n\t}\n}"
  },
  {
    "path": "src/utils/color/HSVtoHSL.as",
    "content": "package utils.color\n{\n\t/**\n\t * Convert HSV to HLS using RGB conversions: color preservation may be dubious.\n\t */\n\tpublic function HSVtoHSL(hue:Number, saturation:Number, value:Number):Object\n\t{\n\t\tvar rgbVal:Object = HSVtoRGB(hue, saturation, value);\n\t\treturn RGBtoHSL(rgbVal.r, rgbVal.g, rgbVal.b);\n\t}\n}"
  },
  {
    "path": "src/utils/color/HSVtoRGB.as",
    "content": "package utils.color\n{\n\t/**\n\t * Convert HSV values to RGB values.\n\t * @param hue                   on 0 to 360 scale.\n\t * @param saturation    on 0 to 1 scale.\n\t * @param value                 on 0 to 1 scale.\n\t * @return                              Object with R,G,B values on 0 to 1 scale.\n\t */\n\tpublic function HSVtoRGB(hue:Number, saturation:Number, value:Number):Object\n\t{\n\t\tvar min:Number = (1 - saturation) * value;\n\n\t\treturn HueToRGB(min, value, hue);\n\t}\n}"
  },
  {
    "path": "src/utils/color/HueToRGB.as",
    "content": "package utils.color\n{\n\t/**\n\t * Convert hue to RGB values using a linear transformation.\n\t * @param min   of R,G,B.\n\t * @param max   of R,G,B.\n\t * @param hue   value angle hue.\n\t * @return              Object with R,G,B properties on 0-1 scale.\n\t */\n\tpublic function HueToRGB(min:Number, max:Number, hue:Number):Object\n\t{\n\t\tconst HUE_MAX:uint = 360;\n\n\t\tvar mu:Number, md:Number, F:Number, n:Number;\n\t\twhile (hue < 0)\n\t\t{\n\t\t\thue += HUE_MAX;\n\t\t}\n\t\tn = Math.floor(hue / 60);\n\t\tF = (hue - n * 60) / 60;\n\t\tn %= 6;\n\n\t\tmu = min + ((max - min) * F);\n\t\tmd = max - ((max - min) * F);\n\n\t\tswitch (n)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\treturn { r: max, g: mu, b: min };\n\t\t\tcase 1:\n\t\t\t\treturn { r: md, g: max, b: min };\n\t\t\tcase 2:\n\t\t\t\treturn { r: min, g: max, b: mu };\n\t\t\tcase 3:\n\t\t\t\treturn { r: min, g: md, b: max };\n\t\t\tcase 4:\n\t\t\t\treturn { r: mu, g: min, b: max };\n\t\t\tcase 5:\n\t\t\t\treturn { r: max, g: min, b: md };\n\t\t}\n\t\treturn null;\n\t}\n}"
  },
  {
    "path": "src/utils/color/RGBToHue.as",
    "content": "package utils.color\n{\n\timport utils.range.center;\n\n\t/**\n\t * Convert RGB values to a hue using a linear transformation.\n\t * @param red           value on 0 to 1 scale.\n\t * @param green         value on 0 to 1 scale.\n\t * @param blue          value on 0 to 1 scale.\n\t * @return                      hue degree between 0 and 360.\n\t */\n\tpublic function RGBToHue(red:Number, green:Number, blue:Number):uint\n\t{\n\t\tvar f:Number, min:Number, mid:Number, max:Number, n:Number;\n\n\t\tmax = Math.max(red, Math.max(green, blue));\n\t\tmin = Math.min(red, Math.min(green, blue));\n\n\t\t// achromatic case\n\t\tif (max - min == 0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tmid = center(red, green, blue);\n\n\t\t// using this loop to avoid super-ugly nested ifs\n\t\twhile (true)\n\t\t{\n\t\t\tif (red == max)\n\t\t\t{\n\t\t\t\tif (blue == min)\n\t\t\t\t\tn = 0;\n\t\t\t\telse\n\t\t\t\t\tn = 5;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (green == max)\n\t\t\t{\n\t\t\t\tif (blue == min)\n\t\t\t\t\tn = 1;\n\t\t\t\telse\n\t\t\t\t\tn = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (red == min)\n\t\t\t\tn = 3;\n\t\t\telse\n\t\t\t\tn = 4;\n\t\t\tbreak;\n\t\t}\n\n\t\tif ((n % 2) == 0)\n\t\t{\n\t\t\tf = mid - min;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tf = max - mid;\n\t\t}\n\t\tf = f / (max - min);\n\n\t\treturn 60 * (n + f);\n\t}\n}"
  },
  {
    "path": "src/utils/color/RGBtoHSL.as",
    "content": "package utils.color {\n\n\n\n\t/**\n\t * Convert an RGB Hexadecimal value to HSL values\n\t * @param red           0 - 1 scale.\n\t * @param green         0 - 1 scale.\n\t * @param blue          0 - 1 scale.\n\t * @return Object with h (hue), l (lightness), s (saturation) values:<ul>\n\t * <li><code>h</code> on 0 - 360 scale.</li>\n\t * <li><code>l</code> on 0 - 255 scale.</li>\n\t * <li><code>s</code> on 0 - 1 scale.</li></ul>\n\t */\n\tpublic function RGBtoHSL(red:Number, green:Number, blue:Number):Object {\n\t\tvar min:Number, max:Number, delta:Number, l:Number, s:Number, h:Number = 0;\n\n\t\tmax = Math.max(red, Math.max(green, blue));\n\t\tmin = Math.min(red, Math.min(green, blue));\n\n\t\t//l = (min + max) / 2;\n\t\tl = (min + max) * 0.5;\n\t\t// L\n\t\tif(l == 0) {\n\t\t\treturn { h: h, l: 0, s: 1 };\n\t\t}\n\n\t\t//delta = (max - min) / 2;\n\t\tdelta = (max - min) * 0.5;\n\n\t\tif(l < 0.5) {\n\t\t\t// S\n\t\t\ts = delta / l;\n\t\t}\n\t\telse {\n\t\t\ts = delta / (1 - l);\n\t\t}\n\t\t// H\n\t\th = RGBToHue(red, green, blue);\n\n\t\treturn { h: h, l: l, s: s };\n\t}\n}\n"
  },
  {
    "path": "src/utils/color/RGBtoHSV.as",
    "content": "package utils.color\n{\n\t/**\n\t * Convert RGB values to HSV values.\n\t * @param red           0 to 1 scale.\n\t * @param green         0 to 1 scale.\n\t * @param blue          0 to 1 scale.\n\t * @return                      Object with H,S,V values:<ul>\n\t *                                              <li>h - on 0 to 360 scale</li>\n\t *                                              <li>s - on 0 to 1 scale</li>\n\t *                                              <li>v - on 0 to 1 scale</li></ul>\n\t */\n\tpublic function RGBtoHSV(red:Number, green:Number, blue:Number):Object\n\t{\n\t\tvar min:Number, max:Number, s:Number, v:Number, h:Number = 0;\n\n\t\tmax = Math.max(red, Math.max(green, blue));\n\t\tmin = Math.min(red, Math.min(green, blue));\n\n\t\tif (max == 0)\n\t\t{\n\t\t\treturn { h: 0, s: 0, v: 0 };\n\t\t}\n\n\t\tv = max;\n\t\ts = (max - min) / max;\n\n\t\th = RGBToHue(red, green, blue);\n\n\t\treturn { h: h, s: s, v: v };\n\t}\n}"
  },
  {
    "path": "src/utils/color/averageBlue.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * Sample &amp; average the <i>Blue</i> (RGB) value from a display object or one of its region.\n\t *\n\t * @param src The DisplayObject\n\t * @param accuracy Percentage of pixels to sample when averaging.\n\t * @param region to sample from [Default: null = entire src object].\n\t * @return the sampled average <i>blue</i> value on a scale of 0-255.\n\t */\n\tpublic function averageBlue(src:DisplayObject, accuracy:Number = 0.01, region:Rectangle = null):int\n\t{\n\t\treturn averageColorProperty(src, region, accuracy, 'b');\n\t}\n}"
  },
  {
    "path": "src/utils/color/averageColorProperty.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * @private\n\t *\n\t * Sample & average a colorspace value (RGB or HSL) value from a display object or one of its region.\n\t * @param src                   of the display object.\n\t * @param region                to sample from [Default: null = entire src object].\n\t * @param accuracy              percentage of pixels to sample when averaging.\n\t * @colorspace                  to be sampled. Valid arguments are <code>'r', 'g', 'b', 'h', 's', 'l', 'v'</code>.\n\t * @return                              the sampled average value requested from the colorspace.\n\t */\n\tpublic function averageColorProperty(src:DisplayObject, region:Rectangle = null, accuracy:Number = 0.01, colorspace:String = 'l'):Number\n\t{\n\t\tif (!region)\n\t\t{\n\t\t\tregion = new Rectangle(0, 0, src.width, src.height);\n\t\t}\n\t\tvar offset:int = 1 / accuracy;\n\t\tvar total:int;\n\t\tvar count:int;\n\t\t// loop thru x/y pixels by offset\n\t\tfor (var i:int = region.x; i < (region.x + region.width); i += offset)\n\t\t{\n\t\t\tfor (var j:int = region.y; j < (region.y + region.height); j += offset)\n\t\t\t{\n\t\t\t\tvar hex:uint = getColorFromDisplayObject(src, i, j);\n\t\t\t\tvar obj:Object = getRGB(hex);\n\t\t\t\tif (colorspace == \"h\" || colorspace == \"s\" || colorspace == \"l\")\n\t\t\t\t{\n\t\t\t\t\tvar hsl:Object = RGBtoHSL(obj.r, obj.g, obj.b);\n\t\t\t\t\tobj = hsl;\n\t\t\t\t}\n\t\t\t\tif (colorspace == \"v\")\n\t\t\t\t{\n\t\t\t\t\tvar hsv:Object = RGBtoHSV(obj.r, obj.g, obj.b);\n\t\t\t\t\tobj = hsv;\n\t\t\t\t}\n\t\t\t\ttotal += obj[colorspace];\n\t\t\t\tcount++;\n\t\t\t\t\t//trace( \"colorspace: '\" + colorspace + \"' = \" + obj[colorspace] );\n\t\t\t}\n\t\t}\n\t\t// return the average value\n\t\treturn total / count;\n\t}\n}"
  },
  {
    "path": "src/utils/color/averageGreen.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * Sample &amp; average the <i>Green</i> (RGB) value from a display object or one of its region.\n\t *\n\t * @param src The DisplayObject\n\t * @param accuracy Percentage of pixels to sample when averaging.\n\t * @param region to sample from [Default: null = entire src object].\n\t * @return the sampled average <i>green</i> value on a scale of 0-255.\n\t */\n\tpublic function averageGreen(src:DisplayObject, accuracy:Number = 0.01, region:Rectangle = null):int\n\t{\n\t\treturn averageColorProperty(src, region, accuracy, 'g');\n\t}\n}"
  },
  {
    "path": "src/utils/color/averageHue.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * Sample &amp; average the <i>Hue</i> (HSL) value from a display object or one of its region.\n\t *\n\t * @param src The DisplayObject\n\t * @param accuracy percentage of pixels to sample when averaging.\n\t * @param region to sample from [Default: null = entire src object].\n\t * @return the sampled average <i>hue</i> value on a scale of 0-360.\n\t */\n\tpublic function averageHue(src:DisplayObject, accuracy:Number = 0.01, region:Rectangle = null):int\n\t{\n\t\treturn averageColorProperty(src, region, accuracy, 'h');\n\t}\n}"
  },
  {
    "path": "src/utils/color/averageLightness.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * Sample &amp; average the <i>Lightness</i> (HSL) value from a display object or one of its region.\n\t *\n\t * @param src The DisplayObject\n\t * @param accuracy percentage of pixels to sample when averaging.\n\t * @param region to sample from [Default: null = entire src object].\n\t * @return the sampled average <i>lightness</i> value on a scale of 0-255.\n\t */\n\tpublic function averageLightness(src:DisplayObject, accuracy:Number = 0.01, region:Rectangle = null):int\n\t{\n\t\treturn averageColorProperty(src, region, accuracy, 'l');\n\t}\n}"
  },
  {
    "path": "src/utils/color/averageRed.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * Sample &amp; average the <i>Red</i> (RGB) value from a display object or one of its region.\n\t *\n\t * @param src The DisplayObject.\n\t * @param accuracy Percentage of pixels to sample when averaging.\n\t * @param region to sample from [Default: null = entire src object].\n\t * @return the sampled average <i>red</i> value on a scale of 0-255.\n\t */\n\tpublic function averageRed(src:DisplayObject, accuracy:Number = 0.01, region:Rectangle = null):int\n\t{\n\t\treturn averageColorProperty(src, region, accuracy, 'r');\n\t}\n}"
  },
  {
    "path": "src/utils/color/averageSaturation.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * Sample &amp; average the <i>Saturation</i> (HSL) value from a display object or one of its region.\n\t *\n\t * @param src The DisplayObject.\n\t * @param accuracy percentage of pixels to sample when averaging.\n\t * @param region to sample from [Default: null = entire src object].\n\t * @return the sampled average <i>saturation</i> value on a scale of 0-1.\n\t */\n\tpublic function averageSaturation(src:DisplayObject, accuracy:Number = 0.01, region:Rectangle = null):Number\n\t{\n\t\treturn averageColorProperty(src, region, accuracy, 's');\n\t}\n}"
  },
  {
    "path": "src/utils/color/averageValue.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * Sample &amp; average the <i>Value</i> (HSV) value from a display object or one of its region.\n\t *\n\t * @param src The DisplayObject\n\t * @param accuracy percentage of pixels to sample when averaging.\n\t * @param region to sample from [Default: null = entire src object].\n\t * @return the sampled average <i>lightness</i> value on a scale of 0-1.\n\t */\n\tpublic function averageValue(src:DisplayObject, accuracy:Number = 0.01, region:Rectangle = null):Number\n\t{\n\t\treturn averageColorProperty(src, region, accuracy, 'v');\n\t}\n}"
  },
  {
    "path": "src/utils/color/changeContrast.as",
    "content": "package utils.color {\n\timport utils.number.clamp;\n\n\n\n\t/**\n\t * Change the contrast of a hexadecimal Number by a certain increment\n\t * @param hex           color value to shift contrast on\n\t * @param inc           increment value to shift\n\t * @return new hex color value\n\t */\n\tpublic function changeContrast(hex:Number, inc:Number):Number {\n\t\tvar o:Object = getRGB(hex);\n\t\to.r = clamp(o.r + inc, 0, 255);\n\t\to.g = clamp(o.g + inc, 0, 255);\n\t\to.b = clamp(o.b + inc, 0, 255);\n\t\treturn toRGBComponents(o.r, o.g, o.b);\n\t}\n}\n"
  },
  {
    "path": "src/utils/color/getARGB.as",
    "content": "package utils.color\n{\n\t/**\n\t   Converts a 32-bit ARGB color value into an ARGB object.\n\n\t   @param color: The 32-bit ARGB color value.\n\t   @return Returns an object with the properties a, r, g, and b defined.\n\t   @example\n\t   <listing version=\"3.0\">\n\t   var myRGB:Object = ColorUtil.getARGB(0xCCFF00FF);\n\t   trace(\"Alpha = \" + myRGB.a);\n\t   trace(\"Red = \" + myRGB.r);\n\t   trace(\"Green = \" + myRGB.g);\n\t   trace(\"Blue = \" + myRGB.b);\n\t   </listing>\n\t */\n\tpublic function getARGB(color:uint):Object\n\t{\n\t\tvar c:Object = {};\n\t\tc.a = color >> 24 & 0xFF;\n\t\tc.r = color >> 16 & 0xFF;\n\t\tc.g = color >> 8 & 0xFF;\n\t\tc.b = color & 0xFF;\n\t\treturn c;\n\t}\n}"
  },
  {
    "path": "src/utils/color/getColor.as",
    "content": "package utils.color\n{\n\t/**\n\t   Converts a series of individual RGB(A) values to a 32-bit ARGB color value.\n\n\t   @param r A uint from 0 to 255 representing the red color value.\n\t   @param g A uint from 0 to 255 representing the green color value.\n\t   @param b A uint from 0 to 255 representing the blue color value.\n\t   @param a A uint from 0 to 255 representing the alpha value. Default is <code>255</code>.\n\t   @return Returns a hexidecimal color as a String.\n\t   @example\n\t   <listing version=\"3.0\">\n\t   var hexColor : String = ColorUtil.getHexStringFromARGB(128, 255, 0, 255);\n\t   trace(hexColor); // Traces 80FF00FF\n\t   </listing>\n\t */\n\tpublic function getColor(r:uint, g:uint, b:uint, a:uint = 255):uint\n\t{\n\t\treturn (a << 24) | (r << 16) | (g << 8) | b;\n\t}\n}"
  },
  {
    "path": "src/utils/color/getColorFromDisplayObject.as",
    "content": "package utils.color\n{\n\timport flash.display.BitmapData;\n\timport flash.display.DisplayObject;\n\n\timport utils.number.clamp;\n\n\t/**\n\t * Return the (A)RGB <i>hexadecimal</i> color value of a DisplayObject.\n\t * @param src           of the display object.\n\t * @param x             position to sample.\n\t * @param y             position to sample.\n\t * @param getAlpha      if true return is RGBA, else RGB.\n\t */\n\tpublic function getColorFromDisplayObject(src:DisplayObject, x:uint = 0, y:uint = 0, getAlpha:Boolean = false):uint\n\t{\n\t\tconst MAX_SIZE_SAFE:int = 2880;\n\n\t\tvar w:Number = clamp(src.width, 1, MAX_SIZE_SAFE);\n\t\tvar h:Number = clamp(src.height, 1, MAX_SIZE_SAFE);\n\t\tvar bmp:BitmapData = new BitmapData(w, h);\n\t\tbmp.lock();\n\t\tbmp.draw(src);\n\t\tvar color:uint = (!getAlpha) ? bmp.getPixel(int(x), int(y)) : bmp.getPixel32(int(x), int(y));\n\t\tbmp.unlock();\n\t\tbmp.dispose();\n\t\treturn color;\n\t}\n}"
  },
  {
    "path": "src/utils/color/getHexStringFromARGB.as",
    "content": "package utils.color {\n\n\n\n\t/**\n\t Converts a 32-bit ARGB color value into a hexadecimal String representation.\n\t @param a A uint from 0 to 255 representing the alpha value.\n\t @param r A uint from 0 to 255 representing the red color value.\n\t @param g A uint from 0 to 255 representing the green color value.\n\t @param b A uint from 0 to 255 representing the blue color value.\n\t @return Returns a hexadecimal color as a String.\n\t @example\n\t <code>\n\t var hexColor : String = ColorUtil.getHexStringFromARGB(128, 255, 0, 255);\n\t trace(hexColor); // Traces 80FF00FF\n\t </code>\n\t */\n\tpublic function getHexStringFromARGB(a:uint, r:uint, g:uint, b:uint):String {\n\t\tvar aa:String = a.toString(16);\n\t\tvar rr:String = r.toString(16);\n\t\tvar gg:String = g.toString(16);\n\t\tvar bb:String = b.toString(16);\n\t\taa = (aa.length == 1) ? '0' + aa : aa;\n\t\trr = (rr.length == 1) ? '0' + rr : rr;\n\t\tgg = (gg.length == 1) ? '0' + gg : gg;\n\t\tbb = (bb.length == 1) ? '0' + bb : bb;\n\t\treturn (aa + rr + gg + bb).toUpperCase();\n\t}\n}\n"
  },
  {
    "path": "src/utils/color/getHexStringFromRGB.as",
    "content": "package utils.color {\n\n\n\n\t/**\n\t Converts an RGB color value into a hexadecimal String representation.\n\t @param r A uint from 0 to 255 representing the red color value.\n\t @param g A uint from 0 to 255 representing the green color value.\n\t @param b A uint from 0 to 255 representing the blue color value.\n\t @return Returns a hexadecimal color as a String.\n\t @example\n\t <code>\n\t var hexColor : String = ColorUtil.getHexStringFromRGB(255, 0, 255);\n\t trace(hexColor); // Traces FF00FF\n\t </code>\n\t */\n\tpublic function getHexStringFromRGB(r:uint, g:uint, b:uint):String {\n\t\tvar rr:String = r.toString(16);\n\t\tvar gg:String = g.toString(16);\n\t\tvar bb:String = b.toString(16);\n\t\trr = (rr.length == 1) ? '0' + rr : rr;\n\t\tgg = (gg.length == 1) ? '0' + gg : gg;\n\t\tbb = (bb.length == 1) ? '0' + bb : bb;\n\t\treturn (rr + gg + bb).toUpperCase();\n\t}\n}\n"
  },
  {
    "path": "src/utils/color/getRGB.as",
    "content": "package utils.color\n{\n\t/**\n\t   Converts a 24-bit RGB color value into an RGB object.\n\n\t   @param color: The 24-bit RGB color value.\n\t   @return Returns an object with the properties r, g, and b defined.\n\t   @example\n\t   <code>\n\t   var myRGB:Object = ColorUtil.getRGB(0xFF00FF);\n\t   trace(\"Red = \" + myRGB.r);\n\t   trace(\"Green = \" + myRGB.g);\n\t   trace(\"Blue = \" + myRGB.b);\n\t   </code>\n\t */\n\tpublic function getRGB(color:uint):Object\n\t{\n\t\tvar c:Object = {};\n\t\tc.r = color >> 16 & 0xFF;\n\t\tc.g = color >> 8 & 0xFF;\n\t\tc.b = color & 0xFF;\n\t\treturn c;\n\t}\n}"
  },
  {
    "path": "src/utils/color/getTransform.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.ColorTransform;\n\n\t/**\n\t * Returns the transform value set by the last setTransform() call.\n\t * @return An object containing the current offset and percentage values for the color.\n\t */\n\tpublic function getTransform(src:DisplayObject):Object\n\t{\n\t\tvar ct:ColorTransform = src.transform.colorTransform;\n\t\treturn { ra: ct.redMultiplier * 100, rb: ct.redOffset, ga: ct.greenMultiplier * 100, gb: ct.greenOffset, ba: ct.blueMultiplier * 100, bb: ct.blueOffset, aa: ct.alphaMultiplier * 100,\n\t\t\t\tab: ct.alphaOffset };\n\t}\n}"
  },
  {
    "path": "src/utils/color/interpolateColor.as",
    "content": "package utils.color\n{\n\timport flash.geom.ColorTransform;\n\n\timport utils.math.Percent;\n\timport utils.number.interpolate;\n\n\t/**\n\t   Interpolates (tints) between two colors.\n\n\t   @param begin: The start color.\n\t   @param end: The finish color.\n\t   @param amount: The level of interpolation between the two colors.\n\t   @return The new interpolated color.\n\t   @usage\n\t   <code>\n\t   var myColor:ColorTransform = new ColorTransform();\n\t   myColor.color              = 0xFF0000;\n\n\t   var box:Sprite = new Sprite();\n\t   box.graphics.beginFill(0x0000FF);\n\t   box.graphics.drawRect(10, 10, 250, 250);\n\t   box.graphics.endFill();\n\n\t   box.transform.colorTransform = ColorUtil.interpolateColor(new ColorTransform(), myColor, new Percent(0.5));\n\n\t   this.addChild(box);\n\t   </code>\n\t */\n\tpublic function interpolateColor(begin:ColorTransform, end:ColorTransform, amount:Percent):ColorTransform\n\t{\n\t\tvar interpolation:ColorTransform = new ColorTransform();\n\n\t\tinterpolation.redMultiplier = interpolate(amount, begin.redMultiplier, end.redMultiplier);\n\t\tinterpolation.greenMultiplier = interpolate(amount, begin.greenMultiplier, end.greenMultiplier);\n\t\tinterpolation.blueMultiplier = interpolate(amount, begin.blueMultiplier, end.blueMultiplier);\n\t\tinterpolation.alphaMultiplier = interpolate(amount, begin.alphaMultiplier, end.alphaMultiplier);\n\t\tinterpolation.redOffset = interpolate(amount, begin.redOffset, end.redOffset);\n\t\tinterpolation.greenOffset = interpolate(amount, begin.greenOffset, end.greenOffset);\n\t\tinterpolation.blueOffset = interpolate(amount, begin.blueOffset, end.blueOffset);\n\t\tinterpolation.alphaOffset = interpolate(amount, begin.alphaOffset, end.alphaOffset);\n\n\t\treturn interpolation;\n\t}\n}"
  },
  {
    "path": "src/utils/color/invertColor.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Inverts the color of the DisplayObject.\n\t */\n\tpublic function invertColor(src:DisplayObject):void\n\t{\n\t\tvar t:Object = getTransform(src);\n\t\tsetTransform(src, {\n\t\t\t\tra: -t['ra'], ga: -t['ga'], ba: -t['ba'], rb: 255 - t['rb'], gb: 255 - t['gb'], bb: 255 - t['bb']\n\t\t\t});\n\t}\n}"
  },
  {
    "path": "src/utils/color/randomColor.as",
    "content": "package utils.color\n{\n\t/**\n\t * Returns a random color between 0x000000 and 0xFFFFFF\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function randomColor():uint {\n\t\treturn uint(Math.random() * 0xFFFFFF);\n\t}\n}"
  },
  {
    "path": "src/utils/color/resetColor.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Reset the color of the DisplayObject to its original view (pre-ColorTransformed).\n\t */\n\tpublic function resetColor(src:DisplayObject):void\n\t{\n\t\tsetTransform(src, { ra: 100, ga: 100, ba: 100, rb: 0, gb: 0, bb: 0 });\n\t}\n}"
  },
  {
    "path": "src/utils/color/setARGB.as",
    "content": "package utils.color\n{\n\tpublic function setARGB(a:Number, r:Number, g:Number, b:Number):uint\n\t{\n\t\tvar argb:uint = 0;\n\t\targb += (a << 24);\n\t\targb += (r << 16);\n\t\targb += (g << 8);\n\t\targb += (b);\n\t\treturn argb;\n\t}\n}"
  },
  {
    "path": "src/utils/color/setColor.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.ColorTransform;\n\n\t/**\n\t * Set the (A)RGB <i>hexadecimal</i> color value of a DisplayObject using ColorTransform.\n\t */\n\tpublic function setColor(src:DisplayObject, hex:uint):void\n\t{\n\t\tvar ct:ColorTransform = src.transform.colorTransform;\n\t\tct.color = hex;\n\t\tsrc.transform.colorTransform = ct;\n\t}\n}"
  },
  {
    "path": "src/utils/color/setTransform.as",
    "content": "package utils.color\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.ColorTransform;\n\n\t/**\n\t * Set ColorTransform information for a DisplayObject.\n\t *\n\t * <p>The colorTransformObject parameter is a generic object that you create from the new Object constructor. It has parameters specifying the percentage and\n\t * offset values for the red, green, blue, and alpha (transparency) components of a color, entered in the format 0xRRGGBBAA.</p>\n\t *\n\t * @param transformObject An object created with the new Object constructor. This instance of the Object class must have the following properties\n\t * that specify color transform values: ra, rb, ga, gb, ba, bb, aa, ab. These properties are explained in the above summary for the setTransform() method.\n\t */\n\tpublic function setTransform(src:DisplayObject, transformObject:Object):void\n\t{\n\t\tvar t:Object = { ra: 100, rb: 0, ga: 100, gb: 0, ba: 100, bb: 0, aa: 100, ab: 0 };\n\t\tfor (var p:String in transformObject)\n\t\t{\n\t\t\tt[p] = transformObject[p];\n\t\t}\n\t\tvar ct:ColorTransform = new ColorTransform(t['ra'] * 0.01, t['ga'] * 0.01, t['ba'] * 0.01, t['aa'] * 0.01, t['rb'], t['gb'], t['bb'], t['ab']);\n\t\tsrc.transform.colorTransform = ct;\n\t}\n}"
  },
  {
    "path": "src/utils/color/toColor.as",
    "content": "package utils.color\n{\n\t/**\n\t * Parse a String representation of a color (hex or html) to uint.\n\t */\n\tpublic function toColor(str:String):uint\n\t{\n\t\tif (str.substr(0, 2) == '0x')\n\t\t{\n\t\t\tstr = str.substr(2);\n\t\t}\n\t\telse if (str.substr(0, 1) == '#')\n\t\t{\n\t\t\tstr = str.substr(1);\n\t\t}\n\t\treturn parseInt(str, 16);\n\t}\n}"
  },
  {
    "path": "src/utils/color/toGrayscale.as",
    "content": "package utils.color\n{\n\tpublic function toGrayscale(hex:uint):uint\n\t{\n\t\tvar color:Object = getARGB(hex);\n\t\tvar c:Number = 0;\n\t\tc += color.r * .3;\n\t\tc += color.g * .59;\n\t\tc += color.b * .11;\n\t\tcolor.r = color.g = color.b = c;\n\t\treturn setARGB(color.a, color.r, color.g, color.b);\n\t}\n}"
  },
  {
    "path": "src/utils/color/toHTML.as",
    "content": "package utils.color {\n\n\n\n\t/**\n\t * Convert a hexadecimal number to a string representation with HTML notation: <code>#rrggbb</code>.\n\t */\n\tpublic function toHTML(hex:uint):String {\n\t\treturn \"#\" + (hex.toString(16)).toUpperCase();\n\t}\n}\n"
  },
  {
    "path": "src/utils/color/toHexString.as",
    "content": "package utils.color {\n\n\n\n\t/**\n\t * Convert a hexadecimal number to a string representation with ECMAScript notation: <code>0xrrggbb</code>.\n\t */\n\tpublic function toHexString(hex:uint):String {\n\t\treturn \"0x\" + (hex.toString(16)).toUpperCase();\n\t}\n}\n"
  },
  {
    "path": "src/utils/color/toRGBComponents.as",
    "content": "package utils.color {\n\n\n\n\t/**\n\t * Convert individual R,G,B values to a hexadecimal value.\n\t */\n\tpublic function toRGBComponents(r:uint, g:uint, b:uint):uint {\n\t\tvar hex:uint = 0;\n\t\thex += (r << 16);\n\t\thex += (g << 8);\n\t\thex += (b);\n\t\treturn hex;\n\t}\n}\n"
  },
  {
    "path": "src/utils/conversion/bitsToBytes.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts bits to bytes.\n\n\t   @param bits: The number of bits.\n\t   @return Returns the number of bytes.\n\t */\n\tpublic function bitsToBytes(bits:Number):Number\n\t{\n\t\treturn bits / 8;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/bitsToKilobits.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts bits to kilobits.\n\n\t   @param bits: The number of bits.\n\t   @return Returns the number of kilobits.\n\t */\n\tpublic function bitsToKilobits(bits:Number):Number\n\t{\n\t\treturn bits / 1024;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/bitsToKilobytes.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts bits to kilobytes.\n\n\t   @param bits: The number of bits.\n\t   @return Returns the number of kilobits.\n\t */\n\tpublic function bitsToKilobytes(bits:Number):Number\n\t{\n\t\treturn bits / 8192;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/bytesToBits.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts bytes to bits.\n\n\t   @param bytes: The number of bytes.\n\t   @return Returns the number of bits.\n\t */\n\tpublic function bytesToBits(bytes:Number):Number\n\t{\n\t\treturn bytes * 8;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/bytesToKilobits.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts bytes to kilobits.\n\n\t   @param bytes: The number of bytes.\n\t   @return Returns the number of kilobits.\n\t */\n\tpublic function bytesToKilobits(bytes:Number):Number\n\t{\n\t\treturn bytes / 128;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/bytesToKilobytes.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts bytes to kilobytes.\n\n\t   @param bytes: The number of bytes.\n\t   @return Returns the number of kilobytes.\n\t */\n\tpublic function bytesToKilobytes(bytes:Number):Number\n\t{\n\t\treturn bytes / 1024;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/daysToHours.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts days to hours.\n\n\t   @param days: The number of days.\n\t   @return Returns the number of hours.\n\t */\n\tpublic function daysToHours(days:Number):Number\n\t{\n\t\treturn days * 24;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/daysToMilliseconds.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts days to milliseconds.\n\n\t   @param days: The number of days.\n\t   @return Returns the number of milliseconds.\n\t */\n\tpublic function daysToMilliseconds(days:Number):Number\n\t{\n\t\treturn secondsToMilliseconds(daysToSeconds(days));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/daysToMinutes.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts days to minutes.\n\n\t   @param days: The number of days.\n\t   @return Returns the number of minutes.\n\t */\n\tpublic function daysToMinutes(days:Number):Number\n\t{\n\t\treturn hoursToMinutes(daysToHours(days));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/daysToSeconds.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts days to seconds.\n\n\t   @param days: The number of days.\n\t   @return Returns the number of seconds.\n\t */\n\tpublic function daysToSeconds(days:Number):Number\n\t{\n\t\treturn minutesToSeconds(daysToMinutes(days));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/degreesToRadians.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts degrees to radians.\n\n\t   @param degrees: The number of degrees.\n\t   @return Returns the number of radians.\n\t */\n\tpublic function degreesToRadians(degrees:Number):Number\n\t{\n\t\treturn degrees * (Math.PI / 180);\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/hoursToDays.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts hours to days.\n\n\t   @param hours: The number of hours.\n\t   @return Returns the number of days.\n\t */\n\tpublic function hoursToDays(hours:Number):Number\n\t{\n\t\treturn hours / 24;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/hoursToMilliseconds.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts hours to milliseconds.\n\n\t   @param hours: The number of hours.\n\t   @return Returns the number of milliseconds.\n\t */\n\tpublic function hoursToMilliseconds(hours:Number):Number\n\t{\n\t\treturn secondsToMilliseconds(hoursToSeconds(hours));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/hoursToMinutes.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts hours to minutes.\n\n\t   @param hours: The number of hours.\n\t   @return Returns the number of minutes.\n\t */\n\tpublic function hoursToMinutes(hours:Number):Number\n\t{\n\t\treturn hours * 60;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/hoursToSeconds.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts hours to seconds.\n\n\t   @param hours: The number of hours.\n\t   @return Returns the number of seconds.\n\t */\n\tpublic function hoursToSeconds(hours:Number):Number\n\t{\n\t\treturn minutesToSeconds(hoursToMinutes(hours));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/kilobitsToBits.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts kilobits to bits.\n\n\t   @param kilobits: The number of kilobits.\n\t   @return Returns the number of bits.\n\t */\n\tpublic function kilobitsToBits(kilobits:Number):Number\n\t{\n\t\treturn kilobits * 1024;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/kilobitsToBytes.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts kilobits to bytes.\n\n\t   @param kilobits: The number of kilobits.\n\t   @return Returns the number of bytes.\n\t */\n\tpublic function kilobitsToBytes(kilobits:Number):Number\n\t{\n\t\treturn kilobits * 128;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/kilobitsToKilobytes.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts kilobits to kilobytes.\n\n\t   @param kilobytes: The number of kilobits.\n\t   @return Returns the number of kilobytes.\n\t */\n\tpublic function kilobitsToKilobytes(kilobits:Number):Number\n\t{\n\t\treturn kilobits / 8;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/kilobytesToBits.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts kilobytes to bits.\n\n\t   @param kilobytes: The number of kilobytes.\n\t   @return Returns the number of bits.\n\t */\n\tpublic function kilobytesToBits(kilobytes:Number):Number\n\t{\n\t\treturn kilobytes * 8192;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/kilobytesToBytes.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts kilobytes to bytes.\n\n\t   @param kilobytes: The number of kilobytes.\n\t   @return Returns the number of bytes.\n\t */\n\tpublic function kilobytesToBytes(kilobytes:Number):Number\n\t{\n\t\treturn kilobytes * 1024;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/kilobytesToKilobits.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts kilobytes to kilobits.\n\n\t   @param kilobytes: The number of kilobytes.\n\t   @return Returns the number of kilobits.\n\t */\n\tpublic function kilobytesToKilobits(kilobytes:Number):Number\n\t{\n\t\treturn kilobytes * 8;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/millisecondsToDays.as",
    "content": "package utils.conversion\n{\n\n\t/**\n\t   Converts milliseconds to days.\n\n\t   @param milliseconds: The number of milliseconds.\n\t   @return Returns the number of days.\n\t */\n\tpublic function millisecondsToDays(milliseconds:Number):Number\n\t{\n\t\treturn hoursToDays(millisecondsToHours(milliseconds));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/millisecondsToHours.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts milliseconds to hours.\n\n\t   @param milliseconds: The number of milliseconds.\n\t   @return Returns the number of hours.\n\t */\n\tpublic function millisecondsToHours(milliseconds:Number):Number\n\t{\n\t\treturn minutesToHours(millisecondsToMinutes(milliseconds));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/millisecondsToMinutes.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts milliseconds to minutes.\n\n\t   @param milliseconds: The number of milliseconds.\n\t   @return Returns the number of minutes.\n\t */\n\tpublic function millisecondsToMinutes(milliseconds:Number):Number\n\t{\n\t\treturn secondsToMinutes(millisecondsToSeconds(milliseconds));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/millisecondsToSeconds.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts milliseconds to seconds.\n\n\t   @param milliseconds: The number of milliseconds.\n\t   @return Returns the number of seconds.\n\t */\n\tpublic function millisecondsToSeconds(milliseconds:Number):Number\n\t{\n\t\treturn milliseconds / 1000;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/minutesToDays.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts minutes to days.\n\n\t   @param minutes: The number of minutes.\n\t   @return Returns the number of days.\n\t */\n\tpublic function minutesToDays(minutes:Number):Number\n\t{\n\t\treturn hoursToDays(minutesToHours(minutes));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/minutesToHours.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts minutes to hours.\n\n\t   @param minutes: The number of minutes.\n\t   @return Returns the number of hours.\n\t */\n\tpublic function minutesToHours(minutes:Number):Number\n\t{\n\t\treturn minutes / 60;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/minutesToMilliseconds.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts minutes to milliseconds.\n\n\t   @param minutes: The number of minutes.\n\t   @return Returns the number of milliseconds.\n\t */\n\tpublic function minutesToMilliseconds(minutes:Number):Number\n\t{\n\t\treturn secondsToMilliseconds(minutesToSeconds(minutes));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/minutesToSeconds.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts minutes to seconds.\n\n\t   @param minutes: The number of minutes.\n\t   @return Returns the number of seconds.\n\t */\n\tpublic function minutesToSeconds(minutes:Number):Number\n\t{\n\t\treturn minutes * 60;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/radiansToDegrees.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts radians to degrees.\n\n\t   @param radians: The number of radians.\n\t   @return Returns the number of degrees.\n\t */\n\tpublic function radiansToDegrees(radians:Number):Number\n\t{\n\t\treturn radians * (180 / Math.PI);\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/secondsToDays.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts seconds to days.\n\n\t   @param seconds: The number of seconds.\n\t   @return Returns the number of days.\n\t */\n\tpublic function secondsToDays(seconds:Number):Number\n\t{\n\t\treturn hoursToDays(secondsToHours(seconds));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/secondsToHours.as",
    "content": "package utils.conversion\n{\n\n\t/**\n\t   Converts seconds to hours.\n\n\t   @param seconds: The number of seconds.\n\t   @return Returns the number of hours.\n\t */\n\tpublic function secondsToHours(seconds:Number):Number\n\t{\n\t\treturn minutesToHours(secondsToMinutes(seconds));\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/secondsToMilliseconds.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts seconds to milliseconds.\n\n\t   @param seconds: The number of seconds.\n\t   @return Returns the number of milliseconds.\n\t */\n\tpublic function secondsToMilliseconds(seconds:Number):Number\n\t{\n\t\treturn seconds * 1000;\n\t}\n}"
  },
  {
    "path": "src/utils/conversion/secondsToMinutes.as",
    "content": "package utils.conversion\n{\n\t/**\n\t   Converts seconds to minutes.\n\n\t   @param seconds: The number of seconds.\n\t   @return Returns the number of minutes.\n\t */\n\tpublic function secondsToMinutes(seconds:Number):Number\n\t{\n\t\treturn seconds / 60;\n\t}\n}"
  },
  {
    "path": "src/utils/cookie/getCookie.as",
    "content": "package utils.cookie\n{\n\timport flash.external.ExternalInterface;\n\n\tpublic function getCookie(cookieName:String):String\n\t{\n\t\tvar r:String = \"\";\n\t\tvar search:String = cookieName + \"=\";\n\t\tvar js:String = \"function get_cookie(){return document.cookie;}\";\n\t\tvar o:Object = ExternalInterface.call(js);\n\t\tvar cookieVariable:String = o.toString();\n\n\t\tif (cookieVariable.length > 0)\n\t\t{\n\t\t\tvar offset:int = cookieVariable.indexOf(search);\n\t\t\tif (offset != -1)\n\t\t\t{\n\t\t\t\toffset += search.length;\n\t\t\t\tvar end:int = cookieVariable.indexOf(\";\", offset);\n\t\t\t\tif (end == -1)\n\t\t\t\t\tend = cookieVariable.length;\n\t\t\t\tr = unescape(cookieVariable.substring(offset, end));\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}\n}"
  },
  {
    "path": "src/utils/cookie/setCookie.as",
    "content": "package utils.cookie\n{\n\timport flash.external.ExternalInterface;\n\n\tpublic function setCookie(cookieName:String, cookieValue:String):void\n\t{\n\t\tvar js:String = \"function sc(){\";\n\t\tjs += \"var c = escape('\" + cookieName + \"') + '=' + escape('\" + cookieValue + \"') + '; path=/';\";\n\t\tjs += \"document.cookie = c;\";\n\t\tjs += \"}\";\n\t\tExternalInterface.call(js);\n\t}\n}"
  },
  {
    "path": "src/utils/date/Calendar.as",
    "content": "/**\n * User: John Lindquist\n * Date: 3/16/11\n * Time: 11:27 AM\n */\npackage utils.date\n{\n\t/**\n\t * Calendar is an exception to the \"package-level function\" rule\n\t * \n\t * This class provides common dates (today, yesterday, tomorrow, last Sunday, next Thursday, the first of the year, the first of June, etc)\n\t * all based on \"now\"\n\t * \n\t * To determine whether or not a date belongs in \"Calendar\", simply ask yourself, \"Is this date based on 'now'?\"\n\t * \n\t * These properties will leverage many of the package-level functions such as \"getNextDay\", etc, but will simply be based on \"now\"\n\t */\n\tpublic class Calendar\n\t{\n\t\tpublic var now:Date = new Date();\n\t\tpublic var today:Date = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);\n\t}\n}"
  },
  {
    "path": "src/utils/date/TimeRelationships.as",
    "content": "package utils.date\n{\n\n\tpublic class TimeRelationships\n\t{\n\t\t//\n\t\t// Milliseconds\n\t\t//\n\n\t\tpublic static const YEAR_IN_MILLISECONDS:Number = 31536000000.0;\n\n\t\tpublic static const THIRTY_ONE_DAY_MONTH_IN_MILLISECONDS:Number = 2678400000.0;\n\n\t\tpublic static const THIRTY_DAY_MONTH_IN_MILLISECONDS:Number = 2592000000.0;\n\n\t\tpublic static const TWENTY_EIGHT_DAY_MONTH_IN_MILLISECONDS:Number = 2419200000.0;\n\n\t\tpublic static const WEEK_IN_MILLISECONDS:Number = 604800000.0;\n\n\t\tpublic static const DAY_IN_MILLISECONDS:Number = 86400000.0;\n\n\t\tpublic static const HOUR_IN_MILLISECONDS:Number = 3600000.0;\n\n\t\tpublic static const MINUTE_IN_MILLISECONDS:Number = 60000.0;\n\n\n\t\t//\n\t\t// Seconds\n\t\t//\n\n\t\tpublic static const YEAR_IN_SECONDS:Number = 31536000;\n\n\t\tpublic static const THIRTY_ONE_DAY_MONTH_IN_SECONDS:Number = 2678400;\n\n\t\tpublic static const THIRTY_DAY_MONTH_IN_SECONDS:Number = 2592000;\n\n\t\tpublic static const TWENTY_EIGHT_DAY_MONTH_IN_SECONDS:Number = 2419200;\n\n\t\tpublic static const WEEK_IN_SECONDS:Number = 604800;\n\n\t\tpublic static const DAY_IN_SECONDS:Number = 86400;\n\n\t\tpublic static const HOUR_IN_SECONDS:Number = 3600;\n\n\t\tpublic static const MINUTE_IN_SECONDS:Number = 60;\n\t}\n}"
  },
  {
    "path": "src/utils/date/Timezone.as",
    "content": "package utils.date\n{\n\t/*\n\t* Need to discuss how to refactor timezone logic into better utils\n\t* \n\t* This class currently only works with USA (the offsets default to EAST if the timezone is outside of the USA.\n\t* \n\t* */\n\tpublic class Timezone\n\t{\n\t\tpublic static const EAST:String = \"ET\";\n\t\tpublic static const WEST:String = \"WT\";\n\t\tpublic static const ARIZONA:String = \"AZ\";\n\t\tpublic static const MOUNTAIN:String = \"MT\";\n\t\tpublic static const CENTRAL:String = \"CT\";\n\t\tpublic static const PACIFIC:String = \"PT\";\n\t\tpublic static const ALASKA:String = \"AK\";\n\t\tpublic static const HAWAII:String = \"HT\";\n\t\t\n\t\tprivate static var nonDstOffsetDate:Date = new Date(2010, 1, 1);\n\t\tprivate static var dstOffsetDate:Date = new Date(2010, 7, 1);\n\t\tprivate static var observesDST:Boolean = (nonDstOffsetDate.timezoneOffset != dstOffsetDate.timezoneOffset);\n\t\tprivate static var timezone:String = EAST;\n        \n\n\t\tpublic static function get zuluOffset():String\n\t\t{\n\t\t\tvar offset:Number = nonDstOffsetDate.timezoneOffset / 60;\n\n            if(offset > 11 || offset <= 5)\n            {\n                offset = 4; //defaulting to east coast\n\t\t\t    return String(offset);\n            }\n\n            return String(new Date().timezoneOffset / 60);\n\t\t}\n\n\t\tpublic static function get dstOffset():String\n\t\t{\n            var offset:Number = dstOffsetDate.timezoneOffset / 60;\n\n\t\t\tif(offset > 10 || offset <= 4)\n            {\n                offset = 4; //defaulting to east coast\n            }\n\n            return String(offset);\n\t\t}\n\n\t\tpublic static function get nonDstOffset():String\n\t\t{\n            var offset:Number = nonDstOffsetDate.timezoneOffset / 60;\n\n            if(offset > 11 || offset <= 5)\n            {\n                offset = 5; //defaulting to east coast\n            }\n\t\t\treturn String(offset);\n\t\t}\n\n\t\tpublic static function get name():String\n\t\t{\n\t\t\t//Default to Eastern\n\t\t\tswitch (nonDstOffset)\n\t\t\t{\n\t\t\t\tcase \"10\":\n\t\t\t\t\ttimezone = HAWAII; //Hawaii\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"9\":\n\t\t\t\t\ttimezone = ALASKA; //Alaska\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"8\":\n\t\t\t\t\ttimezone = PACIFIC;//Pacific\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"7\":\n\t\t\t\t\ttimezone = MOUNTAIN;//Mountain\n\t\t\t\t\tif(!observesDST) timezone = ARIZONA;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"6\":\n\t\t\t\t\ttimezone = CENTRAL;//Central\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\ttimezone = EAST;\n\t\t\t}\n\n\t\t\treturn timezone;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/utils/date/addWeeks.as",
    "content": "package utils.date\n{\n\tpublic function addWeeks(date:Date,  weeks:uint):Date\n\t{\n\t\tdate.date += weeks * 7;\n\t\treturn date;\n\t}\n}"
  },
  {
    "path": "src/utils/date/ceil.as",
    "content": "package utils.date\n{\n\t/**\n\t * Returns the rounded up date where the time is 12:00am.\n\t * If a date is not provided, the current date is used.\n\t * @param date the date to round up\n\t * @return\n\t */\n\tpublic function ceil(date:Date = null):Date\n\t{\n\t\tif (!date)\n\t\t\tdate = new Date();\n\n\t\tdate.date += 1.0;\n\t\tdate.hours = 0.0;\n\t\tdate.minutes = 0.0;\n\t\tdate.seconds = 0.0;\n\t\tdate.milliseconds = 0.0;\n\n\t\treturn date;\n\t}\n}"
  },
  {
    "path": "src/utils/date/clone.as",
    "content": "package utils.date\n{\n\tpublic function clone(date:Date):Date\n\t{\n\t\treturn new Date(date.fullYear, date.month, date.date, date.hours, date.minutes, date.seconds, date.milliseconds);\n\t}\n}"
  },
  {
    "path": "src/utils/date/compareDates.as",
    "content": "package utils.date\n{\n\t/**\n\t *       Compares two dates and returns an integer depending on their relationship.\n\t *\n\t *       Returns -1 if d1 is later than d2.\n\t *       Returns 1 if d2 is later than d1.\n\t *       Returns 0 if both dates are equal.\n\t *\n\t *       @param d1 The date that will be compared to the second date.\n\t *       @param d2 The date that will be compared to the first date.\n\t *\n\t *       @return An int indicating how the two dates compare.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function compareDates(d1:Date, d2:Date):int\n\t{\n\t\tvar d1ms:Number = d1.getTime();\n\t\tvar d2ms:Number = d2.getTime();\n\n\t\tif (d1ms > d2ms)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\telse if (d1ms < d2ms)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/date/dayAbbrNames.as",
    "content": "package utils.date {\n\n\n\tpublic const dayAbbrNames:Array = [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ];\n\n\n}\n"
  },
  {
    "path": "src/utils/date/dayNames.as",
    "content": "package utils.date\n{\n\tpublic const dayNames:Array = [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ];\n}"
  },
  {
    "path": "src/utils/date/equals.as",
    "content": "package utils.date\n{\n\t/**\n\t   Determines if two Dates are the same time.\n\n\t   @param first: First Date to compare to <code>second</code>.\n\t   @param second: Second Date to compare to <code>first</code>.\n\t   @return Returns <code>true</code> if Dates are the same; otherwise <code>false</code>.\n\t */\n\tpublic function equals(first:Date, second:Date):Boolean\n\t{\n\t\treturn first.valueOf() == second.valueOf();\n\t}\n}"
  },
  {
    "path": "src/utils/date/floor.as",
    "content": "package utils.date\n{\n\t/**\n\t * Returns the rounded down date where the time is 12:00am.\n\t * If a date is not provided, the current date is used.\n\t * @param date the date to round down\n\t * @return\n\t */\n\tpublic function floor(date:Date = null):Date\n\t{\n\t\tif (!date)\n\t\t\tdate = new Date();\n\n\t\tdate.hours = 0.0;\n\t\tdate.minutes = 0.0;\n\t\tdate.seconds = 0.0;\n\t\tdate.milliseconds = 0.0;\n\n\t\treturn date;\n\t}\n}"
  },
  {
    "path": "src/utils/date/formatDate.as",
    "content": "package utils.date {\n\timport utils.conversion.minutesToSeconds;\n\timport utils.number.addLeadingZeroes;\n\timport utils.number.format;\n\timport utils.number.getOrdinalSuffix;\n\n\n\n\t/**\n\t * Formats a Date object for display. Acts almost identically to the PHP date() function.\n\t * You can prevent a recognized character in the format string from being expanded by escaping it with a preceding ^.\n\t * <table border=\"1\">\n\t *      <tr>\n\t *          <th style=\"width:150px;\">Format character</th>\n\t *          <th>Description</th>\n\t *          <th style=\"width:200px;\">Example returned values</th>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>d</td>\n\t *          <td>Day of the month, 2 digits with leading zeros.</td>\n\t *          <td>01 to 31</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>D</td>\n\t *          <td>A textual representation of a day, three letters.</td>\n\t *          <td>Mon through Sun</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>j</td>\n\t *          <td>Day of the month without leading zeros.</td>\n\t *          <td>1 to 31</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>l</td>\n\t *          <td>A full textual representation of the day of the week.</td>\n\t *          <td>Sunday through Saturday</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>N</td>\n\t *          <td>ISO-8601 numeric representation of the day of the week.</td>\n\t *          <td>1 (for Monday) through 7 (for Sunday)</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>S</td>\n\t *          <td>English ordinal suffix for the day of the month, 2 characters.</td>\n\t *          <td>st, nd, rd or th</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>w</td>\n\t *          <td>Numeric representation of the day of the week.</td>\n\t *          <td>0 (for Sunday) through 6 (for Saturday)</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>z</td>\n\t *          <td>The day of the year (starting from 0).</td>\n\t *          <td>0 through 365</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>W</td>\n\t *          <td>ISO-8601 week number of year, weeks starting on Monday.</td>\n\t *          <td>Example: 42 (the 42nd week in the year)</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>F</td>\n\t *          <td>A full textual representation of a month, such as January or March.</td>\n\t *          <td>January through December</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>m</td>\n\t *          <td>Numeric representation of a month, with leading zeros.</td>\n\t *          <td>01 through 12</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>M</td>\n\t *          <td>A short textual representation of a month, three letters.</td>\n\t *          <td>Jan through Dec</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>n</td>\n\t *          <td>Numeric representation of a month, without leading zeros.</td>\n\t *          <td>1 through 12</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>t</td>\n\t *          <td>Number of days in the given month.</td>\n\t *          <td>28 through 31</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>L</td>\n\t *          <td>Determines if it is a leap year.</td>\n\t *          <td>1 if it is a leap year, 0 otherwise</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>o or Y</td>\n\t *          <td>A full numeric representation of a year, 4 digits.</td>\n\t *          <td>Examples: 1999 or 2003</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>y</td>\n\t *          <td>A two digit representation of a year.</td>\n\t *          <td>Examples: 99 or 03</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>a</td>\n\t *          <td>Lowercase Ante meridiem and Post meridiem.</td>\n\t *          <td>am or pm</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>A</td>\n\t *          <td>Uppercase Ante meridiem and Post meridiem.</td>\n\t *          <td>AM or PM</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>B</td>\n\t *          <td>Swatch Internet time.</td>\n\t *          <td>000 through 999</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>g</td>\n\t *          <td>12-hour format of an hour without leading zeros.</td>\n\t *          <td>1 through 12</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>G</td>\n\t *          <td>24-hour format of an hour without leading zeros.</td>\n\t *          <td>0 through 23</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>h</td>\n\t *          <td>12-hour format of an hour with leading zeros.</td>\n\t *          <td>01 through 12</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>H</td>\n\t *          <td>24-hour format of an hour with leading zeros.</td>\n\t *          <td>00 through 23</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>i</td>\n\t *          <td>Minutes with leading zeros.</td>\n\t *          <td>00 to 59</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>s</td>\n\t *          <td>Seconds, with leading zeros.</td>\n\t *          <td>00 through 59</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>I</td>\n\t *          <td>Determines if the date is in daylight saving time.</td>\n\t *          <td>1 if Daylight Saving Time, 0 otherwise</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>O</td>\n\t *          <td>Difference to coordinated universal time (UTC) in hours.</td>\n\t *          <td>Example: +0200</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>P</td>\n\t *          <td>Difference to Greenwich time (GMT/UTC) in hours with colon between hours and minutes.</td>\n\t *          <td>Example: +02:00</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>e or T</td>\n\t *          <td>Timezone abbreviation.</td>\n\t *          <td>Examples: EST, MDT</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>Z</td>\n\t *          <td>Timezone offset in seconds.</td>\n\t *          <td>-43200 through 50400</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>c</td>\n\t *          <td>ISO 8601 date.</td>\n\t *          <td>2004-02-12T15:19:21+00:00</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>r</td>\n\t *          <td>RFC 2822 formatted date.</td>\n\t *          <td>Example: Thu, 21 Dec 2000 16:01:07 +0200</td>\n\t *      </tr>\n\t *      <tr>\n\t *          <td>U</td>\n\t *          <td>Seconds since the Unix Epoch.</td>\n\t *          <td>Example: 1171479314</td>\n\t *      </tr>\n\t *  </table>\n\t * Example code:\n\t *      <pre>\n\t *          trace(DateUtils.formatDate(new Date(), \"l ^t^h^e dS ^of F Y h:i:s A\"));\n\t *      </pre>\n\t * @param dateToFormat Date object you wish to format\n\t * @param formatString Format of the outputted date String. See the format characters options above.\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function formatDate(dateToFormat:Date, formatString:String):String {\n\t\tvar out:String = \"\";\n\t\tvar c:String;\n\t\tvar i:int = -1;\n\t\tvar l:uint = formatString.length;\n\t\tvar t:Number;\n\n\t\twhile(++i < l) {\n\t\t\tc = formatString.substr(i, 1);\n\n\t\t\tif(c == \"^\") {\n\t\t\t\tout += formatString.substr(++i, 1);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tswitch(c) {\n\t\t\t\t\tcase \"d\" :\n\t\t\t\t\t\t// Day of the month, 2 digits with leading zeros\n\t\t\t\t\t\tout += addLeadingZeroes(dateToFormat.getDate());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"D\" :\n\t\t\t\t\t\t// A textual representation of a day, three letters\n\t\t\t\t\t\tout += getDayAbbrName(dateToFormat.getDay());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"j\" :\n\t\t\t\t\t\t// Day of the month without leading zeros\n\t\t\t\t\t\tout += String(dateToFormat.getDate());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"l\" :\n\t\t\t\t\t\t// A full textual representation of the day of the week\n\t\t\t\t\t\tout += getDayAsString(dateToFormat.getDay());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"N\" :\n\t\t\t\t\t\t// ISO-8601 numeric representation of the day of the week\n\t\t\t\t\t\tt = dateToFormat.getDay();\n\t\t\t\t\t\tif(t == 0) t = 7;\n\t\t\t\t\t\tout += String(t);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"S\" :\n\t\t\t\t\t\t// English ordinal suffix for the day of the month, 2 characters\n\t\t\t\t\t\tout += getOrdinalSuffix(dateToFormat.getDate());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"w\" :\n\t\t\t\t\t\t// Numeric representation of the day of the week\n\t\t\t\t\t\tout += String(dateToFormat.getDay());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"z\" :\n\t\t\t\t\t\t// The day of the year (starting from 0)\n\t\t\t\t\t\tout += String(addLeadingZeroes(getDayOfTheYear(dateToFormat)));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"W\" :\n\t\t\t\t\t\t// ISO-8601 week number of year, weeks starting on Monday\n\t\t\t\t\t\tout += String(addLeadingZeroes(getWeekOfTheYear(dateToFormat)));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"F\" :\n\t\t\t\t\t\t// A full textual representation of a month, such as January or March\n\t\t\t\t\t\tout += getMonthName(dateToFormat.getMonth());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"m\" :\n\t\t\t\t\t\t// Numeric representation of a month, with leading zeros\n\t\t\t\t\t\tout += addLeadingZeroes(dateToFormat.getMonth() + 1);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"M\" :\n\t\t\t\t\t\t// A short textual representation of a month, three letters\n\t\t\t\t\t\tout += getMonthAbbrName(dateToFormat.getMonth());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"n\" :\n\t\t\t\t\t\t// Numeric representation of a month, without leading zeros\n\t\t\t\t\t\tout += String((dateToFormat.getMonth() + 1));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"t\" :\n\t\t\t\t\t\t// Number of days in the given month\n\t\t\t\t\t\tout += String(getDaysInMonth(dateToFormat.getMonth(), dateToFormat.getFullYear()));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"L\" :\n\t\t\t\t\t\t// Whether it is a leap year\n\t\t\t\t\t\tout += (isLeapYear(dateToFormat.getFullYear())) ? \"1\" : \"0\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"o\" :\n\t\t\t\t\tcase \"Y\" :\n\t\t\t\t\t\t// A full numeric representation of a year, 4 digits\n\t\t\t\t\t\tout += String(dateToFormat.getFullYear());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"y\" :\n\t\t\t\t\t\t// A two digit representation of a year\n\t\t\t\t\t\tout += String(dateToFormat.getFullYear()).substr(-2);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"a\" :\n\t\t\t\t\t\t// Lowercase Ante meridiem and Post meridiem\n\t\t\t\t\t\tout += getMeridiem(dateToFormat.getHours()).toLowerCase();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"A\" :\n\t\t\t\t\t\t// Uppercase Ante meridiem and Post meridiem\n\t\t\t\t\t\tout += getMeridiem(dateToFormat.getHours());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"B\" :\n\t\t\t\t\t\t// Swatch Internet time\n\t\t\t\t\t\tout += format(getInternetTime(dateToFormat), 3, null, \"0\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"g\" :\n\t\t\t\t\t\t// 12-hour format of an hour without leading zeros\n\t\t\t\t\t\tt = dateToFormat.getHours();\n\t\t\t\t\t\tif(t == 0) {\n\t\t\t\t\t\t\tt = 12;\n\t\t\t\t\t\t} else if(t > 12) {\n\t\t\t\t\t\t\tt -= 12;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tout += String(t);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"G\" :\n\t\t\t\t\t\t// 24-hour format of an hour without leading zeros\n\t\t\t\t\t\tout += String(dateToFormat.getHours());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"h\" :\n\t\t\t\t\t\t// 12-hour format of an hour with leading zeros\n\t\t\t\t\t\tt = dateToFormat.getHours() + 1;\n\t\t\t\t\t\tif(t == 0) {\n\t\t\t\t\t\t\tt = 12;\n\t\t\t\t\t\t} else if(t > 12) {\n\t\t\t\t\t\t\tt -= 12;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tout += addLeadingZeroes(t);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"H\" :\n\t\t\t\t\t\t// 24-hour format of an hour with leading zeros\n\t\t\t\t\t\tout += addLeadingZeroes(dateToFormat.getHours());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"i\" :\n\t\t\t\t\t\t// Minutes with leading zeros\n\t\t\t\t\t\tout += addLeadingZeroes(dateToFormat.getMinutes());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"s\" :\n\t\t\t\t\t\t// Seconds, with leading zeros\n\t\t\t\t\t\tout += addLeadingZeroes(dateToFormat.getSeconds());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"I\" :\n\t\t\t\t\t\t// Whether or not the date is in daylights savings time\n\t\t\t\t\t\tout += (isDaylightSavings(dateToFormat)) ? \"1\" : \"0\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"O\" :\n\t\t\t\t\t\t// Difference to Greenwich time (GMT/UTC) in hours\n\t\t\t\t\t\tout += getFormattedDifferenceFromUTC(dateToFormat);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"P\" :\n\t\t\t\t\t\tout += getFormattedDifferenceFromUTC(dateToFormat, \":\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"e\" :\n\t\t\t\t\tcase \"T\" :\n\t\t\t\t\t\t// Timezone identifier\n\t\t\t\t\t\tout += getTimezone(dateToFormat);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"Z\" :\n\t\t\t\t\t\t// Timezone offset (GMT/UTC) in seconds.\n\t\t\t\t\t\tout += String(int(minutesToSeconds(dateToFormat.getTimezoneOffset())));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"c\" :\n\t\t\t\t\t\t// ISO 8601 date\n\t\t\t\t\t\tout += dateToFormat.getFullYear() + \"-\" + addLeadingZeroes(dateToFormat.getMonth() + 1) + \"-\" + addLeadingZeroes(dateToFormat.getDate()) + \"T\" + addLeadingZeroes(dateToFormat.getHours()) + \":\" + addLeadingZeroes(dateToFormat.getMinutes()) + \":\" + addLeadingZeroes(dateToFormat.getSeconds()) + getFormattedDifferenceFromUTC(dateToFormat, \":\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"r\" :\n\t\t\t\t\t\t// RFC 2822 formatted date\n\t\t\t\t\t\tout += getDayAbbrName(dateToFormat.getDay()) + \", \" + dateToFormat.getDate() + \" \" + getMonthAbbrName(dateToFormat.getMonth()) + \" \" + dateToFormat.getFullYear() + \" \" + addLeadingZeroes(dateToFormat.getHours()) + \":\" + addLeadingZeroes(dateToFormat.getMinutes()) + \":\" + addLeadingZeroes(dateToFormat.getSeconds()) + \" \" + getFormattedDifferenceFromUTC(dateToFormat);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"U\" :\n\t\t\t\t\t\t// Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)\n\t\t\t\t\t\tt = int(dateToFormat.getTime() / 1000);\n\t\t\t\t\t\tout += String(t);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault :\n\t\t\t\t\t\tout += formatString.substr(i, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/date/formatWeekOf.as",
    "content": "package utils.date\n{\n\tpublic function formatWeekOf(date:Date):String\n\t{\n\t\tdate = getLastSunday(date);\n\n\t\tvar string:String = \"\";\n\t\tstring = \"Week of \" + String(date.getUTCMonth() + 1) + \"/\" + String(date.getUTCDate());\n\n\t\treturn string;\n\t}\n}"
  },
  {
    "path": "src/utils/date/getAMPM.as",
    "content": "package utils.date\n{\n\t/**\n\t *       Returns a string indicating whether the date represents a time in the\n\t *       ante meridiem (AM) or post meridiem (PM).\n\t *\n\t *       If the hour is less than 12 then \"AM\" will be returned.\n\t *\n\t *       If the hour is greater than 12 then \"PM\" will be returned.\n\t *\n\t *       @param d1 The Date from which to generate the 12 hour clock indicator.\n\t *\n\t *       @return A String (\"AM\" or \"PM\") indicating which half of the day the\n\t *       hour represents.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function getAMPM(d:Date):String\n\t{\n\t\treturn (d.hours > 11) ? \"PM\" : \"AM\";\n\t}\n}"
  },
  {
    "path": "src/utils/date/getCountdownUntil.as",
    "content": "package utils.date\n{\n\timport utils.conversion.daysToHours;\n\timport utils.conversion.hoursToMinutes;\n\timport utils.conversion.millisecondsToDays;\n\timport utils.conversion.minutesToSeconds;\n\timport utils.conversion.secondsToMilliseconds;\n\n\t/**\n\t   Determines the time remaining until a certain date.\n\n\t   @param startDate: The starting date.\n\t   @param endDate: The ending date.\n\t   @return Returns an Object with the properties <code>days</code>, <code>hours</code>, <code>minutes</code>, <code>seconds</code> and <code>milliseconds</code> defined as numbers.\n\t   @example\n\t   <code>\n\t   var countdown:Object = DateUtil.getCountdownUntil(new Date(2006, 11, 31, 21, 36), new Date(2007, 0, 1));\n\t   trace(\"There are \" + countdown.hours + \" hours and \" + countdown.minutes + \" minutes until the new year!\");\n\t   </code>\n\t */\n\tpublic function getCountdownUntil(startDate:Date, endDate:Date):Object\n\t{\n\t\tvar daysUntil:Number = millisecondsToDays(getTimeBetween(startDate, endDate));\n\t\tvar hoursUntil:Number = daysToHours(daysUntil % 1);\n\t\tvar minsUntil:Number = hoursToMinutes(hoursUntil % 1);\n\t\tvar secsUntil:Number = minutesToSeconds(minsUntil % 1);\n\t\tvar milliUntil:Number = secondsToMilliseconds(secsUntil % 1);\n\n\t\treturn {\n\t\t\t\tdays: int(daysUntil),\n\t\t\t\thours: int(hoursUntil),\n\t\t\t\tminutes: int(minsUntil),\n\t\t\t\tseconds: int(secsUntil),\n\t\t\t\tmilliseconds: int(milliUntil)};\n\t}\n}"
  },
  {
    "path": "src/utils/date/getDayAbbrName.as",
    "content": "package utils.date {\n\n\n\n\t/**\n\t * Returns the English abbreviation name of the provided day.\n\t * @param day the index of the day, where zero returns 'Sun' and six returns 'Sat'\n\t * @return\n\t */\n\tpublic function getDayAbbrName(day:int):String {\n\t\treturn dayAbbrNames[day];\n\t}\n}\n"
  },
  {
    "path": "src/utils/date/getDayAsString.as",
    "content": "package utils.date\n{\n\tpublic function getDayAsString(day:Number):String\n\t{\n\t\tvar dayNamesFull:Array = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');\n\t\treturn dayNamesFull[day];\n\t}\n}"
  },
  {
    "path": "src/utils/date/getDayName.as",
    "content": "package utils.date\n{\n\t/**\n\t * Returns the English name of the provided day.\n\t * @param day the index of the day, where zero returns 'Sunday' and six returns 'Saturday'\n\t * @return\n\t */\n\tpublic function getDayName(day:int):String\n\t{\n\t\treturn dayNames[day];\n\t}\n}"
  },
  {
    "path": "src/utils/date/getDayOfTheYear.as",
    "content": "package utils.date\n{\n\t/**\n\t   Gets the current day out of the total days in the year (starting from 0).\n\n\t   @param d: Date object to find the current day of the year from.\n\t   @return Returns the current day of the year (0-364 or 0-365 on a leap year).\n\t */\n\tpublic function getDayOfTheYear(d:Date):uint\n\t{\n\t\tvar firstDay:Date = new Date(d.getFullYear(), 0, 1);\n\t\treturn (d.getTime() - firstDay.getTime()) / 86400000;\n\t}\n}"
  },
  {
    "path": "src/utils/date/getDaysInMonth.as",
    "content": "package utils.date\n{\n\t/**\n\t   Finds the number of days in the given month.\n\n\t   @param year: The full year.\n\t   @param month: The month number (0 for January, 1 for February, and so on).\n\t   @return The number of days in the month; 28 through 31.\n\t   @example\n\t   <code>\n\t   var myDate:Date = new Date(2000, 0, 1);\n\n\t   trace(DateUtil.getDaysInMonth(myDate.getFullYear(), myDate.getMonth())); // Traces 31\n\t   </code>\n\t */\n\tpublic function getDaysInMonth(year:Number, month:Number):uint\n\t{\n\t\treturn (new Date(year, ++month, 0)).getDate();\n\t}\n}"
  },
  {
    "path": "src/utils/date/getEarliestDate.as",
    "content": "package utils.date\n{\n\t/**\n\t *       Compares dates and returns the latest one.\n\t *\n\t *       @param dates that will be compared.\n\t * \t\t @return The latest date.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t * \t\t @author Mims H. Wright\n\t */\n\tpublic function getEarliestDate(... dates ):Date\n\t{\n\t\tvar earliestDate:Date;\n\t\tif (dates.length() == 0) {\n\t\t\tthrow new ArgumentError(\"Requires at least one argument\");\n\t\t} \n\t\tfor each (var date:Date in dates) {\n\t\t\tif (!earliestDate) {\n\t\t\t\tearliestDate = date;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif (date.getTime() > earliestDate.getTime()) {\n\t\t\t\tearliestDate = date;\n\t\t\t}\n\t\t}\n\t\treturn earliestDate;\n\t}\n}"
  },
  {
    "path": "src/utils/date/getFormattedDifferenceFromUTC.as",
    "content": "package utils.date {\n\timport utils.conversion.minutesToHours;\n\timport utils.number.addLeadingZeroes;\n\n\n\n\t/**\n\t * Formats the difference to coordinated undefined time (UTC).\n\t * @param date Date object to find the time zone offset of\n\t * @param separator Character(s) that separates the hours from minutes\n\t * @return Formatted time difference from UTC\n\t */\n\tpublic function getFormattedDifferenceFromUTC(date:Date, separator:String = \"\"):String {\n\t\tvar pre:String = (-date.getTimezoneOffset() < 0) ? \"-\" : \"+\";\n\n\t\treturn pre + addLeadingZeroes(Math.floor(minutesToHours(date.getTimezoneOffset()))) + separator + addLeadingZeroes(date.getTimezoneOffset() % 60);\n\t}\n}\n"
  },
  {
    "path": "src/utils/date/getInternetTime.as",
    "content": "package utils.date\n{\n\timport utils.conversion.minutesToHours;\n\timport utils.conversion.secondsToHours;\n\n\t/**\n\t   Converts current time into Swatch internet time or beats.\n\n\t   @param d: Date object to convert.\n\t   @return Returns time in beats (0 to 999).\n\t */\n\tpublic function getInternetTime(d:Date):Number\n\t{\n\t\tvar beats:uint = ((d.getUTCHours() + 1 + minutesToHours(d.getUTCMinutes()) + secondsToHours(d.getUTCSeconds())) / 0.024);\n\t\treturn (beats > 1000) ? beats - 1000 : beats;\n\t}\n}"
  },
  {
    "path": "src/utils/date/getLastMonday.as",
    "content": "package utils.date\n{\n\tpublic function getLastMonday(date:Date):Date\n\t{\n\t\tdate.date -= (date.day - 1);\n\n\t\treturn date;\n\t}\n}"
  },
  {
    "path": "src/utils/date/getLastSunday.as",
    "content": "package utils.date\n{\n\tpublic function getLastSunday(date:Date):Date\n\t{\n\t\tvar temp:Date = clone(date);\n\n\t\ttemp.date -= temp.day;\n\n\t\treturn temp;\n\t}\n}"
  },
  {
    "path": "src/utils/date/getLatestDate.as",
    "content": "package utils.date\n{\n\t/**\n\t *       Compares dates and returns the latest one.\n\t *\n\t *       @param dates that will be compared.\n\t * \t\t @return The latest date.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t * \t\t @author Mims H. Wright\n\t */\n\tpublic function getLatestDate(... dates ):Date\n\t{\n\t\tvar latestDate:Date;\n\t\tif (dates.length() == 0) {\n\t\t\tthrow new ArgumentError(\"Requires at least one argument\");\n\t\t} \n\t\tfor each (var date:Date in dates) {\n\t\t\tif (!latestDate) {\n\t\t\t\tlatestDate = date;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif (date.getTime() > latestDate.getTime()) {\n\t\t\t\tlatestDate = date;\n\t\t\t}\n\t\t}\n\t\treturn latestDate;\n\t}\n}"
  },
  {
    "path": "src/utils/date/getMeridiem.as",
    "content": "package utils.date\n{\n\t/**\n\t   Determines if time is Ante meridiem or Post meridiem.\n\n\t   @param hours: The hour to find the meridiem of (an integer from 0 to 23).\n\t   @return Returns either <code>\"AM\"</code> or <code>\"PM\"</code>\n\t   @example\n\t   <code>\n\t   trace(DateUtil.getMeridiem(17)); // Traces PM\n\t   </code>\n\t */\n\tpublic function getMeridiem(hours:Number):String\n\t{\n\t\treturn (hours < 12) ? 'AM' : 'PM';\n\t}\n}"
  },
  {
    "path": "src/utils/date/getMonthAbbrName.as",
    "content": "package utils.date {\n\n\n\n\t/**\n\t * Returns the English abbreviation name of the provided month.\n\t * @param month the index of the month, starting at zero\n\t * @return\n\t */\n\tpublic function getMonthAbbrName(month:int):String {\n\t\treturn monthAbbrNames[month];\n\t}\n}\n"
  },
  {
    "path": "src/utils/date/getMonthName.as",
    "content": "package utils.date\n{\n\t/**\n\t * Returns the English name of the provided month.\n\t * @param month the index of the month, starting at zero\n\t * @return\n\t */\n\tpublic function getMonthName(month:int):String\n\t{\n\t\treturn monthNames[month];\n\t}\n}"
  },
  {
    "path": "src/utils/date/getNextDay.as",
    "content": "package utils.date\n{\n    /** Returns the next calender date following the provided Date.\n\t * If no Date is provided, the current date is used.\n\t * @param startDate The date you wish to get the next day of\n\t * @return\n\t */\n    public function getNextDay(startDate:Date=null):Date\n    {\n        const millisecondsPerDay:int = 1000 * 60 * 60 * 24;\n\n\t\tif(!startDate)\n\t\t\tstartDate = new Date();\n\n\t\t//scrub the time of day\n\t\tvar tmpDate:Date = new Date(startDate.getFullYear(),\n                            startDate.getMonth(),\n                            startDate.getDate());\n\t\t\n\t\ttmpDate.setTime(tmpDate.getTime() + millisecondsPerDay);\n        return tmpDate;\n    }\n}\n"
  },
  {
    "path": "src/utils/date/getPreviousDay.as",
    "content": "package utils.date\n{\n\t/** Returns the previous calender date to the provided Date.\n\t * If no Date is provided, the current date is used.\n\t * @param startDate The date you wish to get the previous day of\n\t * @return\n\t */\n    public function getPreviousDay(startDate:Date=null):Date\n    {\n        const millisecondsPerDay:int = 1000 * 60 * 60 * 24;\n\n\t\tif(!startDate)\n\t\t\tstartDate = new Date();\n\t\t\n        //scrub the time of day\n        var tmpDate:Date = new Date(startDate.getFullYear(),\n                                    startDate.getMonth(),\n                                    startDate.getDate());\n        return new Date(tmpDate.getTime() - millisecondsPerDay);\n    }\n}\n"
  },
  {
    "path": "src/utils/date/getShortHour.as",
    "content": "package utils.date\n{\n\t/**\n\t *       Returns a short hour (0 - 12) represented by the specified date.\n\t *\n\t *       If the hour is less than 12 (0 - 11 AM) then the hour will be returned.\n\t *\n\t *       If the hour is greater than 12 (12 - 23 PM) then the hour minus 12\n\t *       will be returned.\n\t *\n\t *       @param d1 The Date from which to generate the short hour\n\t *\n\t *       @return An int between 0 and 13 ( 1 - 12 ) representing the short hour.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function getShortHour(d:Date):int\n\t{\n\t\tvar h:int = d.hours;\n\n\t\tif (h == 0 || h == 12)\n\t\t{\n\t\t\treturn 12;\n\t\t}\n\t\telse if (h > 12)\n\t\t{\n\t\t\treturn h - 12;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn h;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/date/getShortYear.as",
    "content": "package utils.date\n{\n\t/**\n\t *       Returns a two digit representation of the year represented by the\n\t *       specified date.\n\t *\n\t *       @param d The Date instance whose year will be used to generate a two\n\t *       digit string representation of the year.\n\t *\n\t *       @return A string that contains a 2 digit representation of the year.\n\t *       Single digits will be padded with 0.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function getShortYear(d:Date):String\n\t{\n\t\tvar dStr:String = String(d.getFullYear());\n\n\t\tif (dStr.length < 3)\n\t\t{\n\t\t\treturn dStr;\n\t\t}\n\n\t\treturn (dStr.substr(dStr.length - 2));\n\t}\n}"
  },
  {
    "path": "src/utils/date/getStartOfWeek.as",
    "content": "package utils.date\n{\n\tpublic function getStartOfWeek(date:Date):Date\n\t{\n\t\tvar temp:Date = clone(date);\n\n\t\ttemp.date -= temp.day;\n        temp = makeMorning(temp);\n        \n\t\treturn temp;\n\t}\n}"
  },
  {
    "path": "src/utils/date/getTimeBetween.as",
    "content": "package utils.date\n{\n\t/**\n\t   Determines the difference between two dates.\n\n\t   @param startDate: The starting date.\n\t   @param endDate: The ending date.\n\t   @return Returns the difference in milliseconds between the two dates.\n\t   @example\n\t   <code>\n\t   trace(ConversionUtil.millisecondsToDays(DateUtil.getTimeBetween(new Date(2007, 0, 1), new Date(2007, 0, 11)))); // Traces 10\n\t   </code>\n\t */\n\tpublic function getTimeBetween(startDate:Date, endDate:Date):Number\n\t{\n\t\treturn endDate.getTime() - startDate.getTime();\n\t}\n}"
  },
  {
    "path": "src/utils/date/getTimeElapsedString.as",
    "content": "package utils.date\n{\n\t/** \n\t * Takes a Date object and returns a string in the format\n\t * \"X UNITS ago\" where X is a number and UNITS is a unit of\n\t * time. Also has some other strings like \"yesterday\".\n\t * \n\t * @author Mims Wright (with thanks to John Resig)\n\t * \n\t * @param date The date to convert to a past string.\n\t * @param now Optional time to compare against. Default will be the present.\n\t */ \n\tpublic function getTimeElapsedString(date:Date, now:Date = null):String {\n\t\t\n\t\tconst SEC_PER_MINUTE:int = 60;\n\t\tconst SEC_PER_HOUR:int = SEC_PER_MINUTE * 60;\n\t\tconst SEC_PER_DAY:int = SEC_PER_HOUR * 24;\n\t\tconst SEC_PER_WEEK:int = SEC_PER_DAY * 7;\n\t\tconst SEC_PER_MONTH:int = SEC_PER_DAY * 30;\n\t\tconst SEC_PER_YEAR:int = SEC_PER_MONTH * 12; \n\t\t\n\t\t// if now isn't defined, make it a new Date object (the present)\n\t\tif (!now) { now = new Date(); }\n\t\t\n\t\t// don't use secondsElapsed here because the values are \n\t\t// huge so they use uints and are never negative\n\t\tif (now.time < date.time) { return \"in the future\"; }\n\t\t\n\t\t// get the difference in seconds between the two values. \n\t\tvar secondsElapsed:uint = Math.floor((now.time - date.time) / 1000);\n\n\t\t\n\t\t// seconds\n\t\tif (secondsElapsed < SEC_PER_MINUTE) { return \"just now\"; }\n\t\t\n\t\t// minutes\n\t\tif (secondsElapsed < SEC_PER_HOUR) { \n\t\t\tvar minutes:int = int(secondsElapsed / SEC_PER_MINUTE);\n\t\t\treturn formatAgoString(minutes, \"minute\");\n\t\t}\n\t\t\n\t\t// hours\n\t\tif (secondsElapsed < SEC_PER_DAY) { \n\t\t\tvar hours:int = int(secondsElapsed / SEC_PER_HOUR);\n\t\t\treturn formatAgoString(hours, \"hour\");\n\t\t}\n\t\t\n\t\t// days\n\t\tif (secondsElapsed < SEC_PER_WEEK) { \n\t\t\tvar days:int = int(secondsElapsed / SEC_PER_DAY);\n\t\t\tif (days == 1) { return \"yesterday\"; }\n\t\t\t\n\t\t\treturn formatAgoString(days, \"day\");\n\t\t}\n\t\t\n\t\t// weeks\n\t\tif (secondsElapsed < SEC_PER_MONTH) { \n\t\t\tvar weeks:int = int(secondsElapsed / SEC_PER_WEEK);\n\t\t\treturn formatAgoString(weeks, \"week\");\n\t\t}\n\t\t\n\t\t// months\n\t\tif (secondsElapsed < SEC_PER_YEAR) { \n\t\t\tvar months:int = int(secondsElapsed / SEC_PER_MONTH);\n\t\t\treturn formatAgoString(months, \"month\");\n\t\t}\n\t\t\n\t\t// years\n\t\treturn \"more than a year ago\";\n\t\t\n\t\t// Returns a string in the format \"count unit(s) ago\"\n\t\tfunction formatAgoString(count:int, unit:String):String {\n\t\t\treturn count + \" \" + unit + (count > 1 ? \"s\" : \"\") + \" ago\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/date/getTimezone.as",
    "content": "package utils.date\n{\n\t/**\n\t   Determines the time zone of the user from a Date object.\n\n\t   @param d: Date object to find the time zone of.\n\t   @return Returns the time zone abbreviation.\n\t   @example\n\t   <code>\n\t   trace(DateUtil.getTimezone(new Date()));\n\t   </code>\n\t */\n\tpublic function getTimezone(d:Date):String\n\t{\n\t\tvar timeZones:Array =\n\t\t\tnew Array('IDLW', 'NT', 'HST', 'AKST', 'PST', 'MST', 'CST', 'EST', 'AST', 'ADT', 'AT', 'WAT', 'GMT', 'CET', 'EET', 'MSK', 'ZP4', 'ZP5', 'ZP6', 'WAST', 'WST', 'JST', 'AEST', 'AEDT',\n\t\t\t\t\t  'NZST');\n\t\tvar hour:uint = Math.round(12 + -(d.getTimezoneOffset() / 60));\n\n\t\tif (isDaylightSavings(d))\n\t\t\thour--;\n\n\t\treturn timeZones[hour];\n\t}\n}"
  },
  {
    "path": "src/utils/date/getUTCDate.as",
    "content": "package utils.date\n{\n\t/**\n\t * Sort of converts a date into UTC.\n\t */\n\tpublic function getUTCDate(d:Date):Date\n\t{\n\t\tvar nd:Date = new Date();\n\t\tvar offset:Number = d.getTimezoneOffset() * 60 * 1000;\n\t\tnd.setTime(d.getTime() + offset);\n\t\treturn nd;\n\t}\n}"
  },
  {
    "path": "src/utils/date/getWeekOfTheYear.as",
    "content": "package utils.date\n{\n\timport utils.conversion.millisecondsToDays;\n\n\t/**\n\t   Determines the week number of year, weeks start on Mondays.\n\n\t   @param d: Date object to find the current week number of.\n\t   @return Returns the the week of the year the date falls in.\n\t */\n\tpublic function getWeekOfTheYear(d:Date):uint\n\t{\n\t\tvar firstDay:Date = new Date(d.getFullYear(), 0, 1);\n\t\tvar dayOffset:uint = 9 - firstDay.getDay();\n\t\tvar firstMonday:Date = new Date(d.getFullYear(), 0, (dayOffset > 7) ? dayOffset - 7 : dayOffset);\n\t\tvar currentDay:Date = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n\t\tvar weekNumber:uint = (millisecondsToDays(currentDay.getTime() - firstMonday.getTime()) / 7) + 1;\n\n\t\treturn (weekNumber == 0) ? getWeekOfTheYear(new Date(d.getFullYear() - 1, 11, 31)) : weekNumber;\n\t}\n}"
  },
  {
    "path": "src/utils/date/isDaylightSavings.as",
    "content": "package utils.date\n{\n\t/**\n\t   Determines if or not the date is in daylight saving time.\n\n\t   @param d: Date to find if it is during daylight savings time.\n\t   @return Returns <code>true</code> if daylight savings time; otherwise <code>false</code>.\n\t */\n\tpublic function isDaylightSavings(d:Date):Boolean\n\t{\n\t\tvar months:uint = 12;\n\t\tvar offset:uint = d.getTimezoneOffset();\n\t\tvar offsetCheck:Number;\n\n\t\twhile (months--)\n\t\t{\n\t\t\toffsetCheck = (new Date(d.getFullYear(), months, 1)).getTimezoneOffset();\n\n\t\t\tif (offsetCheck != offset)\n\t\t\t\treturn (offsetCheck > offset);\n\t\t}\n\n\t\treturn false;\n\t}\n}"
  },
  {
    "path": "src/utils/date/isInCurrentWeek.as",
    "content": "package utils.date\n{\n    public function isInCurrentWeek(date:Date):Boolean\n    {\n        var today:Date = new Date();\n        var startOfWeek:Date = getStartOfWeek(today);\n\n        var millisecondsDifference:Number = getTimeBetween(startOfWeek, date);\n\n        var b:Boolean;\n        b = millisecondsDifference < TimeRelationships.WEEK_IN_MILLISECONDS;\n        b &&= millisecondsDifference >= 0;\n        return b;\n    }\n}"
  },
  {
    "path": "src/utils/date/isLeapYear.as",
    "content": "package utils.date\n{\n\t/**\n\t   Determines if year is a leap year or a common year.\n\n\t   @param year: The full year.\n\t   @return Returns <code>true</code> if year is a leap year; otherwise <code>false</code>.\n\t   @example\n\t   <code>\n\t   var myDate:Date = new Date(2000, 0, 1);\n\n\t   trace(DateUtil.isLeapYear(myDate.getFullYear())); // Traces true\n\t   </code>\n\t */\n\tpublic function isLeapYear(year:Number):Boolean\n\t{\n\t\treturn getDaysInMonth(year, 1) == 29;\n\t}\n}"
  },
  {
    "path": "src/utils/date/isPast.as",
    "content": "package utils.date\n{\n\t/**\n\t * Returns true if date is in the past.\n\t * If the date is exactly equal to the current time, it will return false.\n\t * \n\t * @author Mims H. Wright\n\t */\n\tpublic function isPast(date:Date):Boolean\n\t{\n\t\treturn (new Date().getTime() - date.getTime()) > 0;\n\t}\n}"
  },
  {
    "path": "src/utils/date/iso8601ToDate.as",
    "content": "package utils.date {\n\timport utils.conversion.minutesToHours;\n\timport utils.object.isEmpty;\n\n\n\n\t/**\n\t * Converts W3C ISO 8601 date String into a Date object.\n\t * Example code:\n\t *      <pre>\n\t *          trace(iso8601ToDate(\"1994-11-05T08:15:30-05:00\").toString());\n\t *      </pre>\n\t * @param iso8601 Valid ISO 8601 formatted String\n\t * @return Date object of the specified date and time of the ISO 8601 String in universal time\n\t * @see http://www.w3.org/TR/NOTE-datetime (W3C ISO 8601 specification)\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function iso8601ToDate(iso8601:String):Date {\n\t\tvar parts:Array = iso8601.toUpperCase().split(\"T\");\n\t\tvar date:Array = parts[0].split(\"-\");\n\t\tvar time:Array = (parts.length <= 1) ? [] : parts[1].split(\":\");\n\t\tvar year:uint = isEmpty(date[0]) ? 0 : Number(date[0]);\n\t\tvar month:uint = isEmpty(date[1]) ? 0 : Number(date[1] - 1);\n\t\tvar day:uint = isEmpty(date[2]) ? 1 : Number(date[2]);\n\t\tvar hour:int = isEmpty(time[0]) ? 0 : Number(time[0]);\n\t\tvar minute:uint = isEmpty(time[1]) ? 0 : Number(time[1]);\n\t\tvar second:uint = 0;\n\t\tvar millisecond:uint = 0;\n\n\t\tif(time[2] != undefined) {\n\t\t\tvar index:int = time[2].length;\n\t\t\tvar temp:Number;\n\n\t\t\tif(time[2].indexOf(\"+\") > -1) {\n\t\t\t\tindex = time[2].indexOf(\"+\");\n\t\t\t} else if(time[2].indexOf(\"-\") > -1) {\n\t\t\t\tindex = time[2].indexOf(\"-\");\n\t\t\t} else if(time[2].indexOf(\"Z\") > -1) {\n\t\t\t\tindex = time[2].indexOf(\"Z\");\n\t\t\t}\n\n\t\t\tif(isNaN(index)) {\n\t\t\t\ttemp = Number(time[2].slice(0, index));\n\t\t\t\tsecond = Math.floor(temp);\n\t\t\t\tmillisecond = 1000 * (temp % 1);\n\t\t\t}\n\n\t\t\tif(index != time[2].length) {\n\t\t\t\tvar offset:String = time[2].slice(index);\n\t\t\t\tvar userOffset:Number = minutesToHours(new Date(year, month, day).getTimezoneOffset());\n\n\t\t\t\tswitch(offset.charAt(0)) {\n\t\t\t\t\tcase \"+\" :\n\t\t\t\t\tcase \"-\" :\n\t\t\t\t\t\thour -= userOffset + Number(offset.slice(0));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"Z\" :\n\t\t\t\t\t\thour -= userOffset;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new Date(year, month, day, hour, minute, second, millisecond);\n\t}\n}\n"
  },
  {
    "path": "src/utils/date/makeMorning.as",
    "content": "package utils.date\n{\n\t/**\n\t * Converts a date into just after midnight.\n\t */\n\tpublic function makeMorning(d:Date):Date\n\t{\n\t\td = new Date(d.time);\n\t\td.hours = 0;\n\t\td.minutes = 0;\n\t\td.seconds = 0;\n\t\td.milliseconds = 0;\n\t\treturn d;\n\t}\n}"
  },
  {
    "path": "src/utils/date/makeNight.as",
    "content": "package utils.date {\n\n\n\n\t/**\n\t * Converts a date into just before midnight.\n\t */\n\tpublic function makeNight(d:Date):Date {\n\t\td = new Date(d.time);\n\t\td.hours = 23;\n\t\td.minutes = 59;\n\t\td.seconds = 59;\n\t\td.milliseconds = 999;\n\t\treturn d;\n\t}\n}\n"
  },
  {
    "path": "src/utils/date/monthAbbrNames.as",
    "content": "package utils.date {\n\n\n\tpublic const monthAbbrNames:Array = [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ];\n\n\n}\n"
  },
  {
    "path": "src/utils/date/monthNames.as",
    "content": "package utils.date\n{\n\tpublic const monthNames:Array = [ \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ];\n}"
  },
  {
    "path": "src/utils/date/parseW3CDTF.as",
    "content": "package utils.date\n{\n\t/**\n\t * Parses dates that conform to the W3C Date-time Format into Date objects.\n\t *\n\t * This function is useful for parsing RSS 1.0 and Atom 1.0 dates.\n\t *\n\t * @param str\n\t *\n\t * @returns Date\n\t *\n\t * @langversion ActionScript 3.0\n\t * @playerversion Flash 9.0\n\t * @tiptext\n\t *\n\t * @see http://www.w3.org/TR/NOTE-datetime\n\t */\n\tpublic function parseW3CDTF(str:String):Date\n\t{\n\t\tvar finalDate:Date;\n\t\ttry\n\t\t{\n\t\t\tvar dateStr:String = str.substring(0, str.indexOf(\"T\"));\n\t\t\tvar timeStr:String = str.substring(str.indexOf(\"T\") + 1, str.length);\n\t\t\tvar dateArr:Array = dateStr.split(\"-\");\n\t\t\tvar year:Number = Number(dateArr.shift());\n\t\t\tvar month:Number = Number(dateArr.shift());\n\t\t\tvar date:Number = Number(dateArr.shift());\n\n\t\t\tvar multiplier:Number;\n\t\t\tvar offsetHours:Number;\n\t\t\tvar offsetMinutes:Number;\n\t\t\tvar offsetStr:String;\n\n\t\t\tif (timeStr.indexOf(\"Z\") != -1)\n\t\t\t{\n\t\t\t\tmultiplier = 1;\n\t\t\t\toffsetHours = 0;\n\t\t\t\toffsetMinutes = 0;\n\t\t\t\ttimeStr = timeStr.replace(\"Z\", \"\");\n\t\t\t}\n\t\t\telse if (timeStr.indexOf(\"+\") != -1)\n\t\t\t{\n\t\t\t\tmultiplier = 1;\n\t\t\t\toffsetStr = timeStr.substring(timeStr.indexOf(\"+\") + 1, timeStr.length);\n\t\t\t\toffsetHours = Number(offsetStr.substring(0, offsetStr.indexOf(\":\")));\n\t\t\t\toffsetMinutes = Number(offsetStr.substring(offsetStr.indexOf(\":\") + 1, offsetStr.length));\n\t\t\t\ttimeStr = timeStr.substring(0, timeStr.indexOf(\"+\"));\n\t\t\t}\n\t\t\telse // offset is -\n\t\t\t{\n\t\t\t\tmultiplier = -1;\n\t\t\t\toffsetStr = timeStr.substring(timeStr.indexOf(\"-\") + 1, timeStr.length);\n\t\t\t\toffsetHours = Number(offsetStr.substring(0, offsetStr.indexOf(\":\")));\n\t\t\t\toffsetMinutes = Number(offsetStr.substring(offsetStr.indexOf(\":\") + 1, offsetStr.length));\n\t\t\t\ttimeStr = timeStr.substring(0, timeStr.indexOf(\"-\"));\n\t\t\t}\n\t\t\tvar timeArr:Array = timeStr.split(\":\");\n\t\t\tvar hour:Number = Number(timeArr.shift());\n\t\t\tvar minutes:Number = Number(timeArr.shift());\n\t\t\tvar secondsArr:Array = (timeArr.length > 0) ? String(timeArr.shift()).split(\".\") : null;\n\t\t\tvar seconds:Number = (secondsArr != null && secondsArr.length > 0) ? Number(secondsArr.shift()) : 0;\n\t\t\t//var milliseconds:Number = (secondsArr != null && secondsArr.length > 0) ? Number(secondsArr.shift()) : 0;\n\n\t\t\tvar milliseconds:Number = (secondsArr != null && secondsArr.length > 0) ? 1000 * parseFloat(\"0.\" + secondsArr.shift()) : 0;\n\t\t\tvar utc:Number = Date.UTC(year, month - 1, date, hour, minutes, seconds, milliseconds);\n\t\t\tvar offset:Number = (((offsetHours * 3600000) + (offsetMinutes * 60000)) * multiplier);\n\t\t\tfinalDate = new Date(utc - offset);\n\n\t\t\tif (finalDate.toString() == \"Invalid Date\")\n\t\t\t{\n\t\t\t\tthrow new Error(\"This date does not conform to W3CDTF.\");\n\t\t\t}\n\t\t}\n\t\tcatch (e:Error)\n\t\t{\n\t\t\tvar eStr:String = \"Unable to parse the string [\" + str + \"] into a date. \";\n\t\t\teStr += \"The internal error was: \" + e.toString();\n\t\t\tthrow new Error(eStr);\n\t\t}\n\t\treturn finalDate;\n\t}\n}"
  },
  {
    "path": "src/utils/date/timeCode.as",
    "content": "package utils.date {\n\n\t/**\n\t * Utility function for generating time code given a number seconds.\n\t * @param sec Seconds\n\t * @return Timecode\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function timeCode(sec:Number):String {\n\t\tvar h:Number = Math.floor(sec / 3600);\n\t\tvar m:Number = Math.floor((sec % 3600) / 60);\n\t\tvar s:Number = Math.floor((sec % 3600) % 60);\n\n\t\treturn (h == 0 ? \"\" \n\t\t\t: (h < 10 ? \"0\" + String(h) + \":\" : String(h) + \":\")) \n\t\t\t+ (m < 10 ? \"0\" + String(m) : String(m)) + \":\" \n\t\t\t+ (s < 10 ? \"0\" + String(s) : String(s));\n\t}\n}\n"
  },
  {
    "path": "src/utils/date/toW3CDTF.as",
    "content": "package utils.date\n{\n\t/**\n\t * Returns a date string formatted according to W3CDTF.\n\t *\n\t * @param d\n\t * @param includeMilliseconds Determines whether to include the\n\t * milliseconds value (if any) in the formatted string.\n\t *\n\t * @returns String\n\t *\n\t * @langversion ActionScript 3.0\n\t * @playerversion Flash 9.0\n\t * @tiptext\n\t *\n\t * @see http://www.w3.org/TR/NOTE-datetime\n\t */\n\tpublic function toW3CDTF(d:Date, includeMilliseconds:Boolean = false):String\n\t{\n\t\tvar date:Number = d.getUTCDate();\n\t\tvar month:Number = d.getUTCMonth();\n\t\tvar hours:Number = d.getUTCHours();\n\t\tvar minutes:Number = d.getUTCMinutes();\n\t\tvar seconds:Number = d.getUTCSeconds();\n\t\tvar milliseconds:Number = d.getUTCMilliseconds();\n\t\tvar sb:String = new String();\n\n\t\tsb += String(d.getUTCFullYear());\n\t\tsb += \"-\";\n\n\t\t//thanks to \"dom\" who sent in a fix for the line below\n\t\tif (month + 1 < 10)\n\t\t{\n\t\t\tsb += \"0\";\n\t\t}\n\t\tsb += String(month + 1);\n\t\tsb += \"-\";\n\t\tif (date < 10)\n\t\t{\n\t\t\tsb += \"0\";\n\t\t}\n\t\tsb += String(date);\n\t\tsb += \"T\";\n\t\tif (hours < 10)\n\t\t{\n\t\t\tsb += \"0\";\n\t\t}\n\t\tsb += String(hours);\n\t\tsb += \":\";\n\t\tif (minutes < 10)\n\t\t{\n\t\t\tsb += \"0\";\n\t\t}\n\t\tsb += String(minutes);\n\t\tsb += \":\";\n\t\tif (seconds < 10)\n\t\t{\n\t\t\tsb += \"0\";\n\t\t}\n\t\tsb += String(seconds);\n\t\tif (includeMilliseconds && milliseconds > 0)\n\t\t{\n\t\t\tsb += \".\";\n\t\t\tsb += String(milliseconds);\n\t\t}\n\t\tsb += \"-00:00\";\n\t\treturn sb;\n\t}\n\n\n}"
  },
  {
    "path": "src/utils/date/toggleAMPM.as",
    "content": "package utils.date\n{\n\t/** \n\t * If a date is AM, changes it to PM and vice versa.\n\t * \n\t * @author Mims H. Wright\n\t * \n\t * @param date The Date to flip.\n\t * @returns A new date object, 12 hours later or earlier depending.\n\t */\n\tpublic function toggleAMPM(date:Date):Date\n\t{\n\t\tvar d:Date = new Date(date.time);\n\t\tif (getAMPM(date) == \"PM\") { \n\t\t\td.hours -= 12;\n\t\t} else {\n\t\t\td.hours += 12;\n\t\t}\n\t\treturn d;\n\t}\n}"
  },
  {
    "path": "src/utils/dictionary/CircularDictionary.as",
    "content": "package utils.dictionary\n{\n\timport flash.errors.IllegalOperationError;\n\timport flash.utils.Dictionary;\n\n\t/**\n\t * A dictionary which allows a pairing of two values to point to each other.\n\t * For example, if you have two objects, A and B, A would point to B and \n\t * B would point to A. \n\t * \n\t * @example <listing version=\"3.0\">\n\t * var dict:CircularDictionary = new CircularDictionary();\n\t * dict.addPair(A, B);\n\t * dict.getCounterpartTo(A); // B\n\t * dict.getCounterpartTo(B); // A\n\t * dict.getCounterpartTo(dict.getCounterpartTo(A)); // A\n\t * dict.dictionary[B]; // A. Same as getCounterpartTo(B)\n\t * dict.removePair(B); // removes both A and B.\n\t * </listing>\n\t * \n\t * @author Mims H. Wright\n\t */\n\tpublic class CircularDictionary\n\t{\n\t\tprivate var _dictionary:Dictionary;\n\t\tpublic function get dictionary():Dictionary { return _dictionary; }\n\t\t\n\t\t/**\n\t\t * Constructor.\n\t\t * \n\t\t * @param useWeakReferences Indicates whether the internal dictionary should use weak references. \n\t\t */\n\t\tpublic function CircularDictionary(useWeakReferences:Boolean = false) \n\t\t{\n\t\t\t_dictionary = new Dictionary ( useWeakReferences );\n\t\t}\n\t\t\n\t\t/**\n\t\t * Adds a related pair of values.\n\t\t * \n\t\t * @throws IllegalOperationError If the same key is added more than once.\n\t\t * \n\t\t * @param a The first value (references b)\n\t\t * @param b The second value (references a)\n\t\t */\n\t\tpublic function addPair(a:*, b:*):void {\n\t\t\tif ( _dictionary[a] == undefined && _dictionary[b] == undefined) {\n\t\t\t\t_dictionary[a] = b;\n\t\t\t\t_dictionary[b] = a;\n\t\t\t\treturn;\n\t\t\t} \n\t\t\tthrow new IllegalOperationError (\"You cannot use the same key or value more than once.\");\n\t\t}\n\t\t\n\t\t/**\n\t\t * Removes a related pair of values.\n\t\t * \n\t\t * @param aOrB Either value, a or b. Both references to each other are removed.\n\t\t * @returns The counterpart to whatever value you provided.\n\t\t */\n\t\tpublic function removePair (aOrB:*):* {\n\t\t\tvar counterpart:* = _dictionary[aOrB];\n\t\t\tdelete _dictionary[aOrB];\n\t\t\tdelete _dictionary[counterpart];\n\t\t\treturn counterpart;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Returns the corresponding value to the key you provided. If key = a, \n\t\t * returns b, and vice versa. \n\t\t */ \n\t\tpublic function getCounterpartTo(key:*):* {\n\t\t\treturn _dictionary[key];\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/dictionary/getKeys.as",
    "content": "package utils.dictionary\n{\n\timport flash.utils.Dictionary;\n\n\t/**\n\t *       Returns an Array of all keys within the specified dictionary.\n\t *\n\t *       @param d The Dictionary instance whose keys will be returned.\n\t *\n\t *       @return Array of keys contained within the Dictionary\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function getKeys(d:Dictionary):Array\n\t{\n\t\tvar a:Array = new Array();\n\n\t\tfor (var key:Object in d)\n\t\t{\n\t\t\ta.push(key);\n\t\t}\n\n\t\treturn a;\n\t}\n}"
  },
  {
    "path": "src/utils/dictionary/getValues.as",
    "content": "package utils.dictionary\n{\n\timport flash.utils.Dictionary;\n\n\t/**\n\t *       Returns an Array of all values within the specified dictionary.\n\t *\n\t *       @param d The Dictionary instance whose values will be returned.\n\t *\n\t *       @return Array of values contained within the Dictionary\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function getValues(d:Dictionary):Array\n\t{\n\t\tvar a:Array = new Array();\n\n\t\tfor each (var value:Object in d)\n\t\t{\n\t\t\ta.push(value);\n\t\t}\n\n\t\treturn a;\n\t}\n}"
  },
  {
    "path": "src/utils/display/Alignment.as",
    "content": "package utils.display\n{\n\n\t/**\n\t * @author Justin Windle (justin(at)soulwire.co.uk)\n\t */\n\tpublic class Alignment\n\t{\n\t\t/**\n\t\t * Specifies that alignment is at the bottom.\n\t\t */\n\t\tpublic static const BOTTOM:String = \"B\";\n\t\t/**\n\t\t * Specifies that alignment is in the bottom-left corner.\n\t\t */\n\t\tpublic static const BOTTOM_LEFT:String = \"BL\";\n\t\t/**\n\t\t * Specifies that alignment is in the bottom-right corner.\n\t\t */\n\t\tpublic static const BOTTOM_RIGHT:String = \"BR\";\n\t\t/**\n\t\t * Specifies that alignment is on the left.\n\t\t */\n\t\tpublic static const LEFT:String = \"L\";\n\t\t/**\n\t\t * Specifies that alignment is in the middle\n\t\t */\n\t\tpublic static const MIDDLE:String = \"C\";\n\t\t/**\n\t\t * Specifies that alignment is on the right.\n\t\t */\n\t\tpublic static const RIGHT:String = \"R\";\n\t\t/**\n\t\t * Specifies that alignment is at the top.\n\t\t */\n\t\tpublic static const TOP:String = \"T\";\n\t\t/**\n\t\t * Specifies that alignment is in the top-left corner.\n\t\t */\n\t\tpublic static const TOP_LEFT:String = \"TL\";\n\t\t/**\n\t\t * Specifies that alignment is in the top-right corner.\n\t\t */\n\t\tpublic static const TOP_RIGHT:String = \"TR\";\n\t}\n}\n"
  },
  {
    "path": "src/utils/display/IDisplayObject.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\t\n\t/**\n\t * An interface to work around the lack of interface for display objects.\n\t * Especially useful when you want to type a variable with an interface\n\t * and add it to the stage without type casting to DisplayObject each time\n\t * (and running the risk of an error). \n\t * \n\t * @example <listing version=\"3.0\">\n\t * var d:IDisplayObject = new ClassThatImplementsIDisplayObject();\n\t * addChild(d.asDisplayObject());\n\t * </listing>\n\t * \n\t * @author Mims H. Wright\n\t */\n\tpublic interface IDisplayObject\n\t{\n\t\t/** \n\t\t * Returns a representation of the object as a DisplayObject.\n\t\t * Usually would return the object itself.\n\t\t */ \n\t\tfunction asDisplayObject():DisplayObject;\n\t}\n}"
  },
  {
    "path": "src/utils/display/addChild.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.DisplayObjectContainer;\n\t\n\n\t/**\n\t * Allows you to add a child without first checking that the child or parent exist.\n\t * Allows you to add a child at an index higher than the number of children without error.\n\t * Allows you to use the same function for addChild and addChildAt.\n\t * \n\t * @param child The child DisplayObject to add.\n\t * @param parent The container to add the child to.\n\t * @param atIndex The index to add the child at. Default is to add to the top (-1)\n\t * @return Boolean True if the child was added, false if something prevented it from being added.\n\t * \n\t * @author Mims Wright \n\t */\n\tpublic function addChild(child:DisplayObject, parent:DisplayObjectContainer, atIndex:int = -1):Boolean\n\t{\n\t\tif (child && parent) {\n\t\t\tif (atIndex < 0 || atIndex > parent.numChildren) {\n\t\t\t\tatIndex = parent.numChildren;\n\t\t\t}\n\t\t\tparent.addChildAt(child, atIndex);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}"
  },
  {
    "path": "src/utils/display/applyNaturalScrollRect.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t *   Apply a scroll rect from (0,0) to (width,height)\n\t *   @param dispObj Display object to apply on\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function applyNaturalScrollRect(dispObj:DisplayObject):void\n\t{\n\t\tdispObj.scrollRect = new Rectangle(0, 0, dispObj.width, dispObj.height);\n\t}\n}"
  },
  {
    "path": "src/utils/display/bringForward.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\t\n\timport utils.number.clamp;\n\n\t/**\n\t * Brings the DisplayObject forward in the display list. The <code>steps</code> parameter can be used to jump more than one level.\n\t * @param object the DisplayObject to reorder\n\t * @param steps the number of levels bring the DisplayObject forward\n\t * @return the new index of the DisplayObject\n\t */\n\tpublic function bringForward(object:DisplayObject, steps:uint = 1):int\n\t{\n\t\tif (!object.parent)\n\t\t\treturn -1;\n\n\t\tvar index:int = object.parent.getChildIndex(object) + steps;\n\t\tindex = clamp(index, 0, object.parent.numChildren - 1);\n\n\t\tobject.parent.setChildIndex(object, index);\n\n\t\treturn index;\n\t}\n}"
  },
  {
    "path": "src/utils/display/bringToFront.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\n\timport utils.number.clamp;\n\n\t/**\n\t * Brings the DisplayObject to the front of the display list. The <code>back</code> parameter can be used to pull the DisplayObject back a few levels from the front.\n\t * @param object the DisplayObject to reorder\n\t * @param back the number of levels from the front of the display list\n\t * @return the new index of the DisplayObject\n\t */\n\tpublic function bringToFront(object:DisplayObject, back:uint = 0):int\n\t{\n\t\tif (!object.parent)\n\t\t\treturn -1;\n\n\t\tvar index:int = object.parent.numChildren - (back + 1);\n\t\tindex = clamp(index, 0, object.parent.numChildren - 1);\n\n\t\tobject.parent.setChildIndex(object, index);\n\n\t\treturn index;\n\t}\n}"
  },
  {
    "path": "src/utils/display/centerWithin.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\t\n\t/** \n\t * Centers a display object within the bounds of another based on each of their sizes.\n\t * Note: does not add the object as a child or add to stage or resize either object.\n\t * \n\t * @param objectToPosition The DisplayObject that will be moved.\n\t * @param withinObject The DisplayObject to position within. If left blank, \n\t * \t\t\t\t\t   will attempt to use the object's parent.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function centerWithin(objectToPosition:DisplayObject, withinObject:DisplayObject = null):void {\n\t\tif (!objectToPosition) { return; }\n\t\tif (!withinObject) {\n\t\t\tif (objectToPosition.parent) {\n\t\t\t\twithinObject = objectToPosition.parent;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tobjectToPosition.x = withinObject.x + (withinObject.width - objectToPosition.width)/2;\n\t\tobjectToPosition.y = withinObject.y + (withinObject.height - objectToPosition.height)/2;\n\t}\n}"
  },
  {
    "path": "src/utils/display/createBitmap.as",
    "content": "package utils.display\n{\n\timport flash.display.Bitmap;\n\timport flash.display.BitmapData;\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Returns a Bitmap instance of the supplied DisplayObject.\n\t */\n\tpublic function createBitmap(source:DisplayObject, useSmoothing:Boolean = true):Bitmap\n\t{\n\t\tconst bitmapData:BitmapData = new BitmapData(source.width, source.height, true, 0xffffff);\n\t\tbitmapData.draw(source);\n\n\t\tconst bitmap:Bitmap = new Bitmap(bitmapData);\n\t\tbitmap.smoothing = useSmoothing;\n\n\t\treturn bitmap;\n\t}\n}"
  },
  {
    "path": "src/utils/display/createThumb.as",
    "content": "package utils.display\n{\n\timport flash.display.Bitmap;\n\timport flash.display.BitmapData;\n\timport flash.display.PixelSnapping;\n\n\t/**\n\t * Creates a thumbnail of a BitmapData. The thumbnail can be any size as\n\t * the copied image will be scaled proportionally and cropped if necessary\n\t * to fit into the thumbnail area. If the image needs to be cropped in order\n\t * to fit the thumbnail area, the alignment of the crop can be specified\n\t *\n\t * @param image\n\t *\n\t * The source image for which a thumbnail should be created. The source\n\t * will not be modified\n\t *\n\t * @param width\n\t *\n\t * The width of the thumbnail\n\t *\n\t * @param height\n\t *\n\t * The height of the thumbnail\n\t *\n\t * @param align\n\t *\n\t * If the thumbnail has a different aspect ratio to the source image, although\n\t * the image will be scaled to fit along one axis it will be necessary to crop\n\t * the image. Use this parameter to specify how the copied and scaled image should\n\t * be aligned within the thumbnail boundaries. Use a constant from the Alignment\n\t * enumeration clazz\n\t *\n\t * @param smooth\n\t *\n\t * Whether to apply bitmap smoothing to the thumbnail\n\t */\n\n\tpublic function createThumb(image:BitmapData, width:int, height:int, align:String = \"C\", smooth:Boolean = true):Bitmap\n\t{\n\t\tvar source:Bitmap = new Bitmap(image);\n\t\tvar thumbnail:BitmapData = new BitmapData(width, height, false, 0x0);\n\n\t\tthumbnail.draw(image, fitIntoRect(source, thumbnail.rect, true, align, false), null, null, null, smooth);\n\t\tsource = null;\n\n\t\treturn new Bitmap(thumbnail, PixelSnapping.AUTO, smooth);\n\t}\n}"
  },
  {
    "path": "src/utils/display/cropBitmapData.as",
    "content": "package utils.display {\n\t\n\timport flash.display.BitmapData;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * Crop the BitmapData source and return a new BitmapData.\n\t * @param source Source BitmapData\n\t * @param dest Crop area as Rectangle\n\t * @return Cropped source as BitmapData\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function cropBitmapData(source:BitmapData, dest:Rectangle):BitmapData {\n\t\tvar o:BitmapData = new BitmapData(dest.width, dest.height);\n\t\tvar point:Point = new Point(0, 0);\n\n\t\to.copyPixels(source, dest, point);\n\n\t\treturn o;\n\t}\n}\n"
  },
  {
    "path": "src/utils/display/duplicateDisplayObject.as",
    "content": "package utils.display {\n\timport flash.display.DisplayObject;\n\timport flash.display.Graphics;\n\timport flash.geom.Rectangle;\n\timport flash.system.Capabilities;\n\n\n\n\t/**\n\t * duplicateDisplayObject\n\t * creates a duplicate of the DisplayObject passed.\n\t * similar to duplicateMovieClip in AVM1. If using Flash 9, make sure\n\t * you export for ActionScript the symbol you are duplicating\n\t *\n\t * @param source the display object to duplicate\n\t * @param autoAdd if true, adds the duplicate to the display list\n\t * in which source was located\n\t * @return a duplicate instance of source\n\t *\n\t * @author Trevor McCauley - www.senocular.com\n\t * @author cleaned up by Mims Wright\n\t */\n\tpublic function duplicateDisplayObject(source:DisplayObject, autoAdd:Boolean = false):DisplayObject {\n\t\tvar sourceClass:Class = Class(Object(source).constructor);\n\t\tvar duplicate:DisplayObject = new sourceClass() as DisplayObject;\n\n\t\t// duplicate properties\n\t\tduplicate.transform = source.transform;\n\t\tduplicate.filters = source.filters;\n\t\tduplicate.cacheAsBitmap = source.cacheAsBitmap;\n\t\tduplicate.opaqueBackground = source.opaqueBackground;\n\t\tif(source.scale9Grid) {\n\t\t\tvar rect:Rectangle = source.scale9Grid;\n\n\t\t\t// version check for scale9Grid bug\n\t\t\tif(Capabilities.version.split(\" \")[1] == \"9,0,16,0\") {\n\t\t\t\t// Flash 9 bug where returned scale9Grid as twips\n\t\t\t\trect.x /= 20,rect.y /= 20,rect.width /= 20,rect.height /= 20;\n\t\t\t}\n\n\t\t\tduplicate.scale9Grid = rect;\n\t\t}\n\n\t\t// todo: needs test\n\t\tif(\"graphics\" in source) {\n\t\t\tvar graphics:Graphics = Graphics(source[\"graphics\"]);\n\t\t\tGraphics(duplicate[\"graphics\"]).copyFrom(graphics);\n\t\t}\n\n\t\t// add to target parent's display list\n\t\t// if autoAdd was provided as true\n\t\tif(autoAdd && source.parent) {\n\t\t\tsource.parent.addChild(duplicate);\n\t\t}\n\t\treturn duplicate;\n\t}\n}\n"
  },
  {
    "path": "src/utils/display/filterChildrenByProps.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.DisplayObjectContainer;\n\n\tpublic function filterChildrenByProps(container:DisplayObjectContainer, props:Object):Array\n\t{\n\t\tvar filteredChildren:Array = [];\n\t\tvar child:DisplayObject;\n\n\t\tfor (var i:int = 0, l:int = container.numChildren; i < l; i++)\n\t\t{\n\t\t\tchild = container.getChildAt(i);\n\t\t\tvar isOK:Boolean = true;\n\t\t\tfor (var prop:String in props)\n\t\t\t{\n\t\t\t\tif (child[prop] != props[prop])\n\t\t\t\t{\n\t\t\t\t\tisOK = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isOK)\n\t\t\t\tfilteredChildren.push(child);\n\t\t}\n\t\treturn filteredChildren;\n\t}\n}"
  },
  {
    "path": "src/utils/display/findAncestor.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t *   Search the ancestry for a specific parent object.\n\t *   @param child The display object whose parents to check.\n\t *   @param ancestor The ancestor to check for.\n\t *   @return The ancestor or null.\n\t *   @author Mims H. Wright\n\t */\n\tpublic function findAncestor(child:DisplayObject, ancestor:DisplayObject):DisplayObject\n\t{\n\t\tif (child == ancestor) { return ancestor; }\n\t\tif (child.parent == null) { return null; }\n\t\tif (child.parent == ancestor) { return ancestor; }\n\t\treturn findAncestor(child.parent, ancestor);\n\t}\n}"
  },
  {
    "path": "src/utils/display/findAncestorWithType.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t *   Search the ancestry for a specific parent object.\n\t *   @param child The display object whose parents to check.\n\t *   @param type The type to check for. Should be a class or interface.\n\t *   @return The ancestor or null.\n\t *   @author Mims H. Wright\n\t */\n\tpublic function findAncestorWithType(child:DisplayObject, type:*):*\n\t{\n\t\tif (child.parent == null) { return null; }\n\t\tif (child.parent is type) { return child.parent; }\n\t\treturn findAncestorWithType(child.parent, type);\n\t}\n}"
  },
  {
    "path": "src/utils/display/fitIntoRect.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Matrix;\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * Fits a DisplayObject into a rectangular area with several options for scale\n\t * and alignment. This method will return the Matrix required to duplicate the\n\t * transformation and can optionally apply this matrix to the DisplayObject.\n\t *\n\t * @param displayObject\n\t *\n\t * The DisplayObject that needs to be fitted into the Rectangle.\n\t *\n\t * @param rectangle\n\t *\n\t * A Rectangle object representing the space which the DisplayObject should fit into.\n\t *\n\t * @param fillRect\n\t *\n\t * Whether the DisplayObject should fill the entire Rectangle or just fit within it.\n\t * If true, the DisplayObject will be cropped if its aspect ratio differs to that of\n\t * the target Rectangle.\n\t *\n\t * @param align\n\t *\n\t * The alignment of the DisplayObject within the target Rectangle. Use a constant from\n\t * the DisplayUtils clazz.\n\t *\n\t * @param applyTransform\n\t *\n\t * Whether to apply the generated transformation matrix to the DisplayObject. By setting this\n\t * to false you can leave the DisplayObject as it is but store the returned Matrix for to use\n\t * either with a DisplayObject's transform property or with, for example, BitmapData.draw()\n\t */\n\n\tpublic function fitIntoRect(displayObject:DisplayObject, rectangle:Rectangle, fillRect:Boolean = true, align:String = \"C\", applyTransform:Boolean = true):Matrix\n\t{\n\t\tvar matrix:Matrix = new Matrix();\n\n\t\tvar wD:Number = displayObject.width / displayObject.scaleX;\n\t\tvar hD:Number = displayObject.height / displayObject.scaleY;\n\n\t\tvar wR:Number = rectangle.width;\n\t\tvar hR:Number = rectangle.height;\n\n\t\tvar sX:Number = wR / wD;\n\t\tvar sY:Number = hR / hD;\n\n\t\tvar rD:Number = wD / hD;\n\t\tvar rR:Number = wR / hR;\n\n\t\tvar sH:Number = fillRect ? sY : sX;\n\t\tvar sV:Number = fillRect ? sX : sY;\n\n\t\tvar s:Number = rD >= rR ? sH : sV;\n\t\tvar w:Number = wD * s;\n\t\tvar h:Number = hD * s;\n\n\t\tvar tX:Number = 0.0;\n\t\tvar tY:Number = 0.0;\n\n\t\tswitch (align)\n\t\t{\n\t\t\tcase Alignment.LEFT:\n\t\t\tcase Alignment.TOP_LEFT:\n\t\t\tcase Alignment.BOTTOM_LEFT:\n\t\t\t\ttX = 0.0;\n\t\t\t\tbreak;\n\n\t\t\tcase Alignment.RIGHT:\n\t\t\tcase Alignment.TOP_RIGHT:\n\t\t\tcase Alignment.BOTTOM_RIGHT:\n\t\t\t\ttX = w - wR;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\ttX = 0.5 * (w - wR);\n\t\t}\n\n\t\tswitch (align)\n\t\t{\n\t\t\tcase Alignment.TOP:\n\t\t\tcase Alignment.TOP_LEFT:\n\t\t\tcase Alignment.TOP_RIGHT:\n\t\t\t\ttY = 0.0;\n\t\t\t\tbreak;\n\n\t\t\tcase Alignment.BOTTOM:\n\t\t\tcase Alignment.BOTTOM_LEFT:\n\t\t\tcase Alignment.BOTTOM_RIGHT:\n\t\t\t\ttY = h - hR;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\ttY = 0.5 * (h - hR);\n\t\t}\n\n\t\tmatrix.scale(s, s);\n\t\tmatrix.translate(rectangle.left - tX, rectangle.top - tY);\n\n\t\tif (applyTransform)\n\t\t{\n\t\t\tdisplayObject.transform.matrix = matrix;\n\t\t}\n\n\t\treturn matrix;\n\t}\n}"
  },
  {
    "path": "src/utils/display/getChildren.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObjectContainer;\n\n\t/**\n\t *   Get the children of a container as an array\n\t *   @param container Container to get the children of\n\t *   @return The children of the given container as an array\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function getChildren(container:DisplayObjectContainer):Array\n\t{\n\t\tvar ret:Array = [];\n\n\t\tvar numChildren:int = container.numChildren;\n\t\tfor (var i:int = 0; i < numChildren; ++i)\n\t\t{\n\t\t\tret.push(container.getChildAt(i));\n\t\t}\n\n\t\treturn ret;\n\t}\n}"
  },
  {
    "path": "src/utils/display/getFullBounds.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Matrix;\n\timport flash.geom.Rectangle;\n\timport flash.geom.Transform;\n\n\t/**\n\t * Determines the full bounds of the display object regardless of masking elements.\n\t * @param    displayObject    The display object to analyze.\n\t * @return    the display object dimensions.\n\t */\n\tpublic function getFullBounds(displayObject:DisplayObject):Rectangle\n\t{\n\t\tvar bounds:Rectangle, transform:Transform, toGlobalMatrix:Matrix, currentMatrix:Matrix;\n\n\t\ttransform = displayObject.transform;\n\t\tcurrentMatrix = transform.matrix;\n\t\ttoGlobalMatrix = transform.concatenatedMatrix;\n\t\ttoGlobalMatrix.invert();\n\t\ttransform.matrix = toGlobalMatrix;\n\n\t\tbounds = transform.pixelBounds.clone();\n\n\t\ttransform.matrix = currentMatrix;\n\n\t\treturn bounds;\n\t}\n}"
  },
  {
    "path": "src/utils/display/getParents.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t *   Get the parents of a display object as an array\n\t *   @param obj Object whose parents should be retrieved\n\t *   @param includeSelf If obj should be included in the returned array\n\t *   @param stopAt Display object to stop getting parents at. Passing\n\t *                 null indicates that all parents should be included.\n\t *   @return An array of the parents of the given display object. This\n\t *           includes all parents unless stopAt is non-null. If stopAt is\n\t *           non-null, it and its parents will not be included in the\n\t *           returned array.\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function getParents(obj:DisplayObject, includeSelf:Boolean = true, stopAt:DisplayObject = null):Array\n\t{\n\t\tvar ret:Array = [];\n\n\t\tfor (var cur:DisplayObject = includeSelf ? obj : obj.parent; cur != stopAt && cur != null; cur = cur.parent)\n\t\t{\n\t\t\tret.push(cur);\n\t\t}\n\n\t\treturn ret;\n\t}\n}"
  },
  {
    "path": "src/utils/display/isVisible.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t *   Check if a display object is visible. This checks all of its\n\t *   parents' visibilities.\n\t *   @param obj Display object to check\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function isVisible(obj:DisplayObject):Boolean\n\t{\n\t\tfor (var cur:DisplayObject = obj; cur != null; cur = cur.parent)\n\t\t{\n\t\t\tif (!cur.visible)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}"
  },
  {
    "path": "src/utils/display/localToLocal.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Point;\n\n\t/**\n\t * Translate <code>DisplayObject</code> container position in a new container.\n\t */\n\tpublic function localToLocal(from:DisplayObject, to:DisplayObject):Point\n\t{\n\t\tvar point:Point = new Point();\n\t\tpoint = from.localToGlobal(point);\n\t\tpoint = to.globalToLocal(point);\n\t\treturn point;\n\t}\n}"
  },
  {
    "path": "src/utils/display/moveBy.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Moves a display object by a given x and y position.\n\t * x and y parameters are optional and if either is omitted, the current position will not change. \n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function moveBy(displayObject:DisplayObject, x:Number = NaN, y:Number = NaN):void\n\t{\n\t\tif (isNaN(x)) { x = 0; }\n\t\tif (isNaN(y)) { y = 0; }\n\t\tdisplayObject.x += x;\n\t\tdisplayObject.y += y;\n\t}\n}"
  },
  {
    "path": "src/utils/display/moveTo.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Moves a display object to a given x and y position.\n\t * x and y parameters are optional and if either is omitted, the current position will not change. \n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function moveTo(displayObject:DisplayObject, x:Number = NaN, y:Number = NaN):void\n\t{\n\t\tif (isNaN(x)) { x = displayObject.x; }\n\t\tif (isNaN(y)) { y = displayObject.y; }\n\t\tdisplayObject.x = x;\n\t\tdisplayObject.y = y;\n\t}\n}"
  },
  {
    "path": "src/utils/display/originalHeight.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\n\tpublic function originalHeight(obj:DisplayObject):Number\n\t{\n\t\treturn obj.height / obj.scaleY;\n\t}\n}"
  },
  {
    "path": "src/utils/display/originalWidth.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\n\tpublic function originalWidth(obj:DisplayObject):Number\n\t{\n\t\treturn obj.width / obj.scaleX;\n\t}\n}"
  },
  {
    "path": "src/utils/display/relativePos.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Point;\n\n\tpublic function relativePos(dO1:DisplayObject, dO2:DisplayObject):Point\n\t{\n\t\tvar pos:Point = new Point(0, 0);\n\t\tpos = dO1.localToGlobal(pos);\n\t\tpos = dO2.globalToLocal(pos);\n\t\treturn pos;\n\t}\n}"
  },
  {
    "path": "src/utils/display/removeAllChildren.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObjectContainer;\n\n\t/**\n\t *   Remove all children from a container and leave the bottom few\n\t *   @param container Container to remove from\n\t *   @param leave (optional) Number of bottom children to leave\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function removeAllChildren(container:DisplayObjectContainer, leave:int = 0):void\n\t{\n\t\twhile (container.numChildren > leave)\n\t\t{\n\t\t\tcontainer.removeChildAt(leave);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/display/removeAllChildrenByType.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.DisplayObjectContainer;\n\n\t/**\n\t *  Remove all children of a specific type from a container.\n\t * \n\t * @example <listing version=\"3.0\">\n\t * var s:Sprite = new Sprite();\n\t * s.addChild(new Shape());\n\t * s.addChild(new Shape());\n\t * s.addChild(new MovieClip());\n\t * s.addChild(new Sprite());\n\t * trace(s.numChildren); // 4\n\t * removeAllChildrenByType(s, Shape);\n\t * trace(s.numChildren); // 2\n\t * </listing>\n\t *   \n\t * \t@param container Container to remove from\n\t *  @param the type of children to remove\n\t *  @author John Lindquist\n\t *  @author Mims Wright - Rewrote 2012-10-11\n\t */\n\tpublic function removeAllChildrenByType(container:DisplayObjectContainer, type:Class):void\n\t{\n\t\tvar i:int = 0\n\t\t  , l:int = container.numChildren\n\t\t  , childrenToRemove:Array = []\n\t\t  , child:DisplayObject;\n\t\t\n\t\tfor (;i<l;i+=1)\t{\n\t\t\tchild = container.getChildAt(i);\n\t\t\tif(child is type) {\n\t\t\t\tchildrenToRemove.push(child);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor each (child in childrenToRemove) {\n\t\t\tcontainer.removeChild(child);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/display/removeChild.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.DisplayObjectContainer;\n\n\t/**\n\t * Removes a child from the parent without throwing errors if the child or parent is null\n\t * or if the child isn't a child of the specified parent.\n\t * \n\t * @param child The child DisplayObject to remove.\n\t * @param parent The parent to remove the child from. If none is specified, the function\n\t * \t\t\t\t attempts to get the parent from the child's <code>parent</code> property.\n\t * @return DisplayObject The child that was removed.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function removeChild(child:DisplayObject, parent:DisplayObjectContainer = null):DisplayObject\n\t{\n\t\tif (child) {\n\t\t\tif (!parent) {\n\t\t\t\tif (!child.parent) { // if parent and child.parent are null\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tparent = child.parent;\n\t\t\t}\n\t\t\tif (parent == child.parent) {\n\t\t\t\tparent.removeChild(child);\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n}"
  },
  {
    "path": "src/utils/display/removeChildAt.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.DisplayObjectContainer;\n\n\t/**\n\t * Removes the child at the index specified in a container and returns it.\n\t * Automatically handles cases that could potentially throw errors such as the index\n\t * being out of bounds or the parent being null.\n\t * \n\t * @param parent The container to remove the child from.\n\t * @param index The index to remove. If left blank or if out of bounds, defaults to the top child.\n\t * @return DisplayObject The child that was removed.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function removeChildAt(parent:DisplayObjectContainer, index:int = -1):DisplayObject\n\t{\n\t\tif (parent && parent.numChildren > 0) {\n\t\t\tif (index < 0 || index > parent.numChildren) { index = parent.numChildren; }\n\t\t\tvar child:DisplayObject = parent.removeChildAt(index);\n\t\t}\n\t\treturn null;\n\t}\n}"
  },
  {
    "path": "src/utils/display/scheduleForNextFrame.as",
    "content": "package utils.display {\n\t\n\timport flash.display.Shape;\n\timport flash.events.Event;\n\n\t/**\n\t * Wait for a next frame.\n\t * Prevents high CPU state, when AVM doesn't send ENTER_FRAMES. It just simply waits until it gets one.\n\t * @param callback Function to call once when next frame is displayed\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function scheduleForNextFrame(callback:Function):void {\n\t\tvar obj:Shape = new Shape();\n\n\t\tobj.addEventListener(Event.ENTER_FRAME, function(ev:Event):void {\n\t\t\tobj.removeEventListener(Event.ENTER_FRAME, arguments.callee);\n\t\t\tcallback();\n\t\t});\n\t}\n}\n"
  },
  {
    "path": "src/utils/display/sendBackward.as",
    "content": "package utils.display\n{\n\t\n\timport flash.display.DisplayObject;\n\t\n\timport utils.number.clamp;\n\n\t/**\n\t * Sends the DisplayObject back in the display list. The <code>steps</code> parameter can be used to jump more than one level.\n\t * @param object the DisplayObject to reorder\n\t * @param steps the number of levels send the DisplayObject backward\n\t * @return the new index of the DisplayObject\n\t */\n\tpublic function sendBackward(object:DisplayObject, steps:uint = 1):int\n\t{\n\t\tif (!object.parent)\n\t\t\treturn -1;\n\n\t\tvar index:int = object.parent.getChildIndex(object) - steps;\n\t\tindex = clamp(index, 0, object.parent.numChildren - 1);\n\n\t\tobject.parent.setChildIndex(object, index);\n\n\t\treturn index;\n\t}\n}"
  },
  {
    "path": "src/utils/display/sendToBack.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\t\n\timport utils.number.clamp;\n\n\n\t/**\n\t * Sends the DisplayObject to the back of the display list. The <code>forward</code> parameter can be used to bring the DisplayObject forward a few levels from the back.\n\t * @param object the DisplayObject to reorder\n\t * @param forward the number of levels from the back of the display list\n\t * @return the new index of the DisplayObject\n\t */\n\tpublic function sendToBack(object:DisplayObject, forward:uint = 0):int\n\t{\n\t\tif (!object.parent)\n\t\t\treturn -1;\n\n\t\tvar index:int = clamp(forward, 0, object.parent.numChildren - 1);\n\n\t\tobject.parent.setChildIndex(object, index);\n\n\t\treturn index;\n\t}\n}"
  },
  {
    "path": "src/utils/display/setProperties.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\n\tpublic function setProperties(children:Array, props:Object):void\n\t{\n\t\tvar child:DisplayObject;\n\t\tfor (var i:int = 0, l:int = children.length; i < l; i++)\n\t\t{\n\t\t\tchild = children[i];\n\t\t\tfor (var prop:String in props)\n\t\t\t{\n\t\t\t\tchild[prop] = props[prop];\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/display/showChildren.as",
    "content": "/**\n * Created by ${PRODUCT_NAME}.\n * User: jlindqui\n * Date: 3/9/11\n * Time: 10:21 AM\n * To change this template use File | Settings | File Templates.\n */\npackage utils.display\n{\n    import flash.display.DisplayObject;\n    import flash.display.DisplayObjectContainer;\n\n\t/**\n\t * \n\t * @param displayObjectContainer - the DisplayObjectContainer that you want to see all the children of\n\t * This is useful for visual debugging of hidden objects.\n\t */\n    public function showChildren(displayObjectContainer:DisplayObjectContainer):void\n    {\n        var i:int = 0;\n        while (i < displayObjectContainer.numChildren)\n        {\n            var childAt:DisplayObject = displayObjectContainer.getChildAt(i);\n            childAt.visible = true;\n            if (childAt is DisplayObjectContainer)\n            {\n                showChildren(DisplayObjectContainer(childAt));\n            }\n            i++;\n        }\n    }\n}\n"
  },
  {
    "path": "src/utils/display/stopAllTimelines.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.DisplayObjectContainer;\n\timport flash.display.MovieClip;\n\n\t/**\n\t * Stops all timelines of the specified display object and its children.\n\t * @param    displayObject    The display object to loop through.\n\t */\n\tpublic function stopAllTimelines(displayObject:DisplayObjectContainer):void\n\t{\n\t\tvar numChildren:int = displayObject.numChildren;\n\n\t\tfor (var i:int = 0; i < numChildren; i++)\n\t\t{\n\t\t\tvar child:DisplayObject = displayObject.getChildAt(i);\n\n\t\t\tif (child is DisplayObjectContainer)\n\t\t\t{\n\t\t\t\tif (child is MovieClip)\n\t\t\t\t{\n\t\t\t\t\tMovieClip(child).stop();\n\t\t\t\t}\n\n\t\t\t\tstopAllTimelines(child as DisplayObjectContainer);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/display/sumProps.as",
    "content": "package utils.display\n{\n\tpublic function sumProps(children:Array, prop:String):Number\n\t{\n\t\tvar sum:Number = 0;\n\t\tfor (var i:int = 0, l:int = children.length; i < l; i++)\n\t\t{\n\t\t\tsum += children[i][prop];\n\t\t}\n\t\treturn sum;\n\t}\n}"
  },
  {
    "path": "src/utils/display/traceChildren.as",
    "content": "package utils.display {\n\t\n\timport flash.display.DisplayObject;\n\timport flash.display.DisplayObjectContainer;\n\n\t/**\n\t * trace() children of the DisplayObjectContainer.\n\t * @param container DisplayObjectContainer to get children of\n\t * @param indentLevel Indentation level (default 0)\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function traceChildren(container:DisplayObjectContainer, indentLevel:int = 0):void {\n\t\tfor(var i:int = 0; i < container.numChildren; i++) {\n\t\t\tvar thisChild:DisplayObject = container.getChildAt(i);\n\t\t\tvar output:String = \"\";\n\n\t\t\tfor(var j:int = 0; j < indentLevel; j++) { \n\t\t\t\toutput += \"   \";\n\t\t\t}\n\n\t\t\toutput += \"+  \" + thisChild.name + \" = \" + String(thisChild);\n\n\t\t\ttrace(output);\n\n\t\t\tif(thisChild is DisplayObjectContainer) { \n\t\t\t\ttraceChildren(DisplayObjectContainer(thisChild), indentLevel + 1);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/utils/display/transformToFitRect.as",
    "content": "package utils.display\n{\n\timport flash.display.DisplayObject;\n\timport flash.geom.Rectangle;\n\t\n\t/**\n\t * Moves and resizes a display object to fit within a rectangle.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function transformToFitRect(displayObject:DisplayObject, rectangle:Rectangle):void\n\t{\n\t\tdisplayObject.x = rectangle.x;\n\t\tdisplayObject.y = rectangle.y;\n\t\tdisplayObject.width = rectangle.width;\n\t\tdisplayObject.height = rectangle.height;\n\t}\n}"
  },
  {
    "path": "src/utils/display/wait.as",
    "content": "package utils.display\n{\n\timport flash.display.Shape;\n\timport flash.events.Event;\n\n\t/**\n\t *   Wait a given number of frames then call a callback\n\t *   @param numFrames Number of frames to wait before calling the callback\n\t *   @param callback Function to call once the given number of frames have passed\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function wait(numFrames:uint, callback:Function):void\n\t{\n\t\tvar obj:Shape = new Shape();\n\t\tobj.addEventListener(\n\t\t\tEvent.ENTER_FRAME,\n\t\t\tfunction(ev:Event):void\n\t\t\t{\n\t\t\t\tnumFrames--;\n\t\t\t\tif (numFrames == 0)\n\t\t\t\t{\n\t\t\t\t\tobj.removeEventListener(Event.ENTER_FRAME, arguments.callee);\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t\t);\n\t}\n}"
  },
  {
    "path": "src/utils/draw/createCircleShape.as",
    "content": "package utils.draw\n{\n\timport flash.display.Graphics;\n\timport flash.display.Shape;\n\n\t/**\n\t *   Create a shape that is a simple solid color-filled circle\n\t * \n\t *   @param r Radius of the circle.\n\t *   @param color Color of the circle. Default is black.\n\t *   @param alpha Alpha of the circle. Default is full opacity.\n\t *   @param x Initial x position\n\t *   @param y Initial y position\n\t *   @return The created shape\n\t * \n\t *   @author Mims Wright\n\t */\n\tpublic function createCircleShape (r:Number, color:uint = 0, alpha:Number = 1, x:Number = 0, y:Number = 0):Shape\n\t{\n\t\tvar circle:Shape = new Shape();\n\t\tvar g:Graphics = circle.graphics;\n\t\tg.beginFill(color, alpha);\n\t\tg.drawCircle(0,0,r);\n\t\tg.endFill();\n\t\t\n\t\tcircle.x = x;\n\t\tcircle.y = y;\n\t\t\n\t\treturn circle;\n\t}\n}"
  },
  {
    "path": "src/utils/draw/createEllipseShape.as",
    "content": "package utils.draw\n{\n\timport flash.display.Graphics;\n\timport flash.display.Shape;\n\n\t/**\n\t *   Create a shape that is a simple solid color-filled ellipse\n\t * \n\t *   @param w Width of the ellipse.\n\t *   @param h Height of the ellipse.\n\t *   @param color Color of the ellipse. Default is black.\n\t *   @param alpha Alpha of the ellipse. Default is full opacity.\n\t *   @param x Initial x position\n\t *   @param y Initial y position\n\t *   @return The created shape\n\t * \n\t *   @author Mims Wright\n\t */\n\tpublic function createEllipseShape(w:Number, h:Number = 0, color:uint = 0, alpha:Number = 1, x:Number = 0, y:Number = 0):Shape\n\t{\n\t\tif (h <= 0) {\n\t\t\th = w;\n\t\t}\n\t\t\n\t\tvar ellipse:Shape = new Shape();\n\t\tvar g:Graphics = ellipse.graphics;\n\t\tg.beginFill(color, alpha);\n\t\tg.drawEllipse(0,0,w,h);\n\t\tg.endFill();\n\t\t\n\t\tellipse.x = x;\n\t\tellipse.y = y;\n\t\t\n\t\treturn ellipse;\n\t}\n}"
  },
  {
    "path": "src/utils/draw/createRectangleShape.as",
    "content": "package utils.draw\n{\n\timport flash.display.Graphics;\n\timport flash.display.Shape;\n\n\t/**\n\t *   Create a shape that is a simple solid color-filled rectangle\n\t * \n\t *   @param width Width of the rectangle\n\t *   @param height Height of the rectangle\n\t *   @param color Color of the rectangle. Default is black.\n\t *   @param alpha Alpha of the rectangle. Default is full opacity.\n\t *   @param x Initial x position\n\t *   @param y Initial y position\n\t *   @return The created shape\n\t *   @author Jackson Dunstan, modified by Mims Wright\n\t */\n\tpublic function createRectangleShape(width:uint, height:uint, color:uint = 0, alpha:Number = 1, x:Number = 0, y:Number = 0):Shape\n\t{\n\t\tvar rect:Shape = new Shape();\n\n\t\tvar g:Graphics = rect.graphics;\n\t\tg.beginFill(color, alpha);\n\t\tg.drawRect(0, 0, width, height);\n\t\tg.endFill();\n\t\t\n\t\trect.x = x;\n\t\trect.y = y;\n\n\t\treturn rect;\n\t}\n}"
  },
  {
    "path": "src/utils/draw/drawRoundRect.as",
    "content": "package utils.draw\n{\n\timport flash.display.Graphics;\n\n\t/**\n\t   Draws a rounded rectangle. Act identically to <code>Graphics.drawRoundRect</code> but allows the specification of which corners are rounded.\n\n\t   @param graphics: The location where drawing should occur.\n\t   @param x: The horizontal position of the rectangle.\n\t   @param y: The vertical position of the rectangle.\n\t   @param width: The width of the rectangle.\n\t   @param height: The height of the rectangle.\n\t   @param ellipseWidth: The width in pixels of the ellipse used to draw the rounded corners.\n\t   @param ellipseHeight: The height in pixels of the ellipse used to draw the rounded corners.\n\t   @param topLeft: Specifies if the top left corner of the rectangle should be rounded <code>true</code>, or should be square <code>false</code>.\n\t   @param topRight:Specifies if the top right corner of the rectangle should be rounded <code>true</code>, or should be square <code>false</code>.\n\t   @param bottomRight: Specifies if the bottom right corner of the rectangle should be rounded <code>true</code>, or should be square <code>false</code>.\n\t   @param bottomLeft: Specifies if the bottom left corner of the rectangle should be rounded <code>true</code>, or should be square <code>false</code>.\n\t   @usage\n\t   <code>\n\t   this.graphics.beginFill(0xFF00FF);\n\t   DrawUtil.drawRoundRect(this.graphics, 10, 10, 200, 200, 50, 50, true, false, true, false);\n\t   this.graphics.endFill();\n\t   </code>\n\t */\n\tpublic function drawRoundRect(graphics:Graphics, x:Number, y:Number, width:Number, height:Number, ellipseWidth:Number, ellipseHeight:Number, topLeft:Boolean = true, topRight:Boolean = true,\n\t\t\t\t\t\t\t\t  bottomRight:Boolean = true, bottomLeft:Boolean = true):void\n\t{\n\t\tconst radiusWidth:Number = ellipseWidth * 0.5;\n\t\tconst radiusHeight:Number = ellipseHeight * 0.5;\n\n\t\tif (topLeft)\n\t\t\tgraphics.moveTo(x + radiusWidth, y);\n\t\telse\n\t\t\tgraphics.moveTo(x, y);\n\n\t\tif (topRight)\n\t\t{\n\t\t\tgraphics.lineTo(x + width - radiusWidth, y);\n\t\t\tgraphics.curveTo(x + width, y, x + width, y + radiusHeight);\n\t\t}\n\t\telse\n\t\t\tgraphics.lineTo(x + width, y);\n\n\t\tif (bottomRight)\n\t\t{\n\t\t\tgraphics.lineTo(x + width, y + height - radiusHeight);\n\t\t\tgraphics.curveTo(x + width, y + height, x + width - radiusWidth, y + height);\n\t\t}\n\t\telse\n\t\t\tgraphics.lineTo(x + width, y + height);\n\n\t\tif (bottomLeft)\n\t\t{\n\t\t\tgraphics.lineTo(x + radiusWidth, y + height);\n\t\t\tgraphics.curveTo(x, y + height, x, y + height - radiusHeight);\n\t\t}\n\t\telse\n\t\t\tgraphics.lineTo(x, y + height);\n\n\t\tif (topLeft)\n\t\t{\n\t\t\tgraphics.lineTo(x, y + radiusHeight);\n\t\t\tgraphics.curveTo(x, y, x + radiusWidth, y);\n\t\t}\n\t\telse\n\t\t\tgraphics.lineTo(x, y);\n\t}\n}"
  },
  {
    "path": "src/utils/draw/drawWedge.as",
    "content": "package utils.draw\n{\n\timport flash.display.Graphics;\n\n\timport utils.geom.Ellipse;\n\n\t/**\n\t   Draws a circular wedge.\n\n\t   @param graphics The location where drawing should occur.\n\t   @param ellipse An Ellipse object that contains the size and position of the shape.\n\t   @param startAngle The starting angle of wedge in degrees.\n\t   @param arc The sweep of the wedge in degrees.\n\t   @usage\n\t   <listing version=\"3.0\">\n\t   this.graphics.beginFill(0xFF00FF);\n\t   DrawUtil.drawWedge(this.graphics, new Ellipse(0, 0, 300, 200), 0, 300);\n\t   this.graphics.endFill();\n\t   </listing>\n\t */\n\tpublic function drawWedge(graphics:Graphics, ellipse:Ellipse, startAngle:Number, arc:Number):void\n\t{\n\t\tif (Math.abs(arc) >= 360)\n\t\t{\n\t\t\tgraphics.drawEllipse(ellipse.x, ellipse.y, ellipse.width, ellipse.height);\n\t\t\treturn;\n\t\t}\n\n\t\tstartAngle += 90;\n\n\t\tvar radius:Number = ellipse.width * .5;\n\t\tvar yRadius:Number = ellipse.height * .5;\n\t\tvar x:Number = ellipse.x + radius;\n\t\tvar y:Number = ellipse.y + yRadius;\n\t\tvar segs:Number = Math.ceil(Math.abs(arc) / 45);\n\t\tvar segAngle:Number = -arc / segs;\n\t\tvar theta:Number = -(segAngle / 180) * Math.PI;\n\t\tvar angle:Number = -(startAngle / 180) * Math.PI;\n\t\tvar ax:Number = x + Math.cos(startAngle / 180 * Math.PI) * radius;\n\t\tvar ay:Number = y + Math.sin(-startAngle / 180 * Math.PI) * yRadius;\n\t\tvar angleMid:Number;\n\n\t\tgraphics.moveTo(x, y);\n\t\tgraphics.lineTo(ax, ay);\n\n\t\tvar i:Number = -1;\n\t\twhile (++i < segs)\n\t\t{\n\t\t\tangle += theta;\n\t\t\tangleMid = angle - (theta * .5);\n\n\t\t\tgraphics.curveTo(x + Math.cos(angleMid) * (radius / Math.cos(theta * .5)), y + Math.sin(angleMid) * (yRadius / Math.cos(theta * .5)), x + Math.cos(angle) * radius,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t y + Math.sin(angle) * yRadius);\n\t\t}\n\n\t\tgraphics.lineTo(x, y);\n\t}\n}"
  },
  {
    "path": "src/utils/error/getStackTrace.as",
    "content": "package utils.error\n{\n\t/**\n\t *   Get a stack trace\n\t *   @return A stack trace\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function getStackTrace():String\n\t{\n\t\treturn new Error().getStackTrace();\n\t}\n}"
  },
  {
    "path": "src/utils/frame/addFrameScript.as",
    "content": "package utils.frame\n{\n\timport flash.display.MovieClip;\n\n\t/**\n\t   Calls a specified method when a specific frame is reached in a MovieClip timeline.\n\n\t   @param target: The MovieClip that contains the <code>frame</code>.\n\t   @param frame: The frame to be notified when reached. Can either be a frame number (<code>uint</code>), or the frame label (<code>String</code>).\n\t   @param notify: The function that will be called when the frame is reached.\n\t   @return Returns <code>true</code> if the frame was found; otherwise <code>false</code>.\n\t   @throws ArguementTypeError if you pass a type other than a <code>String</code> or <code>uint</code> to parameter <code>frame</code>.\n\t */\n\tpublic function addFrameScript(target:MovieClip, frame:*, notify:Function):Boolean\n\t{\n\t\tif (frame is String)\n\t\t\tframe = getFrameNumberForLabel(target, frame);\n\t\telse if (!(frame is uint))\n\t\t\tthrow new Error('frame');\n\n\t\tif (frame == -1 || frame == 0 || frame > target.totalFrames)\n\t\t\treturn false;\n\n\t\ttarget.addFrameScript(frame - 1, notify);\n\n\t\treturn true;\n\t}\n}"
  },
  {
    "path": "src/utils/frame/getFrameNumberForLabel.as",
    "content": "package utils.frame\n{\n\timport flash.display.MovieClip;\n\n\t/**\n\t   Determines the frame number for the specified label.\n\n\t   @param target: The MovieClip to search for the frame label in.\n\t   @param label: The name of the frame label.\n\t   @return The frame number of the label or <code>-1</code> if the frame label was not found.\n\t */\n\tpublic function getFrameNumberForLabel(target:MovieClip, label:String):int\n\t{\n\t\tvar labels:Array = target.currentLabels;\n\t\tvar l:int = labels.length;\n\n\t\twhile (l--)\n\t\t\tif (labels[l].name == label)\n\t\t\t\treturn labels[l].frame;\n\n\t\treturn -1;\n\t}\n}"
  },
  {
    "path": "src/utils/frame/removeFrameScript.as",
    "content": "package utils.frame\n{\n\timport flash.display.MovieClip;\n\n\t/**\n\t   Removes a frame from triggering/calling a function when reached.\n\n\t   @param target: The MovieClip that contains the <code>frame</code>.\n\t   @param frame: The frame to remove notification from. Can either be a frame number (<code>uint</code>), or the frame label (<code>String</code>).\n\t   @throws ArguementTypeError if you pass a type other than a <code>String</code> or <code>uint</code> to parameter <code>frame</code>.\n\t */\n\tpublic function removeFrameScript(target:MovieClip, frame:*):void\n\t{\n\t\tif (frame is String)\n\t\t\tframe = getFrameNumberForLabel(target, frame);\n\t\telse if (!(frame is uint))\n\t\t\tthrow new Error('frame');\n\n\t\tif (frame == -1 || frame == 0 || frame > target.totalFrames)\n\t\t\treturn;\n\n\t\ttarget.addFrameScript(frame - 1, null);\n\t}\n}"
  },
  {
    "path": "src/utils/fullscreen/toggleFullScreen.as",
    "content": "package utils.fullscreen\n{\n\timport flash.display.Stage;\n\timport flash.display.StageDisplayState;\n\n\t/**\n\t * Toggles the stage display state between normal and fullscreen.\n\t * \n\t * @param stage A reference to the stage object.\n\t * @returns String The new state.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function toggleFullScreen(stage:Stage):String\n\t{\n\t\tvar state:String;\n\t\tif (stage.displayState == StageDisplayState.FULL_SCREEN) {\n\t\t\tstate = StageDisplayState.NORMAL;\n\t\t} else {\n\t\t\tstate = StageDisplayState.FULL_SCREEN;\n\t\t}\n\t\tstage.displayState = state;\n\t\treturn state;\n\t}\n}"
  },
  {
    "path": "src/utils/garbageCollection/gc.as",
    "content": "package utils.garbageCollection\n{\n\timport flash.net.LocalConnection;\n\n\t// TODO: Needs documentation\n\tpublic function gc():void\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew LocalConnection().connect(\"gc\");\n\t\t\tnew LocalConnection().connect(\"gc\");\n\t\t}\n\t\tcatch (e:Error)\n\t\t{\n\t\t\tvar shouldTouchHere:Boolean = true;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/geom/Direction.as",
    "content": "package utils.geom\n{\n\t\n\t/**\n\t * An enumeration of the four cardinal directions.\n\t * Mirrors the directions in Side.\n\t * \n\t * Make a hybrid direction using '|', e.g. <code>var NW:int = NORTH | WEST;</code>\n\t * \n\t * @author Mims Wright\n\t * \n\t * @see utils.geom.Side\n\t */\t\n\tpublic class Direction\n\t{\n\t\tpublic static const UP:int = 1;\n\t\tpublic static const DOWN:int = 2;\n\t\tpublic static const LEFT:int = 4;\n\t\tpublic static const RIGHT:int = 8;\n\t\t\n\t\tpublic static const NORTH:int = UP;\n\t\tpublic static const SOUTH:int = DOWN;\n\t\tpublic static const WEST:int = LEFT;\n\t\tpublic static const EAST:int = RIGHT;\n\t\t\n\t\tpublic static const NONE:int = 0;\n\t\tpublic static const ALL:int = UP | DOWN | LEFT | RIGHT;\n\t}\n}"
  },
  {
    "path": "src/utils/geom/Ellipse.as",
    "content": "/*\n   CASA Lib for ActionScript 3.0\n   Copyright (c) 2010, Aaron Clinger & Contributors of CASA Lib\n   All rights reserved.\n\n   Redistribution and use in source and binary forms, with or without\n   modification, are permitted provided that the following conditions are met:\n\n   - Redistributions of source code must retain the above copyright notice,\n   this list of conditions and the following disclaimer.\n\n   - Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n   - Neither the name of the CASA Lib nor the names of its contributors\n   may be used to endorse or promote products derived from this software\n   without specific prior written permission.\n\n   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n   POSSIBILITY OF SUCH DAMAGE.\n */\npackage utils.geom\n{\n\timport flash.geom.Point;\n\n\t/**\n\t   Stores position and size of an ellipse (circle or oval).\n\n\t   @author Aaron Clinger\n\t   @author Mike Creighton\n\t   @version 04/13/08\n\t */\n\tpublic class Ellipse\n\t{\n\t\tprotected var _x:Number;\n\t\tprotected var _y:Number;\n\t\tprotected var _width:Number;\n\t\tprotected var _height:Number;\n\n\n\t\t/**\n\t\t   Creates new Ellipse object.\n\n\t\t   @param x: The horizontal position of the ellipse.\n\t\t   @param y: The vertical position of the ellipse.\n\t\t   @param width: Width of the ellipse at its widest horizontal point.\n\t\t   @param height: Height of the ellipse at its tallest point.\n\t\t */\n\t\tpublic function Ellipse(x:Number, y:Number, width:Number, height:Number)\n\t\t{\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t}\n\n\t\t/**\n\t\t   The horizontal coordinate of the point.\n\t\t */\n\t\tpublic function get x():Number\n\t\t{\n\t\t\treturn this._x;\n\t\t}\n\n\t\tpublic function set x(xPos:Number):void\n\t\t{\n\t\t\tthis._x = xPos;\n\t\t}\n\n\t\t/**\n\t\t   The vertical coordinate of the point.\n\t\t */\n\t\tpublic function get y():Number\n\t\t{\n\t\t\treturn this._y;\n\t\t}\n\n\t\tpublic function set y(yPos:Number):void\n\t\t{\n\t\t\tthis._y = yPos;\n\t\t}\n\n\t\t/**\n\t\t   The width of the ellipse.\n\t\t */\n\t\tpublic function get width():Number\n\t\t{\n\t\t\treturn this._width;\n\t\t}\n\n\t\tpublic function set width(width:Number):void\n\t\t{\n\t\t\tthis._width = width;\n\t\t}\n\n\t\t/**\n\t\t   The height of the rectangle.\n\t\t */\n\t\tpublic function get height():Number\n\t\t{\n\t\t\treturn this._height;\n\t\t}\n\n\t\tpublic function set height(height:Number):void\n\t\t{\n\t\t\tthis._height = height;\n\t\t}\n\n\t\t/**\n\t\t   The center of the ellipse.\n\t\t */\n\t\tpublic function get center():Point\n\t\t{\n\t\t\treturn new Point(this.x + this.width * 0.5, this.y + this.height * 0.5);\n\t\t}\n\n\t\tpublic function set center(c:Point):void\n\t\t{\n\t\t\tthis.x = c.x - this.width * 0.5;\n\t\t\tthis.y = c.y - this.height * 0.5;\n\t\t}\n\n\t\t/**\n\t\t   The size of the ellipse, expressed as a Point object with the values of the width and height properties.\n\t\t */\n\t\tpublic function get size():Point\n\t\t{\n\t\t\treturn new Point(this.width, this.height);\n\t\t}\n\n\t\t/**\n\t\t   The circumference of the ellipse.\n\n\t\t   @usageNote Calculating the circumference of an ellipse is difficult; this is an approximation but should be fine for most cases.\n\t\t */\n\t\tpublic function get perimeter():Number\n\t\t{\n\t\t\treturn (Math.sqrt(.5 * (Math.pow(this.width, 2) + Math.pow(this.height, 2))) * Math.PI * 2) * 0.5;\n\t\t}\n\n\t\t/**\n\t\t   The area of the ellipse.\n\t\t */\n\t\tpublic function get area():Number\n\t\t{\n\t\t\treturn Math.PI * (this.width * 0.5) * (this.height * 0.5);\n\t\t}\n\n\t\t/**\n\t\t   Finds the <code>x</code>, <code>y</code> position of the degree along the circumference of the ellipse.\n\n\t\t   @param degree: Number representing a degree on the ellipse.\n\t\t   @return A Point object.\n\t\t   @usageNote <code>degree</code> can be over 360 or even negitive numbers; minding <code>0 = 360 = 720</code>, <code>540 = 180</code>, <code>-90 = 270</code>, etc.\n\t\t */\n\t\tpublic function getPointOfDegree(degree:Number):Point\n\t\t{\n\t\t\tvar radian:Number = (degree - 90) * (Math.PI / 180);\n\t\t\tvar xRadius:Number = this.width * 0.5;\n\t\t\tvar yRadius:Number = this.height * 0.5;\n\n\t\t\treturn new Point(this.x + xRadius + Math.cos(radian) * xRadius, this.y + yRadius + Math.sin(radian) * yRadius);\n\t\t}\n\n\t\t/**\n\t\t   Finds if point is contained inside the ellipse perimeter.\n\n\t\t   @param point: A Point object.\n\t\t   @return Returns <code>true</code> if shape's area contains point; otherwise <code>false</code>.\n\t\t */\n\t\tpublic function containsPoint(point:Point):Boolean\n\t\t{\n\t\t\tvar xRadius:Number = this.width * 0.5;\n\t\t\tvar yRadius:Number = this.height * 0.5;\n\t\t\tvar xTar:Number = point.x - this.x - xRadius;\n\t\t\tvar yTar:Number = point.y - this.y - yRadius;\n\n\t\t\treturn Math.pow(xTar / xRadius, 2) + Math.pow(yTar / yRadius, 2) <= 1;\n\t\t}\n\n\t\t/**\n\t\t   Determines if the Ellipse specified in the <code>ellipse</code> parameter is equal to this Ellipse object.\n\n\t\t   @param ellipse: An Ellipse object.\n\t\t   @return Returns <code>true</code> if object is equal to this Ellipse; otherwise <code>false</code>.\n\t\t */\n\t\tpublic function equals(ellipse:Ellipse):Boolean\n\t\t{\n\t\t\treturn this.x == ellipse.x && this.y == ellipse.y && this.width == ellipse.width && this.height == ellipse.height;\n\t\t}\n\n\t\t/**\n\t\t   @return A new Ellipse object with the same values as this Ellipse.\n\t\t */\n\t\tpublic function clone():Ellipse\n\t\t{\n\t\t\treturn new Ellipse(this.x, this.y, this.width, this.height);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/geom/Point3d.as",
    "content": "/*\n   CASA Lib for ActionScript 3.0\n   Copyright (c) 2010, Aaron Clinger & Contributors of CASA Lib\n   All rights reserved.\n\n   Redistribution and use in source and binary forms, with or without\n   modification, are permitted provided that the following conditions are met:\n\n   - Redistributions of source code must retain the above copyright notice,\n   this list of conditions and the following disclaimer.\n\n   - Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n   - Neither the name of the CASA Lib nor the names of its contributors\n   may be used to endorse or promote products derived from this software\n   without specific prior written permission.\n\n   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n   POSSIBILITY OF SUCH DAMAGE.\n */\npackage utils.geom\n{\n\n\timport utils.math.Percent;\n\n\timport utils.number.interpolate;\n\n\t/**\n\t   Stores location of a point in a three-dimensional coordinate system, where x represents the horizontal axis, y represents the vertical axis, z represents the axis that is vertically perpendicular to the x/y axis or depth.\n\n\t   @author Aaron Clinger\n\t   @author David Bliss\n\t   @author Mike Creighton\n\t   @version 09/23/08\n\t */\n\tpublic class Point3d\n\t{\n\t\tprotected var _x:Number;\n\t\tprotected var _y:Number;\n\t\tprotected var _z:Number;\n\n\n\t\t/**\n\t\t   Creates a new Point3d.\n\n\t\t   @param x: The horizontal coordinate of the point.\n\t\t   @param y: The vertical coordinate of the point.\n\t\t   @param z: The depth coordinate of the point.\n\t\t */\n\t\tpublic function Point3d(x:Number = 0, y:Number = 0, z:Number = 0)\n\t\t{\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\t\t}\n\n\t\t/**\n\t\t   The horizontal coordinate of the point.\n\t\t */\n\t\tpublic function get x():Number\n\t\t{\n\t\t\treturn this._x;\n\t\t}\n\n\t\tpublic function set x(position:Number):void\n\t\t{\n\t\t\tthis._x = position;\n\t\t}\n\n\t\t/**\n\t\t   The vertical coordinate of the point.\n\t\t */\n\t\tpublic function get y():Number\n\t\t{\n\t\t\treturn this._y;\n\t\t}\n\n\t\tpublic function set y(position:Number):void\n\t\t{\n\t\t\tthis._y = position;\n\t\t}\n\n\t\t/**\n\t\t   The depth coordinate of the point.\n\t\t */\n\t\tpublic function get z():Number\n\t\t{\n\t\t\treturn this._z;\n\t\t}\n\n\t\tpublic function set z(position:Number):void\n\t\t{\n\t\t\tthis._z = position;\n\t\t}\n\n\t\t/**\n\t\t   Adds the coordinates of another Point3d to the coordinates of this point to create a new Point3d.\n\n\t\t   @param point: The point to be added.\n\t\t   @return The new point.\n\t\t */\n\t\tpublic function add(point:Point3d):Point3d\n\t\t{\n\t\t\treturn new Point3d(this.x + point.x, this.y + point.y, this.z + point.z);\n\t\t}\n\n\t\t/**\n\t\t   Subtracts the coordinates of another Point3d from the coordinates of this point to create a new Point3d.\n\n\t\t   @param point: The point to be subtracted.\n\t\t   @return The new point.\n\t\t */\n\t\tpublic function subtract(point:Point3d):Point3d\n\t\t{\n\t\t\treturn new Point3d(this.x - point.x, this.y - point.y, this.z - point.z);\n\t\t}\n\n\t\t/**\n\t\t   Offsets the Point object by the specified amount.\n\n\t\t   @param xOffset: The amount by which to offset the horizontal coordinate.\n\t\t   @param yOffset: The amount by which to offset the vertical coordinate.\n\t\t   @param zOffset: The amount by which to offset the depth coordinate.\n\t\t */\n\t\tpublic function offset(xOffset:Number, yOffset:Number, zOffset:Number):void\n\t\t{\n\t\t\tthis.x += xOffset;\n\t\t\tthis.y += yOffset;\n\t\t\tthis.z += zOffset;\n\t\t}\n\n\t\t/**\n\t\t   Determines if the point specified in the <code>point</code> parameter is equal to this point object.\n\n\t\t   @param point: A Point3d object.\n\t\t   @return Returns <code>true</code> if shape's location is identical; otherwise <code>false</code>.\n\t\t */\n\t\tpublic function equals(point:Point3d):Boolean\n\t\t{\n\t\t\treturn this.x == point.x && this.y == point.y && this.z == point.z;\n\t\t}\n\n\t\t/**\n\t\t   Creates a copy of this Point3d object.\n\n\t\t   @return A new Point3d with the same values as this point.\n\t\t */\n\t\tpublic function clone():Point3d\n\t\t{\n\t\t\treturn new Point3d(this.x, this.y, this.z);\n\t\t}\n\n\t\t/**\n\t\t   Determines the distance between the first and second points in 3D space.\n\n\t\t   @param firstPoint: The first Point3d.\n\t\t   @param secondPoint: The second Point3d.\n\t\t   @return Distance between the two points.\n\t\t */\n\t\tpublic static function distance(firstPoint:Point3d, secondPoint:Point3d):Number\n\t\t{\n\t\t\tvar x:Number = secondPoint.x - firstPoint.x;\n\t\t\tvar y:Number = secondPoint.y - firstPoint.y;\n\t\t\tvar z:Number = secondPoint.z - firstPoint.z;\n\n\t\t\treturn Math.sqrt(x * x + y * y + z * z);\n\t\t}\n\n\t\t/**\n\t\t   Determines a point between two specified points.\n\n\t\t   @param firstPoint: The first Point3d.\n\t\t   @param secondPoint: The second Point3d.\n\t\t   @param amount: The level of interpolation between the two points. If <code>0%</code>, <code>firstPoint</code> is returned; if <code>100%</code>, <code>secondPoint</code> is returned.\n\t\t   @return The new, interpolated point.\n\t\t */\n\t\tpublic static function interpolate(firstPoint:Point3d, secondPoint:Point3d, amount:Percent):Point3d\n\t\t{\n\t\t\tvar x:Number = utils.number.interpolate(amount, firstPoint.x, secondPoint.x);\n\t\t\tvar y:Number = utils.number.interpolate(amount, firstPoint.y, secondPoint.y);\n\t\t\tvar z:Number = utils.number.interpolate(amount, firstPoint.z, secondPoint.z);\n\n\t\t\treturn new Point3d(x, y, z);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/geom/Side.as",
    "content": "package utils.geom\n{\n\t/**\n\t * An enumeration of the four sides of a rectangle. \n\t * Useful for working with tile engines, creating borders, etc.\n\t */ \n\tpublic class Side\n\t{\n\t\tpublic static const TOP:int = 1;\n\t\tpublic static const BOTTOM:int = 2;\n\t\tpublic static const LEFT:int = 4;\n\t\tpublic static const RIGHT:int = 8;\n\t\t\n\t\tpublic static const NONE:int = 0;\n\t\tpublic static const ALL:int = TOP | BOTTOM | LEFT | RIGHT;\n\t}\n}"
  },
  {
    "path": "src/utils/geom/angle.as",
    "content": "package utils.geom\n{\n\timport flash.geom.Point;\n\n\t/**\n\t   Determines the angle/degree between the first and second point.\n\n\t   @param first: The first Point.\n\t   @param second: The second Point.\n\t   @return The degree between the two points.\n\t */\n\tpublic function angle(first:Point, second:Point):Number\n\t{\n\t\treturn Math.atan2(second.y - first.y, second.x - first.x) / (Math.PI / 180);\n\t}\n}"
  },
  {
    "path": "src/utils/geom/cartesianToPolarCoordinates.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: Sep 30, 2010\n * Time: 11:56:07 AM\n */\npackage utils.geom {\n\n    /**\n\t    Converts cartesian coordinates to polar coordinates.\n\n\t   @param x: The x value of the cartesian point.\n\t   @param y: The y value of the cartesian point.\n\t   @return Returns an array containing polar coordinates r and q.\n\t */\n\n    public function cartesianToPolarCoordinates(x:Number,  y:Number) : Array {\n\n        var r:Number = Math.sqrt(Math.pow(x,2) + Math.pow(y,2));\n        var q:Number = Math.atan(y/x) * (180/Math.PI);\n\n        return [r, q];\n    }\n\n}"
  },
  {
    "path": "src/utils/geom/getRectangleCenter.as",
    "content": "package utils.geom {\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\n\t//TODO: Author?\n\t\n\t/**\n\t * Calculates center Point of a Rectangle.\n\t * \n\t * @param value Rectangle to determine center Point of\n\t */\n\tpublic function getRectangleCenter(value:Rectangle):Point {\n\t\treturn new Point(value.x + (value.width / 2), value.y + (value.height / 2));\n\t}\n}\n"
  },
  {
    "path": "src/utils/geom/getRectanglePerimeter.as",
    "content": "package utils.geom\n{\n\timport flash.geom.Rectangle;\n\n\t/**\n\t   Calculates the perimeter of a rectangle.\n\n\t   @param rect: Rectangle to determine the perimeter of.\n\t */\n\tpublic function getRectanglePerimeter(rect:Rectangle):Number\n\t{\n\t\treturn rect.width * 2 + rect.height * 2;\n\t}\n}"
  },
  {
    "path": "src/utils/geom/polarToCartesianCoordinates.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: Sep 30, 2010\n * Time: 1:00:51 PM\n */\npackage utils.geom {\nimport flash.geom.Point;\n\n    /**\n    * Converts polar coordinates to cartesian coordinates.\n    * @param r The r value of the polar coordinate.\n    * @param q The q value of the polar coordinate in degrees.\n    */\n\n    public function polarToCartesianCoordinates(r:Number, q:Number) : Point {\n\n        var asRadian:Number = q * Math.PI/180;\n\n        var x:Number = r * Math.cos(asRadian);\n        var y:Number = r * Math.sin(asRadian);\n\n        return new Point(x,y);\n    }\n\n}"
  },
  {
    "path": "src/utils/geom/randomPoint.as",
    "content": "package utils.geom\n{\n\timport flash.geom.Point;\n\t\n\timport utils.number.randomIntegerWithinRange;\n\n\t/**\n\t * Returns a randomly generated point (containing int values)\n\t * \n\t * @author Mims H. Wright\n\t */\n\tpublic function randomPoint(xLow:int, xHigh:int, yLow:int, yHigh:int):Point {\n\t\treturn new Point(\n\t\t\trandomIntegerWithinRange(xLow, xHigh),\n\t\t\trandomIntegerWithinRange(yLow, yHigh)\n\t\t);\n\t}\t\t\n}"
  },
  {
    "path": "src/utils/geom/reverseRectangle.as",
    "content": "package utils.geom {\n\timport flash.geom.Rectangle;\n\n\n\t// TODO: What's the point of this? Does this even work? Can a rect have a negative width or height?\n\t// TODO: Author?\n\n\t/**\n\t * Reverse a rectangle.\n\t * \n\t * @param value Source rectangle\n\t * @return Reversed rectangle\n\t */\n\tpublic function reverseRectangle(value:Rectangle):Rectangle {\n\t\treturn new Rectangle(value.left, value.top, -value.width, -value.height);\n\t}\n}\n"
  },
  {
    "path": "src/utils/geom/rotatePoint.as",
    "content": "package utils.geom\n{\n\timport flash.geom.Point;\n\n\timport utils.conversion.degreesToRadians;\n\n\t/**\n\t   Rotates a Point around another Point by the specified angle.\n\n\t   @param point: The Point to rotate.\n\t   @param centerPoint: The Point to rotate this Point around.\n\t   @param angle: The angle (in degrees) to rotate this point.\n\t */\n\tpublic function rotatePoint(point:Point, centerPoint:Point, angle:Number):void\n\t{\n\t\tvar radians:Number = degreesToRadians(angle);\n\t\tvar baseX:Number = point.x - centerPoint.x;\n\t\tvar baseY:Number = point.y - centerPoint.y;\n\n\t\tpoint.x = (Math.cos(radians) * baseX) - (Math.sin(radians) * baseY) + centerPoint.x;\n\t\tpoint.y = (Math.sin(radians) * baseX) + (Math.cos(radians) * baseY) + centerPoint.y;\n\t}\n}"
  },
  {
    "path": "src/utils/geom/roundPoint.as",
    "content": "package utils.geom {\n\timport flash.geom.Point;\n\n\t// todo: author?\n\n\t/**\n\t * Returns a new point with x and y values rounded down to the nearest int.\n\t * \n\t * @param value Source Point to be rounded.\n\t * @return Point A new point with x and y rounded down to an int.\n\t */\n\tpublic function roundPoint(point:Point):Point {\n\t\treturn new Point(int(point.x), int(point.y));\n\t}\n}\n"
  },
  {
    "path": "src/utils/geom/simplifyAngle.as",
    "content": "package utils.geom {\n\n\t/**\n\t * Simplifies the supplied angle to its simplest representation.\n\t * Example code:\n\t *      <pre>\n\t *          var simpAngle:Number = simplifyAngle(725); // returns 5\n\t *          var simpAngle2:Number = simplifyAngle(-725); // returns -5\n\t *      </pre>\n\t * @param angle Angle to simplify in degrees\n\t * @return Supplied angle simplified\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function simplifyAngle(angle:Number):Number {\n\t\tvar _rotations:Number = Math.floor(angle / 360);\n\n\t\treturn (angle >= 0) ? angle - (360 * _rotations) : angle + (360 * _rotations);\n\t}\n}\n"
  },
  {
    "path": "src/utils/geom/trimAngle.as",
    "content": "package utils.geom {\n\n\t/**\n\t * Trims the supplied angle to its 0..360 representation.\n\t * Example code:\n\t *      <pre>\n\t *          var simpAngle:Number = trimAngle(725); // returns 5\n\t *      </pre>\n\t * @param value Angle to trim\n\t * @return Supplied angle trimmed\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function trimAngle(value:Number):Number {\n\t\tvar a:Number = value;\n\n\t\twhile(a < 0) a += 360;\n\t\twhile(a > 360) a -= 360;\n\n\t\treturn a;\n\t}\n}\n"
  },
  {
    "path": "src/utils/html/a.as",
    "content": "package utils.html\n{\n\t/**\n\t * Generate an A HREF tag.\n\t */\n\tpublic function a(href:String, text:String, styleClass:String = null):String\n\t{\n\t\treturn '<a href=\"' + href + '\"' + ((styleClass) ? ' class=\"' + styleClass + '\"' : \"\") + \">\" + text + \"</a>\";\n\t}\n}"
  },
  {
    "path": "src/utils/html/br.as",
    "content": "package utils.html\n{\n\t/**\n\t * Inset a BR with optional newline.\n\t */\n\tpublic function br(addNewline:Boolean = false):String\n\t{\n\t\treturn \"<br/>\" + (addNewline ? \"\\n\" : \"\");\n\t}\n}"
  },
  {
    "path": "src/utils/html/entities.as",
    "content": "package utils.html\n{\n\timport flash.utils.Dictionary;\n\n\tpublic const entities:Dictionary = new Dictionary();\n\tentities[\"\\\"\"] = \"&quot;\";\n\tentities[\"'\"] = \"&apos;\";\n\tentities[\"&\"] = \"&amp;\";\n\tentities[\"<\"] = \"&lt;\";\n\tentities[\">\"] = \"&gt;\";\n\tentities[\" \"] = \"&nbsp;\";\n\tentities[\"\"] = \"&iexcl;\";\n\tentities[\"\"] = \"&curren;\";\n\tentities[\"\"] = \"&cent;\";\n\tentities[\"\"] = \"&pound;\";\n\tentities[\"\"] = \"&yen;\";\n\tentities[\"\"] = \"&brvbar;\";\n\tentities[\"\"] = \"&sect;\";\n\tentities[\"\"] = \"&uml;\";\n\tentities[\"\"] = \"&copy;\";\n\tentities[\"\"] = \"&ordf;\";\n\tentities[\"\"] = \"&laquo;\";\n\tentities[\"\"] = \"&not;\";\n\tentities[\"\"] = \"&shy;\";\n\tentities[\"\"] = \"&reg;\";\n\tentities[\"\"] = \"&trade;\";\n\tentities[\"\"] = \"&macr;\";\n\tentities[\"\"] = \"&deg;\";\n\tentities[\"\"] = \"&plusmn;\";\n\tentities[\"\"] = \"&sup2;\";\n\tentities[\"\"] = \"&sup3;\";\n\tentities[\"\"] = \"&acute;\";\n\tentities[\"\"] = \"&micro;\";\n\tentities[\"\"] = \"&para;\";\n\tentities[\"\"] = \"&middot;\";\n\tentities[\"\"] = \"&cedil;\";\n\tentities[\"\"] = \"&sup1;\";\n\tentities[\"\"] = \"&ordm;\";\n\tentities[\"\"] = \"&raquo;\";\n\tentities[\"\"] = \"&frac14;\";\n\tentities[\"\"] = \"&frac12;\";\n\tentities[\"\"] = \"&frac34;\";\n\tentities[\"\"] = \"&iquest;\";\n\tentities[\"\"] = \"&times;\";\n\tentities[\"\"] = \"&divide;\";\n\tentities[\"\"] = \"&Agrave;\";\n\tentities[\"\"] = \"&Aacute;\";\n\tentities[\"\"] = \"&Acirc;\";\n\tentities[\"\"] = \"&Atilde;\";\n\tentities[\"\"] = \"&Auml;\";\n\tentities[\"\"] = \"&Aring;\";\n\tentities[\"\"] = \"&AElig;\";\n\tentities[\"\"] = \"&Ccedil;\";\n\tentities[\"\"] = \"&Egrave;\";\n\tentities[\"\"] = \"&Eacute;\";\n\tentities[\"\"] = \"&Ecirc;\";\n\tentities[\"\"] = \"&Euml;\";\n\tentities[\"\"] = \"&Igrave;\";\n\tentities[\"\"] = \"&Iacute;\";\n\tentities[\"\"] = \"&Icirc;\";\n\tentities[\"\"] = \"&Iuml;\";\n\tentities[\"\"] = \"&ETH;\";\n\tentities[\"\"] = \"&Ntilde;\";\n\tentities[\"\"] = \"&Ograve;\";\n\tentities[\"\"] = \"&Oacute;\";\n\tentities[\"\"] = \"&Ocirc;\";\n\tentities[\"\"] = \"&Otilde;\";\n\tentities[\"\"] = \"&Ouml;\";\n\tentities[\"\"] = \"&Oslash;\";\n\tentities[\"\"] = \"&Ugrave;\";\n\tentities[\"\"] = \"&Uacute;\";\n\tentities[\"\"] = \"&Ucirc;\";\n\tentities[\"\"] = \"&Uuml;\";\n\tentities[\"\"] = \"&THORN;\";\n\tentities[\"\"] = \"&szlig;\";\n\tentities[\"\"] = \"&agrave;\";\n\tentities[\"\"] = \"&aacute;\";\n\tentities[\"\"] = \"&acirc;\";\n\tentities[\"\"] = \"&atilde;\";\n\tentities[\"\"] = \"&auml;\";\n\tentities[\"\"] = \"&aring;\";\n\tentities[\"\"] = \"&aelig;\";\n\tentities[\"\"] = \"&eacute;\";\n\tentities[\"\"] = \"&euml;\";\n\tentities[\"\"] = \"&igrave;\";\n\tentities[\"\"] = \"&iacute;\";\n\tentities[\"\"] = \"&icirc;\";\n\tentities[\"\"] = \"&iuml;\";\n\tentities[\"\"] = \"&eth;\";\n\tentities[\"\"] = \"&ntilde;\";\n\tentities[\"\"] = \"&ograve;\";\n\tentities[\"\"] = \"&oacute;\";\n\tentities[\"\"] = \"&ocirc;\";\n\tentities[\"\"] = \"&otilde;\";\n\tentities[\"\"] = \"&ouml;\";\n\tentities[\"\"] = \"&oslash;\";\n\tentities[\"\"] = \"&uacute;\";\n\tentities[\"\"] = \"&ucirc;\";\n\tentities[\"\"] = \"&uuml;\";\n\tentities[\"\"] = \"&yacute;\";\n\tentities[\"\"] = \"&thorn;\";\n\tentities[\"\"] = \"&yuml;\";\n\tentities[\"\"] = \"&OElig;\";\n\tentities[\"\"] = \"&oelig;\";\n\tentities[\"\"] = \"&Scaron;\";\n\tentities[\"\"] = \"&scaron;\";\n\tentities[\"\"] = \"&Yuml;\";\n\tentities[\"\"] = \"&circ;\";\n\tentities[\"\"] = \"&tilde;\";\n\tentities[\"\"] = \"&ndash;\";\n\tentities[\"\"] = \"&mdash;\";\n\tentities[\"\"] = \"&lsquo;\";\n\tentities[\"\"] = \"&rsquo;\";\n\tentities[\"\"] = \"&sbquo;\";\n\tentities[\"\"] = \"&ldquo;\";\n\tentities[\"\"] = \"&rdquo;\";\n\tentities[\"\"] = \"&bdquo;\";\n\tentities[\"\"] = \"&dagger;\";\n\tentities[\"\"] = \"&Dagger;\";\n\tentities[\"\"] = \"&hellip;\";\n\tentities[\"\"] = \"&permil;\";\n\tentities[\"\"] = \"&lsaquo;\";\n\tentities[\"\"] = \"&rsaquo;\";\n\tentities[\"\"] = \"&euro;\";\n}"
  },
  {
    "path": "src/utils/html/img.as",
    "content": "package utils.html\n{\n\t/**\n\t * Generate an IMG tag.\n\t */\n\tpublic function img(src:String, alt:String = \"image\", width:int = 0, height:int = 0):String\n\t{\n\t\treturn '<img src=\"' + src + '\" alt=\"' + alt + '\"' + ((width > 0) ? ' width=\"' + width.toString() + '\"' : \"\") + ((height > 0) ? ' height=\"' + height.toString() + '\"' : \"\") + '/>';\n\t}\n}"
  },
  {
    "path": "src/utils/html/p.as",
    "content": "package utils.html\n{\n\t/**\n\t * Generate a P tag.\n\t */\n\tpublic function p(text:String, styleClass:String = null):String\n\t{\n\t\treturn styledTag(\"p\", text, styleClass);\n\t}\n}"
  },
  {
    "path": "src/utils/html/span.as",
    "content": "package utils.html\n{\n\t/**\n\t * Generate a SPAN tag.\n\t */\n\tpublic function span(text:String, styleClass:String = null):String\n\t{\n\t\treturn styledTag(\"span\", text, styleClass);\n\t}\n}"
  },
  {
    "path": "src/utils/html/styledTag.as",
    "content": "package utils.html\n{\n\n\t/**\n\t * Generate a styled tag.\n\t */\n\t[ExludeClass]\n\tpublic function styledTag(tagName:String, text:String, styleClass:String):String\n\t{\n\t\treturn '<' + tagName + ((styleClass) ? ' class=\"' + styleClass + '\"' : \"\") + '>' + text + '</' + tagName + '>';\n\t}\n}"
  },
  {
    "path": "src/utils/js/callJSFunction.as",
    "content": "package utils.js {\n\timport flash.external.ExternalInterface;\n\n\t/**\n\t * Call a JS function.\n\t * @param func Name of the function to be called\n\t * @param arg1 Argument 1\n\t * @param arg2 Argument 2\n\t * @param arg3 Argument 3\n\t * @param arg4 Argument 4\n\t * @throws Error if empty function name supplied\n\t * @throws Error if SecurityError occurred\n\t * @throws Error if Error occurred\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function callJSFunction(func:String, arg1:* = null, arg2:* = null, arg3:* = null, arg4:* = null):void {\n\t\tif(func == \"\") {\n\t\t\tthrow new Error(\"A valid function argument must be supplied\");\n\t\t}\n\n\t\t// track avea if a type is supplied\n\t\tif(ExternalInterface.available) {\n\t\t\ttry {\n\t\t\t\tExternalInterface.call(func, arg1, arg2, arg3, arg4);\n\t\t\t}\n\t\t\tcatch(error:SecurityError) {\n\t\t\t\tthrow new Error(func + \" request failed. A SecurityError occurred: \" + error.message + \"\\n\");\n\t\t\t}\n\t\t\tcatch (error:Error) {\n\t\t\t\tthrow new Error(func + \" request failed. An Error occurred: \" + error.message + \"\\n\");\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\tthrow new Error(func + \" request Failed. External interface is not available for this container. If you're trying to use it locally, try using it through an HTTP address.\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/utils/library/getBitmapDataFromLibrary.as",
    "content": "package utils.library {\n\timport flash.display.BitmapData;\n\n\n\n\t/**\n\t *   Get an instance of a BitmapData from the clip library\n\t *   @param className Name of the BitmapData's class (aka. linkage ID)\n\t *   @return An instance of the BitmapData with the given name or null if\n\t *           the class cannot be found or the BitmapData cannot be\n\t *           instantiated\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function getBitmapDataFromLibrary(className:String):BitmapData {\n\t\tvar clazz:Class = getClassFromLibrary(className);\n\t\tif(!clazz) {\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\t// Need to pass a width and height, but they are ignored\n\t\t\treturn new clazz(0, 0);\n\t\t}\n\t\tcatch (err:ArgumentError) {\n\t\t\treturn null;\n\t\t}\n\t\treturn null;\n\t}\n}\n"
  },
  {
    "path": "src/utils/library/getClassFromLibrary.as",
    "content": "package utils.library {\n\n\n\n\t/**\n\t *   Get a class from the clip library\n\t *   @param className Name of the class to get\n\t *   @return The class with the given name or null if it cannot be found\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function getClassFromLibrary(className:String):Class {\n\t\ttry {\n\t\t\treturn Class(this.loaderInfo.applicationDomain.getDefinition(className));\n\t\t}\n\t\tcatch (refErr:ReferenceError) {\n\t\t\treturn null;\n\t\t}\n\t\tcatch (typeErr:TypeError) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn null;\n\t}\n}\n"
  },
  {
    "path": "src/utils/library/getClipFromLibrary.as",
    "content": "package utils.library {\n\timport flash.display.MovieClip;\n\n\n\n\t/**\n\t *   Get an instance of a clip from the clip library\n\t *   @param className Name of the clip class (aka. linkage ID)\n\t *   @return An instance of the clip with the given name or null if the\n\t *           class cannot be found or the clip cannot be instantiated\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function getClipFromLibrary(className:String):MovieClip {\n\t\tvar clazz:Class = getClassFromLibrary(className);\n\t\tif(!clazz) {\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\treturn new clazz();\n\t\t}\n\t\tcatch (err:ArgumentError) {\n\t\t\treturn null;\n\t\t}\n\t\treturn null;\n\t}\n}\n"
  },
  {
    "path": "src/utils/load/calculateBps.as",
    "content": "package utils.load\n{\n\timport utils.conversion.millisecondsToSeconds;\n\n\t/**\n\t   Calculates the load speed in bytes per second (Bps).\n\n\t   @param bytesLoaded: Number of bytes that have loaded between <code>startTime</code> and <code>elapsedTime</code>.\n\t   @param startTime: Time in milliseconds when the load started.\n\t   @param elapsedTime: Time in milliseconds since the load started or time when load completed.\n\t   @return Bytes per second.\n\t   @usageNote This method returns BYTES per second, not bits per second.\n\t */\n\tpublic function calculateBps(bytesLoaded:uint, startTime:uint, elapsedTime:uint):int\n\t{\n\t\treturn Math.max(0, (bytesLoaded / millisecondsToSeconds(elapsedTime - startTime)));\n\t}\n}"
  },
  {
    "path": "src/utils/load/calculateBufferPercent.as",
    "content": "package utils.load\n{\n\timport utils.math.Percent;\n\timport utils.number.clamp;\n\n\t/**\n\t   Calculates the percent the video has buffered.\n\n\t   @param bytesLoaded: Number of bytes that have loaded between <code>startTime</code> and <code>elapsedTime</code>.\n\t   @param bytesTotal: Number of bytes total to be loaded.\n\t   @param startTime: Time in milliseconds when the load started.\n\t   @param elapsedTime: The current time in milliseconds or time when load completed.\n\t   @param lengthInMilliseconds: The total duration/length of the video in milliseconds.\n\t   @return The percent buffered.\n\t */\n\tpublic function calculateBufferPercent(bytesLoaded:uint, bytesTotal:uint, startTime:uint, elapsedTime:uint, lengthInMilliseconds:uint):Percent\n\t{\n\t\tvar totalWait:Number = bytesTotal / (bytesLoaded / (elapsedTime - startTime)) - lengthInMilliseconds;\n\t\tvar millisecondsRemaining:uint = calculateMillisecondsUntilBuffered(bytesLoaded, bytesTotal, startTime, elapsedTime, lengthInMilliseconds);\n\n\t\treturn (totalWait == Number.POSITIVE_INFINITY) ? new Percent(0) : new Percent(clamp(1 - millisecondsRemaining / totalWait, 0, 1));\n\t}\n}"
  },
  {
    "path": "src/utils/load/calculateKBps.as",
    "content": "package utils.load\n{\n\timport utils.conversion.bytesToKilobytes;\n\n\t/**\n\t   Calculates the load speed in kilobytes per second (kBps).\n\n\t   @param bytesLoaded: Number of bytes that have loaded between <code>startTime</code> and <code>elapsedTime</code>.\n\t   @param startTime: Time in milliseconds when the load started.\n\t   @param elapsedTime: Time in milliseconds since the load started or time when load completed.\n\t   @return Kilobytes per second.\n\t   @usageNote This method returns kiloBYTES per second, not kilobits per second.\n\t */\n\tpublic function calculateKBps(bytesLoaded:uint, startTime:uint, elapsedTime:uint):Number\n\t{\n\t\treturn bytesToKilobytes(calculateBps(bytesLoaded, startTime, elapsedTime));\n\t}\n}\n"
  },
  {
    "path": "src/utils/load/calculateMillisecondsUntilBuffered.as",
    "content": "package utils.load\n{\n\t/**\n\t   Calculates the remaining time until the video is buffered.\n\n\t   @param bytesLoaded: Number of bytes that have loaded between <code>startTime</code> and <code>elapsedTime</code>.\n\t   @param bytesTotal: Number of bytes total to be loaded.\n\t   @param startTime: Time in milliseconds when the load started.\n\t   @param elapsedTime: The current time in milliseconds or time when load completed.\n\t   @param lengthInMilliseconds: The total duration/length of the video in milliseconds.\n\t   @return The amount millisecond that remain before the video is buffered.\n\t */\n\tpublic function calculateMillisecondsUntilBuffered(bytesLoaded:uint, bytesTotal:uint, startTime:uint, elapsedTime:uint, lengthInMilliseconds:uint):uint\n\t{\n\t\treturn Math.max(Math.ceil((bytesTotal - bytesLoaded) / (bytesLoaded / (elapsedTime - startTime))) - lengthInMilliseconds, 0);\n\t}\n}"
  },
  {
    "path": "src/utils/load/checkDomain.as",
    "content": "package utils.load\n{\n\timport flash.display.LoaderInfo;\n\timport flash.errors.IOError;\n\timport flash.external.ExternalInterface;\n\n\t/**\n\t * Ensures that the domain that loaded the app is from an approved list of domains.\n\t *\n\t * @example <listing version=\"3.0\">\n\t * var approvedDomains:Array = [\".*\\.example\\.com\", \".*\\.foo\\.com\", \".*\\.me\\.mysite\\.com\"];\n\t * try {\n\t * \tvar testPassed:Boolean = checkDomain(this.loaderInfo, approvedDomains);\n\t * } catch (e:IOError) {\n\t * \t// Domain check didn't pass. Stop the application.\n\t * } \n\t * // If there wasn't an error, continue the application.\n\t * </listing>\n\t * \n\t * @throws IOError If the domain isn't allowed.\n\t *  \n\t * @param loaderInfo The LoaderInfo object for the main app. \n\t * \t\t\t\t\t This would probably be your application's main class' loaderInfo.\n\t * @param allowedDomains An array of approved domains as RegExp strings. e.g. \".*\\.example.com\"\n\t * @return Boolean True if domain check passed.\n\t * \n\t * @author Mims H. Wright\n\t */\n\tpublic function checkDomain(loaderInfo:LoaderInfo, approvedDomains:Array):Boolean {\n\t\tvar url:String;\n\t\tif (ExternalInterface.available) {\n\t\t\turl = ExternalInterface.call(\"window.location.href.toString\");\n\t\t} else {\n\t\t\turl = loaderInfo.loaderURL;\n\t\t}\n\t\t\n\t\tvar allowedDomainsString:String = approvedDomains.join(\"|\");\n\t\tvar allowedPattern:String = \"(^\"+allowedDomainsString+\"/?)\";\n\t\t\n\t\tvar domainCheck:RegExp = new RegExp(allowedPattern,\"i\");\n\t\tvar domainCheckResult:Object = domainCheck.exec(url);\n\t\tif (domainCheckResult == null) {\n\t\t\t// domain check failed, abort application\n\t\t\tthrow new IOError(\"You are not permitted to load this file from this location \" + url);\n\t\t\treturn false;\n\t\t} else {\n\t\t\t// domain okay, proceed\n\t\t\treturn true;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/location/getDomain.as",
    "content": "package utils.location {\n\t\n\timport flash.display.DisplayObject;\n\n\t/**\n\t * Detects MovieClip domain location.\n\t * Function does not return folder path or file name. The method also treats \"www\" and sans \"www\" as the same; if \"www\" is present method does not return it.\n\t * Example code:\n\t *      <pre>\n\t *          trace(getDomain(_root));\n\t *      </pre>\n\t * @param location MovieClip to get location of\n\t * @return Full domain (including sub-domains) of MovieClip location\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function getDomain(location:DisplayObject):String {\n\t\tvar baseUrl:String = location.loaderInfo.url.split(\"://\")[1].split(\"/\")[0];\n\t\treturn (baseUrl.substr(0, 4) == \"www.\") ? baseUrl.substr(4) : baseUrl;\n\t}\n}\n"
  },
  {
    "path": "src/utils/location/getLocationName.as",
    "content": "package utils.location {\n\t\n\timport flash.external.ExternalInterface;\n\n\timport utils.capabilities.isStandAlone;\n\n\t/**\n\t * Return current location name.\n\t * @return Current location name\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function getLocationName():String {\n\t\tvar out:String;\n\t\tvar browserAgent:String;\n\n\t\tif(isStandAlone()) {\n\t\t\tout = locationNames.STANDALONE_PLAYER;\n\t\t}\n\n\t\telse {\n\t\t\tif(ExternalInterface.available) {\n\t\t\t\t// uses external interface to reach out to browser and grab browser useragent info.\n\t\t\t\tbrowserAgent = ExternalInterface.call(\"function getBrowser(){return navigator.userAgent;}\");\n\n\t\t\t\t// determines brand of browser using a find index. If not found indexOf returns (-1).\n\t\t\t\t// noinspection IfStatementWithTooManyBranchesJS\n\t\t\t\tif(browserAgent != null && browserAgent.indexOf(\"Firefox\") >= 0) {\n\t\t\t\t\tout = locationNames.BROWSER_FIREFOX;\n\t\t\t\t} else if(browserAgent != null && browserAgent.indexOf(\"Safari\") >= 0) {\n\t\t\t\t\tout = locationNames.BROWSER_SAFARI;\n\t\t\t\t} else if(browserAgent != null && browserAgent.indexOf(\"MSIE\") >= 0) {\n\t\t\t\t\tout = locationNames.BROWSER_IE;\n\t\t\t\t} else if(browserAgent != null && browserAgent.indexOf(\"Opera\") >= 0) {\n\t\t\t\t\tout = locationNames.BROWSER_OPERA;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tout = locationNames.BROWSER_UNDEFINED;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\t// standalone player\n\t\t\t\tout = locationNames.BROWSER_UNDEFINED;\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/location/isDomain.as",
    "content": "package utils.location {\n\timport flash.display.DisplayObject;\n\n\n\n\t/**\n\t * Detects if MovieClip embed location matches passed domain.\n\t * Check for domain:\n\t *      <pre>\n\t *          trace(isDomain(_root, \"google.com\"));\n\t *          trace(isDomain(_root, \"bbc.co.uk\"));\n\t *      </pre>\n\t * You can even check for subdomains:\n\t *      <pre>\n\t *          trace(isDomain(_root, \"subdomain.aaronclinger.com\"))\n\t *      </pre>\n\t * @param location MovieClip to compare location of\n\t * @param domain Web domain\n\t * @return true if file's embed location matched passed domain\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function isDomain(location:DisplayObject, domain:String):Boolean {\n\t\treturn getDomain(location).slice(-domain.length) == domain;\n\t}\n}\n"
  },
  {
    "path": "src/utils/location/locationNames.as",
    "content": "package utils.location {\n\tpublic class locationNames {\n\n\n\t\t/** Firefox */\n\t\tpublic static const BROWSER_FIREFOX:String = \"browserFirefox\";\n\n\t\t/** Safari */\n\t\tpublic static const BROWSER_SAFARI:String = \"browserSafari\";\n\n\t\t/** Internet Explorer */\n\t\tpublic static const BROWSER_IE:String = \"browserIE\";\n\n\t\t/** Opera */\n\t\tpublic static const BROWSER_OPERA:String = \"browserOpera\";\n\n\t\t/** Undefined browser */\n\t\tpublic static const BROWSER_UNDEFINED:String = \"browserUndefined\";\n\n\t\t/** Standalone player */\n\t\tpublic static const STANDALONE_PLAYER:String = \"standalonePlayer\";\n\n\n\t}\n}\n"
  },
  {
    "path": "src/utils/location/openURL.as",
    "content": "package utils.location {\n\timport flash.external.ExternalInterface;\n\timport flash.net.URLRequest;\n\timport flash.net.navigateToURL;\n\n\timport utils.capabilities.isIDE;\n\n\n\n\t/**\n\t * Simlifies navigateToURL by allowing you to either use a String or an URLRequest\n\t * reference to the URL. This method also helps prevent pop-up blocking by trying to use\n\t * openWindow() before calling navigateToURL.\n\t * @param request A String or an URLRequest reference to the URL you wish to open/navigate to\n\t * @param window Browser window or HTML frame in which to display the URL indicated by the request parameter\n\t * @throws Error if you pass a value type other than a String or URLRequest to parameter request.\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function openURL(request:*, window:String = \"_self\" /* windowNames.WINDOW_SELF */):void {\n\t\tvar r:* = request;\n\n\t\tif(r is String) {\n\t\t\tr = new URLRequest(r);\n\t\t} else if(!(r is URLRequest)) {\n\t\t\tthrow new Error(\"request\");\n\t\t}\n\n\t\tif(window == windowNames.WINDOW_BLANK && ExternalInterface.available && !isIDE() && request._data == null) {\n\t\t\tif(openWindow(r.url, window)) return;\n\t\t}\n\n\t\tnavigateToURL(r, window);\n\t}\n}\n"
  },
  {
    "path": "src/utils/location/openWindow.as",
    "content": "package utils.location {\n\timport flash.external.ExternalInterface;\n\timport flash.net.URLRequest;\n\timport flash.net.navigateToURL;\n\n\n\n\t/**\n\t * Open a new browser window and prevent browser from blocking it.\n\t * Based on script by Sergey Kovalyov (http://skovalyov.blogspot.com/2007/01/how-to-prevent-pop-up-blocking-in.html)\n\t * Based on script by Jason the Saj (http://thesaj.wordpress.com/2008/02/12/the-nightmare-that-is-_blank-part-ii-help)\n\t * Original: http://apdevblog.com/problems-using-navigatetourl\n\t * You also have to set the wmode inside your containing html file to \"opaque\" and the allowScriptAccess to \"always\".\n\t * @param url url to be opened\n\t * @param window Window target\n\t * @param features Additional features for window.open function\n\t * @author Sergey Kovalyov\n\t * @author Jason the Saj\n\t * @author Aron Woost (<a href=\"http://apdevblog.com\">apdevblog.com</a>)\n\t * @author Philipp Kyeck (<a href=\"http://apdevblog.com\">apdevblog.com</a>)\n\t */\n\tpublic function openWindow(url:String, window:String = \"_blank\", features:String = \"\"):void {\n\t\tswitch(getLocationName()) {\n\t\t\tcase locationNames.BROWSER_FIREFOX:\n\t\t\t\tExternalInterface.call(\"window.open\", url, window, features);\n\t\t\t\tbreak;\n\n\t\t\tcase locationNames.BROWSER_IE:\n\t\t\t\tExternalInterface.call(\"function setWMWindow() {window.open('\" + url + \"');}\");\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// otherwise, use Flash's native 'navigateToURL()' function to pop-window.\n\t\t\t\t// this is necessary because Safari 3 no longer works with the above ExternalInterface work-a-round.\n\t\t\t\tnavigateToURL(new URLRequest(url), window);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/utils/location/windowNames.as",
    "content": "package utils.location {\n\tpublic class windowNames {\n\n\n\t\tpublic static const WINDOW_SELF:String = \"_self\";\n\t\tpublic static const WINDOW_BLANK:String = \"_blank\";\n\t\tpublic static const WINDOW_PARENT:String = \"_parent\";\n\t\tpublic static const WINDOW_TOP:String = \"_top\";\n\n\n\t}\n}\n"
  },
  {
    "path": "src/utils/math/Percent.as",
    "content": "/*\n   CASA Lib for ActionScript 3.0\n   Copyright (c) 2010, Aaron Clinger & Contributors of CASA Lib\n   All rights reserved.\n\n   Redistribution and use in source and binary forms, with or without\n   modification, are permitted provided that the following conditions are met:\n\n   - Redistributions of source code must retain the above copyright notice,\n   this list of conditions and the following disclaimer.\n\n   - Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n   - Neither the name of the CASA Lib nor the names of its contributors\n   may be used to endorse or promote products derived from this software\n   without specific prior written permission.\n\n   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n   POSSIBILITY OF SUCH DAMAGE.\n */\npackage utils.math\n{\n\n\t/**\n\t   Creates a standardized way of describing and storing percentages. You can store and receive percentages in two different formats; regular percentage or as an decimal percentage.\n\n\t   If percent is 37.5% a regular percentage would be expressed as <code>37.5</code> while the decimal percentage will be expressed <code>0.375</code>.\n\n\t   @author Aaron Clinger\n\t   @author Mike Creighton\n\t   @version 02/16/09\n\t */\n\tpublic class Percent\n\t{\n\t\tprotected var _percent:Number;\n\n\n\t\t/**\n\t\t   Creates a new Percent.\n\n\t\t   @param percentage: Percent formated at a percentage or an decimal percentage.\n\t\t   @param isDecimalPercentage: Indicates if the parameter <code>percentage</code> is a decimal percentage <code>true</code>, or regular percentage <code>false</code>.\n\t\t */\n\t\tpublic function Percent(percentage:Number = 0, isDecimalPercentage:Boolean = true)\n\t\t{\n\t\t\tsuper();\n\n\t\t\tif (isDecimalPercentage)\n\t\t\t{\n\t\t\t\tthis.decimalPercentage = percentage;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.percentage = percentage;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t   The percent expressed as a regular percentage. 37.5% would be expressed as <code>37.5</code>.\n\t\t */\n\t\tpublic function get percentage():Number\n\t\t{\n\t\t\treturn 100 * this._percent;\n\t\t}\n\n\t\tpublic function set percentage(percent:Number):void\n\t\t{\n\t\t\tthis._percent = percent * .01;\n\t\t}\n\n\t\t/**\n\t\t   The percent expressed as a decimal percentage. 37.5% would be expressed as <code>0.375</code>.\n\t\t */\n\t\tpublic function get decimalPercentage():Number\n\t\t{\n\t\t\treturn this._percent;\n\t\t}\n\n\t\tpublic function set decimalPercentage(percent:Number):void\n\t\t{\n\t\t\tthis._percent = percent;\n\t\t}\n\n\t\t/**\n\t\t   Determines if the percent specified in the <code>percent</code> parameter is equal to this percent object.\n\n\t\t   @param percent: A Percent object.\n\t\t   @return Returns <code>true</code> if percents are identical; otherwise <code>false</code>.\n\t\t */\n\t\tpublic function equals(percent:Percent):Boolean\n\t\t{\n\t\t\treturn this.decimalPercentage == percent.decimalPercentage;\n\t\t}\n\n\t\t/**\n\t\t   @return A new percent object with the same value as this percent.\n\t\t */\n\t\tpublic function clone():Percent\n\t\t{\n\t\t\treturn new Percent(this.decimalPercentage);\n\t\t}\n\n\t\tpublic function valueOf():Number\n\t\t{\n\t\t\treturn this.decimalPercentage;\n\t\t}\n\n\t\tpublic function toString():String\n\t\t{\n\t\t\treturn this.decimalPercentage.toString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/math/Range.as",
    "content": "/*\n   CASA Lib for ActionScript 3.0\n   Copyright (c) 2009, Aaron Clinger & Contributors of CASA Lib\n   All rights reserved.\n\n   Redistribution and use in source and binary forms, with or without\n   modification, are permitted provided that the following conditions are met:\n\n   - Redistributions of source code must retain the above copyright notice,\n   this list of conditions and the following disclaimer.\n\n   - Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n   - Neither the name of the CASA Lib nor the names of its contributors\n   may be used to endorse or promote products derived from this software\n   without specific prior written permission.\n\n   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n   POSSIBILITY OF SUCH DAMAGE.\n */\npackage utils.math\n{\n\n\t/**\n\t   Creates a standardized way of describing and storing an extent of variation/a value range.\n\n\t   @author Aaron Clinger\n\t   @author Mike Creighton\n\t   @version 10/19/08\n\t */\n\tpublic class Range\n\t{\n\t\tprotected var _end:Number;\n\t\tprotected var _start:Number;\n\n\n\t\t/**\n\t\t   Creates and defines a Range object.\n\n\t\t   @param start: Beginning value of the range.\n\t\t   @param end: Ending value of the range.\n\t\t   @usageNote You are not required to define the range in the contructor you can do it at any point by calling {@link #setRange}.\n\t\t */\n\t\tpublic function Range(start:Number, end:Number)\n\t\t{\n\t\t\tsuper();\n\n\t\t\tthis.setRange(start, end);\n\t\t}\n\n\t\t/**\n\t\t   Defines or redefines range.\n\n\t\t   @param start: Beginning value of the range.\n\t\t   @param end: Ending value of the range.\n\t\t */\n\t\tpublic function setRange(start:Number, end:Number):void\n\t\t{\n\t\t\tthis.start = start;\n\t\t\tthis.end = end;\n\t\t}\n\n\t\t/**\n\t\t   The start value of the range.\n\t\t */\n\t\tpublic function get start():Number\n\t\t{\n\t\t\treturn this._start;\n\t\t}\n\n\t\tpublic function set start(value:Number):void\n\t\t{\n\t\t\tthis._start = value;\n\t\t}\n\n\t\t/**\n\t\t   The end value of the range.\n\t\t */\n\t\tpublic function get end():Number\n\t\t{\n\t\t\treturn this._end;\n\t\t}\n\n\t\tpublic function set end(value:Number):void\n\t\t{\n\t\t\tthis._end = value;\n\t\t}\n\n\t\t/**\n\t\t   The minimum or smallest value of the range.\n\t\t */\n\t\tpublic function get min():Number\n\t\t{\n\t\t\treturn Math.min(this.start, this.end);\n\t\t}\n\n\t\t/**\n\t\t   Tthe maximum or largest value of the range.\n\t\t */\n\t\tpublic function get max():Number\n\t\t{\n\t\t\treturn Math.max(this.start, this.end);\n\t\t}\n\n\t\t/**\n\t\t   Determines if value is included in the range including the range's start and end values.\n\n\t\t   @return Returns <code>true</code> if value was included in range; otherwise <code>false</code>.\n\t\t */\n\t\tpublic function isWithinRange(value:Number):Boolean\n\t\t{\n\t\t\treturn (value <= this.max && value >= this.min);\n\t\t}\n\n\t\t/**\n\t\t   Calculates the percent of the range.\n\n\t\t   @param percent: A {@link Percent} object.\n\t\t   @return The value the percent represent of the range.\n\t\t */\n\t\tpublic function getValueOfPercent(percent:Percent):Number\n\t\t{\n\t\t\tvar min:Number;\n\t\t\tvar max:Number;\n\t\t\tvar val:Number;\n\t\t\tvar per:Percent = percent.clone();\n\n\t\t\tif (this.start <= this.end)\n\t\t\t{\n\t\t\t\tmin = this.start;\n\t\t\t\tmax = this.end;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tper.decimalPercentage = 1 - per.decimalPercentage;\n\n\t\t\t\tmin = this.end;\n\t\t\t\tmax = this.start;\n\t\t\t}\n\n\t\t\tval = Math.abs(max - min) * per.decimalPercentage + min;\n\n\t\t\treturn val;\n\t\t}\n\n\t\t/**\n\t\t   Returns the percentage the value represents out of the range.\n\n\t\t   @param value: An integer.\n\t\t   @return A Percent object.\n\t\t */\n\t\tpublic function getPercentOfValue(value:Number):Percent\n\t\t{\n\t\t\treturn new Percent((value - this.min) / (this.max - this.min));\n\t\t}\n\n\t\t/**\n\t\t   Determines if the range specified by the <code>range</code> parameter is equal to this range object.\n\n\t\t   @param percent: A Range object.\n\t\t   @return Returns <code>true</code> if ranges are identical; otherwise <code>false</code>.\n\t\t */\n\t\tpublic function equals(range:Range):Boolean\n\t\t{\n\t\t\treturn this.start == range.start && this.end == range.end;\n\t\t}\n\n\t\t/**\n\t\t   Determines if this range and the range specified by the <code>range</code> parameter overlap.\n\n\t\t   @param A Range object.\n\t\t   @return Returns <code>true</code> if this range contains any value of the range specified; otherwise <code>false</code>.\n\t\t */\n\t\tpublic function overlaps(range:Range):Boolean\n\t\t{\n\t\t\tif (this.equals(range) || this.contains(range) || range.contains(Range(this)) || this.isWithinRange(range.start) || this.isWithinRange(range.end))\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t   Determines if this range contains the range specified by the <code>range</code> parameter.\n\n\t\t   @param A Range object.\n\t\t   @return Returns <code>true</code> if this range contains all values of the range specified; otherwise <code>false</code>.\n\t\t */\n\t\tpublic function contains(range:Range):Boolean\n\t\t{\n\t\t\treturn this.start <= range.start && this.end >= range.end;\n\t\t}\n\n\t\t/**\n\t\t   @return A new range object with the same values as this range.\n\t\t */\n\t\tpublic function clone():Range\n\t\t{\n\t\t\treturn new Range(this.start, this.end);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/math/expressAsOdds.as",
    "content": "package utils.math\n{\n\t/**\n\t * Expresses chances that an outcome will occur out of a number of total possible outcomes.\n\t * \n\t * @example <pre> \n\t * // number of kings in a deck of cards.\n\t * expressAsOdds(4, 52); // 1:13\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function expressAsOdds(numberOfChances:int, allPossibleOutcomes:int):String {\n\t\tvar _gcd:int = gcd(numberOfChances, allPossibleOutcomes);\n\t\treturn (numberOfChances / _gcd) + \":\" + (allPossibleOutcomes / _gcd);\t\n\t}\n}"
  },
  {
    "path": "src/utils/math/gcd.as",
    "content": "package utils.math\n{\n\t/**\n\t * Returns the greatest common devisor between two ints.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function gcd(a:int, b:int):int {\n\t\tif (b == 0) {\n\t\t\treturn a;\n\t\t}\n\t\treturn gcd (b, a%b);\n\t}\n}"
  },
  {
    "path": "src/utils/mvc/AbstractController.as",
    "content": "package utils.mvc\n{\n\t/**\n\t * Provides basic implementation of the \"controller\" of\n\t * a Model/View/Controller triad.\n\t * \n\t * @author From original AS2 code by Colin Moock modified by Mims Wright http://www.moock.org/lectures/mvc/\n\t */\n\tpublic class AbstractController implements IController\n\t{\n\t\t/**\n\t\t * Constructor\n\t\t *\n\t\t * @param   model   The model this controller's view is observing.\n\t\t */\n\t\tpublic function AbstractController( model : * )\n\t\t{\n\t\t\tthis.model = model;\n\t\t}\n\t\t\n\t\tpublic function get model():* { return _model; }\n\t\tpublic function set model(model:*):void { _model = model; }\n\t\tprotected var _model:*;\n\t\t\n\t\t\n\t\tpublic function get view():IView { return _view; }\n\t\tpublic function set view(view:IView):void { _view = view; }\n\t\tprotected var _view:IView;\n\t}\n}\n"
  },
  {
    "path": "src/utils/mvc/AbstractModel.as",
    "content": "package utils.mvc\n{\n\timport flash.events.EventDispatcher;\n\timport flash.events.IEventDispatcher;\n\t\n\t/**\n\t * Specifies the minimum functionality that the \"model\" of\n\t * a Model/View/Controller triad must provide.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic class AbstractModel extends EventDispatcher implements IModel\n\t{\n\t\tpublic function AbstractModel()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/mvc/AbstractView.as",
    "content": "package utils.mvc\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.MovieClip;\n\t\n\t/**\n\t * A default implementation of IView based on MovieClip.\n\t * \n\t * @author From original AS2 code by Colin Moock modified by Mims Wright http://www.moock.org/lectures/mvc/\n\t */\n\tpublic class AbstractView extends MovieClip implements IView\n\t{\n\t\t\n\t\t/**\n\t\t * Constructor. \n\t\t *\n\t\t * @param model The data model that defines this view. \n\t\t * @param controller A specific controller to use (otherwise, the defaultController will be used)\n\t\t */ \n\t\tpublic function AbstractView ( model:*, controller:IController = null) {\n\t\t\tsuper();\n\t\t\tthis.model = model;\n\t\t\t\n\t\t\tif (controller != null) {\n\t\t\t\tthis.controller = controller;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/** @inheritDoc */\n\t\tpublic function asDisplayObject():DisplayObject {\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\t/** @inheritDoc */\n\t\tpublic function get model():* { return _model; }\n\t\tpublic function set model(model:*):void { _model = model; }\n\t\tprotected var _model:*;\n\t\t\n\t\t\n\t\t/** \n\t\t * The controller for the model that the view will use to modify it.\n\t\t * If it is set to null, the default controller will be used.\n\t\t */\n\t\tpublic function get controller():IController {\n\t\t\t// If a controller hasn't been defined yet...\n\t\t\tif (_controller == null) {\n\t\t\t\t// ...make one. Note that defaultController() is normally overridden \n\t\t\t\t// by the AbstractView subclass so that it returns the appropriate\n\t\t\t\t// controller for the view.\n\t\t\t\tthis.controller = getDefaultController( model );\n\t\t\t\tthis.controller.view = this;\n\t\t\t}\n\t\t\treturn controller;\n\t\t}\n\t\tpublic function set controller(controller:IController):void {\n\t\t\t_controller = controller;\n\t\t\tcontroller.view = this;\n\t\t}\n\t\tprotected var _controller:IController;\n\t\t\n\t\tpublic function getDefaultController( model:* ):IController {\n//\t\t\tAbstractEnforcer.enforceMethod();\n\t\t\treturn null;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/mvc/IController.as",
    "content": "package utils.mvc\n{\n\t\n\t\n\t/**\n\t * Specifies the minimum functionality that the \"controller\" of\n\t * a Model/View/Controller triad must provide.\n\t * \n\t * @author From original AS2 code by Colin Moock modified by Mims Wright http://www.moock.org/lectures/mvc/\n\t */\n\tpublic interface IController\n\t{\n\t\t/**\n\t\t * Sets the model for this controller.\n\t\t */\n\t\tfunction set model (model:*):void;\n\t\t\n\t\t/**\n\t\t * Returns the model for this controller.\n\t\t */\n\t\tfunction get model ():*;\n\t\t\n\t\t/**\n\t\t * Sets the view this controller is servicing.\n\t\t */\n\t\tfunction set view (view:IView):void;\n\t\t\n\t\t/**\n\t\t * Returns this controller's view.\n\t\t */\n\t\tfunction get view ():IView;\n\t}\n}"
  },
  {
    "path": "src/utils/mvc/IModel.as",
    "content": "package utils.mvc\n{\n\timport flash.events.IEventDispatcher;\n\t\n\t/**\n\t * Specifies the minimum functionality that the \"model\" of\n\t * a Model/View/Controller triad must provide.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic interface IModel extends IEventDispatcher\n\t{\n\t\t\n\t}\n}"
  },
  {
    "path": "src/utils/mvc/IView.as",
    "content": "package utils.mvc\n{\n\timport utils.display.IDisplayObject;\n\n\t/**\n\t * Specifies the minimum functionality that the \"view\" \n\t * of a Model/View/Controller triad must provide.\n\t * \n\t * @author From original AS2 code by Colin Moock modified by Mims Wright  http://www.moock.org/lectures/mvc/\n\t */\n\tpublic interface IView extends IDisplayObject\n\t{\n\t\t/** A reference to the model associated with this view. */\n\t\tfunction set model ( model:* ):void;\n\t\tfunction get model ():*;\n\t\t\n\t\t/** A reference to the model's controller. */\n\t\tfunction set controller ( controller:IController ):void;\n\t\tfunction get controller ():IController;\n\t\t\n\t\t/** \n\t\t * Returns an instance to a default implementation of the controller\n\t\t * for the model.\n\t\t */ \n\t\tfunction getDefaultController ( model:* ):IController;\n\t}\n}"
  },
  {
    "path": "src/utils/number/addLeadingZeroes.as",
    "content": "package utils.number\n{\n\t/**\n\t * Formats a number to include one or more leading zeroes if needed. \n\t * @example <listing version=\"3.0\">\n\t * addLeadingZeroes(4); // \"04\"\n\t * addLeadingZeroes(5, 3); // \"0005\"\n\t * addLeadingZeroes(10, 1); // \"10\"\n\t * addLeadingZeroes(10, 2); // \"010\"\n\t * </listing>\n\t * \n\t * @param n The number that will be formatted. Ignores negative numbers.\n\t * @return A string of the number with leading zeroes.\n\t *\n\t * @langversion ActionScript 3.0\n\t * @playerversion Flash 9.0\n\t * \n\t * @author updated by Mims Wright - original contributor unknown\n\t */\n\tpublic function addLeadingZeroes(n:Number, zeroes:int = 1):String\n\t{\n\t\tvar out:String = String(n);\n\t\t\n\t\tif (n < 0 || zeroes < 1) {\n\t\t\treturn out;\n\t\t}\n\n\t\twhile (out.length < zeroes + 1) {\n\t\t\tout = \"0\" + out;\n\t\t}\n\n\t\treturn out;\n\t}\n}"
  },
  {
    "path": "src/utils/number/clamp.as",
    "content": "package utils.number\n{\n\t/**\n\t * Constrains a value to the defined numeric boundaries.\n\t * \n\t * @example <listing version=\"3.0\">\n\t * clamp(3, 2, 5);   // this will give back 3 since it's within the range\n\t * clamp(20, 2, 5);  // this will give back 5 since 5 is the upper boundary\n\t * clamp(-5, 2, 5);  // this will give back 2 since 2 is the lower boundary\n\t * </listing>\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function clamp(val:Number, min:Number, max:Number):Number\n\t{\n\t\treturn Math.max(Math.min(val, max), min);\n\t}\n}"
  },
  {
    "path": "src/utils/number/createStepsBetween.as",
    "content": "package utils.number\n{\n\t/**\n\t   Creates evenly spaced numerical increments between two numbers.\n\n\t   @param begin: The starting value.\n\t   @param end: The ending value.\n\t   @param steps: The number of increments between the starting and ending values.\n\t   @return Returns an Array composed of the increments between the two values.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.createStepsBetween(0, 5, 4)); // Traces 1,2,3,4\n\t   trace(NumberUtil.createStepsBetween(1, 3, 3)); // Traces 1.5,2,2.5\n\t   </code>\n\t */\n\tpublic function createStepsBetween(begin:Number, end:Number, steps:Number):Array\n\t{\n\t\tsteps++;\n\n\t\tvar i:uint = 0;\n\t\tvar stepsBetween:Array = new Array();\n\t\tvar increment:Number = (end - begin) / steps;\n\n\t\twhile (++i < steps)\n\t\t\tstepsBetween.push((i * increment) + begin);\n\n\t\treturn stepsBetween;\n\t}\n}"
  },
  {
    "path": "src/utils/number/fastMax2.as",
    "content": "package utils.number {\n\n\n\n\t/**\n\t * Get fast max for two numbers.\n\t * @param val1 Number A\n\t * @param val2 Number B\n\t * @return Max\n\t * @author Jackson Dunstan (http://jacksondunstan.com/articles/445)\n\t */\n\tpublic function fastMax2(val1:Number, val2:Number):Number {\n\t\tif((!(val1 <= 0) && !(val1 > 0)) || (!(val2 <= 0) && !(val2 > 0))) return NaN;\n\t\treturn val1 > val2 ? val1 : val2;\n\t}\n}\n"
  },
  {
    "path": "src/utils/number/fastMin2.as",
    "content": "package utils.number {\n\n\n\n\t/**\n\t * Get fast min for two numbers.\n\t * @param val1 Number A\n\t * @param val2 Number B\n\t * @return Min\n\t * @author Jackson Dunstan (http://jacksondunstan.com/articles/445)\n\t */\n\tpublic function fastMin2(val1:Number, val2:Number):Number {\n\t\tif((!(val1 <= 0) && !(val1 > 0)) || (!(val2 <= 0) && !(val2 > 0))) return NaN;\n\t\treturn val1 < val2 ? val1 : val2;\n\t}\n}\n"
  },
  {
    "path": "src/utils/number/format.as",
    "content": "package utils.number {\n\n\n\n\t/**\n\t Formats a number.\n\t @param value The number you wish to format.\n\t @param minLength The minimum length of the number.\n\t @param thouDelim The character used to separate thousands.\n\t @param fillChar The leading character used to make the number the minimum length.\n\t @return Returns the formatted number as a String.\n\t @example\n\t <code>\n\t trace(NumberUtil.format(1234567, 8, \",\")); // Traces 01,234,567\n\t </code>\n\t */\n\tpublic function format(value:Number, minLength:uint, thouDelim:String = null, fillChar:String = null):String {\n\t\tvar num:String = value.toString();\n\t\tvar len:uint = num.length;\n\n\t\tif(thouDelim != null) {\n\t\t\tvar numSplit:Array = num.split('');\n\t\t\tvar counter:uint = 3;\n\t\t\tvar i:uint = numSplit.length;\n\n\t\t\twhile(--i > 0) {\n\t\t\t\tcounter--;\n\t\t\t\tif(counter == 0) {\n\t\t\t\t\tcounter = 3;\n\t\t\t\t\tnumSplit.splice(i, 0, thouDelim);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnum = numSplit.join('');\n\t\t}\n\n\t\tif(minLength != 0) {\n\t\t\tif(len < minLength) {\n\t\t\t\tminLength -= len;\n\n\t\t\t\tvar addChar:String = (fillChar == null) ? '0' : fillChar;\n\n\t\t\t\twhile(minLength--)\n\t\t\t\t\tnum = addChar + num;\n\t\t\t}\n\t\t}\n\n\t\treturn num;\n\t}\n}\n"
  },
  {
    "path": "src/utils/number/getOrdinalSuffix.as",
    "content": "package utils.number\n{\n\t/**\n\t   Finds the English ordinal suffix for the number given.\n\n\t   @param value: Number to find the ordinal suffix of.\n\t   @return Returns the suffix for the number, 2 characters.\n\t   @example\n\t   <code>\n\t   trace(32 + NumberUtil.getOrdinalSuffix(32)); // Traces 32nd\n\t   </code>\n\t */\n\tpublic function getOrdinalSuffix(value:int):String\n\t{\n\t\tif (value >= 10 && value <= 20)\n\t\t\treturn 'th';\n\n\t\tswitch (value % 10)\n\t\t{\n\t\t\tcase 0:\n\t\t\tcase 4:\n\t\t\tcase 5:\n\t\t\tcase 6:\n\t\t\tcase 7:\n\t\t\tcase 8:\n\t\t\tcase 9:\n\t\t\t\treturn 'th';\n\t\t\tcase 3:\n\t\t\t\treturn 'rd';\n\t\t\tcase 2:\n\t\t\t\treturn 'nd';\n\t\t\tcase 1:\n\t\t\t\treturn 'st';\n\t\t\tdefault:\n\t\t\t\treturn '';\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/number/getWeightedAverage.as",
    "content": "package utils.number {\n\n\n\n\t/**\n\t * Low pass filter algorithm for easing a value toward a destination value.\n\t * Works best for tweening values when no definite time duration exists and\n\t * when the destination value changes.\n\t * When <code>(0.5 &lt; n &lt; 1)</code>, then the resulting values will\n\t * overshoot (ping-pong) until they reach the destination value.\n\t * When <code>n</code> is greater than 1, as its value increases, the time\n\t * it takes to reach the destination also increases. A pleasing value for\n\t * <code>n</code> is 5.\n\t * @param value The current value.\n\t * @param dest The destination value.\n\t * @param n The slowdown factor.\n\t * @return The weighted average.\n\t */\n\tpublic function getWeightedAverage(value:Number, dest:Number, n:Number):Number {\n\t\treturn value + (dest - value) / n;\n\t}\n}\n"
  },
  {
    "path": "src/utils/number/hexChars.as",
    "content": "package utils.number\n{\n\t[ExcludeClass]\n\t/** String for quick lookup of a hex character based on index */\n\tpublic const hexChars:String = \"0123456789abcdef\";\n}"
  },
  {
    "path": "src/utils/number/insertCommas.as",
    "content": "package utils.number\n{\n\t/**\n\t * Inserts commas every three digits in the integer of <code>value</code>\n\t * @param value the number to insert commas into\n\t * @return <code>value</code> as a <code>String</code> formatted with commas\n\t */\n\tpublic function insertCommas(value:Number):String\n\t{\n\t\t// convert the value to a string\n\t\tvar valueString:String = String(value);\n\n\t\t// determine the location of the point\n\t\tvar commaIndex:int = valueString.indexOf(\".\");\n\n\t\t// if a point doesn't exist, consider it to be at the end of the value\n\t\tif (commaIndex == -1)\n\t\t\tcommaIndex = valueString.length;\n\n\t\tdo\n\t\t{\n\t\t\t// move to the left three digits\n\t\t\tcommaIndex -= 3;\n\n\t\t\t// if index is beyond the beginning of the value, end the loop\n\t\t\tif (commaIndex <= 0)\n\t\t\t\tbreak;\n\n\t\t\t// insert the comma\n\t\t\tvalueString = valueString.substring(0, commaIndex) + \",\" + valueString.substr(commaIndex);\n\t\t}\n\t\twhile (true);\n\n\t\t// remove \"0\" if value is a decimal\n\t\tif (valueString.substr(0, 2) == \"0.\")\n\t\t\tvalueString = valueString.substr(1);\n\n\t\treturn valueString;\n\t}\n}"
  },
  {
    "path": "src/utils/number/interpolate.as",
    "content": "package utils.number\n{\n\timport utils.math.Percent;\n\n\t/**\n\t   Determines a value between two specified values.\n\n\t   @param amount: The level of interpolation between the two values. If <code>0%</code>, <code>begin</code> value is returned; if <code>100%</code>, <code>end</code> value is returned.\n\t   @param minimum: The lower value.\n\t   @param maximum: The upper value.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.interpolate(new Percent(0.5), 0, 10)); // Traces 5\n\t   </code>\n\t */\n\tpublic function interpolate(amount:Percent, minimum:Number, maximum:Number):Number\n\t{\n\t\treturn minimum + (maximum - minimum) * amount.decimalPercentage;\n\t}\n}"
  },
  {
    "path": "src/utils/number/isBetween.as",
    "content": "package utils.number\n{\n\t/**\n\t   Determines if the value is included within a range.\n\n\t   @param value: Number to determine if it is included in the range.\n\t   @param firstValue: First value of the range.\n\t   @param secondValue: Second value of the range.\n\t   @return Returns <code>true</code> if the number falls within the range; otherwise <code>false</code>.\n\t   @usageNote The range values do not need to be in order.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.isBetween(3, 0, 5)); // Traces true\n\t   trace(NumberUtil.isBetween(7, 0, 5)); // Traces false\n\t   </code>\n\t */\n\tpublic function isBetween(value:Number, firstValue:Number, secondValue:Number):Boolean\n\t{\n\t\treturn !(value < Math.min(firstValue, secondValue) || value > Math.max(firstValue, secondValue));\n\t}\n}"
  },
  {
    "path": "src/utils/number/isEqual.as",
    "content": "package utils.number\n{\n\t/**\n\t   Determines if the two values are equal, with the option to define the precision.\n\n\t   @param val1: A value to compare.\n\t   @param val2: A value to compare.\n\t   @param precision: The maximum amount the two values can differ and still be considered equal.\n\t   @return Returns <code>true</code> the values are equal; otherwise <code>false</code>.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.isEqual(3.042, 3, 0)); // Traces false\n\t   trace(NumberUtil.isEqual(3.042, 3, 0.5)); // Traces true\n\t   </code>\n\t */\n\tpublic function isEqual(val1:Number, val2:Number, precision:Number = 0):Boolean\n\t{\n\t\treturn Math.abs(val1 - val2) <= Math.abs(precision);\n\t}\n}"
  },
  {
    "path": "src/utils/number/isEven.as",
    "content": "package utils.number\n{\n\t/**\n\t   Determines if the number is even.\n\n\t   @param value: A number to determine if it is divisible by <code>2</code>.\n\t   @return Returns <code>true</code> if the number is even; otherwise <code>false</code>.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.isEven(7)); // Traces false\n\t   trace(NumberUtil.isEven(12)); // Traces true\n\t   </code>\n\t */\n\tpublic function isEven(value:Number):Boolean\n\t{\n\t\treturn (value & 1) == 0;\n\t}\n}"
  },
  {
    "path": "src/utils/number/isInteger.as",
    "content": "package utils.number\n{\n\t/**\n\t   Determines if the number is an integer.\n\n\t   @param value: A number to determine if it contains no decimal values.\n\t   @return Returns <code>true</code> if the number is an integer; otherwise <code>false</code>.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.isInteger(13)); // Traces true\n\t   trace(NumberUtil.isInteger(1.2345)); // Traces false\n\t   </code>\n\t */\n\tpublic function isInteger(value:Number):Boolean\n\t{\n\t\treturn (value % 1) == 0;\n\t}\n}"
  },
  {
    "path": "src/utils/number/isNegative.as",
    "content": "package utils.number {\n\n\n\n\t/**\n\t * Determines whether or not the supplied Number is negative.\n\t * @param value Number to evaluate\n\t * @return Whether or not the supplied Number is negative\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function isNegative(value:Number):Boolean {\n\t\treturn !isPositive(value);\n\t}\n}\n"
  },
  {
    "path": "src/utils/number/isOdd.as",
    "content": "package utils.number\n{\n\t/**\n\t   Determines if the number is odd.\n\n\t   @param value: A number to determine if it is not divisible by <code>2</code>.\n\t   @return Returns <code>true</code> if the number is odd; otherwise <code>false</code>.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.isOdd(7)); // Traces true\n\t   trace(NumberUtil.isOdd(12)); // Traces false\n\t   </code>\n\t */\n\tpublic function isOdd(value:Number):Boolean\n\t{\n\t\treturn !isEven(value);\n\t}\n}"
  },
  {
    "path": "src/utils/number/isPositive.as",
    "content": "package utils.number {\n\n\n\n\t/**\n\t * Determines whether or not the supplied Number is positive.\n\t * @param value Number to evaluate\n\t * @return Whether or not the supplied Number is positive\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function isPositive(value:Number):Boolean {\n\t\treturn Boolean(value >= 0);\n\t}\n}\n"
  },
  {
    "path": "src/utils/number/isPrime.as",
    "content": "package utils.number\n{\n\t/**\n\t   Determines if the number is prime.\n\n\t   @param value: A number to determine if it is only divisible by <code>1</code> and itself.\n\t   @return Returns <code>true</code> if the number is prime; otherwise <code>false</code>.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.isPrime(13)); // Traces true\n\t   trace(NumberUtil.isPrime(4)); // Traces false\n\t   </code>\n\t */\n\tpublic function isPrime(value:Number):Boolean\n\t{\n\t\tif (value == 1 || value == 2)\n\t\t\treturn true;\n\n\t\tif (isEven(value))\n\t\t\treturn false;\n\n\t\tvar s:Number = Math.sqrt(value);\n\t\tfor (var i:Number = 3; i <= s; i++)\n\t\t\tif (value % i == 0)\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}\n}"
  },
  {
    "path": "src/utils/number/isRoughlyEqual.as",
    "content": "package utils.number {\n\t\n\t/**\n\t * Returns true if the two numbers are within \"maxPercentDifferent\" percent of each other. \n\t * \n\t * @example <listing version='3.0'>\n\t * isRoughlyEqual(0.7, 0.69); // true\n\t * isRoughlyEqual(0.7, 0.5); // false\n\t * \n\t * isRoughlyEqual(123456789, 123450000); // true\n\t * isRoughlyEqual(123456789, 100000000); // false\n\t * isRoughlyEqual(123456789, 100000000, 0.25); // true\n\t * \n\t * </listing>\n\t */\n\tpublic function isRoughlyEqual ( a:Number, b:Number, maxPercentDifferent:Number = 0.10 ):Boolean {\n\t\treturn Math.abs((a/b) - 1.0) < maxPercentDifferent; \n\t}\n}"
  },
  {
    "path": "src/utils/number/loopIndex.as",
    "content": "package utils.number\n{\n\t/**\n\t   Determines if index is included within the collection length otherwise the index loops to the beginning or end of the range and continues.\n\n\t   @param index: Index to loop if needed.\n\t   @param length: The total elements in the collection.\n\t   @return A valid zero-based index.\n\t   @example\n\t   <code>\n\t   var colors:Array = new Array(\"Red\", \"Green\", \"Blue\");\n\n\t   trace(colors[NumberUtil.loopIndex(2, colors.length)]); // Traces Blue\n\t   trace(colors[NumberUtil.loopIndex(4, colors.length)]); // Traces Green\n\t   trace(colors[NumberUtil.loopIndex(-6, colors.length)]); // Traces Red\n\t   </code>\n\t */\n\tpublic function loopIndex(index:int, length:uint):uint\n\t{\n\t\tif (index < 0)\n\t\t\tindex = length + index % length;\n\n\t\tif (index >= length)\n\t\t\treturn index % length;\n\n\t\treturn index;\n\t}\n}"
  },
  {
    "path": "src/utils/number/map.as",
    "content": "package utils.number\n{\n\t/**\n\t   Maps a value from one coordinate space to another.\n\n\t   @param value: Value from the input coordinate space to map to the output coordinate space.\n\t   @param min1: Starting value of the input coordinate space.\n\t   @param max1: Ending value of the input coordinate space.\n\t   @param min2: Starting value of the output coordinate space.\n\t   @param max2: Ending value of the output coordinate space.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.map(0.75, 0, 1, 0, 100)); // Traces 75\n\t   </code>\n\t */\n\tpublic function map(value:Number, min1:Number, max1:Number, min2:Number, max2:Number):Number\n\t{\n\t\treturn min2 + (max2 - min2) * ((value - min1) / (max1 - min1));\n\t}\n}"
  },
  {
    "path": "src/utils/number/max.as",
    "content": "package utils.number\n{\n\t/**\n\t   Evaluates <code>val1</code> and <code>val2</code> and returns the larger value. Unlike <code>Math.max</code> this method will return the defined value if the other value is <code>null</code> or not a number.\n\n\t   @param val1: A value to compare.\n\t   @param val2: A value to compare.\n\t   @return Returns the largest value, or the value out of the two that is defined and valid.\n\t   @example\n\t   <code>\n\t   trace(max(-5, null)); // Traces -5\n\t   trace(max(-5, \"CASA\")); // Traces -5\n\t   trace(max(-5, -13)); // Traces -5\n\t   </code>\n\t */\n\tpublic function max(val1:*, val2:*):Number\n\t{\n\t\tif (isNaN(val1) && isNaN(val2) || val1 == null && val2 == null)\n\t\t\treturn NaN;\n\n\t\tif (val1 == null || val2 == null)\n\t\t\treturn (val2 == null) ? val1 : val2;\n\n\t\tif (isNaN(val1) || isNaN(val2))\n\t\t\treturn (isNaN(val2)) ? val1 : val2;\n\n\t\treturn Math.max(val1, val2);\n\t}\n}"
  },
  {
    "path": "src/utils/number/min.as",
    "content": "package utils.number\n{\n\t/**\n\t   Evaluates <code>val1</code> and <code>val2</code> and returns the smaller value. Unlike <code>Math.min</code> this method will return the defined value if the other value is <code>null</code> or not a number.\n\n\t   @param val1: A value to compare.\n\t   @param val2: A value to compare.\n\t   @return Returns the smallest value, or the value out of the two that is defined and valid.\n\t   @example\n\t   <code>\n\t   trace(min(5, null)); // Traces 5\n\t   trace(min(5, \"CASA\")); // Traces 5\n\t   trace(min(5, 13)); // Traces 5\n\t   </code>\n\t */\n\tpublic function min(val1:*, val2:*):Number\n\t{\n\t\tif (isNaN(val1) && isNaN(val2) || val1 == null && val2 == null)\n\t\t\treturn NaN;\n\n\t\tif (val1 == null || val2 == null)\n\t\t\treturn (val2 == null) ? val1 : val2;\n\n\t\tif (isNaN(val1) || isNaN(val2))\n\t\t\treturn isNaN(val2) ? val1 : val2;\n\n\t\treturn Math.min(val1, val2);\n\t}\n}"
  },
  {
    "path": "src/utils/number/normalize.as",
    "content": "package utils.number\n{\n\timport utils.math.Percent;\n\n\t/**\n\t   Determines a percentage of a value in a given range.\n\n\t   @param value: The value to be converted.\n\t   @param minimum: The lower value of the range.\n\t   @param maximum: The upper value of the range.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.normalize(8, 4, 20).decimalPercentage); // Traces 0.25\n\t   </code>\n\t */\n\tpublic function normalize(value:Number, minimum:Number, maximum:Number):Percent\n\t{\n\t\treturn new Percent((value - minimum) / (maximum - minimum));\n\t}\n}"
  },
  {
    "path": "src/utils/number/pad.as",
    "content": "package utils.number {\n\n\n\n\t/**\n\t * Pads the <code>value</code> with the set number of digits before and after the point.\n\t * If the number of digits in the integer of <code>value</code> is less than <code>beforePoint</code>, the remaining digits are filled with zeros.\n\t * If the number of digits in the decimal of <code>value</code> is less than <code>afterPoint</code>, the remaining digits are filled with zeros.\n\t * @param value the number to pad\n\t * @param beforePoint the number of digits to pad before the point\n\t * @param afterPoint the number of digits to pad after the point\n\t * @return <code>value</code> padded as a <code>String</code>\n\t * @example\n\t * <listing version=\"3.0\">\n\t * NumberUtil.pad(.824, 0, 5); // returns \".82400\"\n\t * NumberUtil.pad(9, 3, 2); // returns \"009.00\"\n\t * NumberUtil.pad(2835.3, 4, 2); // returns \"2835.30\"\n\t * </listing>\n\t */\n\tpublic function pad(value:Number, beforePoint:uint, afterPoint:uint = 0):String {\n\t\t// separate the integer from the decimal\n\t\tvar valueArray:Array = String(value).split(\".\");\n\n\t\tvar integer:String = valueArray[0];\n\n\t\t// determine the sign of the value\n\t\tvar negative:Boolean = integer.substr(0, 1) == \"-\";\n\n\t\t// remove the \"-\" if it exists\n\t\tif(negative)\n\t\t\tinteger = integer.substr(1);\n\n\t\t// treat zeros as empty, so integer.length doesn't return 1 when integer is 0\n\t\tif(integer == \"0\") {\n\t\t\tinteger = \"\";\n\t\t}\n\n\t\tvar len:int = integer.length;\n\n\t\t// determine how many times \"0\" needs to be prepended\n\t\tvar zeros:int = Math.max(0, beforePoint - len);\n\n\t\t// prepend \"0\" until zeros == 0\n\t\twhile(zeros--)\n\t\t\tinteger = \"0\" + integer;\n\n\t\tvar decimal:String;\n\n\t\t// if a point didn't exist or the decimal is 0, empty the decimal\n\t\tif(valueArray.length == 1 || valueArray[1] == \"0\") {\n\t\t\tdecimal = \"\";\n\t\t}\n\t\telse {\n\t\t\tdecimal = valueArray[1];\n\t\t}\n\n\t\tlen = decimal.length;\n\n\t\t// determine how many times \"0\" needs to be appended\n\t\tzeros = Math.max(0, afterPoint - len);\n\n\t\t// append \"0\" until zeros == 0\n\t\twhile(zeros--)\n\t\t\tdecimal += \"0\";\n\n\t\t// set sign if negative\n\t\tvar sign:String = negative ? \"-\" : \"\";\n\n\t\t// set point if a decimal exists (or afterPoint > 0, determined earlier)\n\t\tvar point:String = decimal ? \".\" : \"\";\n\n\t\treturn sign + integer + point + decimal;\n\t}\n}\n"
  },
  {
    "path": "src/utils/number/randomIntegerWithinRange.as",
    "content": "package utils.number\n{\n\t/**\n\t   Creates a random integer within the defined range.\n\n\t   @param min: The minimum value the random integer can be.\n\t   @param min: The maximum value the random integer can be.\n\t   @return Returns a random integer within the range.\n\t */\n\tpublic function randomIntegerWithinRange(min:int, max:int):int\n\t{\n\t\treturn Math.round(randomWithinRange(min, max));\n\t}\n}"
  },
  {
    "path": "src/utils/number/randomSign.as",
    "content": "package utils.number {\n\n\n\n\t/**\n\t * Returns an int: -1 or 1.\n\t * Example code:\n\t *      <pre>\n\t *          RandomUtils.sign(); // returns 1 or -1 (50% chance of 1)\n\t *      </pre>\n\t * Another example code:\n\t *      <pre>\n\t *          RandomUtils.sign(0.8); // returns 1 or -1 (80% chance of 1)\n\t *      </pre>\n\t * @param chance Chance Number (0-1)\n\t * @return int: -1 or 1.\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function randomSign(chance:Number = 0.5):int {\n\t\treturn(Math.random() < chance) ? 1 : -1;\n\t}\n}\n"
  },
  {
    "path": "src/utils/number/randomWithinRange.as",
    "content": "package utils.number\n{\n\t/**\n\t *  Randomly generates a number in a range between min and max inclusively.\n\t *  Automatically swaps max and min if min is higher than max.\n\t *\n\t *  @param min The minimum value the random number can be.\n\t *  @param min The maximum value the random number can be.\n\t *  @return Returns a random number within the range.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function randomWithinRange(min:Number, max:Number):Number\n\t{\n\t\tif (min > max) {\n\t\t\tvar temp:Number = max;\n\t\t\tmax = min;\n\t\t\tmin = temp;\n\t\t}\n\t\treturn min + (Math.random() * (max - min));\n\t}\n}"
  },
  {
    "path": "src/utils/number/rol.as",
    "content": "package utils.number\n{\n\t/**\n\t * Rotates x left n bits\n\t *\n\t * @langversion ActionScript 3.0\n\t * @playerversion Flash 9.0\n\t * @tiptext\n\t */\n\tpublic function rol(x:int, n:int):int\n\t{\n\t\treturn (x << n) | (x >>> (32 - n));\n\t}\n}"
  },
  {
    "path": "src/utils/number/ror.as",
    "content": "package utils.number\n{\n\t/**\n\t * Rotates x right n bits\n\t *\n\t * @langversion ActionScript 3.0\n\t * @playerversion Flash 9.0\n\t * @tiptext\n\t */\n\tpublic function ror(x:int, n:int):uint\n\t{\n\t\tvar nn:int = 32 - n;\n\t\treturn (x << nn) | (x >>> (32 - nn));\n\t}\n}"
  },
  {
    "path": "src/utils/number/round.as",
    "content": "package utils.number\n{\n\t/**\n\t * Rounds a number to the nearest nth, where <code>digits</code> is n / 10.\n\t * @param value the number to round\n\t * @param digits the number of digits to show after the point\n\t * @return\n\t */\n\tpublic function round(value:Number, digits:int):Number\n\t{\n\t\tdigits = Math.pow(10, digits);\n\n\t\treturn Math.round(value * digits) / digits;\n\t}\n}"
  },
  {
    "path": "src/utils/number/roundDecimalToPlace.as",
    "content": "package utils.number\n{\n\t/**\n\t   Rounds a number's decimal value to a specific place.\n\n\t   @param value: The number to round.\n\t   @param place: The decimal place to round.\n\t   @return Returns the value rounded to the defined place.\n\t   @example\n\t   <code>\n\t   trace(NumberUtil.roundToPlace(3.14159, 2)); // Traces 3.14\n\t   trace(NumberUtil.roundToPlace(3.14159, 3)); // Traces 3.142\n\t   </code>\n\t */\n\tpublic function roundDecimalToPlace(value:Number, place:uint):Number\n\t{\n\t\tvar p:Number = Math.pow(10, place);\n\n\t\treturn Math.round(value * p) / p;\n\t}\n}"
  },
  {
    "path": "src/utils/number/toHex.as",
    "content": "package utils.number {\n\timport flash.utils.Endian;\n\n\t/**\n\t * Converts a uint into a string in the format “0x123456789ABCDEF”.\n\t * This function is quite useful for displaying hex colors as text.\n\t *\n\t * @example \n\t * <listing version=\"3.0\">\n\t * getNumberAsHexString(255); // 0xFF\n\t * getNumberAsHexString(0xABCDEF); // 0xABCDEF\n\t * getNumberAsHexString(0x00FFCC); // 0xFFCC\n\t * getNumberAsHexString(0x00FFCC, 6); // 0x00FFCC\n\t * getNumberAsHexString(0x00FFCC, 6, false); // 00FFCC\n\t * getNumberAsHexString(0x12345, 1, false, Endian.BIG_ENDIAN); // 452301 (note 0 added to 1 to make a byte)\n\t * </listing>\n\t *\n\t *\n\t * @param number The number to convert to hex. Note, numbers larger than 0xFFFFFFFF may produce unexpected results.\n\t * @param minimumLength The smallest number of hexits to include in the output.\n\t * \t\t\t\t\t   Missing places will be filled in with 0’s.\n\t * \t\t\t\t\t   e.g. getNumberAsHexString(0xFF33, 6); // results in \"0x00FF33\"\n\t * @param showHexDenotation If true, will append \"0x\" to the front of the string.\n\t * @param endianness Flag to output the int as big or little endian. \n\t * \t\t\t\t\t Can be Endian.BIG_INDIAN/Endian.LITTLE_ENDIAN or true/false. \n\t * \t\t\t\t\t Default is BIG.\n\t * @return String representation of the number as a string starting with \"0x\"\n\t * \n\t * @langversion ActionScript 3.0\n\t * @playerversion Flash 9.0\n\t * @see flash.utils.Endian\n\t * \n\t * @author Mims H. Wright (modified by Pimm Hogeling)\n\t */\n\tpublic function toHex(n:int, minimumLength:uint = 1, showHexDenotation:Boolean = true, endianness:* = null):String {\n\t\tvar bigEndian:Boolean;\n\t\tif (endianness == null) { endianness = Endian.BIG_ENDIAN; }\n\t\tif (endianness is Boolean) { \n\t\t\tbigEndian = Boolean(endianness);\n\t\t} else {\n\t\t\tbigEndian = endianness == Endian.BIG_ENDIAN;\n\t\t}\n\n\t\t\n\t\t// The string that will be output at the end of the function.\n\t\tvar string:String = n.toString(16).toUpperCase();\n\t\t\n\t\t// While the minimumLength argument is higher than the length of the string, add a leading zero.\n\t\twhile (minimumLength > string.length) {\n\t\t\tstring = \"0\" + string;\n\t\t}\n\t\t\n\t\tif (!bigEndian) {\n\t\t\t// reverse string.\n\t\t\tif (string.length %2 == 1) { string = \"0\" + string; }\n\t\t\tvar i:int = 0;\n\t\t\tvar reversed:Array = [];\n\t\t\twhile (i < string.length) {\n\t\t\t\tvar byte:String = string.charAt(i++) + string.charAt(i++);\n\t\t\t\treversed.unshift(byte);\n\t\t\t}\n\t\t\tstring = reversed.join(\"\");\n\t\t\t\n\t\t}\n\t\t\n\t\t// Return the result with a \"0x\" in front of the result.\n\t\tif (showHexDenotation) { string = \"0x\" + string; }\n\t\t\n\t\treturn string;\n\t}\n}\n"
  },
  {
    "path": "src/utils/object/assign.as",
    "content": "package utils.object {\n\n\n\n\t/**\n\t * Assign properties from params to an Object.\n\t * @param obj Target Object\n\t * @param params Source Object\n\t * @return Resulting Object\n\t */\n\tpublic function assign(obj:Object, params:Object):Object {\n\t\tvar out:Object = (obj);\n\n\t\tfor(var i:String in params) {\n\t\t\t//noinspection EmptyCatchBlockJS,UnusedCatchParameterJS\n\t\t\ttry {\n\t\t\t\tout[i] = params[i];\n\t\t\t}\n\t\t\tcatch(err:Error) {\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/object/clone.as",
    "content": "package utils.object\n{\n\timport flash.net.registerClassAlias;\n\timport flash.utils.ByteArray;\n\timport flash.utils.getQualifiedClassName;\n\n\t/**\n\t * Creates a duplicate of the source object by storing it in a ByteArray and reading it back in, \n\t * The object will return untyped so you may need to cast it to the desired class. \n\t * AMF rules apply. Check out the documentation for more info.\n\t * NOTE: This will not work if the object has any required parameters in the constructor.\n\t * \n\t * @throws flash.errors.ArgumentError If the source's constructor requires any parameters.\n\t * \n\t * @example \n\t * <listing version=\"3.0\">\n\t * \t\tvar example:Example = new Example();\n\t * \t\tvar clone:Example = Cloner.clone(example) as Example;\n\t * </listing>\n\t * \n\t * @see flash.net#registerClassAlias()\n\t * \n\t * @param source The object to duplicate.\n\t * @param autoRegisterClassAlias Determines whether the class will be registered before cloning. \n\t * \t\t\t\t\t\t\t\t Defaults to true, though advanced users may wish to register class aliases manually.\n\t * @return * A duplicate of the source object.\n\t * \n\t * @author Mims Wright\n\t */\n\tpublic function clone(source:Object, autoRegisterClassAlias:Boolean = true):* {\n\t\t// automatically register the class so that the clone retains its class.\n\t\tif (autoRegisterClassAlias) registerClassAlias(getQualifiedClassName(source), source.constructor as Class);\n\t\t\n\t\tvar copy:ByteArray = new ByteArray();\n\t\tcopy.writeObject(source);\n\t\tcopy.position = 0;\n\t\treturn copy.readObject();\n\t}\n}"
  },
  {
    "path": "src/utils/object/combine.as",
    "content": "package utils.object\n{\n    /**\n     * Combines all of the properties from two objects into a single objects. Note that\n     * duplicate properties will be overwritten by the values on the second parameter object.\n     *\n     * @param defaultVars\n     * @param additionalVars\n     * @return\n     */\n\tpublic function combine(defaultVars:Object, additionalVars:Object):Object\n\t{\n\t\tvar combinedObject:Object = {};\n\t\tvar property:String;\n\n\t\tfor (property in defaultVars)\n\t\t{\n\t\t\tcombinedObject[property] = defaultVars[property];\n\t\t}\n\n\t\tfor (property in additionalVars)\n\t\t{\n\t\t\tcombinedObject[property] = additionalVars[property];\n\t\t}\n\n\t\treturn combinedObject;\n\t}\n}"
  },
  {
    "path": "src/utils/object/contains.as",
    "content": "package utils.object {\n\n\n\n\t/**\n\t * Searches the first level properties of an Object for a another Object.\n\t * @param obj Object to search in.\n\t * @param member Object to search for.\n\t * @return true if Object was found\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function contains(obj:Object, member:Object):Boolean {\n\t\tfor(var prop:String in obj) {\n\t\t\tif(obj[prop] == member) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n}\n"
  },
  {
    "path": "src/utils/object/copy.as",
    "content": "package utils.object\n{\n\t/**\n\t *   Copy an object\n\t *   @param obj Object to copy\n\t *   @param into (optional) Object to copy into. If null, a new object\n\t *                is created.\n\t *   @return A one-level deep copy of the object or null if the argument\n\t *           is null\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function copy(obj:Object, into:Object = null):Object\n\t{\n\t\tif (into == null)\n\t\t{\n\t\t\tinto = {};\n\t\t}\n\t\tif (obj != null)\n\t\t{\n\t\t\tfor (var o:Object in obj)\n\t\t\t{\n\t\t\t\tinto[o] = obj[o];\n\t\t\t}\n\t\t}\n\t\treturn into;\n\t}\n}"
  },
  {
    "path": "src/utils/object/create.as",
    "content": "package utils.object\n{\n\t/**\n\t * Creates an instance of the given Class, \n\t * optionally passing arguments to the constructor, \n\t * and then decorating with properties.\n\t * \n\t * @param classToInstantiate Class to create an instance of. \n\t * @param constructorArguments Array of arguments to pass to the Class constructor. \n\t * @returns An instance of <code>classToInstantiate</code>\n\t * \n\t * @see utils.object#createInstance\n\t * @see utils.object#merge\n\t * \n\t * @example\n\t * <listing version=\"3.0\">\n\t * \tvar sprite:Sprite = create(Sprite, null, { x: 50, y: 100 });\n\t * </listing>\n\t * \n\t * @author drewbourne   \n\t */\n\tpublic function create(classToInstantiate:Class, \n\t\t\t\t\t\t   constructorArguments:Array = null, \n\t\t\t\t\t\t   properties:Object = null):Object\n\t{\n\t\treturn merge(createInstance(classToInstantiate, constructorArguments), properties);\n\t}\n}"
  },
  {
    "path": "src/utils/object/createInstance.as",
    "content": "package utils.object\n{\n\t/**\n\t * Creates an instance of a given Class,\n\t * optionally passing arguments to the constructor.\n\t * \n\t * @param classToInstantiate Class to create an instance of.\n\t * @param constructorArguments Array of arguments to pass to the Class constructor.\n\t * \n\t * @return An instance of <code>classToInstantiate</code>\n\t * \n\t * @throws ArgumentError When the number of <code>constructorArguments</code> is more than 10.\n\t * \n\t * @see utils.object#create \n\t * \n\t * @example\n\t * <listing version=\"3.0\">\n\t * \tvar event:Event = createInstance(Event, [Event.COMPLETE, true, false]);\n\t * </listing>\n\t * \n\t * @author drewbourne\n\t */\n\tpublic function createInstance(classToInstantiate:Class, constructorArguments:Array = null):Object\n\t{\n\t\tvar args:Array = constructorArguments || [];\n\t\t\t\t\n\t\tswitch (args.length) \n\t\t{\n\t\t\tcase 0: return new classToInstantiate();\n\t\t\tcase 1: return new classToInstantiate(args[0]);\n\t\t\tcase 2: return new classToInstantiate(args[0], args[1]);\n\t\t\tcase 3: return new classToInstantiate(args[0], args[1], args[2]);\n\t\t\tcase 4: return new classToInstantiate(args[0], args[1], args[2], args[3]);\n\t\t\tcase 5: return new classToInstantiate(args[0], args[1], args[2], args[3], args[4]);\n\t\t\tcase 6: return new classToInstantiate(args[0], args[1], args[2], args[3], args[4], args[5]);\n\t\t\tcase 7: return new classToInstantiate(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n\t\t\tcase 8: return new classToInstantiate(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);\n\t\t\tcase 9: return new classToInstantiate(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);\n\t\t\tcase 10: return new classToInstantiate(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);\n\t\t\t\n\t\t\tdefault: \n\t\t\t\tthrow new ArgumentError(\"Unable to instantiate:\" + classToInstantiate + \", unsupported number of constructor arguments, received: \" + args.join(', '));\n\t\t}\t\t\n\t}\n}"
  },
  {
    "path": "src/utils/object/getKeys.as",
    "content": "package utils.object\n{\n\t/**\n\t   Creates an Array comprised of all the keys in an Object.\n\n\t   @param obj: Object in which to find keys.\n\t   @return Array containing all the string key names.\n\t */\n\tpublic function getKeys(obj:Object):Array\n\t{\n\t\tvar keys:Array = new Array();\n\n\t\tfor (var i:String in obj)\n\t\t\tkeys.push(i);\n\n\t\treturn keys;\n\t}\n}"
  },
  {
    "path": "src/utils/object/hasAnyProperties.as",
    "content": "package utils.object\n{\n\t/**\n\t *   Check if an object has any properties\n\t *   @param obj Object to check for properties\n\t *   @return If the specified object has any properties. If the\n\t *           specified object is null, this is false.\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function hasAnyProperties(obj:Object):Boolean\n\t{\n\t\tfor each (var prop:Object in obj)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}"
  },
  {
    "path": "src/utils/object/inspect.as",
    "content": "package utils.object {\n\timport flash.utils.describeType;\n\n\n\n\t/**\n\t * Scan an Object.\n\t * @param obj Object to be scanned\n\t * @param depth Depth of scanning\n\t * @return Scan result\n\t */\n\tpublic function inspect(obj:Object, depth:int = 10, prefix:String = \"\\t\"):String {\n\t\tvar scan:Function = function(obj:Object, depth:int, prefix:String):String {\n\t\t\tvar out:String;\n\n\t\t\tif(depth < 1) {\n\t\t\t\tout = obj is String ? \"\\\"\" + obj + \"\\\"\" : String(obj);\n\t\t\t} else {\n\t\t\t\tconst classDef:XML = describeType(obj);\n\t\t\t\tvar str:String = \"\";\n\n\t\t\t\tfor each(var variable:XML in classDef.variable) {\n\t\t\t\t\tstr += prefix + variable.@name + \" = \" + scan(obj[variable.@name], depth - 1, prefix + \"\\t\") + \"\\n\";\n\t\t\t\t}\n\n\t\t\t\tfor(var s:String in obj) {\n\t\t\t\t\tstr += prefix + s + \"=\" + scan(obj[s], depth - 1, prefix + \"\\t\") + \"\\n\";\n\t\t\t\t}\n\n\t\t\t\t//noinspection NestedConditionalExpressionJS,NegatedConditionalExpressionJS\n\t\t\t\tout = str == \"\" ? ((obj != null) ? (obj is String ? \"\\\"\" + obj + \"\\\"\" : obj + \"\") : \"null\") : (\"[\" + classDef.@name + \"] {\\n\" + str + (prefix.substr(0, prefix.length - 1)) + \"}\");\n\t\t\t}\n\n\t\t\treturn out;\n\t\t};\n\n\t\treturn prefix + scan(obj, depth, prefix + \"\\t\");\n\t}\n}\n"
  },
  {
    "path": "src/utils/object/isEmpty.as",
    "content": "package utils.object {\n\n\n\n\t/**\n\t Determines if object contains no value(s).\n\t @param obj Object to determine if empty.\n\t @return Returns <code>true</code> if object is empty; otherwise <code>false</code>.\n\t @example\n\t <code>\n\t var testNumber:Number;\n\t var testArray:Array   = new Array();\n\t var testString:String = \"\";\n\t var testObject:Object = new Object();\n\n\t trace(ObjectUtil.isEmpty(testNumber)); // traces \"true\"\n\t trace(ObjectUtil.isEmpty(testArray));  // traces \"true\"\n\t trace(ObjectUtil.isEmpty(testString)); // traces \"true\"\n\t trace(ObjectUtil.isEmpty(testObject)); // traces \"true\"\n\t </code>\n\t */\n\tpublic function isEmpty(obj:*):Boolean {\n\t\tif(obj == undefined)\n\t\t\treturn true;\n\n\t\tif(obj is Number)\n\t\t\treturn isNaN(obj);\n\n\t\tif(obj is Array || obj is String)\n\t\t\treturn obj.length == 0;\n\n\t\tif(obj is Object) {\n\t\t\tfor(var prop:String in obj)\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n"
  },
  {
    "path": "src/utils/object/isNull.as",
    "content": "package utils.object {\n\t/**\n\t Uses the strict equality operator to determine if object is <code>null</code>.\n\n\t @param obj: Object to determine if <code>null</code>.\n\t @return Returns <code>true</code> if object is <code>null</code>; otherwise <code>false</code>.\n\t */\n\tpublic function isNull(obj:Object):Boolean {\n\t\treturn obj == null;\n\t}\n}\n"
  },
  {
    "path": "src/utils/object/isSimple.as",
    "content": "package utils.object\n{\n\t/**\n\t * Returns whether or not the given object is simple data type.\n\t *\n\t * @param the object to check\n\t * @return true if the given object is a simple data type; false if not\n\t */\n\tpublic function isSimple(object:Object):Boolean\n\t{\n\t\tswitch (typeof(object))\n\t\t{\n\t\t\tcase \"number\":\n\t\t\tcase \"string\":\n\t\t\tcase \"boolean\":\n\t\t\t\treturn true;\n\t\t\tcase \"object\":\n\t\t\t\treturn (object is Date) || (object is Array);\n\t\t}\n\n\t\treturn false;\n\t}\n}"
  },
  {
    "path": "src/utils/object/isUniformPropertyType.as",
    "content": "package utils.object\n{\n\t/**\n\t *   Check if the properties of an object are all the same\n\t *   @param obj Object whose properties should be checked\n\t *   @param type Type to check the object's properties against\n\t *   @return If all of the properties of the specified object are of the\n\t *           specified type\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function isUniformPropertyType(obj:Object, type:Class):Boolean\n\t{\n\t\tfor each (var prop:Object in obj)\n\t\t{\n\t\t\tif (!(prop is type))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}"
  },
  {
    "path": "src/utils/object/merge.as",
    "content": "package utils.object\n{\n\t/**\n\t * Merge enumerable fields from a source Object to a target Object.\n\t * \n\t * NOTE no checks are made to determine if the property is readable or writable. \n\t *  \n\t * @param target Target\n\t * @param source Source\n\t * @return target\n\t * \n\t * @example\n\t * <listing version=\"3.0\">\n\t * \tvar source:Object = { a: 1, d: 4 };\n\t * \tvar target:Object = { a: 0, b: 2, c: 3 }\n\t * \tvar result:Object = merge(target, source);\n\t * \ttrace(result.a, result.b, result.c, result.d);\n\t * \t// 1 2 3 4\n\t * </listing>\n\t * \n\t * @author drewbourne\n\t */\n\tpublic function merge(target:Object, source:Object):Object \n\t{\n\t\tfor (var field:Object in source || {}) \n\t\t{\n\t\t\ttarget[field] = source[field];\n\t\t}\n\t\t\n\t\treturn target;\n\t} \n}"
  },
  {
    "path": "src/utils/object/numProperties.as",
    "content": "package utils.object\n{\n\t/**\n\t *   Count the properties in an object\n\t *   @param obj Object to count the properties of\n\t *   @return The number of properties in the specified object. If the\n\t *           specified object is null, this is 0.\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function numProperties(obj:Object):int\n\t{\n\t\tvar count:int = 0;\n\t\tfor each (var prop:Object in obj)\n\t\t{\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}\n}"
  },
  {
    "path": "src/utils/object/toArray.as",
    "content": "package utils.object\n{\n\t/**\n\t *   Convert the object to an array. Note that the order of the array is\n\t *   undefined.\n\t *   @param obj Object to convert\n\t *   @return An array with all of the properties of the given object or\n\t *           null if the given object is null\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function toArray(obj:Object):Array\n\t{\n\t\tif (obj == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar ret:Array = [];\n\t\t\tfor each (var prop:Object in obj)\n\t\t\t{\n\t\t\t\tret.push(prop);\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/object/toString.as",
    "content": "package utils.object\n{\n\t/**\n\t * Convert the object to a string of form: <code>PROP: VAL&amp;PROP: VAL</code>\n\t * where:\n\t * <ul>\n\t * <li><code>PROP</code> is a property</li>\n\t * <li><code>VAL</code> is its corresponding value</li>\n\t * <li>&amp; is the specified optional delimiter</li>\n\t * </ul>\n\t *\n\t * @param obj Object to convert\n\t * @param delimiter (optional) Delimiter of property/value pairs\n\t * @return An string of all property/value pairs delimited by the\n\t * \t\tgiven string or null if the input object or delimiter is\n\t *      null.\n\t * @author Jackson Dunstan\n\t */\n\n\tpublic function toString(obj:Object = null, delimiter:String = \"\\n\"):String\n\t{\n\t\tif (obj == null || delimiter == null)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar ret:Array = [];\n\t\t\tfor (var s:Object in obj)\n\t\t\t{\n\t\t\t\tret.push(s + \": \" + obj[s]);\n\t\t\t}\n\t\t\treturn ret.join(delimiter);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/range/center.as",
    "content": "package utils.range\n{\n\t// TODO: what is the purpose of this function? Needs documentation.\n\tpublic function center(a:Number, b:Number, c:Number):Number\n\t{\n\t\tif ((a > b) && (a > c))\n\t\t{\n\t\t\tif (b > c)\n\t\t\t\treturn b;\n\t\t\telse\n\t\t\t\treturn c;\n\t\t}\n\t\telse if ((b > a) && (b > c))\n\t\t{\n\t\t\tif (a > c)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn c;\n\t\t}\n\t\telse if (a > b)\n\t\t{\n\t\t\treturn a;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn b;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/range/isInRange.as",
    "content": "package utils.range\n{\n\t/**\n\t * Check if a number is in range.\n\t */\n\tpublic function isInRange(n:Number, min:Number, max:Number, blacklist:Array = null):Boolean\n\t{\n\t\tif (!blacklist)\n\t\t\tblacklist = new Array();\n\t\tif (blacklist.length > 0)\n\t\t{\n\t\t\tfor (var i:String in blacklist)\n\t\t\t\tif (n == blacklist[i])\n\t\t\t\t\treturn false;\n\t\t}\n\t\treturn (n >= min && n <= max);\n\t}\n}"
  },
  {
    "path": "src/utils/range/randomRangeDate.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: Sep 26, 2010\n * Time: 1:59:33 PM\n */\npackage utils.range {\n\n    /**\n\t * Returns a random date within a given range\n\t */\n\n    public function randomRangeDate(date1:Date, date2:Date) : Date {\n\n        if(date1.getTime() == date2.getTime()){\n\n            throw new Error(\"Dates specified are the same\");\n\n        }\n\n        if(date2.getTime() < date1.getTime() ){\n\n            var temp:Date = date1;\n\n            date1 = date2;\n            date2 = temp;\n\n        }\n\n        var diff:Number = date2.getTime() - date1.getTime();\n\n        var rand:Number = Math.random() * diff;\n\n        var time:Number = date1.getTime() + rand;\n\n        var d:Date = new Date();\n        d.setTime(time);\n\n        return d;\n\n    }\n\n}"
  },
  {
    "path": "src/utils/range/randomRangeSet.as",
    "content": "package utils.range {\n\timport utils.number.randomIntegerWithinRange;\n\n\n\n\t/**\n\t * Returns a set of random numbers inside a specific range (unique numbers is optional)\n\t */\n\tpublic function randomRangeSet(min:Number, max:Number, count:Number, unique:Boolean):Array {\n\t\tvar rnds:Array = new Array();\n\t\tif(unique && count <= max - min + 1) {\n\t\t\t//unique - create num range array\n\t\t\tvar nums:Array = new Array();\n\t\t\tfor(var i:Number = min; i <= max; i++) {\n\t\t\t\tnums.push(i);\n\t\t\t}\n\t\t\tfor(var j:Number = 1; j <= count; j++) {\n\t\t\t\t// random number\n\t\t\t\tvar rn:Number = Math.floor(Math.random() * nums.length);\n\t\t\t\trnds.push(nums[rn]);\n\t\t\t\tnums.splice(rn, 1);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t//non unique\n\t\t\tfor(var k:Number = 1; k <= count; k++) {\n\t\t\t\trnds.push(randomIntegerWithinRange(min, max));\n\t\t\t}\n\t\t}\n\t\treturn rnds;\n\t}\n}\n"
  },
  {
    "path": "src/utils/range/resolve.as",
    "content": "package utils.range\n{\n\t/**\n\t * Resolve the number inside the range. If outside the range the nearest boundary value will be returned.\n\t */\n\tpublic function resolve(val:Number, min:Number, max:Number):Number\n\t{\n\t\treturn Math.max(Math.min(val, max), min);\n\t}\n}"
  },
  {
    "path": "src/utils/ratio/defineRect.as",
    "content": "package utils.ratio {\n\timport flash.geom.Rectangle;\n\n\n\n\tpublic function defineRect(size:Rectangle, width:Number, height:Number, snapToPixel:Boolean):Rectangle {\n\t\tvar scaled:Rectangle = size.clone();\n\n\t\tscaled.width = snapToPixel ? int(width) : width;\n\t\tscaled.height = snapToPixel ? int(height) : height;\n\n\t\treturn scaled;\n\t}\n}\n"
  },
  {
    "path": "src/utils/ratio/heightToWidth.as",
    "content": "package utils.ratio {\n\timport flash.geom.Rectangle;\n\n\n\n\t/**\n\t * Determines the ratio of height to width.\n\t * @param rect Area's width and height expressed as a Rectangle - the Rectangle's x and y values are ignored\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function heightToWidth(rect:Rectangle):Number {\n\t\treturn rect.height / rect.width;\n\t}\n}\n"
  },
  {
    "path": "src/utils/ratio/scale.as",
    "content": "package utils.ratio {\n\timport flash.geom.Rectangle;\n\n\timport utils.math.Percent;\n\n\n\n\t/**\n\t * Scales an area's width and height while preserving aspect ratio.\n\t * @param rect Area's width and height expressed as a Rectangle - the Rectangle's x and y values are ignored\n\t * @param amount Amount you wish to scale by\n\t * @param snapToPixel true to force the scale to whole pixels, or false to allow sub-pixels\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function scale(rect:Rectangle, amount:Percent, snapToPixel:Boolean = true):Rectangle {\n\t\treturn defineRect(rect, rect.width * amount.decimalPercentage, rect.height * amount.decimalPercentage, snapToPixel);\n\t}\n}\n"
  },
  {
    "path": "src/utils/ratio/scaleHeight.as",
    "content": "package utils.ratio {\n\timport flash.geom.Rectangle;\n\n\n\t/**\n\t * Scales the height of an area while preserving aspect ratio.\n\t * @param rect Area's width and height expressed as a Rectangle - the Rectangle's x and y values are ignored\n\t * @param width Width to scale to\n\t * @param snapToPixel true to force the scale to whole pixels, or false to allow sub-pixels\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function scaleHeight(rect:Rectangle, width:Number, snapToPixel:Boolean = true):Rectangle {\n\t\treturn defineRect(rect, width, width * heightToWidth(rect), snapToPixel);\n\t}\n}\n"
  },
  {
    "path": "src/utils/ratio/scaleToFill.as",
    "content": "package utils.ratio {\n\timport flash.geom.Rectangle;\n\n\n\t/**\n\t * Resizes an area to fill the bounding area while preserving aspect ratio.\n\t * @param rect Area's width and height expressed as a Rectangle - the Rectangle's x and y values are ignored\n\t * @param bounds Area to fill - the Rectangle's x and y values are ignored\n\t * @param snapToPixel true to force the scale to whole pixels, or false to allow sub-pixels\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function scaleToFill(rect:Rectangle, bounds:Rectangle, snapToPixel:Boolean = true):Rectangle {\n\t\tvar scaled:Rectangle = scaleHeight(rect, bounds.width, snapToPixel);\n\n\t\tif(scaled.height < bounds.height) scaled = scaleWidth(rect, bounds.height, snapToPixel);\n\n\t\treturn scaled;\n\t}\n}\n"
  },
  {
    "path": "src/utils/ratio/scaleToFit.as",
    "content": "package utils.ratio {\n\timport flash.geom.Rectangle;\n\n\n\t/**\n\t * Resizes an area to the maximum size of a bounding area without exceeding while preserving aspect ratio.\n\t * @param rect Area's width and height expressed as a Rectangle - the Rectangle's x and y values are ignored\n\t * @param bounds Area the rectangle needs to fit within - the Rectangle's x and y values are ignored\n\t * @param snapToPixel true to force the scale to whole pixels, or false to allow sub-pixels\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function scaleToFit(rect:Rectangle, bounds:Rectangle, snapToPixel:Boolean = true):Rectangle {\n\t\tvar scaled:Rectangle = scaleHeight(rect, bounds.width, snapToPixel);\n\n\t\tif(scaled.height > bounds.height) scaled = scaleWidth(rect, bounds.height, snapToPixel);\n\n\t\treturn scaled;\n\t}\n}\n"
  },
  {
    "path": "src/utils/ratio/scaleWidth.as",
    "content": "package utils.ratio {\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * Scales the width of an area while preserving aspect ratio.\n\t * @param rect Area's width and height expressed as a Rectangle - the Rectangle's x and y values are ignored\n\t * @param height Height to scale to\n\t * @param snapToPixel true to force the scale to whole pixels, or false to allow sub-pixels\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function scaleWidth(rect:Rectangle, height:Number, snapToPixel:Boolean = true):Rectangle {\n\t\treturn defineRect(rect, height * widthToHeight(rect), height, snapToPixel);\n\t}\n}\n"
  },
  {
    "path": "src/utils/ratio/widthToHeight.as",
    "content": "package utils.ratio {\n\timport flash.geom.Rectangle;\n\n\n\n\t/**\n\t * Determines the ratio of width to height.\n\t * @param rect Area's width and height expressed as a Rectangle - the Rectangle's x and y values are ignored\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function widthToHeight(rect:Rectangle):Number {\n\t\treturn rect.width / rect.height;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/addSlashes.as",
    "content": "package utils.string\n{\n\t/**\n\t * Returns the string with slashes prepended to all characters specified in the <code>chars</code> parameter\n\t * @param str the string to return slashed\n\t * @param chars the string of chars to slash\n\t * @return\n\t */\n\tpublic function addSlashes(str:String, chars:String = \"\\\"\"):String\n\t{\n\t\t// return the unaltered string if str or chars are null or empty\n\t\tif (!str || !chars)\n\t\t\treturn str;\n\n\t\t// slash unsafe characters\n\t\tchars = slashUnsafeChars(chars);\n\n\t\t// build the regular expression that handles the slashing\n\t\tvar regex:RegExp = new RegExp(\"([\" + chars + \"])\", \"g\");\n\n\t\t// add the slashes to the specified characters\n\t\treturn str.replace(regex, \"\\\\$1\");\n\t}\n}"
  },
  {
    "path": "src/utils/string/afterFirst.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Returns everything after the first occurrence of the provided character in the String.\n\t * @param value Input String\n\t * @param ch Character or sub-string\n\t * @returns Output String\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function afterFirst(value:String, ch:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tvar idx:int = value.indexOf(ch);\n\n\t\t\tif(idx != -1) {\n\t\t\t\tidx += ch.length;\n\t\t\t\tout = value.substr(idx);\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/afterLast.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Returns everything after the last occurrence of the provided character in value.\n\t * @param value Input String\n\t * @param ch Character or sub-string\n\t * @return Output String\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function afterLast(value:String, ch:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tvar idx:int = value.lastIndexOf(ch);\n\n\t\t\tif(idx != -1) {\n\t\t\t\tidx += ch.length;\n\t\t\t\tout = value.substr(idx);\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/arrayList.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Convert an Array to a list.\n\t * @param a Input Array\n\t * @return List as \"item1, item2, item3\"\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function arrayList(a:Array):String {\n\t\tvar out:String = \"\";\n\n\t\tfor each(var i:String in a) {\n\t\t\tout += i + \", \";\n\t\t}\n\n\t\treturn out.substr(0, out.length - 2);\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/beforeFirst.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Returns everything before the first occurrence of the provided character in the String.\n\t * @param value Input String\n\t * @param ch Character or sub-string\n\t * @returns Everything before the first occurence of the provided character in the String\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function beforeFirst(value:String, ch:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tvar idx:int = value.indexOf(ch);\n\n\t\t\tif(idx != -1) {\n\t\t\t\tout = value.substr(0, idx);\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/beforeLast.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Returns everything before the last occurrence of the provided character in the String.\n\t * @param value Input String\n\t * @param ch Character or sub-string\n\t * @returns Everything before the last occurrence of the provided character in the String\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function beforeLast(value:String, ch:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tvar idx:int = value.lastIndexOf(ch);\n\n\t\t\tif(idx != -1) {\n\t\t\t\tout = value.substr(0, idx);\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/beginsWith.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t *       Determines whether the specified string begins with the specified prefix.\n\t *       @param input The string that the prefix will be checked against.\n\t *       @param prefix The prefix that will be tested against the string.\n\t *       @returns True if the string starts with the prefix, false if it does not.\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function beginsWith(input:String, prefix:String):Boolean {\n\t\treturn (prefix == input.substring(0, prefix.length));\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/between.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Returns everything after the first occurrence of begin and before the first occurrence of end in String.\n\t * @param value Input String\n\t * @param start Character or sub-string to use as the start index\n\t * @param end Character or sub-string to use as the end index\n\t * @returns Everything after the first occurrence of begin and before the first occurrence of end in String.\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function between(value:String, start:String, end:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tvar startIdx:int = value.indexOf(start);\n\n\t\t\tif(startIdx != -1) {\n\t\t\t\tstartIdx += start.length; // RM: should we support multiple chars? (or ++startIdx);\n\n\t\t\t\tvar endIdx:int = value.indexOf(end, startIdx);\n\n\t\t\t\tif(endIdx != -1) {\n\t\t\t\t\tout = value.substr(startIdx, endIdx - startIdx);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/constants.as",
    "content": "package utils.string\n{\n\n\tpublic class constants\n\t{\n\t\tpublic static const REGEX_UNSAFE_CHARS:String = \"\\\\-^[]\";\n\n\t\tpublic static const TRIM_RIGHT_REGEX:RegExp = /[\\s]+$/g;\n\t}\n}"
  },
  {
    "path": "src/utils/string/convertBytesString.as",
    "content": "package utils.string {\n\t\n\timport utils.conversion.bytesToKilobytes;\n\n\t/**\n\t * Convert bytes to a String (\"X B\" or \"X kB\")\n\t * @param value Bytes count\n\t * @return Result String\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function convertBytesString(value:uint):String {\n\t\treturn (value <= 8192 ? (String(value) + \" B\") : (String(bytesToKilobytes(value)) + \" kB\"));\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/detectBr.as",
    "content": "package utils.string\n{\n\t/**\n\t * Detect HTML line breaks.\n\t */\n\tpublic function detectBr(str:String):Boolean\n\t{\n\t\treturn str.split(\"<br\").length > 1;\n\t}\n}"
  },
  {
    "path": "src/utils/string/endsWith.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t *       Determines whether the specified string ends with the specified suffix.\n\t *       @param input The string that the suffix will be checked against.\n\t *       @param suffix The suffix that will be tested against the string.\n\t *       @returns True if the string ends with the suffix, false if it does not.\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function endsWith(input:String, suffix:String):Boolean {\n\t\treturn (suffix == input.substring(input.length - suffix.length));\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/equals.as",
    "content": "package utils.string\n{\n\t/**\n\t * Does a case insensitive compare or two strings and returns true if they are equal.\n\t */\n\tpublic function equals(s1:String, s2:String, caseSensitive:Boolean = false):Boolean\n\t{\n\t\treturn (caseSensitive) ? (s1 == s2) : (s1.toUpperCase() == s2.toUpperCase());\n\t}\n\n}"
  },
  {
    "path": "src/utils/string/firstToUpper.as",
    "content": "package utils.string\n{\n\t/**\n\t * Capitalize the first character in the string.\n\t */\n\tpublic function firstToUpper(str:String):String\n\t{\n\t\treturn str.charAt(0).toUpperCase() + str.substr(1);\n\t}\n}"
  },
  {
    "path": "src/utils/string/getLettersFromString.as",
    "content": "package utils.string\n{\n\tpublic function getLettersFromString(source:String):String\n\t{\n\t\tvar pattern:RegExp = /[^A-Z^a-z]/g;\n\t\treturn source.replace(pattern, '');\n\t}\n}"
  },
  {
    "path": "src/utils/string/htmlDecode.as",
    "content": "package utils.string\n{\n\t/**\n\t * Decode HTML.\n\t */\n\tpublic function htmlDecode(s:String):String\n\t{\n\t\ts = replace(s, \"&nbsp;\", \" \");\n\t\ts = replace(s, \"&amp;\", \"&\");\n\t\ts = replace(s, \"&lt;\", \"<\");\n\t\ts = replace(s, \"&gt;\", \">\");\n\t\ts = replace(s, \"&trade;\", '');\n\t\ts = replace(s, \"&reg;\", \"\");\n\t\ts = replace(s, \"&copy;\", \"\");\n\t\ts = replace(s, \"&euro;\", \"\");\n\t\ts = replace(s, \"&pound;\", \"\");\n\t\ts = replace(s, \"&mdash;\", \"\");\n\t\ts = replace(s, \"&ndash;\", \"\");\n\t\ts = replace(s, \"&hellip;\", '');\n\t\ts = replace(s, \"&dagger;\", \"\");\n\t\ts = replace(s, \"&middot;\", '');\n\t\ts = replace(s, \"&micro;\", \"\");\n\t\ts = replace(s, \"&laquo;\", \"\");\n\t\ts = replace(s, \"&raquo;\", \"\");\n\t\ts = replace(s, \"&bull;\", \"\");\n\t\ts = replace(s, \"&deg;\", \"\");\n\t\ts = replace(s, \"&ldquo\", '\"');\n\t\ts = replace(s, \"&rsquo;\", \"'\");\n\t\ts = replace(s, \"&rdquo;\", '\"');\n\t\ts = replace(s, \"&quot;\", '\"');\n\t\treturn s;\n\t}\n}"
  },
  {
    "path": "src/utils/string/htmlEncode.as",
    "content": "package utils.string\n{\n\t/**\n\t * Encode HTML.\n\t */\n\tpublic function htmlEncode(s:String):String\n\t{\n\t\ts = replace(s, \"&\", \"&amp;\");\n\t\t\n\t\ts = replace(s, \" \", \"&nbsp;\");\n\t\ts = replace(s, \"<\", \"&lt;\");\n\t\ts = replace(s, \">\", \"&gt;\");\n\t\ts = replace(s, \"\", '&trade;');\n\t\ts = replace(s, \"\", '&reg;');\n\t\ts = replace(s, \"\", '&copy;');\n\t\ts = replace(s, \"\", \"&euro;\");\n\t\ts = replace(s, \"\", \"&pound;\");\n\t\ts = replace(s, \"\", \"&mdash;\");\n\t\ts = replace(s, \"\", \"&ndash;\");\n\t\ts = replace(s, \"\", \"&hellip;\");\n\t\ts = replace(s, \"\", \"&dagger;\");\n\t\ts = replace(s, \"\", \"&middot;\");\n\t\ts = replace(s, \"\", \"&micro;\");\n\t\ts = replace(s, \"\", \"&laquo;\");\n\t\ts = replace(s, \"\", \"&raquo;\");\n\t\ts = replace(s, \"\", \"&bull;\");\n\t\ts = replace(s, \"\", \"&deg;\");\n\t\ts = replace(s, '\"', \"&quot;\");\n\t\treturn s;\n\t}\n}"
  },
  {
    "path": "src/utils/string/ltrim.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t *       Removes whitespace from the front of the specified string.\n\t *\n\t *       @param value The String whose beginning whitespace will will be removed.\n\t *\n\t *       @returns A String with whitespace removed from the begining\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function ltrim(value:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tout = value.replace(/^\\s+/, \"\");\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/numberToString.as",
    "content": "package utils.string\n{\n\t/**\n\t * Converts a number to its text equivelant\n\t * \n\t * @params n The number to convert\n\t * @returns String equivelant of the number\n\t * @playerversion Flash 10.0\n\t * @author Mims H. Wright\n\t */\n\tpublic function numberToString(n:Number):String {\n\t\tvar output:Vector.<String> = new Vector.<String>();\t// output will temporarily hold the strings that make up str\n\t\tvar isNegative:Boolean = false;                 \t\t// used for removing minus sign.\n\t\tvar integers:Number;\n\t\tvar decimals:Number;\n\t\t\n\t\t// check for NaN \n\t\tif (isNaN(n)) { return N.NAN; }\n\t\t// check for zero\n\t\tif (n == 0) { return N._0; }\n\t\t// check for negatives\n\t\tif (n < 0) { \n\t\t\tisNegative = true;\n\t\t\tn *= -1;\n\t\t}\n\t\t\n\t\t\n\t\t// solve for decimals\n\t\tvar decimalPointIndex:int = n.toString().indexOf(\".\");\n\t\tif (decimalPointIndex > -1) {\n\t\t\tdigits = Vector.<String> (n.toString().substr(decimalPointIndex + 1).split(\"\"));\n\t\t\tdigits.reverse();\n\t\t\t\n\t\t\tvar i:int = 0;\n\t\t\tvar digit:int;\n\t\t\tfor (; i < digits.length; i += 1) {\n\t\t\t\tdigit = int(digits[i]);\n\t\t\t\tif (digit == 0) {\n\t\t\t\t\toutput.push(N._0 + \" \");\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(N._1to9[digit]);\n\t\t\t\t}\n\t\t\t}\n\t\t\toutput.push(N.decimal);\n\t\t}\n\n\t\t// solve for integers\n\t\tintegers = Math.floor(n);\n\t\tvar period:int = 0;\n\t\tvar digits:Vector.<String> = Vector.<String>(integers.toString().split(\"\")).reverse();\n\t\tvar hundreds:int;\n\t\tvar tens:int;\n\t\tvar ones:int;\n\t\tvar next3:String;\n\t\twhile (digits.length > 0) {\n\t\t\t// grab the next three digits and analyze them.\n\t\t\tnext3 = digits.slice(0,3).join(\"\");\n\t\t\t\n\t\t\tif (next3 != \"000\") {\n\t\t\t\toutput.push(N.periods[period]);\n\t\t\t}\n\t\t\t\n\t\t\tones = int(digits[0]); \n\t\t\t\n\t\t\ttry { tens = int(digits[1]); }\n\t\t\tcatch (e:RangeError) { tens = NaN;}\n\t\t\t\n\t\t\ttry { hundreds = int(digits[2]); }\n\t\t\tcatch (e:RangeError) { hundreds = NaN; }\n\t\t\t\n\t\t\tif (!isNaN(tens)) {\n\t\t\t\tif (tens == 1) {\n\t\t\t\t\toutput.push(N._10to19[ones]);\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(N._1to9[ones]);\n\t\t\t\t\toutput.push(N._10to90[tens]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(N._1to9[ones]);\n\t\t\t}\n\t\t\tif (!isNaN(hundreds)) {\n\t\t\t\toutput.push(N._100to900[hundreds]);\n\t\t\t}\n\t\t\t\n\t\t\t// advance the period counter\n\t\t\tperiod++;\n\t\t\t// remove those three digits from the array of digits\n\t\t\tdigits.splice(0, 3);\n\t\t}\n\t\t\n\t\t\n\t\tif (isNegative == true) { \n\t\t\toutput.push(N.negative);\n\t\t\tn *= -1;\n\t\t}\n\t\t\n\t\t// reverse the output so that it will look correct\n\t\toutput.reverse();\n\t\t// save the output to the string\n\t\tvar str:String = output.join(\"\");\n\t\t// remove any trailing spaces.\n\t\tif (str.charAt(str.length-1) == \" \") { \n\t\t\tstr = str.substr(0, str.length-1);\n\t\t}\n\t\treturn str;\n\t}\n}\n\ninternal class N {\n\tpublic static const NAN:String = \"not a number\";\n\tpublic static const decimal:String = \"point \";\n\tpublic static const negative:String = \"negative \";\n\t\n\tpublic static const _0:String = \"zero\";\n\tpublic static const _1:String = \"one \";\n\tpublic static const _2:String = \"two \";\n\tpublic static const _3:String = \"three \";\n\tpublic static const _4:String = \"four \";\n\tpublic static const _5:String = \"five \";\n\tpublic static const _6:String = \"six \";\n\tpublic static const _7:String = \"seven \";\n\tpublic static const _8:String = \"eight \";\n\tpublic static const _9:String = \"nine \";\n\tpublic static const _10:String = \"ten \";\n\tpublic static const _11:String = \"eleven \";\n\tpublic static const _12:String = \"twelve \";\n\tpublic static const _13:String = \"thirteen \";\n\tpublic static const _14:String = \"fourteen \";\n\tpublic static const _15:String = \"fifteen \";\n\tpublic static const _16:String = \"sixteen \";\n\tpublic static const _17:String = \"seventeen \";\n\tpublic static const _18:String = \"eighteen \";\n\tpublic static const _19:String = \"nineteen \";\n\tpublic static const _20:String = \"twenty \";\n\tpublic static const _30:String = \"thirty \";\n\tpublic static const _40:String = \"fourty \";\n\tpublic static const _50:String = \"fifty \";\n\tpublic static const _60:String = \"sixty \";\n\tpublic static const _70:String = \"seventy \";\n\tpublic static const _80:String = \"eighty \";\n\tpublic static const _90:String = \"ninety \";\n\tpublic static const _100:String = \"hundred \";\n\tpublic static const _1000:String = \"thousand \";\n\tpublic static const _1000000:String = \"million \";\n\tpublic static const _1000000000:String = \"billion \";\n\tpublic static const _1000000000000:String = \"trillion \";\n\tpublic static const _1000000000000000:String = \"quadrillion \";\n\tpublic static const _1000000000000000000:String = \"quintillion \";\n\tpublic static const _1000000000000000000000:String = \"sextillion \";\n\tpublic static const _1000000000000000000000000:String = \"septillion \";\n\tpublic static const _1000000000000000000000000000:String = \"octillion \";\n\t\n\t\n\tpublic static const _1to9:Vector.<String> = Vector.<String>([\"\",_1,_2,_3,_4,_5,_6,_7,_8,_9]);\n\tpublic static const _10to19:Vector.<String> = Vector.<String>([_10,_11,_12,_13,_14,_15,_16,_17,_18,_19]);\n\tpublic static const _10to90:Vector.<String> = Vector.<String>([\"\",_10,_20,_30,_40,_50,_60,_70,_80,_90]);\n\tpublic static const _100to900:Vector.<String> = Vector.<String>([\"\",_1 + _100, _2 + _100, _3 + _100, _4 + _100, _5 + _100, _6 + _100, _7 + _100, _8 + _100, _9 + _100]);\n\t\n\tpublic static const periods:Vector.<String> = Vector.<String>(\n\t\t[\"\",\n\t\t_1000, \n\t\t_1000000, \n\t\t_1000000000,\n\t\t_1000000000000,\n\t\t_1000000000000000,\n\t\t_1000000000000000000,\n\t\t_1000000000000000000000,\n\t\t_1000000000000000000000000,\n\t\t_1000000000000000000000000000\n\t]);\n} "
  },
  {
    "path": "src/utils/string/padLeft.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Pads value with specified padChar character to a specified length from the left.\n\t * @param value Input String\n\t * @param padChar Character for pad\n\t * @param length Length to pad to\n\t * @returns Padded String\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function padLeft(value:String, padChar:String, length:uint):String {\n\t\tvar s:String = value;\n\n\t\twhile(s.length < length) {\n\t\t\ts = padChar + s;\n\t\t}\n\n\t\treturn s;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/padRight.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Pads value with specified padChar character to a specified length from the right.\n\t * @param value Input String\n\t * @param padChar Character for pad\n\t * @param length Length to pad to\n\t * @returns Padded String\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function padRight(value:String, padChar:String, length:uint):String {\n\t\tvar s:String = value;\n\n\t\twhile(s.length < length) {\n\t\t\ts += padChar;\n\t\t}\n\n\t\treturn s;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/randomCharacters.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Generate a random String.\n\t * @param amount String length (default 10)\n\t * @param charSet Chars used (default \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\")\n\t * @return Random String\n\t */\n\tpublic function randomCharacters(amount:Number, charSet:String = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"):String {\n\t\tvar alphabet:Array = charSet.split(\"\");\n\t\tvar alphabetLength:int = alphabet.length;\n\t\tvar randomLetters:String = \"\";\n\n\t\tfor(var j:uint = 0; j < amount; j++) {\n\t\t\tvar r:Number = Math.random() * alphabetLength;\n\t\t\tvar s:int = Math.floor(r);\n\t\t\trandomLetters += alphabet[s];\n\t\t}\n\n\t\treturn randomLetters;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/randomLowercaseCharacters.as",
    "content": "package utils.string\n{\n\t/**\n\t * Generate a set of random LowerCase characters.\n\t */\n\tpublic function randomLowercaseCharacters(amount:Number):String\n\t{\n\t\tvar str:String = \"\";\n\t\tfor (var i:int = 0; i < amount; i++)\n\t\t\tstr += String.fromCharCode(Math.round(Math.random() * (122 - 97)) + 97);\n\t\treturn str;\n\t}\n}"
  },
  {
    "path": "src/utils/string/randomNumberString.as",
    "content": "package utils.string\n{\n\t/**\n\t * Generate a set of random Number characters.\n\t */\n\tpublic function randomNumberString(amount:Number):String\n\t{\n\t\tvar str:String = \"\";\n\t\tfor (var i:int = 0; i < amount; i++)\n\t\t\tstr += String.fromCharCode(Math.round(Math.random() * (57 - 48)) + 48);\n\t\treturn str;\n\t}\n}"
  },
  {
    "path": "src/utils/string/randomSequence.as",
    "content": "package utils.string {\n\t\n\timport utils.number.randomIntegerWithinRange;\n\n\t/**\n\t * Get random sentence.\n\t * @param maxLength Max chars\n\t * @param minLength Min chars\n\t * @return Random sentence\n\t * @author Vaclav Vancura (http://vancura.org, http://twitter.com/vancura)\n\t */\n\tpublic function randomSequence(maxLength:uint = 50, minLength:uint = 10):String {\n\t\treturn randomCharacters(randomIntegerWithinRange(minLength, maxLength), \"            abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\");\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/randomSpecialCharacters.as",
    "content": "package utils.string\n{\n\t/**\n\t * Generate a set of random Special and Number characters.\n\t */\n\tpublic function randomSpecialCharacters(amount:Number):String\n\t{\n\t\tvar str:String = \"\";\n\t\tfor (var i:int = 0; i < amount; i++)\n\t\t\tstr += String.fromCharCode(Math.round(Math.random() * (64 - 33)) + 33);\n\t\treturn str;\n\t}\n}"
  },
  {
    "path": "src/utils/string/remove.as",
    "content": "package utils.string\n{\n\t/**\n\t *       Removes all instances of the remove string in the input string.\n\t *\n\t *       @param input The string that will be checked for instances of remove\n\t *       string\n\t *\n\t *       @param remove The string that will be removed from the input string.\n\t *\n\t *       @returns A String with the remove string removed.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function remove(input:String, remove:String):String\n\t{\n\t\treturn replace(input, remove, \"\");\n\t}\n}"
  },
  {
    "path": "src/utils/string/removeExtraWhitespace.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Removes extraneous whitespace (extra spaces, tabs, line breaks, etc) from the specified String.\n\t * @param value String whose extraneous whitespace will be removed\n\t * @returns Output String\n\t */\n\tpublic function removeExtraWhitespace(value:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tvar str:String = trim(value);\n\n\t\t\tout = str.replace(/\\s+/g, \" \");\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/removeSpaces.as",
    "content": "package utils.string\n{\n\t/**\n\t * Remove spaces from string.\n\t * @param str (String)\n\t * @return String\n\t */\n\tpublic function removeSpaces(str:String):String\n\t{\n\t\treturn replace(str, \" \", \"\");\n\t}\n\n}"
  },
  {
    "path": "src/utils/string/removeTabs.as",
    "content": "package utils.string\n{\n\t/**\n\t * Remove tabs from string.\n\t */\n\tpublic function removeTabs(str:String):String\n\t{\n\t\treturn replace(str, \"  \", \"\");\n\t}\n\n}"
  },
  {
    "path": "src/utils/string/repeat.as",
    "content": "package utils.string {\n\n\n\n\tpublic function repeat(n:uint, str:String = \" \"):String {\n\t\treturn new Array(n + 1).join(str);\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/replace.as",
    "content": "package utils.string\n{\n\t/**\n\t *       Replaces all instances of the replace string in the input string\n\t *       with the replaceWith string.\n\t *\n\t *       @param input The string that instances of replace string will be\n\t *       replaces with removeWith string.\n\t *\n\t *       @param replace The string that will be replaced by instances of\n\t *       the replaceWith string.\n\t *\n\t *       @param replaceWith The string that will replace instances of replace\n\t *       string.\n\t *\n\t *       @returns A new String with the replace string replaced with the\n\t *       replaceWith string.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function replace(input:String, replace:String, replaceWith:String):String\n\t{\n\t\treturn input.split(replace).join(replaceWith);\n\t}\n}"
  },
  {
    "path": "src/utils/string/reverse.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Returns the specified String in reverse character order.\n\t * @param value String that will be reversed\n\t * @returns Output String\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function reverse(value:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tout = value.split(\"\").reverse().join(\"\");\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/reverseWords.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Returns the specified String in reverse word order.\n\t * @param value String that will be reversed\n\t * @returns Output String\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function reverseWords(value:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tout = value.split(/\\s+/).reverse().join(\"\");\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/rtrim.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t *       Removes whitespace from the end of the specified string.\n\t *\n\t *       @param value The String whose ending whitespace will will be removed.\n\t *\n\t *       @returns A String with whitespace removed from the end\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function rtrim(value:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tout = value.replace(/\\s+$/, \"\");\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/sanitizeNull.as",
    "content": "package utils.string\n{\n\t/**\n\t * Sanitize <code>null</code> strings for display purposes.\n\t */\n\tpublic function sanitizeNull(str:String):String\n\t{\n\t\treturn (str == null || str == \"null\") ? \"\" : str;\n\t}\n}"
  },
  {
    "path": "src/utils/string/search.as",
    "content": "package utils.string\n{\n\t/**\n\t * Search for key in string.\n\t */\n\tpublic function search(str:String, key:String, caseSensitive:Boolean = true):Boolean\n\t{\n\t\tif (!caseSensitive)\n\t\t{\n\t\t\tstr = str.toUpperCase();\n\t\t\tkey = key.toUpperCase();\n\t\t}\n\t\treturn (str.indexOf(key) <= -1) ? false : true;\n\t}\n}"
  },
  {
    "path": "src/utils/string/slashUnsafeChars.as",
    "content": "package utils.string\n{\n\t/**\n\t * @private\n\t * @param chars\n\t * @return\n\t */\n\tpublic function slashUnsafeChars(chars:String):String\n\t{\n\t\tvar unsafeChar:String;\n\t\tvar m:uint = constants.REGEX_UNSAFE_CHARS.length;\n\n\t\tfor (var i:uint = 0; i < m; ++i)\n\t\t{\n\t\t\tunsafeChar = constants.REGEX_UNSAFE_CHARS.substr(i, 1);\n\n\t\t\tif (chars.indexOf(unsafeChar) != -1)\n\t\t\t\tchars = chars.replace(unsafeChar, \"\\\\\" + unsafeChar);\n\t\t}\n\n\t\treturn chars;\n\t}\n}"
  },
  {
    "path": "src/utils/string/stringHasValue.as",
    "content": "package utils.string\n{\n\t/**\n\t *       Specifies whether the specified string is either non-null, or contains\n\t *       characters (i.e. length is greater that 0)\n\t *\n\t *       @param s The string which is being checked for a value\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function stringHasValue(s:String):Boolean\n\t{\n\t\treturn (s != null && s.length > 0);\n\t}\n}"
  },
  {
    "path": "src/utils/string/stringsAreEqual.as",
    "content": "package utils.string\n{\n\t/**\n\t *       Does a case insensitive compare or two strings and returns true if\n\t *       they are equal.\n\t *\n\t *       @param s1 The first string to compare.\n\t *\n\t *       @param s2 The second string to compare.\n\t *\n\t *       @returns A boolean value indicating whether the strings' values are\n\t *       equal in a case sensitive compare.\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function stringsAreEqual(s1:String, s2:String,\n\t\tcaseSensitive:Boolean):Boolean\n\t{\n\t\tif (caseSensitive)\n\t\t{\n\t\t\treturn (s1 == s2);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (s1.toUpperCase() == s2.toUpperCase());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/string/stripSlashes.as",
    "content": "package utils.string\n{\n\t/**\n\t * Returns the string with slashes removed from all characters specified in the <code>chars</code> parameter\n\t * @param str the string to return stripped of slashes\n\t * @param chars the string of chars to remove slashes from\n\t * @return\n\t */\n\tpublic function stripSlashes(str:String, chars:String = \"\\\"\"):String\n\t{\n\t\t// return the unaltered string if str or chars are null or empty\n\t\tif (!str || !chars)\n\t\t\treturn str;\n\n\t\t// slash unsafe characters\n\t\tchars = slashUnsafeChars(chars);\n\n\t\t// build the regular expression that removes the slashes\n\t\tvar regex:RegExp = new RegExp(\"\\\\\\\\([\" + chars + \"])\", \"g\");\n\n\t\t// strip the slashes from the specified characters\n\t\treturn str.replace(regex, \"$1\");\n\t}\n}"
  },
  {
    "path": "src/utils/string/stripTags.as",
    "content": "package utils.string\n{\n\t/**\n\t * Strip HTML markup tags.\n\t */\n\tpublic function stripTags(str:String):String\n\t{\n\t\tvar s:Array = new Array();\n\t\tvar c:Array = new Array();\n\t\tfor (var i:int = 0; i < str.length; i++)\n\t\t{\n\t\t\tif (str.charAt(i) == \"<\")\n\t\t\t{\n\t\t\t\ts.push(i);\n\t\t\t}\n\t\t\telse if (str.charAt(i) == \">\")\n\t\t\t{\n\t\t\t\tc.push(i);\n\t\t\t}\n\t\t}\n\t\tvar o:String = str.substring(0, s[0]);\n\t\tfor (var j:int = 0; j < c.length; j++)\n\t\t{\n\t\t\to += str.substring(c[j] + 1, s[j + 1]);\n\t\t}\n\t\treturn o;\n\t}\n}"
  },
  {
    "path": "src/utils/string/toDoubleQuote.as",
    "content": "package utils.string\n{\n\t/**\n\t * Convert single quotes to double quotes.\n\t */\n\tpublic function toDoubleQuote(str:String):String\n\t{\n\t\tvar sq:String = \"'\";\n\t\tvar dq:String = String.fromCharCode(34);\n\t\treturn str.split(sq).join(dq);\n\t}\n}"
  },
  {
    "path": "src/utils/string/toNumeric.as",
    "content": "package utils.string\n{\n\t/**\n\t * Remove all formatting and return cleaned numbers from string.\n\t * @example <listing version=\"3.0\">\n\t *      StringUtils.toNumeric(\"123-123-1234\"); // returns 1221231234\n\t * </listing>\n\t */\n\tpublic function toNumeric(str:String):String\n\t{\n\t\tvar len:Number = str.length;\n\t\tvar result:String = \"\";\n\t\tfor (var i:int = 0; i < len; i++)\n\t\t{\n\t\t\tvar code:Number = str.charCodeAt(i);\n\t\t\tif (code >= 48 && code <= 57)\n\t\t\t{\n\t\t\t\tresult += str.substr(i, 1);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n}"
  },
  {
    "path": "src/utils/string/toSingleQuote.as",
    "content": "package utils.string\n{\n\t/**\n\t * Convert double quotes to single quotes.\n\t */\n\tpublic function toSingleQuote(str:String):String\n\t{\n\t\tvar sq:String = \"'\";\n\t\tvar dq:String = String.fromCharCode(34);\n\t\treturn str.split(dq).join(sq);\n\t}\n}"
  },
  {
    "path": "src/utils/string/toTitleCase.as",
    "content": "package utils.string\n{\n\t/**\n\t * Transforms source String to per word capitalization.\n\t */\n\tpublic function toTitleCase(str:String):String\n\t{\n\t\tvar lstr:String = str.toLowerCase();\n\t\treturn lstr.replace(/\\b([a-z])/g, function($0:*):*\n\t\t\t{\n\t\t\t\treturn $0.toUpperCase();\n\t\t\t});\n\t}\n}"
  },
  {
    "path": "src/utils/string/trim.as",
    "content": "package utils.string {\n\t\n\t\n\t\n\t/**\n\t *       Removes whitespace from the front and the end of the specified\n\t *       string.\n\t *\n\t *       @param value The String whose beginning and ending whitespace will\n\t *       will be removed.\n\t *\n\t *       @returns A String with whitespace removed from the begining and end\n\t *\n\t *       @langversion ActionScript 3.0\n\t *       @playerversion Flash 9.0\n\t *       @tiptext\n\t */\n\tpublic function trim(value:String):String {\n\t\tvar out:String = \"\";\n\n\t\tif(value) {\n\t\t\tout = value.replace(/^\\s+|\\s+$/g, \"\");\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/trimCamel.as",
    "content": "package utils.string\n{\n\t/**\n\t * Trim spaces and camel notate String.\n\t */\n\tpublic function trimCamel(str:String = null):String\n\t{\n\t\tstr = (!str) ? \"\" : str;\n\t\tvar o:String = new String();\n\t\tfor (var i:int = 0; i < str.length; i++)\n\t\t{\n\t\t\tif (str.charAt(i) != \" \")\n\t\t\t{\n\t\t\t\tif (justPassedSpace)\n\t\t\t\t{\n\t\t\t\t\to += str.charAt(i).toUpperCase();\n\t\t\t\t\tjustPassedSpace = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\to += str.charAt(i).toLowerCase();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar justPassedSpace:Boolean = true;\n\t\t\t}\n\t\t}\n\t\treturn o;\n\t}\n}"
  },
  {
    "path": "src/utils/string/truncate.as",
    "content": "package utils.string\n{\n\t/**\n\t * Returns the truncated string with an appended ellipsis (...) if the length of <code>str</code> is greater than <code>len</code>.\n\t * If the length of <code>str</code> is less than or equal to <code>len</code>, the method returns <code>str</code> unaltered.\n\t * @param str the string to truncate\n\t * @param len the length to limit the string to\n\t * @return\n\t */\n\tpublic function truncate(str:String, len:int):String\n\t{\n\t\t// return the string if str is null, empty, or the length of str is less than or equal to len\n\t\tif (!str || str.length <= len)\n\t\t\treturn str;\n\n\t\t// short str to len\n\t\tstr = str.substr(0, len);\n\n\t\t// trim the right side of whitespace\n\t\tstr = str.replace(constants.TRIM_RIGHT_REGEX, \"\");\n\n\t\t// append the ellipsis\n\t\treturn str + \"...\";\n\t}\n}"
  },
  {
    "path": "src/utils/string/truncate2.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Returns a String truncated to a specified length with optional suffix.\n\t * @param value Input String\n\t * @param length Length the String should be shortened to\n\t * @param suffix (optional, default=\"...\") String to append to the end of the truncated String\n\t * @returns String String truncated to a specified length with optional suffix\n\t */\n\tpublic function truncate2(value:String, length:uint, suffix:String = \"...\"):String {\n\t\tvar out:String = \"\";\n\t\tvar l:uint = length;\n\n\t\tif(value) {\n\t\t\tl -= suffix.length;\n\n\t\t\tvar trunc:String = value;\n\n\t\t\tif(trunc.length > l) {\n\t\t\t\ttrunc = trunc.substr(0, l);\n\n\t\t\t\tif(/[^\\s]/.test(value.charAt(l))) {\n\t\t\t\t\ttrunc = rtrim(trunc.replace(/\\w+$|\\s+$/, \"\"));\n\t\t\t\t}\n\n\t\t\t\ttrunc += suffix;\n\t\t\t}\n\n\t\t\tout = trunc;\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/wordCount.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Determines the number of words in a String.\n\t * @param value Input String\n\t * @returns Number of words in a String\n\t * @author Aaron Clinger\n\t * @author Shane McCartney\n\t * @author David Nelson\n\t */\n\tpublic function wordCount(value:String):uint {\n\t\tvar out:uint = 0;\n\n\t\tif(value) {\n\t\t\tout = value.match(/\\b\\w+\\b/g).length;\n\t\t}\n\n\t\treturn out;\n\t}\n}\n"
  },
  {
    "path": "src/utils/string/xtrim.as",
    "content": "package utils.string {\n\n\n\n\t/**\n\t * Extreme Trim: remove whitespace, line feeds, carriage returns from string\n\t */\n\tpublic function xtrim(str:String = null):String {\n\t\tstr = (!str) ? \"\" : str;\n\n\t\tvar o:String = new String();\n\t\tvar TAB:Number = 9;\n\t\tvar LINEFEED:Number = 10;\n\t\tvar CARRIAGE:Number = 13;\n\t\tvar SPACE:Number = 32;\n\n\t\tfor(var i:int = 0; i < str.length; i++) {\n\t\t\tif(str.charCodeAt(i) != SPACE && str.charCodeAt(i) != CARRIAGE && str.charCodeAt(i) != LINEFEED && str.charCodeAt(i) != TAB) {\n\t\t\t\to += str.charAt(i);\n\t\t\t}\n\t\t}\n\n\t\treturn o;\n\t}\n}\n"
  },
  {
    "path": "src/utils/swf/SWFReader.as",
    "content": "package utils.swf\n{\n\n\timport flash.display.ActionScriptVersion;\n\timport flash.geom.*;\n\timport flash.utils.ByteArray;\n\timport flash.utils.Endian;\n\n\t/**\n\t * Reads the bytes of a SWF (as a ByteArray) to acquire\n\t * information from the SWF file header.  Some of\n\t * this information is inaccessible to ActionScript\n\t * otherwise.\n\t * \n\t * @author Trevor McCauley - www.senocular.com\n\t */\n\tpublic class SWFReader\n\t{\n\n\t\t// properties starting with those\n\t\t// found first in the byte stream\n\n\t\t/**\n\t\t * Indicates whether or not the SWF\n\t\t * is compressed.\n\t\t */\n\t\tpublic var compressed:Boolean;\n\n\t\t/**\n\t\t * The major version of the SWF.\n\t\t */\n\t\tpublic var version:uint;\n\n\t\t/**\n\t\t * The file size of the SWF.\n\t\t */\n\t\tpublic var fileSize:uint;\n\n\t\t// compression starts here if SWF compressed:\n\n\t\t/**\n\t\t * The dimensions of the SWF in the form of\n\t\t * a Rectangle instance.\n\t\t */\n\t\tpublic function get dimensions():Rectangle\n\t\t{\n\t\t\treturn _dimensions;\n\t\t}\n\t\tprivate var _dimensions:Rectangle = new Rectangle();\n\n\t\t// dimensions gets accessor since we don't\n\t\t// want people nulling the rect; it should\n\t\t// always have a value, even if 0-ed\n\n\t\t/**\n\t\t * Width of the stage as defined by the SWF.\n\t\t * Same as dimensions.width.\n\t\t */\n\t\tpublic function get width():uint\n\t\t{\n\t\t\treturn uint(_dimensions.width);\n\t\t}\n\n\t\t/**\n\t\t * Height of the stage as defined by the SWF.\n\t\t * Same as dimensions.height.\n\t\t */\n\t\tpublic function get height():uint\n\t\t{\n\t\t\treturn uint(_dimensions.height);\n\t\t}\n\n\t\t/**\n\t\t * When true, the bytes supplied in calls made to the tagCallback\n\t\t * function includes the RECORDHEADER of that tag which includes\n\t\t * the tag and the size of the tag. By default (false) this\n\t\t * information is not included.\n\t\t */\n\t\tpublic function get tagCallbackBytesIncludesHeader():Boolean\n\t\t{\n\t\t\treturn _tagCallbackBytesIncludesHeader;\n\t\t}\n\n\t\tpublic function set tagCallbackBytesIncludesHeader(value:Boolean):void\n\t\t{\n\t\t\t_tagCallbackBytesIncludesHeader = value;\n\t\t}\n\t\tprivate var _tagCallbackBytesIncludesHeader:Boolean = false;\n\n\t\t/**\n\t\t * The frame rate of the SWF in frames\n\t\t * per second.\n\t\t */\n\t\tpublic var frameRate:uint;\n\n\t\t/**\n\t\t * The total number of frames of the SWF.\n\t\t */\n\t\tpublic var totalFrames:uint;\n\n\t\t/**\n\t\t * ActionScript version.\n\t\t */\n\t\tpublic var asVersion:uint;\n\n\t\t/**\n\t\t * Determines local playback security; when\n\t\t * true, indicates that when this file is\n\t\t * run locally, it can only access the network.\n\t\t * When false, only local files can be accessed.\n\t\t * This does not apply when the SWF is being\n\t\t * run in a local-trusted sandbox.\n\t\t */\n\t\tpublic var usesNetwork:Boolean;\n\n\t\t/**\n\t\t * The background color of the SWF.\n\t\t */\n\t\tpublic var backgroundColor:uint;\n\n\t\t/**\n\t\t * Determines if the SWF is protected from\n\t\t * being imported into an authoring tool.\n\t\t */\n\t\tpublic var protectedFromImport:Boolean;\n\n\t\t/**\n\t\t * Determines if remote debugging is enabled.\n\t\t */\n\t\tpublic var debuggerEnabled:Boolean;\n\n\t\t/**\n\t\t * The XMP metadata defined in the SWF.\n\t\t */\n\t\tpublic var metadata:XML;\n\n\t\t/**\n\t\t * Maximun allowed levels of recursion.\n\t\t */\n\t\tpublic var recursionLimit:uint;\n\n\t\t/**\n\t\t * Time in seconds a script will run in a\n\t\t * single frame before a timeout error\n\t\t * occurs.\n\t\t */\n\t\tpublic var scriptTimeoutLimit:uint;\n\n\t\t/**\n\t\t * The level of hardware acceleration specified\n\t\t * for the SWF. 0 is none, 1 is direct, and 2\n\t\t * is GPU (Flash Player 10+).\n\t\t */\n\t\tpublic var hardwareAcceleration:uint;\n\n\t\t/**\n\t\t * A callback function that will be called when\n\t\t * a tag is read during the parse process. The\n\t\t * callback function should contain the parameters\n\t\t * (tag:uint, bytes:ByteArray).\n\t\t */\n\t\tpublic var tagCallback:Function;\n\n\t\t/**\n\t\t * Indicates that the SWF bytes last provided\n\t\t * were successfully parsed. If the SWF bytes\n\t\t * were not successfully parsed, no SWF data\n\t\t * will be available.\n\t\t */\n\t\tpublic var parsed:Boolean;\n\n\t\t/**\n\t\t * The Flash Player error message that resulted\n\t\t * from the error that caused a parse to fail.\n\t\t */\n\t\tpublic var errorText:String = \"\";\n\n\t\t// keeping track of data\n\t\tprivate var bytes:ByteArray;\n\t\tprivate var currentByte:int; // used in bit reading\n\t\tprivate var bitPosition:int; // used in bit reading\n\t\tprivate var currentTag:uint;\n\n\t\t// tag flags\n\t\tprivate var bgColorFound:Boolean;\n\n\t\t// constants\n\t\tprivate const GET_DATA_SIZE:int = 5;\n\t\tprivate const TWIPS_TO_PIXELS:Number = 0.05; // 20 twips in a pixel\n\t\tprivate const TAG_HEADER_ID_BITS:int = 6;\n\t\tprivate const TAG_HEADER_MAX_SHORT:int = 0x3F;\n\n\t\tprivate const SWF_C:uint = 0x43; // header characters\n\t\tprivate const SWF_F:uint = 0x46;\n\t\tprivate const SWF_W:uint = 0x57;\n\t\tprivate const SWF_S:uint = 0x53;\n\n\t\tprivate const TAG_ID_EOF:uint = 0; // recognized SWF tags\n\t\tprivate const TAG_ID_BG_COLOR:uint = 9;\n\t\tprivate const TAG_ID_PROTECTED:uint = 24;\n\t\tprivate const TAG_ID_DEBUGGER1:uint = 58;\n\t\tprivate const TAG_ID_DEBUGGER2:uint = 64;\n\t\tprivate const TAG_ID_SCRIPT_LIMITS:uint = 65;\n\t\tprivate const TAG_ID_FILE_ATTS:uint = 69;\n\t\tprivate const TAG_ID_META:uint = 77;\n\n\t\tprivate const TAG_ID_SHAPE_1:uint = 2;\n\t\tprivate const TAG_ID_SHAPE_2:uint = 22;\n\t\tprivate const TAG_ID_SHAPE_3:uint = 32;\n\t\tprivate const TAG_ID_SHAPE_4:uint = 83;\n\n\t\t/**\n\t\t * SWFHeader constructor.\n\t\t * @param\tswfBytes Bytes of the SWF in a ByteArray.\n\t\t * You can get the bytes of a SWF by loading it into\n\t\t * a URLLoader or using Loader.bytes once a SWF has\n\t\t * been loaded into that Loader.\n\t\t */\n\t\tpublic function SWFReader(swfBytes:ByteArray = null)\n\t\t{\n\t\t\tparse(swfBytes);\n\t\t}\n\n\t\t/**\n\t\t * Provides a string presentation of the SWFHeader\n\t\t * object which outlines the different values\n\t\t * obtained from a parsed SWF\n\t\t * @return The String form of the instance\n\t\t */\n\t\tpublic function toString():String\n\t\t{\n\t\t\tif (parsed)\n\t\t\t{\n\t\t\t\tvar compression:String = (compressed) ? \"compressed\" : \"uncompressed\";\n\t\t\t\tvar frames:String = totalFrames > 1 ? \"frames\" : \"frame\";\n\t\t\t\treturn \"[SWF\" + version + \" AS\" + asVersion + \".0: \" + totalFrames + \" \" + frames + \" @ \" + frameRate + \" fps \"\n\t\t\t\t\t+ _dimensions.width + \"x\" + _dimensions.height + \" \" + compression + \"]\";\n\t\t\t}\n\n\t\t\t// default toString if SWF not parsed\n\t\t\treturn Object.prototype.toString.call(this) as String;\n\t\t}\n\n\t\t/**\n\t\t * Parses the bytes of a SWF file to extract\n\t\t * properties from its header.\n\t\t * @param\tswfBytes Bytes of a SWF to parse.\n\t\t */\n\t\tpublic function parse(swfBytes:ByteArray):void\n\t\t{\n\t\t\tparseDefaults();\n\n\t\t\t// null bytes, exit\n\t\t\tif (swfBytes == null)\n\t\t\t{\n\t\t\t\tparseError(\"Error: Cannot parse a null value.\");\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\t// assume at start parse completed successfully\n\t\t\t// on failure, this will be set to false\n\t\t\tparsed = true;\n\n\t\t\t// --------------------------------------\n\t\t\t// HEADER\n\t\t\t// --------------------------------------\n\n\t\t\ttry\n\t\t\t{\n\n\t\t\t\t// try to parse the bytes.  Failures\n\t\t\t\t// results in cleared values for the data\n\t\t\t\tbytes = swfBytes;\n\t\t\t\tbytes.endian = Endian.LITTLE_ENDIAN;\n\t\t\t\tbytes.position = 0;\n\n\t\t\t\t// get header characters\n\t\t\t\tvar swfFC:uint = bytes.readUnsignedByte(); // F, or C if compressed\n\t\t\t\tvar swfW:uint = bytes.readUnsignedByte(); // W\n\t\t\t\tvar swfS:uint = bytes.readUnsignedByte(); // S\n\n\t\t\t\t// validate header characters\n\t\t\t\tif ((swfFC != SWF_F && swfFC != SWF_C)\n\t\t\t\t\t|| swfW != SWF_W || swfS != SWF_S)\n\t\t\t\t{\n\t\t\t\t\tparseError(\"Error: Invalid SWF header.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcompressed = Boolean(swfFC == SWF_C); // == SWF_F if not compressed\n\n\t\t\t\tversion = bytes.readUnsignedByte();\n\n\t\t\t\tfileSize = bytes.readUnsignedInt(); // mostly redundant since we should have full bytes\n\n\t\t\t\t// if compressed, need to uncompress\n\t\t\t\t// the data after the first 8 bytes\n\t\t\t\t// (first 8 already read above)\n\t\t\t\tif (compressed)\n\t\t\t\t{\n\n\t\t\t\t\t// use a temporary byte array to\n\t\t\t\t\t// represent the compressed portion\n\t\t\t\t\t// of the SWF file\n\t\t\t\t\tvar temp:ByteArray = new ByteArray();\n\t\t\t\t\tbytes.readBytes(temp);\n\t\t\t\t\tbytes = temp;\n\t\t\t\t\tbytes.endian = Endian.LITTLE_ENDIAN;\n\t\t\t\t\tbytes.position = 0;\n\t\t\t\t\ttemp = null; // temp no longer needed\n\n\t\t\t\t\tbytes.uncompress();\n\n\t\t\t\t\t\t// Note: at this point, the original\n\t\t\t\t\t\t// uncompressed 8 bytes are no longer\n\t\t\t\t\t\t// part of the current bytes byte array\n\t\t\t\t}\n\n\t\t\t\t_dimensions = readRect();\n\t\t\t\tbytes.position++; // one up after rect\n\n\t\t\t\tframeRate = bytes.readUnsignedByte();\n\n\t\t\t\ttotalFrames = bytes.readUnsignedShort();\n\n\t\t\t}\n\t\t\tcatch (error:Error)\n\t\t\t{\n\n\t\t\t\t// header parse error\n\t\t\t\tparseError(error.message);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// --------------------------------------\n\t\t\t// TAGS\n\t\t\t// --------------------------------------\n\n\t\t\t// read all the tags in the file\n\t\t\t// up until the END tag\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (readTag())\n\t\t\t\t{\n\t\t\t\t\t// noop\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (error:Error)\n\t\t\t{\n\n\t\t\t\t// error in tag parsing. EOF would throw\n\t\t\t\t// an error, but the END tag should be\n\t\t\t\t// reached before that occurs\n\t\t\t\tparseError(error.message);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// parse completed successfully!\n\t\t\t// null bytes since no longer needed\n\t\t\tbytes = null;\n\t\t}\n\n\t\t/**\n\t\t * Defines default values for all the class\n\t\t * properties.  This is used to have accurate\n\t\t * values for properties which may not be\n\t\t * present in the SWF file such as asVersion\n\t\t * which is only required to be specified in\n\t\t * SWF8 and above (in FileAttributes tag).\n\t\t */\n\t\tprivate function parseDefaults():void\n\t\t{\n\t\t\tcompressed = false;\n\t\t\tversion = 1; // SWF1\n\t\t\tfileSize = 0;\n\t\t\t_dimensions = new Rectangle();\n\t\t\tframeRate = 12; // default from Flash authoring (flex == 24)\n\t\t\ttotalFrames = 1;\n\t\t\tmetadata = null;\n\t\t\tasVersion = ActionScriptVersion.ACTIONSCRIPT2; // 2 if not explicit\n\t\t\tusesNetwork = false;\n\t\t\tbackgroundColor = 0xFFFFFF; // white background\n\t\t\tprotectedFromImport = false;\n\t\t\tdebuggerEnabled = true;\n\t\t\tscriptTimeoutLimit = 256;\n\t\t\trecursionLimit = 15;\n\t\t\thardwareAcceleration = 0;\n\n\t\t\terrorText = \"\"; // clear existing error text\n\n\t\t\t// tag helper flags\n\t\t\tbgColorFound = false;\n\t\t}\n\n\t\t/**\n\t\t * Clears variable data and logs an error\n\t\t * message.\n\t\t */\n\t\tprivate function parseError(message:String = \"Unkown error.\"):void\n\t\t{\n\t\t\tcompressed = false;\n\t\t\tversion = 0;\n\t\t\tfileSize = 0;\n\t\t\t_dimensions = new Rectangle();\n\t\t\tframeRate = 0;\n\t\t\ttotalFrames = 0;\n\t\t\tmetadata = null;\n\t\t\tasVersion = 0;\n\t\t\tusesNetwork = false;\n\t\t\tbackgroundColor = 0;\n\t\t\tprotectedFromImport = false;\n\t\t\tdebuggerEnabled = false;\n\t\t\tscriptTimeoutLimit = 0;\n\t\t\trecursionLimit = 0;\n\t\t\thardwareAcceleration = 0;\n\n\t\t\tparsed = false;\n\t\t\tbytes = null;\n\t\t\terrorText = message;\n\t\t}\n\n\t\t/**\n\t\t * Utility to convert a unit value into a string\n\t\t * in hex style padding value with \"0\" characters.\n\t\t * @return The string representation of the hex value.\n\t\t */\n\t\tprivate function paddedHex(value:uint, numChars:int = 6):String\n\t\t{\n\t\t\tvar str:String = value.toString(16);\n\t\t\twhile (str.length < numChars)\n\t\t\t\tstr = \"0\" + str;\n\t\t\treturn \"0x\" + str;\n\t\t}\n\n\t\t/**\n\t\t * Reads a string in the byte stream by\n\t\t * reading all bytes until a null byte (0)\n\t\t * is reached.\n\t\t * @return The string having been read.\n\t\t */\n\t\tprivate function readString():String\n\t\t{\n\n\t\t\t// find ending null character that\n\t\t\t// terminates the string\n\t\t\tvar i:uint = bytes.position;\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (bytes[i] != 0)\n\t\t\t\t\ti++;\n\t\t\t}\n\t\t\tcatch (error:Error)\n\t\t\t{\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t// null byte should have been found\n\t\t\t// return the read string\n\t\t\treturn bytes.readUTFBytes(i - bytes.position);\n\t\t}\n\n\t\t/**\n\t\t * Reads RECT data from the current\n\t\t * location in the current bytes object\n\t\t * @return A rectangle object whose values\n\t\t * match those of the RECT read.\n\t\t */\n\t\tprivate function readRect():Rectangle\n\t\t{\n\t\t\tnextBitByte();\n\t\t\tvar rect:Rectangle = new Rectangle();\n\t\t\tvar dataSize:uint = readBits(GET_DATA_SIZE);\n\t\t\trect.left = readBits(dataSize, true) * TWIPS_TO_PIXELS;\n\t\t\trect.right = readBits(dataSize, true) * TWIPS_TO_PIXELS;\n\t\t\trect.top = readBits(dataSize, true) * TWIPS_TO_PIXELS;\n\t\t\trect.bottom = readBits(dataSize, true) * TWIPS_TO_PIXELS;\n\t\t\treturn rect;\n\t\t}\n\n\t\tprivate function readMatrix():Matrix\n\t\t{\n\t\t\tnextBitByte();\n\t\t\tvar dataSize:uint;\n\t\t\tvar matrix:Matrix = new Matrix();\n\n\t\t\tif (readBits(1))\n\t\t\t{ // has scale\n\t\t\t\tdataSize = readBits(GET_DATA_SIZE);\n\t\t\t\tmatrix.a = readBits(dataSize, true);\n\t\t\t\tmatrix.d = readBits(dataSize, true);\n\t\t\t}\n\n\t\t\tif (readBits(1))\n\t\t\t{ // has rotation\n\t\t\t\tdataSize = readBits(GET_DATA_SIZE);\n\t\t\t\tmatrix.b = readBits(dataSize, true);\n\t\t\t\tmatrix.c = readBits(dataSize, true);\n\t\t\t}\n\n\t\t\t// translation\n\t\t\tdataSize = readBits(GET_DATA_SIZE);\n\t\t\tmatrix.tx = readBits(dataSize, true) * TWIPS_TO_PIXELS;\n\t\t\tmatrix.ty = readBits(dataSize, true) * TWIPS_TO_PIXELS;\n\n\t\t\treturn matrix;\n\t\t}\n\n\t\t/**\n\t\t * Reads a series of bits from the current byte\n\t\t * defined by currentByte based on the but at\n\t\t * position bitPosition.  If more bits are required\n\t\t * than are available in the current byte, the next\n\t\t * byte in the bytes array is read and the bits are\n\t\t * taken from there to complete the request.\n\t\t * @param\tnumBits The number of bits to read.\n\t\t * @return The bits read as a uint.\n\t\t */\n\t\tprivate function readBits(numBits:uint, signed:Boolean = false):Number\n\t\t{\n\t\t\tvar value:Number = 0; // int or uint\n\t\t\tvar remaining:uint = 8 - bitPosition;\n\t\t\tvar mask:uint;\n\n\t\t\t// can get all bits from current byte\n\t\t\tif (numBits <= remaining)\n\t\t\t{\n\t\t\t\tmask = (1 << numBits) - 1;\n\t\t\t\tvalue = (currentByte >> (remaining - numBits)) & mask;\n\t\t\t\tif (numBits == remaining)\n\t\t\t\t\tnextBitByte();\n\t\t\t\telse\n\t\t\t\t\tbitPosition += numBits;\n\n\t\t\t\t\t// have to get bits from 2 (or more)\n\t\t\t\t\t// bytes the current and the next (recursive)\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmask = (1 << remaining) - 1;\n\t\t\t\tvar firstValue:uint = currentByte & mask;\n\t\t\t\tvar over:uint = numBits - remaining;\n\t\t\t\tnextBitByte();\n\t\t\t\tvalue = (firstValue << over) | readBits(over);\n\t\t\t}\n\n\t\t\t// convert to signed int if signed bitflag exists\n\t\t\tif (signed && value >> (numBits - 1) == 1)\n\t\t\t{\n\t\t\t\tremaining = 32 - numBits; // 32-bit uint\n\t\t\t\tmask = (1 << remaining) - 1;\n\t\t\t\treturn int(mask << numBits | value);\n\t\t\t}\n\n\t\t\t// unsigned int\n\t\t\treturn uint(value);\n\t\t}\n\n\t\t/**\n\t\t * Reads the next byte in the stream assigning\n\t\t * it to currentByte and resets the value of\n\t\t * bitPosition to 0.\n\t\t */\n\t\tprivate function nextBitByte():void\n\t\t{\n\t\t\tcurrentByte = bytes.readByte();\n\t\t\tbitPosition = 0;\n\t\t}\n\n\t\t/**\n\t\t * Parses the tag at the current byte location.\n\t\t * @return false if the tag read is the END tag;\n\t\t * true if more tags should be present in the file.\n\t\t */\n\t\tprivate function readTag():Boolean\n\t\t{\n\n\t\t\tvar currentTagPosition:uint = bytes.position;\n\n\t\t\t// read tag header\n\t\t\tvar tagHeader:int = bytes.readUnsignedShort();\n\t\t\tcurrentTag = tagHeader >> TAG_HEADER_ID_BITS;\n\t\t\tvar tagLength:uint = tagHeader & TAG_HEADER_MAX_SHORT;\n\n\t\t\t// if a long tag, the tag length will be\n\t\t\t// set to its maximum. If so, set\n\t\t\t// the tag length to the long length\n\t\t\tif (tagLength == TAG_HEADER_MAX_SHORT)\n\t\t\t{\n\t\t\t\ttagLength = bytes.readUnsignedInt();\n\t\t\t}\n\n\t\t\t// when the tag is read, the position\n\t\t\t// of the byte stream must be set to the\n\t\t\t// end of this tag for the start of the next\n\t\t\t// tag.  This assures the correct position\n\t\t\t// no matter what happens in readTagData()\n\t\t\tvar nextTagPosition:uint = bytes.position + tagLength;\n\n\t\t\t// read the data in the tag (if supported)\n\t\t\tvar moreTags:Boolean = readTagData(tagLength, currentTagPosition, nextTagPosition);\n\t\t\tif (!moreTags)\n\t\t\t\treturn false; // end tag\n\n\t\t\t// next tag\n\t\t\tbytes.position = nextTagPosition;\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Called from readTag, this parses the value of individual\n\t\t * tag based on the tag id read in the tag header.\n\t\t * @param\ttag A tag object containing a tag's id and length.\n\t\t * @param\tstart The start position of the full tag.\n\t\t * @param\tend The end position of the full tag.\n\t\t * @return false if the tag read is the END tag;\n\t\t * true if more tags should be present in the file.\n\t\t */\n\t\tprivate function readTagData(tagLength:uint, start:uint, end:uint):Boolean\n\t\t{\n\n\t\t\t// if defined, call the tag callback with\n\t\t\t// the tag id and a copy of the bytes\n\t\t\t// specific to the tag\n\t\t\tif (tagCallback != null)\n\t\t\t{\n\t\t\t\tvar tagBytes:ByteArray = new ByteArray();\n\t\t\t\tif (_tagCallbackBytesIncludesHeader)\n\t\t\t\t{\n\t\t\t\t\ttagBytes.writeBytes(bytes, start, end - start);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (tagLength)\n\t\t\t\t\t{\n\t\t\t\t\t\ttagBytes.writeBytes(bytes, bytes.position, tagLength);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttagBytes.position = 0;\n\t\t\t\ttagCallback(currentTag, tagBytes);\n\t\t\t}\n\n\t\t\t// handle each tag individually based on\n\t\t\t// it's tag id\n\t\t\tswitch (currentTag)\n\t\t\t{\n\n\n\t\t\t\t// FileAttributes tag was only required for\n\t\t\t\t// SWF 8 and later. Calling defaults()\n\t\t\t\t// assures default values for the properties\n\t\t\t\t// determined here if the tag is not present\n\t\t\t\tcase TAG_ID_FILE_ATTS:\n\n\t\t\t\t\tnextBitByte(); // read file attributes in bits\n\t\t\t\t\treadBits(1); // reserved\n\n\t\t\t\t\thardwareAcceleration = readBits(2);\n\n\t\t\t\t\treadBits(1); // hasMetaData; auto-determined by tag\n\n\t\t\t\t\tasVersion = (readBits(1) && version >= 9)\n\t\t\t\t\t\t? ActionScriptVersion.ACTIONSCRIPT3\n\t\t\t\t\t\t: ActionScriptVersion.ACTIONSCRIPT2;\n\n\t\t\t\t\treadBits(2); // reserved (2)\n\n\t\t\t\t\tusesNetwork = Boolean(readBits(1) == 1);\n\t\t\t\t\t// bunch of others reserved after this\n\t\t\t\t\tbreak;\n\n\n\t\t\t\t// Metadata in a SWF is in the format of\n\t\t\t\t// XMP XML. Though the FileAttributes will\n\t\t\t\t// determine if it is present, it's easier to\n\t\t\t\t// just check for the metadata tag id\n\t\t\t\tcase TAG_ID_META:\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tmetadata = new XML(readString());\n\t\t\t\t\t}\n\t\t\t\t\tcatch (error:Error)\n\t\t\t\t\t{\n\t\t\t\t\t\t// error reading string or parsing as XML\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\t// Many background colors could potentially exist\n\t\t\t\t// for a single SWF, but we're assuming there's\n\t\t\t\t// only one. If there are more, the first will be used\n\t\t\t\tcase TAG_ID_BG_COLOR:\n\n\t\t\t\t\t// check the bg color found flag\n\t\t\t\t\t// if true, we want to ignore all other colors\n\t\t\t\t\t// since they would be added after this one\n\t\t\t\t\tif (!bgColorFound)\n\t\t\t\t\t{\n\t\t\t\t\t\tbgColorFound = true;\n\n\t\t\t\t\t\tbackgroundColor = readRGB();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\t// Only determines if the SWF is protected from\n\t\t\t\t// import; a password, if provided, will not\n\t\t\t\t// be retrieved from the SWF\n\t\t\t\tcase TAG_ID_PROTECTED:\n\n\t\t\t\t\tprotectedFromImport = Boolean(bytes.readUnsignedByte() != 0);\n\t\t\t\t\t// password if needed\n\t\t\t\t\tbreak;\n\n\n\t\t\t\t// the debugger 1 tag is for SWF5 only\n\t\t\t\t// the debugger 2 tag is for SWF6+\n\t\t\t\tcase TAG_ID_DEBUGGER1:\n\n\t\t\t\t\tif (version == 5)\n\t\t\t\t\t\tdebuggerEnabled = true;\n\t\t\t\t\t// password if needed\n\t\t\t\t\tbreak;\n\t\t\t\tcase TAG_ID_DEBUGGER2:\n\n\t\t\t\t\tif (version > 5)\n\t\t\t\t\t\tdebuggerEnabled = true;\n\t\t\t\t\t// password if needed\n\t\t\t\t\tbreak;\n\n\t\t\t\t// for both timeout and recursion but I don't\n\t\t\t\t// think any tool lets you set recursion\n\t\t\t\tcase TAG_ID_SCRIPT_LIMITS:\n\t\t\t\t\trecursionLimit = bytes.readUnsignedShort();\n\t\t\t\t\tscriptTimeoutLimit = bytes.readUnsignedShort();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TAG_ID_EOF:\n\t\t\t\t\treturn false; // end of file\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// unrecognized tag by this parser; do nothing\n\t\t\t\t\t// if you want to support other tags\n\t\t\t\t\t// make sure they're caught above in\n\t\t\t\t\t// this switch statement.\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// not last tag, continue reading\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate function readRGB():uint\n\t\t{\n\t\t\treturn (bytes.readUnsignedByte() << 16) // R\n\t\t\t\t| (bytes.readUnsignedByte() << 8) // G\n\t\t\t\t| bytes.readUnsignedByte(); //       B\n\t\t}\n\n\t\tprivate function readARGB():uint\n\t\t{\n\t\t\treturn (bytes.readUnsignedByte() << 24) // A\n\t\t\t\t| (bytes.readUnsignedByte() << 16) // R\n\t\t\t\t| (bytes.readUnsignedByte() << 8) // G\n\t\t\t\t| bytes.readUnsignedByte(); //       B\n\t\t}\n\n\t\tprivate function readRGBA():uint\n\t\t{\n\t\t\tvar rByte:uint = bytes.readUnsignedByte(); // R\n\t\t\tvar gByte:uint = bytes.readUnsignedByte(); // G\n\t\t\tvar bByte:uint = bytes.readUnsignedByte(); // B\n\t\t\tvar aByte:uint = bytes.readUnsignedByte(); // A\n\t\t\treturn (aByte << 24) // A\n\t\t\t\t| (rByte << 16) // R\n\t\t\t\t| (gByte << 8) // G\n\t\t\t\t| bByte; //       B\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/textField/TextFieldWrapper.as",
    "content": "package utils.textField\n{\n\timport flash.display.MovieClip;\n\timport flash.text.TextField;\n\t\n\t/**\n\t * Because TextFields are not MovieClips, you cannot do timeline\n\t * tweens on a TextField in Flash CSx without first making it a child\n\t * of a MovieClip.\n\t *  \n\t * This class acts as a base class for creating these types of movieclips\n\t * so you don't need to create a new class for each text field that \n\t * does this. \n\t * \n\t * In the flash library, create a new movieclip symbol containing the\n\t * textField. Make sure you set the instance name for the text field to\n\t * \"textField\". Make the base class for the symbol \n\t * \"util.textfield.TextFieldWrapper\". Allow Flash to automatically\n\t * generate the class for you.\n\t * When referencing this MovieClip in your code, use the type \n\t * AbstractTextFieldWrapper insatead of MovieClip. You will be able to set\n\t * the text of the TextField using the .text property.\n\t * \n\t * @author Mims H. Wright\n\t */ \n\tpublic class TextFieldWrapper extends MovieClip\n\t{\n\t\t/**\n\t\t * Direct reference to the text field. \n\t\t */\n\t\tpublic var textField:TextField;\n\t\t\n\t\t/** Passes the text through to the text field. */\n\t\tpublic function set text(text:String):void {\n\t\t\ttextField.text = text;\t\n\t\t}\n\t\tpublic function get text():String {\n\t\t\treturn textField.text;\n\t\t}\n\t\t\n\t\tpublic function TextFieldWrapper() {\n\t\t\tsuper();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/textField/clearFields.as",
    "content": "package utils.textField\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.DisplayObjectContainer;\n\timport flash.text.TextField;\n\n\t/**\n\t * Clear a <code>TextField</code> text or to all <code>TextField</code>'s texts in a <code>DisplayObjectContainer</code>.\n\t * @param o             <code>DisplayObject</code> that either <i>is</i> or contains <code>TextField</code>'s.\n\t */\n\tpublic function clearFields(o:DisplayObject):void\n\t{\n\t\tvar tf:TextField;\n\t\tif (o is TextField)\n\t\t{\n\t\t\ttf = o as TextField;\n\t\t\ttf.text = tf.htmlText = '';\n\t\t}\n\t\telse if (o is DisplayObjectContainer)\n\t\t{\n\t\t\tvar container:DisplayObjectContainer = o as DisplayObjectContainer;\n\t\t\tfor (var i:int = 0; i < container.numChildren; i++)\n\t\t\t{\n\t\t\t\tif (container.getChildAt(i) is TextField)\n\t\t\t\t{\n\t\t\t\t\ttf = container.getChildAt(i) as TextField;\n\t\t\t\t\ttf.text = tf.htmlText = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/textField/createField.as",
    "content": "package utils.textField\n{\n\timport flash.text.StyleSheet;\n\timport flash.text.TextField;\n\timport flash.text.TextFormat;\n\n\t/**\n\t * Create a <code>TextField</code> instance and return it.\n\t */\n\tpublic function createField(str:String, x:Number = 0, y:Number = 0, width:Number = 200, height:Number = 20, multiline:Boolean = false, font:String = \"Verdana\", size:Number = 9, color:uint = 0,\n\t\t\t\t\t\t\t\tautoSize:String = 'left', embedFonts:Boolean = false, selectable:Boolean = false, css:StyleSheet = null):TextField\n\t{\n\t\tvar tf:TextField = new TextField();\n\t\tvar fmt:TextFormat = new TextFormat(font, size, color);\n\t\ttf.x = x;\n\t\ttf.y = y;\n\t\ttf.width = width;\n\t\ttf.height = height;\n\t\ttf.autoSize = autoSize;\n\t\ttf.embedFonts = embedFonts;\n\t\ttf.selectable = selectable;\n\t\ttf.multiline = multiline;\n\t\ttf.textColor = color;\n\t\ttf.defaultTextFormat = fmt;\n\t\ttf.htmlText = str;\n\t\ttf.styleSheet = css;\n\t\treturn tf;\n\t}\n}"
  },
  {
    "path": "src/utils/textField/formatFields.as",
    "content": "package utils.textField\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.DisplayObjectContainer;\n\timport flash.text.TextField;\n\timport flash.text.TextFormat;\n\n\t/**\n\t * Apply a <code>TextFormat</code> to a <code>TextField</code> or to all <code>TextField</code>'s in a <code>DisplayObjectContainer</code>.\n\t * @param o                     <code>DisplayObject</code> that either <i>is</i> or contains <code>TextField</code>'s.\n\t * @param textFormat    to apply to the <code>TextField</code>'s.\n\t */\n\tpublic function formatFields(o:DisplayObject, textFormat:TextFormat):void\n\t{\n\t\tvar tf:TextField;\n\t\tif (o is TextField)\n\t\t{\n\t\t\ttf = o as TextField;\n\t\t\ttf.setTextFormat(textFormat);\n\t\t}\n\t\telse if (o is DisplayObjectContainer)\n\t\t{\n\t\t\tvar container:DisplayObjectContainer = o as DisplayObjectContainer;\n\t\t\tfor (var i:int = 0; i < container.numChildren; i++)\n\t\t\t{\n\t\t\t\tif (container.getChildAt(i) is TextField)\n\t\t\t\t{\n\t\t\t\t\ttf = container.getChildAt(i) as TextField;\n\t\t\t\t\ttf.setTextFormat(textFormat);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/textField/getUsableFonts.as",
    "content": "package utils.textField\n{\n\timport flash.text.Font;\n\n\t/**\n\t * Searches the client's available fonts to see if any of the Font from the <code>desiredFontList</code> are available.\n\t * @param desiredFontList       array of desired <code>fontName</code>'s.\n\t * @return                                      array of desired fonts which are available for use on the client's system.\n\t */\n\tpublic function getUsableFonts(desiredFontList:Array):Array\n\t{\n\t\tvar clientFontList:Array = Font.enumerateFonts(true);\n\t\tvar availableFontList:Array = new Array();\n\t\tfor (var i:Number = 0; i < desiredFontList.length; i++)\n\t\t{\n\t\t\tfor (var j:Number = 0; j < clientFontList.length; j++)\n\t\t\t{\n\t\t\t\tif (desiredFontList[i] == Font(clientFontList[j]).fontName)\n\t\t\t\t{\n\t\t\t\t\tavailableFontList.push(desiredFontList[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (availableFontList.length >= 1) ? availableFontList : null;\n\t}\n}"
  },
  {
    "path": "src/utils/textField/hideFields.as",
    "content": "package utils.textField\n{\n\timport flash.text.TextField;\n\n\t/**\n\t * Hide a <code>TextField</code> or <code>TextField</code>'s from display (visible false, alpha 0).\n\t * @see #reveal\n\t */\n\tpublic function hideFields(... args):void\n\t{\n\t\tfor (var i:int = 0; i < args.length; i++)\n\t\t{\n\t\t\tif (args[i] is TextField)\n\t\t\t{\n\t\t\t\targs[i].alpha = 0;\n\t\t\t\targs[i].visible = false;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/textField/revealFields.as",
    "content": "package utils.textField\n{\n\timport flash.text.TextField;\n\n\t/**\n\t * Reveal a <code>TextField</code> or <code>TextField</code>'s (visible true, alpha 1)\n\t * @see #hide\n\t */\n\tpublic function revealFields(... args):void\n\t{\n\t\tfor (var i:int = 0; i < args.length; i++)\n\t\t{\n\t\t\tif (args[i] is TextField)\n\t\t\t{\n\t\t\t\targs[i].alpha = 1;\n\t\t\t\targs[i].visible = true;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/textField/setFormattedText.as",
    "content": "package utils.textField\n{\n\timport flash.text.TextField;\n\timport flash.text.TextFieldAutoSize;\n\timport flash.text.TextFieldType;\n\timport flash.text.TextFormat;\n\n\timport utils.validation.isBlank;\n\n\t/**\n\t * Set the text of a <code>TextField</code> while preserving the formatting (leading, kerning, etc).\n\t * XXX - Warning: htmlText and styles can break the formatting: no known fix as of yet.\n\t */\n\tpublic function setFormattedText(tf:TextField, str:String, autoSize:Boolean = true):void\n\t{\n\t\tvar s:String = (isBlank(str)) ? \" \" : str;\n\t\tif (autoSize)\n\t\t{\n\t\t\ttf.autoSize = TextFieldAutoSize.LEFT;\n\t\t}\n\t\tvar textFormat:TextFormat = tf.getTextFormat();\n\t\tif (tf.type == TextFieldType.INPUT)\n\t\t{\n\t\t\ttf.text = s;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttf.htmlText = s;\n\t\t}\n\t\ttf.setTextFormat(textFormat);\n\t}\n}"
  },
  {
    "path": "src/utils/textField/setStyledText.as",
    "content": "package utils.textField\n{\n\timport flash.text.StyleSheet;\n\timport flash.text.TextField;\n\n\t/**\n\t * Apply a <code>StyleSheet</code> to a <code>TextField</code> &amp; set its contents.\n\t *\n\t * @param tf <code>TextField</code> to display.\n\t * @param str of text to apply.\n\t * @param stylesheet to apply to the <code>TextField</code>'s (Default: <code>App.css</code>).\n\t *\n\t * @see sekati.core.App#css\n\t */\n\tpublic function setStyledText(tf:TextField, str:String, stylesheet:StyleSheet = null):void\n\t{\n\t\tstyleFields(tf, stylesheet);\n\t\ttf.htmlText = str;\n\t}\n}"
  },
  {
    "path": "src/utils/textField/setTextColor.as",
    "content": "package utils.textField\n{\n\timport flash.text.TextField;\n\n\t/**\n\t * Set the <code>TextField</code> color formatting.\n\t */\n\tpublic function setTextColor(tf:TextField, color:uint, backgroundColor:uint, borderColor:uint):void\n\t{\n\t\ttf.textColor = color;\n\t\ttf.background = true;\n\t\ttf.backgroundColor = backgroundColor;\n\t\ttf.border = true;\n\t\ttf.borderColor = borderColor;\n\t}\n}"
  },
  {
    "path": "src/utils/textField/setTextFont.as",
    "content": "package utils.textField\n{\n\timport flash.text.TextField;\n\timport flash.text.TextFormat;\n\n\t/**\n\t * Set the <code>TextField</code> font formatting.\n\t */\n\tpublic function setTextFont(tf:TextField, fontName:String, fontSize:Number, isEmbedFont:Boolean = false, isBold:Boolean = false, isItalic:Boolean = false, isUnderline:Boolean = false):void\n\t{\n\t\tvar fmt:TextFormat = tf.getTextFormat();\n\t\tfmt.font = fontName;\n\t\tfmt.size = fontSize;\n\t\tfmt.italic = isItalic;\n\t\tfmt.bold = isBold;\n\t\tfmt.underline = isUnderline;\n\t\ttf.embedFonts = isEmbedFont;\n\t\ttf.setTextFormat(fmt);\n\t}\n}"
  },
  {
    "path": "src/utils/textField/setTextLeading.as",
    "content": "package utils.textField\n{\n\timport flash.text.TextField;\n\timport flash.text.TextFormat;\n\n\t/**\n\t * Set the <code>TextField</code> leading formatting.\n\t */\n\tpublic function setTextLeading(tf:TextField, space:Number = 0):void\n\t{\n\t\tvar fmt:TextFormat = tf.getTextFormat();\n\t\tfmt.leading = space;\n\t\ttf.setTextFormat(fmt);\n\t}\n}"
  },
  {
    "path": "src/utils/textField/setTextLetterSpacing.as",
    "content": "package utils.textField\n{\n\timport flash.text.TextField;\n\timport flash.text.TextFormat;\n\n\t/**\n\t * Set the <code>TextField</code> letter spacing formatting.\n\t */\n\tpublic function setTextLetterSpacing(tf:TextField, spacing:Number = 0):void\n\t{\n\t\tvar fmt:TextFormat = tf.getTextFormat();\n\t\tfmt.letterSpacing = spacing;\n\t\ttf.setTextFormat(fmt);\n\t}\n}"
  },
  {
    "path": "src/utils/textField/setTextSpaceWidth.as",
    "content": "package utils.textField\n{\n\timport flash.text.TextField;\n\timport flash.text.TextFormat;\n\n\t/**\n\t * Set the <code>TextField</code>'s width for space characters.\n\t */\n\tpublic function setTextSpaceWidth(tf:TextField, space:Number = 1):void\n\t{\n\t\tvar fmt:TextFormat = new TextFormat();\n\t\tfmt.letterSpacing = space;\n\t\tvar i:int = 0;\n\t\twhile (tf.text.indexOf(\" \", i) > -1)\n\t\t{\n\t\t\tvar index:int = tf.text.indexOf(\" \", i);\n\t\t\ttf.setTextFormat(fmt, index, index + 1);\n\t\t\ti = index + 1;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/textField/styleFields.as",
    "content": "package utils.textField\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.DisplayObjectContainer;\n\timport flash.text.StyleSheet;\n\timport flash.text.TextField;\n\n\t/**\n\t * Apply the application stylesheet to a <code>TextField</code> or to all <code>TextField</code>'s in a <code>DisplayObjectContainer</code>.\n\t *\n\t * <p><b>Warning</b>: Unlike <code>formatFields</code> you must <i>reset</i> your <code>htmlText</code> to have the style applied.</p>\n\t * @param o                     <code>DisplayObject</code> that either <i>is</i> or contains <code>TextField</code>'s.\n\t * @param stylesheet    to apply to the <code>TextField</code>'s (Default: <code>App.css</code>).\n\t * @see sekati.core.App#css\n\t */\n\tpublic function styleFields(o:DisplayObject, stylesheet:StyleSheet):void\n\t{\n\t\tvar tf:TextField;\n\t\tvar css:StyleSheet = stylesheet;\n\t\tif (o is TextField)\n\t\t{\n\t\t\ttf = o as TextField;\n\t\t\ttf.styleSheet = css;\n\t\t}\n\t\telse if (o is DisplayObjectContainer)\n\t\t{\n\t\t\tvar container:DisplayObjectContainer = o as DisplayObjectContainer;\n\t\t\tfor (var i:int = 0; i < container.numChildren; i++)\n\t\t\t{\n\t\t\t\tif (container.getChildAt(i) is TextField)\n\t\t\t\t{\n\t\t\t\t\ttf = container.getChildAt(i) as TextField;\n\t\t\t\t\ttf.styleSheet = css;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/textField/truncateMultilineText.as",
    "content": "package utils.textField\n{\n\timport flash.text.TextField;\n\n\t/**\n\t * Truncate a multiline <code>TextField</code> after the defined number of lines of text.\n\t * @param tf                            <code>TextField</code> to truncate.\n\t * @param numAlllowedLines      before the remaining text is removed.\n\t * @param isEllipsed            determines whether the text is ended with \"...\" or not.\n\t */\n\tpublic function truncateMultilineText(tf:TextField, numAlllowedLines:uint, isEllipsed:Boolean = true):void\n\t{\n\t\tif (tf.bottomScrollV > numAlllowedLines)\n\t\t{\n\t\t\tvar len:int = tf.text.length;\n\t\t\tfor (var i:int = 0; i < len; i++)\n\t\t\t{\n\t\t\t\ttf.scrollV = tf.maxScrollV;\n\t\t\t\tif (tf.bottomScrollV > numAlllowedLines)\n\t\t\t\t{\n\t\t\t\t\ttf.text = tf.text.slice(0, -1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar e:int = (isEllipsed) ? -3 : tf.text.lastIndexOf(\" \");\n\t\t\t\t\ttf.text = tf.text.slice(0, e);\n\t\t\t\t\ttf.appendText(\"...\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/textField/truncateText.as",
    "content": "package utils.textField\n{\n\timport flash.text.TextField;\n\timport flash.text.TextFieldAutoSize;\n\n\t/**\n\t * Truncate a single-line TextField to a specific width.\n\t * @param tf                    the textfield to truncate.\n\t * @param maxWidth              the desired text width to truncate at.\n\t * @param isEllipsed    denotes whether to truncate with the ellipse char \"...\".\n\t * @param isLineEllipse gives the option to \"ellipse\" the entire width of the field.\n\t */\n\tpublic function truncateText(tf:TextField, maxWidth:Number, isEllipsed:Boolean = true, isLineEllipse:Boolean = false):void\n\t{\n\t\tvar ellipse:String = '...';\n\n\t\t// save the autosize settings for renewal at the end ...\n\t\tvar autoSizeSetting:String = tf.autoSize;\n\t\ttf.autoSize = TextFieldAutoSize.NONE;\n\n\t\t// subtract a touch of length from the max width to insure no visual overflow ...\n\t\t//maxWidth = (!isLongEllipse) ? (maxWidth - 5) : (maxWidth -= 10);\n\n\t\t// don't ellipse if we fit under the max width.\n\t\tif (tf.textWidth <= maxWidth && !isLineEllipse)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// hide the field momentarily so the user doesnt see our tests ...\n\t\t//tf.visible = false;\n\n\t\t// save the original text string & it's length\n\t\tvar str:String = tf.htmlText;\n\t\tvar strLength:Number = str.length;\n\n\t\t// save the (stereotypical fonts) widest character's width: \"W\"\n\t\ttf.htmlText = \"W\";\n\t\tvar wCharWidth:Number = tf.textWidth;\n\n\t\t// save the (stereotypical fonts) medium character's width: \"A\"\n\t\ttf.text = \"A\";\n\t\tvar aCharWidth:Number = tf.textWidth;\n\n\t\t// the max num of (the largest) chars which our max desired width can hold.\n\t\tvar ptr:Number = Math.floor(maxWidth / wCharWidth);\n\n\t\t// collect the portion of the string which represents the max large chars (ptr) and add it to the field.\n\t\tvar checkStr:String = str.substr(0, ptr);\n\t\ttf.text = checkStr;\n\n\t\t// Now that we have a baseline set below our maxWidth we can start adding/testing characters:\n\t\t// in this way we optimize the number of loops which must be performed which *greatly* improves\n\t\t// performance rather than adding/testing thru the entire string (this is especially important\n\t\t// when using the method on many long texted TextFields: smart, huh?\n\t\tvar cnt:Number;\n\t\twhile (tf.textWidth < maxWidth)\n\t\t{\n\t\t\t// see if we can fit one or more standard characters in the space remaining: if we cant: bail.\n\t\t\tcnt = Math.floor((maxWidth - tf.textWidth) / aCharWidth);\n\t\t\tif (cnt == 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// increase the max chars: if we accidentally went above the str length: fix er up ...\n\t\t\tptr += cnt;\n\t\t\tptr = (ptr > strLength) ? strLength : ptr;\n\n\t\t\t// once again set a slice of our max fitting chars to the field.\n\t\t\tcheckStr = str.substr(0, ptr);\n\t\t\ttf.htmlText = checkStr;\n\n\t\t\t// if our max fitting chars is the same as the string length: bail too.\n\t\t\tif (strLength == ptr)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// if we want to ellipse apply it to the field.\n\t\tif (isEllipsed)\n\t\t{\n\t\t\ttf.appendText(ellipse);\n\t\t}\n\n\t\t// again check if we've exceeded the max desired width ...\n\t\tif (tf.textWidth > maxWidth)\n\t\t{\n\t\t\t// if we have remove a character and test again.\n\t\t\twhile (tf.textWidth > maxWidth)\n\t\t\t{\n\t\t\t\tcheckStr = checkStr.substr(0, -1);\n\t\t\t\ttf.htmlText = isEllipsed ? (checkStr + ellipse) : checkStr;\n\t\t\t}\n\t\t}\n\n\t\t// alright - things fit perfectly now! However; maybe you want it to\n\t\t// \"ellipse\" thru the entire length of the field for visual effect?\n\t\t//\n\t\t// TODO - Warning: this functions but is not perfect: can be optimized and made more accurate.\n\t\t//\n\t\tif (isLineEllipse)\n\t\t{\n\n\t\t\tvar tmpField:TextField = new TextField();\n\t\t\ttmpField.width = tf.width;\n\t\t\ttmpField.setTextFormat(tf.getTextFormat());\n\n\t\t\t// save the (stereotypical fonts) smallest character's width: \".\"\n\t\t\ttmpField.htmlText = \".\";\n\t\t\tvar periodCharWidth:Number = tmpField.textWidth;\n\n\t\t\ttmpField.htmlText = \"\";\n\t\t\tvar whiteSpaceWidth:Number = tmpField.width - tf.textWidth;\n\t\t\tvar i:Number = Math.floor(whiteSpaceWidth / periodCharWidth);\n\t\t\twhile (i-- > 0)\n\t\t\t{\n\t\t\t\ttmpField.appendText(\".\");\n\t\t\t}\n\t\t\tif (whiteSpaceWidth < tmpField.textWidth)\n\t\t\t{\n\t\t\t\twhile (whiteSpaceWidth < tmpField.textWidth)\n\t\t\t\t{\n\t\t\t\t\ttmpField.htmlText = tmpField.text.substr(0, -1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (whiteSpaceWidth > tmpField.textWidth)\n\t\t\t{\n\t\t\t\twhile (tmpField.textWidth < whiteSpaceWidth)\n\t\t\t\t{\n\t\t\t\t\ttmpField.appendText(\".\");\n\t\t\t\t}\n\t\t\t\ttmpField.htmlText = tmpField.text.substr(0, -1);\n\t\t\t}\n\t\t\ttf.appendText(tmpField.text);\n\t\t}\n\n\t\t// restore the settings and make the text visible again...\n\t\ttf.autoSize = autoSizeSetting;\n\t\t//tf.visible = true;\n\n\t\t// defer rendering if the field is on stage to avoid the flickering of the char tests...\n\t\t//if(tf.stage != null) tf.stage.invalidate( );\n\t}\n}"
  },
  {
    "path": "src/utils/type/PACKAGE_CLASS_SEPARATOR.as",
    "content": "package utils.type\n{\n\t[ExcludeClass]\n\tconst PACKAGE_CLASS_SEPARATOR:String = \"::\";\n}"
  },
  {
    "path": "src/utils/type/convertFullyQualifiedName.as",
    "content": "package utils.type\n{\n\t/**\n\t * Converts the double colon (::) in a fully qualified class name to a dot (.)\n\t */\n\tpublic function convertFullyQualifiedName(className:String):String\n\t{\n\t\treturn className.replace(PACKAGE_CLASS_SEPARATOR, \".\");\n\t}\n}"
  },
  {
    "path": "src/utils/type/describeInheritance.as",
    "content": "package utils.type\n{\n\t/**\n\t * Targeted reflection describing an object's inheritance, including\n\t * extended classes and implemented interfaces.\n\t *\n\t * @param\tvalue\t\t\tThe object or class to introspect.\n\t *\n\t * @return\t\t\t\t\tA list of XML inheritance descriptions.\n\t */\n\tpublic function describeInheritance(value:Object):XMLList\n\t{\n\t\treturn describeType(value).factory.*.(localName() == \"extendsClass\" || localName() == \"implementsInterface\");\n\t}\n}"
  },
  {
    "path": "src/utils/type/describeMethods.as",
    "content": "package utils.type {\n\n\n\n\t/**\n\t * Targeted reflection describing an object's methods.\n\t * @param\tvalue\t\t\tThe object or class to introspect.\n\t * @param\tmetadataType\tOptional filter to return only those\n\t *\t\t\t\t\t\t\t method descriptions containing the\n\t *\t\t\t\t\t\t\t specified metadata.\n\t * @return\t\t\t\t\tA list of XML method descriptions.\n\t */\n\tpublic function describeMethods(value:Object, metadataType:String = null):XMLList {\n\t\tvar methods:XMLList = describeType(value).factory.method;\n\n\t\treturn (metadataType == null) ? methods : methods.(child(\"metadata\").(@name == metadataType).length() > 0);\n\t}\n}\n"
  },
  {
    "path": "src/utils/type/describeProperties.as",
    "content": "package utils.type {\n\n\n\n\t/**\n\t * Targeted reflection describing an object's properties, including both\n\t * accessor (getter/setters) and pure properties.\n\t * @param\tvalue\t\t\tThe object or class to introspect.\n\t * @param\tmetadataType\tOptional filter to return only those\n\t *\t\t\t\t\t\t\t property descriptions containing the\n\t *\t\t\t\t\t\t\t specified metadata.\n\t * @return\t\t\t\t\tA list of XML property descriptions.\n\t */\n\tpublic function describeProperties(value:Object, metadataType:String = null):XMLList {\n\t\tvar properties:XMLList = describeType(value).factory.*.(localName() == \"accessor\" || localName() == \"variable\");\n\n\t\treturn (metadataType == null) ? properties : properties.(child(\"metadata\").(@name == metadataType).length() > 0);\n\t}\n}\n"
  },
  {
    "path": "src/utils/type/describeType.as",
    "content": "package utils.type\n{\n\t/**\n\t * Primary reflection method, producing an XML description of the object\n\t * or class specified. Results are cached internally for performance.\n\t *\n\t * @param\tvalue\t\t\tThe object or class to introspect.\n\t * @param\trefreshCache\tForces a new description to be generated,\n\t * \t\t\t\t\t\t\tuseful only when a class alias has changed.\n\t *\n\t * @return\t\t\t\t\tAn XML description, which format is\n\t * \t\t\t\t\t\t\tdocumented in the <code>flash.utils</code>\n\t * \t\t\t\t\t\t\tpackage.\n\t *\n\t * @see\t\tflash.utils#describeType\n\t */\n\timport flash.utils.describeType;\n\n\tpublic function describeType(value:Object, refreshCache:Boolean = false):XML\n\t{\n\t\tif (!(value is Class))\n\t\t{\n\t\t\tvalue = getType(value);\n\t\t}\n\n\t\tif (refreshCache || typeCache[value] == null)\n\t\t{\n\t\t\ttypeCache[value] = flash.utils.describeType(value);\n\t\t}\n\n\t\treturn typeCache[value];\n\t}\n}"
  },
  {
    "path": "src/utils/type/forInstance.as",
    "content": "package utils.type {\n\timport flash.system.ApplicationDomain;\n\timport flash.utils.getQualifiedClassName;\n\n\n\n\t/**\n\t * Returns a <code>Class</code> object that corresponds with the given\n\t * instance. If no corresponding class was found, a\n\t * <code>ClassNotFoundError</code> will be thrown.\n\t * @param instance the instance from which to return the class\n\t * @param applicationDomain the optional applicationdomain where the instance's class resides\n\t * @return the <code>Class</code> that corresponds with the given instance\n\t */\n\tpublic function forInstance(instance:*, applicationDomain:ApplicationDomain = null):Class {\n\t\tapplicationDomain = (applicationDomain == null) ? ApplicationDomain.currentDomain : applicationDomain;\n\n\t\tvar className:String = getQualifiedClassName(instance);\n\n\t\treturn forName(className, applicationDomain);\n\t}\n}\n"
  },
  {
    "path": "src/utils/type/forName.as",
    "content": "package utils.type {\n\timport flash.system.ApplicationDomain;\n\n\n\n\t/**\n\t * Returns a <code>Class</code> object that corresponds with the given\n\t * name. If no corresponding class was found in the applicationdomain tree, a\n\t * <code>ClassNotFoundError</code> will be thrown.\n\t * @param name the name from which to return the class\n\t * @param applicationDomain the optional applicationdomain where the instance's class resides\n\t * @return the <code>Class</code> that corresponds with the given name\n\t */\n\tpublic function forName(name:String, applicationDomain:ApplicationDomain = null):Class {\n\t\tapplicationDomain = (applicationDomain == null) ? ApplicationDomain.currentDomain : applicationDomain;\n\n\t\tvar result:Class;\n\n\t\tif(!applicationDomain) {\n\t\t\tapplicationDomain = ApplicationDomain.currentDomain;\n\t\t}\n\n\t\twhile(!applicationDomain.hasDefinition(name)) {\n\t\t\tif(applicationDomain.parentDomain) {\n\t\t\t\tapplicationDomain = applicationDomain.parentDomain;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tresult = applicationDomain.getDefinition(name) as Class;\n\t\t}\n\t\tcatch (e:ReferenceError) {\n\t\t\tthrow new Error(\"A class with the name '\" + name + \"' could not be found.\");\n\t\t}\n\n\t\treturn result;\n\t}\n}\n"
  },
  {
    "path": "src/utils/type/getClass.as",
    "content": "package utils.type\n{\n\timport flash.display.DisplayObject;\n\timport flash.utils.getDefinitionByName;\n\timport flash.utils.getQualifiedClassName;\n\n\t/**\n\t *   Get the class of an object\n\t *   @param obj Object to get the class of\n\t *   @return The class of the given object or null if the class cannot be\n\t *           determined\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function getClass(obj:Object):Class\n\t{\n\t\tif (obj == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tvar className:String = getQualifiedClassName(obj);\n\t\t\tvar ret:Class = Class(getDefinitionByName(className));\n\t\t\tif (ret == null && obj is DisplayObject)\n\t\t\t{\n\t\t\t\tret = getDisplayObjectClass(DisplayObject(obj));\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t\tcatch (refErr:ReferenceError)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tcatch (typeErr:TypeError)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\treturn null;\n\t}\n}"
  },
  {
    "path": "src/utils/type/getClassByName.as",
    "content": "package utils.type\n{\n\timport flash.utils.getDefinitionByName;\n\n\t/**\n\t *   Get a class by its fully-qualified name\n\t *   @param className Fully-qualified name of the class\n\t *   @return The class with the given name or null if none exists\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function getClassByName(className:String):Class\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn Class(getDefinitionByName(className));\n\t\t}\n\t\tcatch (refErr:ReferenceError)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tcatch (typeErr:TypeError)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\treturn null;\n\t}\n}"
  },
  {
    "path": "src/utils/type/getClassName.as",
    "content": "package utils.type\n{\n\timport flash.utils.getQualifiedClassName;\n\n\t/**\n\t * Returns the exact class name, without package or path.\n\t *\n\t * @param\tvalue\t\t\tThe object for which the class name is desired.\n\t * \t\t\t\t\t\t\tAny ActionScript value may be passed including\n\t * \t\t\t\t\t\t\tall ActionScript types, object instances,\n\t * \t\t\t\t\t\t\tprimitive types such as uint, and class objects.\n\t */\n\tpublic function getClassName(value:Object):String\n\t{\n\t\treturn getQualifiedClassName(value).split(\"::\").pop();\n\t}\n}"
  },
  {
    "path": "src/utils/type/getDisplayObjectClass.as",
    "content": "package utils.type\n{\n\timport flash.display.DisplayObject;\n\timport flash.utils.getQualifiedClassName;\n\n\t/**\n\t *   Get the class of a display object\n\t *   @param obj Object to get the class of\n\t *   @return The class of the given object or null if the class cannot be\n\t *           determined\n\t *   @author Jackson Dunstan\n\t */\n\tpublic function getDisplayObjectClass(obj:DisplayObject):Class\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn Class(obj.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(obj)));\n\t\t}\n\t\tcatch (refErr:ReferenceError)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tcatch (typeErr:TypeError)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\treturn null;\n\t}\n}"
  },
  {
    "path": "src/utils/type/getFullyQualifiedName.as",
    "content": "package utils.type\n{\n\timport flash.utils.getQualifiedClassName;\n\n\t/**\n\t * Returns the fully qualified name of the given class.\n\t *\n\t * @param clazz the class to get the name from\n\t * @param replaceColons whether the double colons \"::\" should be replaced by a dot \".\"\n\t *             the default is false\n\t *\n\t * @return the fully qualified name of the class\n\t */\n\tpublic function getFullyQualifiedName(clazz:Class, replaceColons:Boolean = false):String\n\t{\n\t\tvar result:String = getQualifiedClassName(clazz);\n\n\t\tif (replaceColons)\n\t\t{\n\t\t\tresult = convertFullyQualifiedName(result);\n\t\t}\n\t\treturn result;\n\t}\n}"
  },
  {
    "path": "src/utils/type/getFullyQualifiedSuperClassname.as",
    "content": "package utils.type\n{\n\timport flash.utils.getQualifiedSuperclassName;\n\n\t/**\n\t * Returns the fully qualified name of the given class' superclass.\n\t *\n\t * @param clazz the class to get its superclass' name from\n\t * @param replaceColons whether the double colons \"::\" should be replaced by a dot \".\"\n\t *             the default is false\n\t *\n\t * @return the fully qualified name of the class' superclass\n\t */\n\tpublic function getFullyQualifiedSuperClassname(clazz:Class, replaceColons:Boolean = false):String\n\t{\n\t\tvar result:String = getQualifiedSuperclassName(clazz);\n\n\t\tif (replaceColons)\n\t\t{\n\t\t\tresult = convertFullyQualifiedName(result);\n\t\t}\n\t\treturn result;\n\t}\n}"
  },
  {
    "path": "src/utils/type/getName.as",
    "content": "package utils.type\n{\n\t/**\n\t * Returns the name of the given class.\n\t *\n\t * @param clazz the class to get the name from\n\t *\n\t * @return the name of the class\n\t */\n\tpublic function getName(clazz:Class):String\n\t{\n\t\treturn getNameFromFullyQualifiedName(getFullyQualifiedName(clazz));\n\t}\n}"
  },
  {
    "path": "src/utils/type/getNameFromFullyQualifiedName.as",
    "content": "package utils.type\n{\n\t/**\n\t * Returns the name of the class or interface, based on the given fully\n\t * qualified class or interface name.\n\t *\n\t * @param fullyQualifiedName the fully qualified name of the class or interface\n\t *\n\t * @return the name of the class or interface\n\t */\n\tpublic function getNameFromFullyQualifiedName(fullyQualifiedName:String):String\n\t{\n\t\tvar result:String = \"\";\n\t\tvar startIndex:int = fullyQualifiedName.indexOf(PACKAGE_CLASS_SEPARATOR);\n\n\t\tif (startIndex == -1)\n\t\t{\n\t\t\tresult = fullyQualifiedName;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresult = fullyQualifiedName.substring(startIndex + PACKAGE_CLASS_SEPARATOR.length, fullyQualifiedName.length);\n\t\t}\n\t\treturn result;\n\t}\n}"
  },
  {
    "path": "src/utils/type/getPropertyType.as",
    "content": "package utils.type\n{\n\timport flash.utils.getDefinitionByName;\n\n\t/**\n\t * Determines the property type without accessing the property directly.\n\t * Evaluation is based on the property definition and not by its value.\n\t *\n\t * @param\tvalue\t\t\tAn object or class containing the property\n\t * \t\t\t\t\t\t\tdefinition to evaluate.\n\t * @param\tproperty\t\tThe name of the property to be evaluated\n\t *\n\t * @return\t\t\t\t\tThe class definition of the property type,\n\t * \t\t\t\t\t\t\tas described by the property definition, or\n\t * \t\t\t\t\t\t\tnull if no definition was found.\n\t */\n\tpublic function getPropertyType(value:Object, property:String):Class\n\t{\n\t\tif (!(value is Class) && !(property in value))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t// retrieve the correct property from the property list\n\t\tvar propList:XMLList = describeProperties(value).(@name == property);\n\n\t\treturn (propList.length() > 0) ? getDefinitionByName(propList[0].@type) as Class : null;\n\t}\n}"
  },
  {
    "path": "src/utils/type/getSuperClassName.as",
    "content": "package utils.type\n{\n\t/**\n\t * Returns the name of the given class' superclass.\n\t *\n\t * @param clazz the class to get the name of its superclass' from\n\t *\n\t * @return the name of the class' superclass\n\t */\n\tpublic function getSuperClassName(clazz:Class):String\n\t{\n\t\tvar fullyQualifiedName:String = getFullyQualifiedSuperClassname(clazz);\n\t\tvar index:int = fullyQualifiedName.indexOf(PACKAGE_CLASS_SEPARATOR) + PACKAGE_CLASS_SEPARATOR.length;\n\t\treturn fullyQualifiedName.substring(index, fullyQualifiedName.length);\n\t}\n}"
  },
  {
    "path": "src/utils/type/getType.as",
    "content": "package utils.type\n{\n\timport flash.utils.Proxy;\n\timport flash.utils.getDefinitionByName;\n\timport flash.utils.getQualifiedClassName;\n\n\tpublic function getType(value:Object):Class\n\t{\n\t\tif (value is Class)\n\t\t{\n\t\t\treturn value as Class;\n\t\t}\n\t\telse if (value is Proxy)\n\t\t{\n\t\t\treturn getDefinitionByName(getQualifiedClassName(value)) as Class;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn value.constructor as Class;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/utils/type/isInterface.as",
    "content": "package utils.type {\n\t/**\n\t * Returns whether the passed in Class object is an interface.\n\t *\n\t * @param clazz the class to check\n\t * @return true if the clazz is an interface; false if not\n\t */\n\tpublic function isInterface(clazz:Class):Boolean {\n\t\treturn (clazz == Object) ? false : (describeType(clazz).factory.extendsClass.length() == 0);\n\t}\n}\n"
  },
  {
    "path": "src/utils/type/isPassedByValue.as",
    "content": "package  utils.type\n{\n\t\n\t/**\n\t * Checks to see if the class of <code>instance</code> is a primitive which will be copied by value\n\t * rather than by pointer.\n\t * The primitive types checked for are :\n\t * Number\n\t * int\n\t * uint\n\t * String\n\t * Boolean\n\t * \n\t * @author Mims Wright\n\t * \n\t * @param instance - the object whos class you want to check.\n\t * @return true if instance is is a primitive value or false if null or otherwise.\n\t */\n\tpublic function isPassedByValue(instance:*):Boolean {\n\t\tif (instance == null) return false;\n\t\t//if (!isNaN(instance)) return true;\n\t\tif (instance is Number) return true;\n\t\tif (instance is int) return true;\n\t\tif (instance is uint) return true;\n\t\tif (instance is String) return true;\n\t\tif (instance is Boolean) return true;\n\t\treturn false;\n\t}\n}"
  },
  {
    "path": "src/utils/type/isType.as",
    "content": "package utils.type\n{\n\timport flash.utils.getQualifiedClassName;\n\t/**\n\t * Evaluates whether an object or class is derived from a specific\n\t * data type, class or interface. The isType() method is comparable to\n\t * ActionScript's <code>is</code> operator except that it also makes\n\t * class to class evaluations.\n\t *\n\t * @param\tvalue\t\t\tThe object or class to evaluate.\n\t * @param\ttype\t\t\tThe data type to check against.\n\t *\n\t * @return\t\t\t\t\tTrue if the object or class is derived from\n\t * \t\t\t\t\t\t\tthe data type.\n\t */\n\tpublic function isType(value:Object, type:Class):Boolean\n\t{\n\t\tif (!(value is Class))\n\t\t{\n\t\t\treturn value is type;\n\t\t}\n\n\t\tif (value == type)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tvar inheritance:XMLList = describeInheritance(value);\n\t\treturn Boolean(inheritance.(@type == getQualifiedClassName(type)).length() > 0);\n\t}\n}"
  },
  {
    "path": "src/utils/type/newInstance.as",
    "content": "package utils.type\n{\n\t/**\n\t * Creates an instance of the given class and passes the arguments to\n\t * the constructor.\n\t *\n\t *\n\t * @param clazz the class from which an instance will be created\n\t * @param args the arguments that need to be passed to the constructor\n\t */\n\tpublic function newInstance(clazz:Class, args:Array = null):*\n\t{\n\t\tvar result:*;\n\t\tvar a:Array = (args == null) ? [] : args;\n\n        if(args.length > 10)\n            throw new Error(\"newInstance has a limit of 10 arguments.\");\n\n\t\tswitch (a.length)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\tresult = new clazz(a[0]);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tresult = new clazz(a[0], a[1]);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tresult = new clazz(a[0], a[1], a[2]);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tresult = new clazz(a[0], a[1], a[2], a[3]);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tresult = new clazz(a[0], a[1], a[2], a[3], a[4]);\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tresult = new clazz(a[0], a[1], a[2], a[3], a[4], a[5]);\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tresult = new clazz(a[0], a[1], a[2], a[3], a[4], a[5], a[6]);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tresult = new clazz(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]);\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\tresult = new clazz(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\tresult = new clazz(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9]);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tresult = new clazz();\n\t\t}\n\n\t\treturn result;\n\t}\n}"
  },
  {
    "path": "src/utils/type/registerType.as",
    "content": "package utils.type\n{\n\timport flash.net.registerClassAlias;\n\timport flash.utils.getQualifiedClassName;\n\n\t/**\n\t * Ensures a class has a registered alias for object serialization and\n\t * remoting. If the class doesn't yet have an alias it will be\n\t * registered with it's full qualified class name, for example:\n\t * <code>flight.utils.Type</code>. If the class has already been\n\t * assigned an alias then its previous registration will be honored.\n\t *\n\t * @param\tvalue\t\t\tThe object or class to register.\n\t *\n\t * @return\t\t\t\t\tTrue if the registration was successful,\n\t * \t\t\t\t\t\t\totherwise the object already has an alias.\n\t *\n\t * @see\t\tflash.net#registerClassAlias\n\t */\n\tpublic function registerType(value:Object):Boolean\n\t{\n\t\tif (!(value is Class))\n\t\t{\n\t\t\tvalue = getType(value);\n\t\t}\n\n\t\t// if not already registered\n\t\tvar alias:String = describeType(value).@alias;\n\t\tif (alias.length)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tregisterClassAlias(getQualifiedClassName(value).split(\"::\").join(\".\"), value as Class);\n\t\treturn true;\n\t}\n}"
  },
  {
    "path": "src/utils/type/strictIs.as",
    "content": "package utils.type\r\n{\r\n\t/**\r\n\t * Checks the class of <code>instance</code> against the <code>compareClass</code> for strict\r\n\t * equality. If the classes are exactly the same, returns true. If\r\n\t * the classes are different even if the <code>instance</code>'s class is a subclass\r\n\t * of <code>compareClass</code>, it returns false.\r\n\t * Does not work with interfaces. The compareClass must be a class.\r\n\t * \r\n\t * @author Mims Wright\r\n\t * \r\n\t * @example <listing version=\"3.0\">\r\n\t * \t\t\tvar myBase:BaseClass = new BaseClass();\r\n\t * \t\t\tvar mySub:SubClass = new SubClass();\r\n\t * \t\t\ttrace(strictIs(myBase, BaseClass)); // true\r\n\t * \t\t\ttrace(strictIs(mySub, SubClass)); \t// true\r\n\t * \t\t\ttrace(strictIs(mySub, BaseClass)); \t// false\r\n\t * \t\t\t</listing>\r\n\t * \r\n\t * @param instance - the object whos class you want to check.\r\n\t * @param compareClass - the class to compare your object against.\r\n\t * @return true if instance is strictly of type compareClass.\r\n\t */\r\n\tpublic function strictIs(instance:Object, compareClass:Class):Boolean {\r\n\t\treturn compareClass == Class(instance.constructor);\r\n\t}\r\n}"
  },
  {
    "path": "src/utils/type/typeCache.as",
    "content": "package utils.type\n{\n\timport flash.utils.Dictionary;\n\n\t// global cache improves reflection performance significantly\n\tpublic var typeCache:Dictionary = new Dictionary();\n}"
  },
  {
    "path": "src/utils/validation/US_STATE_ABBREVIATIONS.as",
    "content": "package utils.validation\n{\n\tpublic const US_STATE_ABBREVIATIONS:Array = [\n\t\t'ak', 'al', 'ar', 'az', 'ca', 'co', 'ct', 'dc', 'de', 'fl', \n\t\t'ga', 'hi', 'ia', 'id', 'il', 'in', 'ks', 'ky', 'la', 'ma', \n\t\t'md', 'me', 'mi', 'mn', 'mo', 'ms', 'mt', 'nb', 'nc', 'nd', \n\t\t'nh', 'nj', 'nm', 'nv', 'ny', 'oh', 'ok', 'or', 'pa', 'ri', \n\t\t'sc', 'sd', 'tn', 'tx', 'ut', 'va', 'vt', 'wa', 'wi', 'wv', \n\t\t'wy'];\n}"
  },
  {
    "path": "src/utils/validation/encodeCreditCardNumber.as",
    "content": "package utils.validation\n{\n\t/**\n\t * Encode a credit card number as a string and encode all digits except the\n\t * last <code>digitsShown</code>.\n\t *\n\t * @param strNumber     credit card number as string\n\t * @param digitsShown   display this many digits at the end of the card number for security purposes\n\t * @param encodeChar    optional encoding character to use instead of default '*'\n\t *\n\t * @example\n\t * <listing version=\"3.0\">\n\t * trace(CreditCardValidator.EncodeNumber(\"1234567890123456\")); // ************3456\n\t * trace(CreditCardValidator.EncodeNumber(\"1234567890123456\", 5, \"x\"));  // xxxxxxxxxxx23456\n\t * </listing>\n\t */\n\tpublic function encodeCreditCardNumber(strNumber:String, digitsShown:uint = 4, encodeChar:String = \"*\"):String\n\t{\n\t\tvar encoded:String = \"\";\n\t\tfor (var i:Number = 0; i < strNumber.length - digitsShown; i++)\n\t\t{\n\t\t\tencoded += encodeChar;\n\t\t}\n\t\tencoded += strNumber.slice(-digitsShown);\n\t\treturn encoded;\n\t}\n}"
  },
  {
    "path": "src/utils/validation/getCreditCardProvider.as",
    "content": "package utils.validation\n{\n\tpublic function getCreditCardProvider(cardNumber:String):String\n\t{\n\t\tif (!isCreditCard(cardNumber))\n\t\t\treturn 'invalid';\n\n\t\tif (cardNumber.length == 13 ||\n\t\t\tcardNumber.length == 16 &&\n\t\t\tcardNumber.indexOf('4') == 0)\n\t\t{\n\t\t\treturn 'visa';\n\t\t}\n\t\telse if (cardNumber.indexOf('51') == 0 ||\n\t\t\tcardNumber.indexOf('52') == 0 ||\n\t\t\tcardNumber.indexOf('53') == 0 ||\n\t\t\tcardNumber.indexOf('54') == 0 ||\n\t\t\tcardNumber.indexOf('55') == 0 &&\n\t\t\tcardNumber.length == 16)\n\t\t{\n\t\t\treturn 'mastercard';\n\t\t}\n\t\telse if (cardNumber.length == 16 &&\n\t\t\tcardNumber.indexOf('6011') == 0)\n\t\t{\n\t\t\treturn 'discover';\n\t\t}\n\t\telse if (cardNumber.indexOf('34') == 0 ||\n\t\t\tcardNumber.indexOf('37') == 0 &&\n\t\t\tcardNumber.length == 15)\n\t\t{\n\t\t\treturn 'amex';\n\t\t}\n\t\telse if (cardNumber.indexOf('300') == 0 ||\n\t\t\tcardNumber.indexOf('301') == 0 ||\n\t\t\tcardNumber.indexOf('302') == 0 ||\n\t\t\tcardNumber.indexOf('303') == 0 ||\n\t\t\tcardNumber.indexOf('304') == 0 ||\n\t\t\tcardNumber.indexOf('305') == 0 ||\n\t\t\tcardNumber.indexOf('36') == 0 ||\n\t\t\tcardNumber.indexOf('38') == 0 &&\n\t\t\tcardNumber.length == 14)\n\t\t{\n\t\t\treturn 'diners';\n\t\t}\n\t\telse\n\t\t\treturn 'other';\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isBlank.as",
    "content": "package utils.validation\n{\n\timport utils.string.trim;\n\n\t/**\n\t * Validate if a strings contents are blank after a safety trim is performed.\n\t */\n\tpublic function isBlank(s:String = null):Boolean\n\t{\n\t\tvar str:String = trim(s);\n\t\tvar i:int = 0;\n\t\tif (str.length == 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\twhile (i < str.length)\n\t\t{\n\t\t\tif (str.charCodeAt(0) != 32)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn true;\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isCreditCard.as",
    "content": "package utils.validation\n{\n\t/**\n\t   Determines if credit card is valid using the Luhn formula.\n\n\t   @param cardNumber: The credit card number.\n\t   @return Returns <code>true</code> if String is a valid credit card number; otherwise <code>false</code>.\n\t */\n\tpublic function isCreditCard(cardNumber:String):Boolean\n\t{\n\t\tif (cardNumber.length < 7 || cardNumber.length > 19 || Number(cardNumber) < 1000000)\n\t\t\treturn false;\n\n\t\tvar pre:Number;\n\t\tvar sum:Number = 0;\n\t\tvar alt:Boolean = true;\n\n\t\tvar i:Number = cardNumber.length;\n\t\twhile (--i > -1)\n\t\t{\n\t\t\tif (alt)\n\t\t\t\tsum += Number(cardNumber.substr(i, 1));\n\t\t\telse\n\t\t\t{\n\t\t\t\tpre = Number(cardNumber.substr(i, 1)) * 2;\n\t\t\t\tsum += (pre > 8) ? pre -= 9 : pre;\n\t\t\t}\n\n\t\t\talt = !alt;\n\t\t}\n\n\t\treturn sum % 10 == 0;\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isEmail.as",
    "content": "package utils.validation\n{\n\t/**\n\t   Determines if String is a valid email address.\n\n\t   @param email: String to verify as email.\n\t   @return Returns <code>true</code> if String is a valid email; otherwise <code>false</code>.\n\t   @see http://www.regular-expressions.info/email.html Read more about the regular expression used by this method.\n\t */\n\tpublic function isEmail(email:String):Boolean\n\t{\n\t\tvar pattern:RegExp = /^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\\.)+[A-Z]{2,4}$/i;\n\t\treturn email.match(pattern) != null;\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isNumeric.as",
    "content": "package utils.validation\n{\n\t/**\n\t * Validate if a string is composed entirely of numbers.\n\t */\n\tpublic function isNumeric(str:String):Boolean\n\t{\n\t\tif (str == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tvar regx:RegExp = /^[-+]?\\d*\\.?\\d+(?:[eE][-+]?\\d+)?$/;\n\t\treturn regx.test(str);\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isPOBox.as",
    "content": "package utils.validation\n{\n\t/**\n\t * Check if address is a Post Office Box\n\t */\n\tpublic function isPOBox(address:String):Boolean\n\t{\n\t\tvar look:Array = [ \"PO \", \"P O\", \"P.O\", \"P. O\", \"p o\", \"p.o\", \"p. o\", \"Box\", \"Post Office\", \"post office\" ];\n\t\tvar len:Number = look.length;\n\t\tfor (var i:int = 0; i < len; i++)\n\t\t{\n\t\t\tif (address.indexOf(look[i]) != -1)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isURL.as",
    "content": "package utils.validation\n{\n\t/**\n\t * Validate as \"http://\" or \"https://\".\n\t */\n\tpublic function isURL(str:String):Boolean\n\t{\n\t\treturn (str.substring(0, 7) == \"http://\" || str.substring(0, 8) == \"https://\");\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isUSAStateAbbreviation.as",
    "content": "package utils.validation\n{\n\timport utils.array.contains;\n\n\t/**\n\t   Determines if String is a valid USA state abbreviation.\n\n\t   @param state: String to verify as two letter state abbreviation (includes DC).\n\t   @return Returns <code>true</code> if String is a state abbreviation; otherwise <code>false</code>.\n\t */\n\tpublic function isUSAStateAbbreviation(state:String):Boolean\n\t{\n\t\treturn contains(US_STATE_ABBREVIATIONS, state.toLowerCase()) == 1;\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isValidCreditCardNumber.as",
    "content": "package utils.validation\n{\n\timport utils.string.toNumeric;\n\n\t/**\n\t * Validate a credit card number as much as possible before submitting for approval.\n\t * @param strNumber     credit card number as string\n\t * @example <listing version=\"3.0\">\n\t * var isValidNumber:Boolean = CreditCardValidator.isValidNumber(\"1234567890123456\");\n\t * </listing>\n\t */\n\tpublic function isValidCreditCardNumber(strNumber:String):Boolean\n\t{\n\t\tvar mod10:Function = function (strNumber:String):Boolean {\n\t\t\t// Seperate each number into it's own index in an array.\n\t\t\tvar aNumbers:Array = strNumber.split(\"\");\n\n\t\t\t// Hold the sums of some calculations that will be made shortly.\n\t\t\tvar nSum_1:Number = 0;\n\t\t\tvar nSum_2:Number = 0;\n\t\t\tvar nSum_Total:Number = 0;\n\n\t\t\t// Check to see if the length of the card number is odd or even. This will\n\t\t\t// be used to determine which indicies are doubled before being summed up.\n\t\t\tvar nParity:Number = aNumbers.length % 2;\n\n\t\t\t// Loop through the card numbers.\n\t\t\tfor (var i:uint = 0; i < aNumbers.length; i++)\n\t\t\t{\n\t\t\t\t// Type cast each digit to a number.\n\n                var num:uint = uint(aNumbers[i]);\n\n\t\t\t\taNumbers[i] = num;\n\n\t\t\t\t// Compare the parity of the index to the parity of the card number length\n\t\t\t\t// to determine how the value of the current index is handled.\n\t\t\t\tif (i % 2 == nParity)\n\t\t\t\t{\n\t\t\t\t\t// Double each number.\n\t\t\t\t\taNumbers[i] *= 2;\n\n\t\t\t\t\t// If the resulting value is greater than '9', subtract '9' from it.\n\t\t\t\t\taNumbers[i] = aNumbers[i] > 9 ? aNumbers[i] - 9 : aNumbers[i];\n\n\t\t\t\t\t// Add each value together.\n\t\t\t\t\tnSum_1 += aNumbers[i];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Add each value together.\n\t\t\t\t\tnSum_2 += aNumbers[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Find the total sum of the two groups.\n\t\t\tnSum_Total = nSum_1 + nSum_2;\n\n\t\t\t// If the sum is divisible by '10', the card number is valid.\n\t\t\treturn (nSum_Total % 10 == 0);\n\t\t};\n\n\t\tconst MINIMUM_CARD_LENGTH:int = 13;\n\t\tconst MAXIMUM_CARD_LENGTH:int = 16;\n\n\t\tvar ccNumber:String = toNumeric(strNumber);\n\t\tif (ccNumber.length > 0 && !isNaN(ccNumber as Number) && (ccNumber.length >= MINIMUM_CARD_LENGTH && ccNumber.length <= MAXIMUM_CARD_LENGTH))\n\t\t{\n\t\t\treturn mod10(ccNumber);\n\t\t}\n\t\treturn false;\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isValidEmailAddress.as",
    "content": "package utils.validation\n{\n\t/**\n\t * Validate a string as a valid email address.\n\t */\n\tpublic function isValidEmailAddress(str:String):Boolean\n\t{\n\t\tvar emailExpression:RegExp = /^[a-z][\\w.-]+@\\w[\\w.-]+\\.[\\w.-]*[a-z][a-z]$/i;\n\t\treturn emailExpression.test(str);\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isValidExpirationDate.as",
    "content": "package utils.validation\n{\n\t/**\n\t * Validate a credit card's expiration date.\n\t * @example <listing version=\"3.0\">\n\t *      var isValidDate:Boolean = CreditCardValidator.isValidExDate( 11, 2010 );\n\t * </listing>\n\t */\n\tpublic function isValidExpirationDate(month:int, year:int):Boolean\n\t{\n\t\tvar d:Date = new Date();\n\t\tvar currentMonth:int = d.getMonth() + 1;\n\t\tvar currentYear:int = d.getFullYear();\n\t\tif ((year > currentYear) || (year == currentYear && month >= currentMonth))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}"
  },
  {
    "path": "src/utils/validation/isValidPhoneNumber.as",
    "content": "package utils.validation\n{\n\t/**\n\t * Validate a string as a phone number.\n\t */\n\tpublic function isValidPhoneNumber(str:String):Boolean\n\t{\n\t\tvar phoneExpression:RegExp = /^((\\+\\d{1,3}(-| )?\\(?\\d\\)?(-| )?\\d{1,3})|(\\(?\\d{2,3}\\)?))(-| )?(\\d{3,4})(-| )?(\\d{4})(( x| ext)\\d{1,5}){0,1}$/i;\n\t\treturn phoneExpression.test(str);\n\t}\n}"
  },
  {
    "path": "src/utils/xml/XMLConstants.as",
    "content": "package utils.xml\n{\n\n\t/**\n\t * Contains references to XML related string constants.\n\t */\n\tpublic class XMLConstants\n\t{\n\t\t/**\n\t\t * Constant representing a text node type returned from XML.nodeKind.\n\t\t *\n\t\t * @see XML.nodeKind()\n\t\t *\n\t\t * @langversion ActionScript 3.0\n\t\t * @playerversion Flash 9.0\n\t\t */\n\t\tpublic static const TEXT:String = \"text\";\n\n\t\t/**\n\t\t * Constant representing a comment node type returned from XML.nodeKind.\n\t\t *\n\t\t * @see XML.nodeKind()\n\t\t *\n\t\t * @langversion ActionScript 3.0\n\t\t * @playerversion Flash 9.0\n\t\t */\n\t\tpublic static const COMMENT:String = \"comment\";\n\n\t\t/**\n\t\t * Constant representing a processing instruction type returned from XML.nodeKind.\n\t\t *\n\t\t * @see XML.nodeKind()\n\t\t *\n\t\t * @langversion ActionScript 3.0\n\t\t * @playerversion Flash 9.0\n\t\t */\n\t\tpublic static const PROCESSING_INSTRUCTION:String = \"processing-instruction\";\n\n\t\t/**\n\t\t * Constant representing an attribute type returned from XML.nodeKind.\n\t\t *\n\t\t * @see XML.nodeKind()\n\t\t *\n\t\t * @langversion ActionScript 3.0\n\t\t * @playerversion Flash 9.0\n\t\t */\n\t\tpublic static const ATTRIBUTE:String = \"attribute\";\n\n\t\t/**\n\t\t * Constant representing a element type returned from XML.nodeKind.\n\t\t *\n\t\t * @see XML.nodeKind()\n\t\t *\n\t\t * @langversion ActionScript 3.0\n\t\t * @playerversion Flash 9.0\n\t\t */\n\t\tpublic static const ELEMENT:String = \"element\";\n\t}\n}"
  },
  {
    "path": "src/utils/xml/getNextSibling.as",
    "content": "package utils.xml\n{\n\t/**\n\t * Returns the next sibling of the specified node relative to the node's parent.\n\t *\n\t * @param x The node whose next sibling will be returned.\n\t *\n\t * @return The next sibling of the node. null if the node does not have\n\t * a sibling after it, or if the node has no parent.\n\t *\n\t * @langversion ActionScript 3.0\n\t * @playerversion Flash 9.0\n\t */\n\tpublic function getNextSibling(x:XML):XML\n\t{\n\t\treturn getSiblingByIndex(x, 1);\n\t}\n}"
  },
  {
    "path": "src/utils/xml/getPreviousSibling.as",
    "content": "package utils.xml\n{\n\t/**\n\t * Returns the sibling before the specified node relative to the node's parent.\n\t *\n\t * @param x The node whose sibling before it will be returned.\n\t *\n\t * @return The sibling before the node. null if the node does not have\n\t * a sibling before it, or if the node has no parent.\n\t *\n\t * @langversion ActionScript 3.0\n\t * @playerversion Flash 9.0\n\t */\n\tpublic function getPreviousSibling(x:XML):XML\n\t{\n\t\treturn getSiblingByIndex(x, -1);\n\t}\n}"
  },
  {
    "path": "src/utils/xml/getSiblingByIndex.as",
    "content": "package utils.xml\n{\n     /**\n\t * Returns the sibling at the index specified relative to the node's parent.\n\t *\n\t * @param x The node whose sibling will be returned.\n\t *\n\t * @return The sibling of the node at the specified position. null if the node does not have\n\t * a sibling at that position, or if the node has no parent.\n\t *\n\t * @langversion ActionScript 3.0\n\t * @playerversion Flash 9.0\n     *\n     * @example Getting a sibling 2 positions behind a node\n     * <listing version=\"3.0\">\n     * \tvar x:XML = <root>\n     *                  <stuff>value1</stuff>\n     *                  <stuff>value2</stuff>\n     *                  <stuff>value3</stuff>\n     *              </root>;\n     *\n     * \t//Request sibling 2 positions before \"value3\"\n     * \tvar sibling:XML = getSiblingByIndex(x.stuff[2], -2);\n     *\n     * \t//returns \"value1\"\n     * </listing>\n\t */\n\tpublic function getSiblingByIndex(x:XML, count:int):XML\n\t{\n\t\tvar out:XML;\n\n\t\ttry\n\t\t{\n\t\t\tout = x.parent().children()[x.childIndex() + count];\n\t\t}\n\t\tcatch (e:Error)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\treturn out;\n\t}\n}"
  },
  {
    "path": "src/utils/xml/isValidXML.as",
    "content": "package utils.xml\n{\n\t/**\n\t * Checks whether the specified string is valid and well formed XML.\n\t *\n\t * @param data The string that is being checked to see if it is valid XML.\n\t *\n\t * @return A Boolean value indicating whether the specified string is\n\t * valid XML.\n\t *\n\t * @langversion ActionScript 3.0\n\t * @playerversion Flash 9.0\n\t */\n\tpublic function isValidXML(data:String):Boolean\n\t{\n\t\tvar xml:XML;\n\n\t\ttry\n\t\t{\n\t\t\txml = new XML(data);\n\t\t}\n\t\tcatch (e:Error)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn xml.nodeKind() == XMLConstants.ELEMENT;\n\t}\n}"
  },
  {
    "path": "test/UtilsTestRunner.as",
    "content": "package\n{\n\timport flash.display.Sprite;\n\t\n\timport org.flexunit.internals.TraceListener;\n\timport org.flexunit.listeners.CIListener;\n\timport org.flexunit.runner.FlexUnitCore;\n\timport org.fluint.uiImpersonation.IVisualTestEnvironment;\n\timport org.fluint.uiImpersonation.VisualTestEnvironmentBuilder;\n\n\tpublic class UtilsTestRunner extends Sprite\n\t{\n\t\tprivate var core:FlexUnitCore;\n\t\tprivate var env:IVisualTestEnvironment;\n\t\t\n\t\tpublic function UtilsTestRunner()\n\t\t{\n\t\t\tsuper();\n\t\t\t\n\t\t\t// make the stage available to tests\n\t\t\tenv = VisualTestEnvironmentBuilder.getInstance(this).buildVisualTestEnvironment();\n\t\t\t\t\t\t\n\t\t\t// run \n\t\t\tcore = new FlexUnitCore();\n\t\t\tcore.addListener(new TraceListener());\n\t\t\tcore.addListener(new CIListener());\n\t\t\tcore.run( UtilsTestSuite );\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/UtilsTestSuite.as",
    "content": "package\n{\n\timport org.flexunit.runners.Suite;\n\t\n\timport utils.align.AlignCenterTest;\n\timport utils.align.AlignLeftTest;\n\timport utils.align.AlignRightTest;\n\timport utils.date.GetNextDayTest;\n\timport utils.date.GetPrevDayTest;\n\timport utils.date.GetTimeElapsedStringTest;\n\timport utils.date.calendar.CalendarTests;\n\timport utils.dictionary.CircularDictionaryTest;\n\timport utils.geom.CartesianToPolarCoordinatesTest;\n\timport utils.geom.PolarToCartesianCoordinatesTest;\n\timport utils.number.ClampTest;\n\timport utils.number.ToHexTest;\n\timport utils.object.CloneTest;\n\timport utils.object.ContainsTest;\n\timport utils.object.CreateInstanceTest;\n\timport utils.object.CreateTest;\n\timport utils.object.MergeTest;\n\timport utils.range.RandomRangeDateTest;\n\timport utils.string.NumberToStringTest;\n\timport utils.string.StringHasValueTest;\n\timport utils.type.IsPassedByValueTest;\n\timport utils.type.StrictIsTest;\n\timport utils.validation.EncodeCreditCardNumberTest;\n\timport utils.validation.GetCreditCardProviderTest;\n\timport utils.validation.IsBlankTest;\n\timport utils.validation.IsCreditCardTest;\n\timport utils.validation.IsEmailTest;\n\timport utils.validation.IsNumericTest;\n\timport utils.validation.IsPOBoxTest;\n\timport utils.validation.IsUSAStateAbbreviationTest;\n\timport utils.validation.IsUrlTest;\n\timport utils.validation.IsValidCreditCardNumberTest;\n\timport utils.validation.IsValidEmailAddressTest;\n\timport utils.validation.IsValidExpirationDateTest;\n\timport utils.validation.IsValidPhoneNumberTest;\n\timport utils.xml.GetNextSiblingTest;\n\timport utils.xml.GetPreviousSiblingTest;\n\timport utils.xml.GetSiblingByIndexTest;\n\timport utils.xml.IsValidXMLTest;\n\n \tSuite;\n\t\n\t[RunWith(\"org.flexunit.runners.Suite\")]\n\t[Suite]\n\tpublic class UtilsTestSuite\n\t{\n\t\t// utils.align\n\t\tpublic var alignCenterTest:AlignCenterTest;\n\t\tpublic var alignLeftTest:AlignLeftTest;\n\t\tpublic var alighRightTest:AlignRightTest;\n\t\t\n\t\t// utils.date.calendar\n\t\tpublic var calendarTest:CalendarTests;\n\t\t\n\t\t// utils.date\n\t\tpublic var getNextDayTest:GetNextDayTest;\n\t\tpublic var getPrevDayTest:GetPrevDayTest;\n\t\tpublic var getTimeElapsedStringTest:GetTimeElapsedStringTest;\n\t\t\n\t\t// utils.dictionary\n\t\tpublic var circularDictionaryTest:CircularDictionaryTest;\n\t\t\n\t\t// utils.geom\n\t\tpublic var cartesianToPolarCoordinatesTest:CartesianToPolarCoordinatesTest;\n\t\tpublic var polarToCartesianCoordinatesTest:PolarToCartesianCoordinatesTest;\n\t\t\n\t\t// utils.number\n\t\tpublic var clampTest:ClampTest;\n\t\tpublic var toHexTest:ToHexTest;\n\t\t\n\t\t// utils.object\n\t\tpublic var cloneTest:CloneTest;\n\t\tpublic var containsTest:ContainsTest;\n\t\tpublic var createInstanceTest:CreateInstanceTest;\n\t\tpublic var createTest:CreateTest;\n\t\tpublic var mergeTest:MergeTest;\n\t\t\n\t\t// utils.range\n\t\tpublic var randomRangeDateTest:RandomRangeDateTest;\n\t\t\n\t\t// utils.string\n\t\tpublic var numberToStringTest:NumberToStringTest;\n\t\tpublic var stringHasValueTest:StringHasValueTest;\n\t\t\n\t\t// utils.type\n\t\tpublic var isPassedByValueTest:IsPassedByValueTest;\n\t\tpublic var strictIsTest:StrictIsTest;\n\t\t\n\t\t// utils.validation\n//\t\tpublic var encodeCreditCardNumberTest:EncodeCreditCardNumberTest;\n//\t\tpublic var getCreditCardProviderTest:GetCreditCardProviderTest;\n//\t\tpublic var isBlankTest:IsBlankTest;\n//\t\tpublic var isCreditCardTest:IsCreditCardTest;\n//\t\tpublic var isEmailTest:IsEmailTest;\n//\t\tpublic var isNumericTest:IsNumericTest;\n//\t\tpublic var isPOBoxTest:IsPOBoxTest;\n//\t\tpublic var isUrlTest:IsUrlTest;\n//\t\tpublic var isUSAStateAbbreviation:IsUSAStateAbbreviationTest;\n\t\tpublic var isValidCreditCardNumberTest:IsValidCreditCardNumberTest;\n\t\tpublic var isValidEmailAddress:IsValidEmailAddressTest;\n\t\tpublic var isValidExpirationDate:IsValidExpirationDateTest;\n\t\tpublic var isValidPhoneNumberTest:IsValidPhoneNumberTest;\n\t\t\n\t\t// utils.xml\n\t\tpublic var getNextSiblingTest:GetNextSiblingTest;\n\t\tpublic var getPreviousSiblingTest:GetPreviousSiblingTest;\n\t\tpublic var getSiblingByIndexTest:GetSiblingByIndexTest;\n\t\tpublic var isValidXMLTest:IsValidXMLTest;\n\t}\n}"
  },
  {
    "path": "test/utils/align/AlignLeftTest.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.Sprite;\n\t\n\timport org.hamcrest.assertThat;\n\timport org.hamcrest.collection.array;\n\timport org.hamcrest.object.hasProperties;\n\t\n\timport utils.object.create;\n\n\tpublic class AlignLeftTest\n\t{\t\t\n\t\tpublic var targets:Array;\n\t\t\n\t\t[Before]\n\t\tpublic function setup():void\n\t\t{\n\t\t\ttargets = [ create(Sprite, null, { x: 5, y: 15 })\n\t\t\t\t\t  , create(Sprite, null, { x: 15, y: 50 })\n\t\t\t\t\t  , create(Sprite, null, { x: 50, y: 5 })\n\t\t\t\t\t  ];\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function alignLeftShouldAlignLeftEdgesOfTargetsToLeftMostTarget():void \n\t\t{\n\t\t\tassertThat(\n\t\t\t\t\"alignLeft set the x of each target to 5\"\n\t\t\t\t, alignLeft(targets)\n\t\t\t\t, array(hasProperties({ x: 5, y: 15 })\n\t\t\t\t\t, hasProperties({ x: 5, y: 50 })\n\t\t\t\t\t, hasProperties({ x: 5, y: 5 })\n\t\t\t\t\t));\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/utils/align/AlignRightTest.as",
    "content": "package utils.align\n{\n\timport flash.display.DisplayObject;\n\timport flash.display.Shape;\n\timport flash.display.Sprite;\n\timport flash.geom.Point;\n\t\n\timport org.hamcrest.assertThat;\n\timport org.hamcrest.collection.array;\n\timport org.hamcrest.object.hasProperties;\n\t\n\timport utils.object.create;\n\n\tpublic class AlignRightTest\n\t{\t\t\n\t\tpublic var targets:Array;\n\t\t\n\t\t[Before]\n\t\tpublic function setup():void\n\t\t{\n\t\t\ttargets = [ create(Square, [20], { x: 5, y: 15 })\n\t\t\t\t\t  , create(Square, [100], { x: 15, y: 50 })\n\t\t\t\t\t  , create(Square, [50], { x: 50, y: 5 })\n\t\t\t\t\t  ];\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function alignRightShouldAlignRightEdgesOfTargetsToRightMostTarget():void \n\t\t{\n\t\t\tassertThat(\n\t\t\t\t\"alignRight\"\n\t\t\t\t, alignRight(targets)\n\t\t\t\t, array(hasProperties({ x: 95, y: 15 })\n\t\t\t\t\t, hasProperties({ x: 15, y: 50 })\n\t\t\t\t\t, hasProperties({ x: 65, y: 5 })\n\t\t\t\t\t));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function alignRightShouldWorkForWidthlessObjects():void \n\t\t{\n\t\t\ttargets = [ new Point(5, 15)\n\t\t\t\t\t  , new Point(15, 50)\n\t\t\t\t\t  , new Point(50, 5)\n\t\t\t\t\t  ];\n\n\t\t\tassertThat(\n\t\t\t\t\"alignRight\"\n\t\t\t\t, alignRight(targets)\n\t\t\t\t, array(hasProperties({ x: 50, y: 15 })\n\t\t\t\t\t, hasProperties({ x: 50, y: 50 })\n\t\t\t\t\t, hasProperties({ x: 50, y: 5 })\n\t\t\t\t));\n\t\t}\n\t}\n}\n\nimport flash.display.Shape;\n\ninternal class Square extends Shape\n{\n\tpublic function Square(size:int = 50)\n\t{\n\t\tgraphics.beginFill(0xFFFFFF, 1.0);\n\t\tgraphics.drawRect(0, 0, size, size);\n\t\tgraphics.endFill();\n\t}\n\t\n\toverride public function toString():String \n\t{\n\t\treturn \"[Square\"\n\t\t\t\t+ \" x=\" + x \n\t\t\t\t+ \" y=\" + y \n\t\t\t\t+ \" w=\" + width \n\t\t\t\t+ \" h=\" + height \n\t\t\t\t+ \"]\";\n\t}\n}"
  },
  {
    "path": "test/utils/align/alignCenterTest.as",
    "content": "package utils.align\n{\n    import flash.display.Sprite;\n    \n    import org.fluint.uiImpersonation.UIImpersonator;\n    import org.hamcrest.assertThat;\n    import org.hamcrest.object.equalTo;\n\n    public class AlignCenterTest\n    {\n\n        [Test]\n        public function alignCenter_aligns_display_object_centers_x():void\n        {\n            var item:Sprite = drawSprite(10,10,10,10);\n            var target:Sprite = drawSprite(20,20,10,10);\n            addItemAndTargetToStage(item, target);\n\n            alignCenter(item, target);\n\n            assertThat(item.x, equalTo(target.x));\n        }\n\n        [Test]\n        public function alignCenter_aligns_display_object_centers_y():void\n        {\n            var item:Sprite = drawSprite(10,10,10,10);\n            var target:Sprite = drawSprite(20,20,10,10);\n            addItemAndTargetToStage(item, target);\n\n            alignCenter(item, target);\n\n            assertThat(item.y, equalTo(target.y));\n        }\n\n        private function drawSprite(x:int, y:int, width:int, height:int):Sprite\n        {\n            var sprite:Sprite = new Sprite();\n\n            sprite.graphics.beginFill(0x000000);\n            sprite.graphics.drawRect(0,0,width,height);\n\n            sprite.x = x;\n            sprite.y = y;\n\n            return sprite;\n        }\n\n        private function addItemAndTargetToStage(item:Sprite, target:Sprite):void\n        {\n\t\t\tvar container:Sprite = new Sprite();\n\t\t\tcontainer.addChild(item);\n\t\t\tcontainer.addChild(target);\n\t\t\tUIImpersonator.addChild(container);\n        }\n    }\n}"
  },
  {
    "path": "test/utils/date/GetNextDayTest.as",
    "content": "package utils.date\n{\nimport org.flexunit.asserts.assertTrue;\nimport org.flexunit.asserts.fail;\nimport utils.date.getNextDay;\n\npublic class GetNextDayTest\n\t{\n\t\t[Test]\n\t\tpublic function returnsNextDay():void\n\t\t{\n\n            var jan14:Date = new Date(2010, 0, 14);\n            var jan15:Date =  new Date(2010, 0, 15);\n\n            assertTrue(getNextDay(jan14).getTime() == jan15.getTime());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function passingNoDateUsesToday():void\n\t\t{\n\t\t\tvar today:Date = new Date();\n\t\t\tvar tomorrow:Date = getNextDay(today);\n\n            assertTrue(getNextDay().getTime() == tomorrow.getTime());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function wrapsToNextMonth():void\n\t\t{\n\t\t\tvar endOfMonth:Date = new Date(2010, 0, 31);\n\t\t\t\n            assertTrue(getNextDay(endOfMonth).getMonth() == 1);\n\t\t}\n\t\t[Test]\n\t\tpublic function wrapsToNextMonthForFebruary():void\n\t\t{\n\t\t\tvar endOfFeb:Date = new Date(2011, 1, 28);\n\t\t\t\n            assertTrue(getNextDay(endOfFeb).getMonth() == 2);\n\t\t}\n\t\t[Test]\n\t\tpublic function doesntWrapToNextMonthForFebruaryInLeapYear():void\n\t\t{\n\t\t\tvar endOfFeb:Date = new Date(2012, 1, 28);\n\t\t\t\n            assertTrue(getNextDay(endOfFeb).getMonth() == 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function wrapsToNextYear():void\n\t\t{\n\t\t\tvar endOfYear:Date = new Date(2010, 11, 31);\n\t\t\t\n            assertTrue(getNextDay(endOfYear).getFullYear() == 2011);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "test/utils/date/GetPrevDayTest.as",
    "content": "package utils.date\n{\nimport org.flexunit.asserts.assertTrue;\nimport org.flexunit.asserts.fail;\nimport utils.date.getPreviousDay;\n\npublic class GetPrevDayTest\n\t{\n\t\t[Test]\n\t\tpublic function returnsPrevDay():void\n\t\t{\n\n            var jan14:Date = new Date(2010, 0, 14);\n            var jan15:Date =  new Date(2010, 0, 15);\n\n            assertTrue(getPreviousDay(jan15).getTime() == jan14.getTime());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function passingNoDateUsesToday():void\n\t\t{\n\t\t\tvar today:Date = new Date();\n\t\t\tvar yesterday:Date = getPreviousDay(today);\n\n            assertTrue(getPreviousDay().getTime() == yesterday.getTime());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function wrapsToPrevMonth():void\n\t\t{\n\t\t\tvar startOfMonth:Date = new Date(2010, 0, 1);\n\t\t\t\n            assertTrue(getPreviousDay(startOfMonth).getMonth() == 11);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function wrapsToPrevYear():void\n\t\t{\n\t\t\tvar startOfYear:Date = new Date(2011, 0, 1);\n\t\t\t\n            assertTrue(getPreviousDay(startOfYear).getFullYear() == 2010);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "test/utils/date/GetTimeElapsedStringTest.as",
    "content": "package utils.date\n{\n\timport flexunit.framework.Assert;\n\t\n\timport utils.date.getTimeElapsedString;\n\t\n\t/**\n\t * DateFormatterTest\n\t *\n\t * @author Mims H. Wright\n\t */\n\tpublic class GetTimeElapsedStringTest\n\t{\n\t\t[Test]\n\t\tpublic function testGetTimeElapsedString():void {\n\t\t\t\n\t\t\t// create a custom date for now to ensure that subtracting time from \n\t\t\t// each field will create a valid date \n\t\t\tvar now:Date = new Date(2010, 11, 30, 12, 50, 50);\n\t\t\t\n\t\t\tvar secondsAgo:Date = new Date(now.fullYear, now.month, now.date, now.hours, now.minutes, now.seconds - 5);\n\t\t\tvar minutesAgo:Date = new Date(now.fullYear, now.month, now.date, now.hours, now.minutes - 5);\n\t\t\tvar hoursAgo:Date = new Date(now.fullYear, now.month, now.date, now.hours - 5);\n\t\t\tvar yesterday:Date = new Date(now.fullYear, now.month, now.date - 1);\n\t\t\tvar daysAgo:Date = new Date(now.fullYear, now.month, now.date - 5);\n\t\t\tvar weeksAgo:Date = new Date(now.fullYear, now.month, now.date - 8);\n\t\t\tvar monthsAgo:Date = new Date(now.fullYear, now.month - 5, now.date );\n\t\t\tvar yearsAgo:Date = new Date(now.fullYear - 2, now.month, now.date);\n\t\t\tvar future:Date = new Date(now.fullYear + 1, now.month, now.date);\n\t\t\t\n\t\t\tAssert.assertEquals(\"just now\", getTimeElapsedString(secondsAgo, now));\n\t\t\tAssert.assertEquals(\"5 minutes ago\", getTimeElapsedString(minutesAgo, now));\n\t\t\tAssert.assertEquals(\"5 hours ago\", getTimeElapsedString(hoursAgo, now));\n\t\t\tAssert.assertEquals(\"yesterday\", getTimeElapsedString(yesterday, now));\n\t\t\tAssert.assertEquals(\"5 days ago\", getTimeElapsedString(daysAgo, now));\n\t\t\tAssert.assertEquals(\"1 week ago\", getTimeElapsedString(weeksAgo, now));\n\t\t\tAssert.assertEquals(\"5 months ago\", getTimeElapsedString(monthsAgo, now));\n\t\t\tAssert.assertEquals(\"more than a year ago\", getTimeElapsedString(yearsAgo, now));\n\t\t\tAssert.assertEquals(\"in the future\", getTimeElapsedString(future, now));\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/utils/date/calendar/CalendarTests.as",
    "content": "/**\n * User: John Lindquist\n * Date: 3/16/11\n * Time: 11:14 AM\n */\npackage utils.date.calendar\n{\n\nimport org.hamcrest.assertThat;\n\nimport org.hamcrest.object.equalTo;\n\nimport utils.date.Calendar;\n\npublic class CalendarTests\n\t{\n\t\t[Test]\n\t\tpublic function now_should_be_the_current_time():void\n\t\t{\n            var calendar:Calendar = new Calendar();\n\n\t\t\tassertThat(calendar.now.toString(), equalTo(new Date().toString()));\n\t\t}\n\t\t\n\n\t}\n}"
  },
  {
    "path": "test/utils/dictionary/CircularDictionaryTest.as",
    "content": "package utils.dictionary\n{\n\timport flexunit.framework.Assert;\n\t\n\timport utils.dictionary.CircularDictionary;\n\t\n\tpublic class CircularDictionaryTest\n\t{\n\t\t[Test]\n\t\tpublic function testAddAndRemovePair():void {\n\t\t\tvar a:Object = {foo:\"bar\"};\n\t\t\tvar b:int = 42;\n\t\t\t\n\t\t\tvar dict:CircularDictionary = new CircularDictionary();\n\t\t\tdict.addPair(a,b);\n\t\t\tAssert.assertEquals(a, dict.getCounterpartTo(b));\n\t\t\tAssert.assertEquals(b, dict.getCounterpartTo(a));\n\t\t\t\n\t\t\tvar result:* = dict.removePair(a);\n\t\t\tAssert.assertUndefined(dict.getCounterpartTo(a), dict.getCounterpartTo(b));\n\t\t\tAssert.assertEquals(result, b);\n\t\t}\t\t\n\t}\n}"
  },
  {
    "path": "test/utils/display/FindAncestorTest.as",
    "content": "package flexUnitTests\n{\n\timport flash.display.MovieClip;\n\timport flash.display.Shape;\n\timport flash.display.Sprite;\n\t\n\timport org.flexunit.asserts.assertEquals;\n\timport org.flexunit.asserts.assertNull;\n\t\n\timport utils.display.findAncestor;\n\timport utils.display.findAncestorWithType;\n\n\tpublic class FindAncestorTest\n\t{\t\t\n\t\t[Test]\n\t\tpublic function findAncestorTest():void\n\t\t{\n\t\t\tvar a:MovieClip = new MovieClip();\n\t\t\tvar b:Sprite = new Sprite();\n\t\t\tvar c:Shape = new Shape();\n\t\t\t\n\t\t\tvar d:Sprite = new Sprite(); // not in chain\n\t\t\t\n\t\t\ta.addChild(b);\n\t\t\tb.addChild(c);\n\t\t\t\n\t\t\tassertEquals(findAncestor(c, a), a);\n\t\t\tassertEquals(findAncestor(c, b), b);\n\t\t\tassertEquals(findAncestor(c, c), c);\n\t\t\t\n\t\t\tassertNull(findAncestor(a, c));\n\t\t\tassertNull(findAncestor(c, d));\n\t\t\t\n\t\t\tassertEquals(findAncestorWithType(c, MovieClip), a);\n\t\t\tassertEquals(findAncestorWithType(c, Sprite), b);\n\n\t\t\tassertNull(findAncestorWithType(c, Shape));\n\t\t\t\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "test/utils/geom/CartesianToPolarCoordinatesTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: Sep 30, 2010\n * Time: 11:50:50 AM\n */\npackage utils.geom\n{\n\nimport org.flexunit.asserts.assertTrue;\nimport utils.geom.cartesianToPolarCoordinates;\n\n    public class CartesianToPolarCoordinatesTest\n    {\n\n\t\t[Before]\n\t\tpublic function setup():void\n\t\t{\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic function CartesianToPolarCoordinatesReturnsProperCoords():void\n\t\t{\n\n                  var polarCoord:Array = cartesianToPolarCoordinates(3, 4);\n\n                  assertTrue(polarCoord[0] == 5 && polarCoord[1] == 53.13010235415598)\n\n        }\n\n\t}\n}"
  },
  {
    "path": "test/utils/geom/PolarToCartesianCoordinatesTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: Sep 30, 2010\n * Time: 11:50:50 AM\n */\npackage utils.geom\n{\nimport flash.geom.Point;\n\nimport org.flexunit.asserts.assertTrue;\nimport org.hamcrest.assertThat;\n\nimport org.hamcrest.object.equalTo;\n\nimport utils.geom.cartesianToPolarCoordinates;\nimport utils.geom.polarToCartesianCoordinates;\n\npublic class PolarToCartesianCoordinatesTest\n{\n\n    [Test]\n    public function PolarToCartesianCoordinatesReturnsProperCoords():void\n    {\n       //R is 12, theta is 195 degrees\n       var cartesianPoint:Point = polarToCartesianCoordinates(12, 195);\n\n       assertThat(cartesianPoint.x, equalTo(-11.59110991546882));\n       assertThat(cartesianPoint.y, equalTo(-3.1058285412302444));\n\n    }\n\n}\n}"
  },
  {
    "path": "test/utils/number/ClampTest.as",
    "content": "package utils.number\n{\n\timport flexunit.framework.Assert;\n\t\n\timport utils.number.clamp;\n\n\tpublic class ClampTest\n\t{\n\t\t[Test]\n\t\tpublic function testClamp():void {\n\t\t\tvar low:int = 0;\n\t\t\tvar high:int = 100;\n\t\t\t\n\t\t\tAssert.assertEquals(\"Values between low and high are passed thru.\", clamp(50, low, high), 50);\n\t\t\tAssert.assertEquals(\"Values lower than low value are limited to the low value.\", clamp(low - 100, low, high), low);\n\t\t\tAssert.assertEquals(\"Values higher than the high value are limited to the high value.\", clamp(high + 100, low, high), high);\n\t\t\tAssert.assertEquals(\"If any values are NaN, return NaN.\", clamp(5, NaN, high), NaN);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/utils/number/ToHexTest.as",
    "content": "package utils.number\n{\n\timport flash.utils.Endian;\n\t\n\timport flexunit.framework.Assert;\n\t\n\timport utils.number.toHex;\n\timport utils.string.endsWith;\n\n\tpublic class ToHexTest\n\t{\n\t\t[Test]\n\t\tpublic function testToHex ():void {\n\t\t\tAssert.assertEquals(\"Big endian\", \"0xFC00\", toHex(0xFC00, 1, true, Endian.BIG_ENDIAN));\n\t\t\tAssert.assertEquals(\"Little endian\", \"0x00FC\", toHex(0xFC00, 1, true, Endian.LITTLE_ENDIAN));\n\t\t\tAssert.assertEquals(\"Add leading 0 if there aren't enough numbers to make a byte\", \"0x452301\", toHex(0x12345, 1, true, Endian.LITTLE_ENDIAN));\n\t\t\tAssert.assertEquals(\"Converting from digital number to hex produces hex string\", \"0xFF\", toHex(255));\n\t\t\tAssert.assertEquals(\"Convert 0 to 0x0\", \"0x0\", toHex(0));\n\t\t\tAssert.assertEquals(\"Floats round down\", \"0x1\", toHex(1.6));\n\t\t\tAssert.assertEquals(\"Converting from hex number to hex produces hex string\", \"0xABCDEF\", toHex(0xABCDEF));\n\t\t\tAssert.assertEquals(\"Hide '0x'\", \"ABC\", toHex(0xABC, 1, false));\n\t\t\tAssert.assertEquals(\"Leading 0's\", \"0x0033CC\", toHex(0x0033CC, 6));\n\t\t\t// todo: test endian param.\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/utils/object/CreateInstanceTest.as",
    "content": "package utils.object\n{\n\timport flash.display.Sprite;\n\timport flash.events.Event;\n\t\n\timport org.hamcrest.assertThat;\n\timport org.hamcrest.object.equalTo;\n\timport org.hamcrest.object.hasProperties;\n\timport org.hamcrest.object.instanceOf;\n\n\tpublic class CreateInstanceTest\n\t{\t\t\n\t\t[Test]\n\t\tpublic function createsAnInstanceOfGivenClass():void \n\t\t{\n\t\t\tassertThat(\n\t\t\t\t\"creates an instance of given class\"\n\t\t\t\t, createInstance(Sprite)\n\t\t\t\t, instanceOf(Sprite)\n\t\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function createsAnInstanceOfGivenClassWithConstructorArguments():void \n\t\t{\n\t\t\tassertThat(\n\t\t\t\t\"creates an instance of given class with constructor arguments\"\n\t\t\t\t, createInstance(Event, [\"eventType\", true, false])\n\t\t\t\t, hasProperties({})\n\t\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function worksForUpToTenConstructorArguments():void \n\t\t{\n\t\t\tassertThat(createInstance(Consumer).consumed, equalTo([]));\n\t\t\tassertThat(createInstance(Consumer, []).consumed, equalTo([]));\n\t\t\tassertThat(createInstance(Consumer, [1]).consumed, equalTo([1]));\n\t\t\tassertThat(createInstance(Consumer, [1, 2]).consumed, equalTo([1, 2]));\n\t\t\tassertThat(createInstance(Consumer, [1, 2, 3]).consumed, equalTo([1, 2, 3]));\n\t\t\tassertThat(createInstance(Consumer, [1, 2, 3, 4]).consumed, equalTo([1, 2, 3, 4]));\n\t\t\tassertThat(createInstance(Consumer, [1, 2, 3, 4, 5]).consumed, equalTo([1, 2, 3, 4, 5]));\n\t\t\tassertThat(createInstance(Consumer, [1, 2, 3, 4, 5, 6]).consumed, equalTo([1, 2, 3, 4, 5, 6]));\n\t\t\tassertThat(createInstance(Consumer, [1, 2, 3, 4, 5, 6, 7]).consumed, equalTo([1, 2, 3, 4, 5, 6, 7]));\n\t\t\tassertThat(createInstance(Consumer, [1, 2, 3, 4, 5, 6, 7, 8]).consumed, equalTo([1, 2, 3, 4, 5, 6, 7, 8]));\n\t\t\tassertThat(createInstance(Consumer, [1, 2, 3, 4, 5, 6, 7, 8, 9]).consumed, equalTo([1, 2, 3, 4, 5, 6, 7, 8, 9]));\n\t\t\tassertThat(createInstance(Consumer, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).consumed, equalTo([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]));\n\t\t}\n\t\n\t\t[Test(expected=\"ArgumentError\")]\n\t\tpublic function explodesIfYouPassTooManyConstructorArguments():void \n\t\t{\n\t\t\tcreateInstance(Consumer, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);\t\t\t\n\t\t}\n\t\t\n\t\t[Test(expected=\"ArgumentError\")]\n\t\tpublic function explodesIfYouForgetRequiredConstructorArguments():void \n\t\t{\n\t\t\tcreateInstance(Event);\n\t\t}\n\t}\n}\n\n// a little something to help test createInstance\n\ninternal class Consumer \n{\n\tprivate var _consumed:Array;\n\t\n\tpublic function Consumer(...rest) \n\t{\n\t\t_consumed = rest;\n\t}\n\t\n\tpublic function get consumed():Array \n\t{\n\t\treturn _consumed;\n\t}\n}"
  },
  {
    "path": "test/utils/object/CreateTest.as",
    "content": "package utils.object\n{\n\timport flash.display.Sprite;\n\timport flash.events.Event;\n\timport flash.events.EventDispatcher;\n\timport flash.filters.GlowFilter;\n\t\n\timport org.hamcrest.assertThat;\n\timport org.hamcrest.core.throws;\n\timport org.hamcrest.number.closeTo;\n\timport org.hamcrest.object.hasProperties;\n\timport org.hamcrest.object.instanceOf;\n\n\tpublic class CreateTest\n\t{\t\t\n\t\t[Test]\n\t\tpublic function createShouldCreateAnInstanceOfTheGivenClass():void \n\t\t{\n\t\t\tassertThat(\n\t\t\t\t\"should create an instance of the given Class\"\n\t\t\t\t, create(Sprite)\n\t\t\t\t, instanceOf(Sprite)\n\t\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function createShouldUseConstructorArguments():void \n\t\t{\n\t\t\tassertThat(\n\t\t\t\t\"should use constructor arguments if given\"\n\t\t\t\t, create(Event, [Event.COMPLETE, true])\n\t\t\t\t, hasProperties({ type: Event.COMPLETE, bubbles: true })\n\t\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function createShouldPopulateTheGivenPropertiesOnTheInstance():void \n\t\t{\n\t\t\tassertThat(\n\t\t\t\t\"should use constructor arguments if given\"\n\t\t\t\t, create(Sprite, null, { x: 50, y: 10 })\n\t\t\t\t, hasProperties({ x: 50, y: 10 })\n\t\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function createShouldSupportBothConstructorArgumentsAndProperties():void \n\t\t{\n\t\t\tassertThat(\n\t\t\t\t\"should constructor arguments THEN properties\"\n\t\t\t\t, create(GlowFilter, [0xFF3333, 1.0], { alpha: 0.5 })\n\t\t\t\t, hasProperties({ color: 0xFF3333, alpha: closeTo(0.5, 0.01) })\n\t\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/utils/object/MergeTest.as",
    "content": "package utils.object\n{\n\timport org.hamcrest.assertThat;\nimport org.hamcrest.object.hasProperties;\n\npublic class MergeTest\n\t{\t\t\n\t\t[Test]\n\t\tpublic function copiesEnumerablePropertiesAndValuesFromSourceToTarget():void \n\t\t{\n\t\t\tvar source:Object = { a: 1, d: 4 };\n\t\t\tvar target:Object = { a: 0, b: 2, c: 3 }\n\n\t\t\tassertThat(merge(target, source), hasProperties({ a: 1, b: 2, c: 3, d: 4 }));\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/utils/object/cloneTest.as",
    "content": "package utils.object\n{\n    import org.hamcrest.assertThat;\n    import org.hamcrest.object.hasProperties;\n\n    public class CloneTest\n    {\n        [Test]\n        public function clone_creates_object_with_equal_properties():void\n        {\n            var originalObject:SimpleObject = new SimpleObject();\n            var cloneObject:Object;\n\n            cloneObject = clone(originalObject);\n\n            assertThat(\n                    \"cloned object properties equal original object properties\",\n                    cloneObject,\n                    hasProperties({propOne:\"propOne\",propTwo:true,propThree:10})\n                    );\n        }\n\n    }\n}\n\nclass SimpleObject\n{\n    public var propOne:String = \"propOne\";\n    public var propTwo:Boolean = true;\n    public var propThree:int = 10;\n}"
  },
  {
    "path": "test/utils/object/containsTest.as",
    "content": "package utils.object\n{\n\timport flexunit.framework.Assert;\n\timport utils.object.contains;\n\n\tpublic class ContainsTest\n\t{\t\t\n\t\t[Test]\n\t\tpublic function testContains():void {\n\t\t\tvar o:Object = {foo:\"bar\", baz:42};\n\t\t\tvar p:Object = {foo:o};\n\t\t\t\n\t\t\tAssert.assertTrue(\"Object contains 'bar'\", contains(o, \"bar\"));\n\t\t\tAssert.assertFalse(\"Doesn't check property names\", contains(o, \"foo\"));\n\t\t\tAssert.assertTrue(\"Object contains other objects\", contains(p, o));\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "test/utils/range/RandomRangeDateTest.as",
    "content": "package utils.range\n{\nimport org.flexunit.asserts.assertTrue;\nimport org.flexunit.asserts.fail;\n\npublic class RandomRangeDateTest\n\t{\n\n\n\t\t[Before]\n\t\tpublic function setup():void\n\t\t{\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic function randomDateReturnsWithinRange():void\n\t\t{\n\n            var firstDate:Date = new Date();\n            firstDate.month = 5;\n            var secondDate:Date = new Date();\n            secondDate.month = 10;\n\n            var date:Date = randomRangeDate(firstDate,secondDate) ;\n\n            assertTrue(date.getTime() > firstDate.getTime() && date.getTime() < secondDate.getTime());\n\n\t\t}\n\n        [Test]\n\t\tpublic function randomDateReturnWithinRangeWithValuesSwapped():void\n\t\t{\n\n            var firstDate:Date = new Date();\n            firstDate.month = 10;\n            var secondDate:Date = new Date();\n            secondDate.month = 5;\n\n            var date:Date = randomRangeDate(firstDate,secondDate) ;\n\n            assertTrue(date.getTime() < firstDate.getTime() && date.getTime() > secondDate.getTime());\n\n\t\t}\n\n        [Test]\n\t\tpublic function randomDateThrowsErrorWhenDatesAreTheSame():void\n\t\t{\n\n            var firstDate:Date = new Date();\n            var secondDate:Date = new Date();\n\n            try{\n                var date:Date = randomRangeDate(firstDate,secondDate) ;\n            }\n            catch(e:Error) {\n\n                assertTrue(1 == 1);\n                return;\n\n            }\n\n            fail(\"Error was not thrown\");\n\n\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "test/utils/string/numberToStringTest.as",
    "content": "package utils.string\n{\n\timport org.flexunit.asserts.*;\n\n\tpublic class NumberToStringTest\n\t{\n\t\t[Before]\n\t\tpublic function setup():void\n\t\t{\n\t\t\t\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function numberToStringTestPositiveNumbers():void {\n\t\t\tassertEquals(\"eleven\", numberToString(11));\n\t\t\tassertEquals(\"ten thousand\", numberToString(10000));\n\t\t\tassertEquals(\"one billion two hundred thirty four million five hundred sixty seven thousand eight hundred ninety\", numberToString(1234567890));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function numberToStringTestDecimalNumbers():void {\n\t\t\tassertEquals(\"point one two three four five\", numberToString(0.12345));\n\t\t\tassertEquals(\"one hundred one point zero zero one\", numberToString(101.001));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function numberToStringTestNegativeNumbers():void {\n\t\t\tassertEquals(\"negative one\", numberToString(-1));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function numberToStringTestZero():void {\n\t\t\tassertEquals(\"zero\", numberToString(0));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function numberToStringTestNaN():void {\n\t\t\tassertEquals(\"not a number\", numberToString(NaN));\n\t\t\tassertEquals(\"not a number\", numberToString(undefined));\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "test/utils/string/stringHasValueTest.as",
    "content": "package utils.string\n{\n    import org.hamcrest.assertThat;\n    import org.hamcrest.object.isFalse;\n    import org.hamcrest.object.isTrue;\n\n    public class StringHasValueTest\n    {\n        [Test]\n        public function stringHasValue_is_true_for_a_string_with_a_value():void\n        {\n            var stringDoesHaveValue:Boolean;\n\n            stringDoesHaveValue = stringHasValue(\"someString\");\n\n            assertThat(\n                    \"The string has a value.\",\n                    stringDoesHaveValue,\n                    isTrue()\n                    );\n        }\n\n        [Test]\n        public function stringHasValue_is_false_for_a_string_with_no_value():void\n        {\n            var noCharStringHasValue:Boolean;\n\n            noCharStringHasValue = stringHasValue(\"\");\n\n            assertThat(\n                    \"The string has no value.\",\n                    noCharStringHasValue,\n                    isFalse()\n                    );\n        }\n\n        [Test]\n        public function stringHasValue_is_false_for_null():void\n        {\n            var nullHasValueAsString:Boolean;\n\n            nullHasValueAsString = stringHasValue(null);\n\n            assertThat(\n                    \"Null has no value.\",\n                    nullHasValueAsString,\n                    isFalse()\n                    );\n        }\n    }\n}"
  },
  {
    "path": "test/utils/type/IsPassedByValueTest.as",
    "content": "package utils.type\n{\n\timport flexunit.framework.Assert;\n\t\n\timport utils.type.isPassedByValue;\n\n\tpublic class IsPassedByValueTest\n\t{\n\t\t[Test]\n\t\tpublic function testIsPassedByValue():void {\n\t\t\tAssert.assertTrue(\"uint is passed by value\", isPassedByValue(uint(5)));\n\t\t\tAssert.assertTrue(\"int is passed by value\", isPassedByValue(int(5)));\n\t\t\tAssert.assertTrue(\"Number is passed by value\", isPassedByValue(5.5));\n\t\t\tAssert.assertTrue(\"String is passed by value\", isPassedByValue(\"foo\"));\n\t\t\tAssert.assertTrue(\"Boolean is passed by value\", isPassedByValue(true));\n\t\t\t\n\t\t\tAssert.assertFalse(\"null values don't indicate the type of the variable container.\", isPassedByValue(null));\n\t\t\t\n\t\t\tvar xml:XML = \n\t\t\t\t        <body>\n\t\t\t\t            <p>hello</p>\n\t\t\t\t        </body>;\n\t\t\tAssert.assertFalse(\"XML is not passed by value even though it's a primitive\", isPassedByValue(xml));\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "test/utils/type/StrictIsTest.as",
    "content": "package utils.type\n{\n\timport flash.display.MovieClip;\n\timport flash.display.Sprite;\n\t\n\timport flexunit.framework.Assert;\n\t\n\timport utils.type.strictIs;\n\n\tpublic class StrictIsTest\n\t{\n\t\t[Test]\n\t\tpublic function testStrictIs():void {\n\t\t\tvar s:Sprite = new Sprite();\n\t\t\tvar m:MovieClip = new MovieClip();\n\t\t\t\n\t\t\tAssert.assertTrue(\"Sprite instance is Sprite\", s is Sprite);\n\t\t\tAssert.assertTrue(\"MovieClip instance is Sprite\", m is Sprite);\n\t\t\tAssert.assertFalse(\"Sprite instance is not MovieClip\", s is MovieClip);\n\n\t\t\tAssert.assertTrue(\"Sprite instance is strictly Sprite\", strictIs(s, Sprite));\n\t\t\tAssert.assertFalse(\"MovieClip instance is strictly not a Sprite\", strictIs(m, Sprite));\n\t\t\tAssert.assertFalse(\"Sprite instance is strictly not a MovieClip\", strictIs(s, MovieClip));\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "test/utils/validation/IsValidEmailAddressTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/20/11\n * Time: 1:47 PM\n */\npackage utils.validation {\nimport org.hamcrest.assertThat;\nimport org.hamcrest.object.equalTo;\n\nimport utils.validation.IsValidEmailAddressTest;\n\npublic class IsValidEmailAddressTest {\n\n    [Test]\n    public function goodEmailPasses() : void {\n\n        assertThat(isValidEmailAddress(\"test@test.com\"), equalTo(true))\n\n    }\n\n    [Test]\n    public function emailWithSpaceFails() : void {\n\n        assertThat(isValidEmailAddress(\"test@ test.com\"), equalTo(false))\n\n    }\n\n    [Test]\n    public function emailWithoutAtSymbolFails() : void {\n\n        assertThat(isValidEmailAddress(\"testtest.com\"), equalTo(false))\n\n    }\n\n    [Test]\n    public function emailWithInvalidCharacterFails() : void {\n\n        assertThat(isValidEmailAddress(\"test@te$t.com\"), equalTo(false))\n\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/encodeCreditCardNumberTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/24/11\n * Time: 3:07 PM\n */\npackage utils.validation {\npublic class EncodeCreditCardNumberTest {\n    public function EncodeCreditCardNumberTest() {\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/getCreditCardProviderTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/24/11\n * Time: 1:26 PM\n */\npackage utils.validation {\npublic class GetCreditCardProviderTest {\n    public function GetCreditCardProviderTest() {\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/isBlankTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/24/11\n * Time: 11:48 AM\n */\npackage utils.validation {\npublic class IsBlankTest {\n    public function IsBlankTest() {\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/isCreditCardTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/24/11\n * Time: 11:44 AM\n */\npackage utils.validation {\npublic class IsCreditCardTest {\n    public function IsCreditCardTest() {\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/isEmailTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/24/11\n * Time: 11:39 AM\n */\npackage utils.validation {\npublic class IsEmailTest {\n    public function IsEmailTest() {\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/isNumericTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/24/11\n * Time: 11:37 AM\n */\npackage utils.validation {\npublic class IsNumericTest {\n    public function IsNumericTest() {\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/isPOBoxTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/24/11\n * Time: 11:35 AM\n */\npackage utils.validation {\npublic class IsPOBoxTest {\n    public function IsPOBoxTest() {\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/isUSAStateAbbreviationTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/24/11\n * Time: 11:24 AM\n */\npackage utils.validation {\nimport org.flexunit.asserts.fail;\n\npublic class IsUSAStateAbbreviationTest {\n\n    [Test]\n    public function IsUSAStateAbbreviationTest() {\n\n        new Array('ak', 'al', 'ar', 'az', 'ca', 'co', 'ct', 'dc', 'de', 'fl', 'ga', 'hi', 'ia', 'id', 'il', 'in', 'ks', 'ky', 'la', 'ma', 'md', 'me', 'mi', 'mn', 'mo', 'ms', 'mt', 'nb', 'nc',\n\t\t\t\t\t  'nd', 'nh', 'nj', 'nm', 'nv', 'ny', 'oh', 'ok', 'or', 'pa', 'ri', 'sc', 'sd', 'tn', 'tx', 'ut', 'va', 'vt', 'wa', 'wi', 'wv', 'wy');\n\n//        assertThat(isUSAStateAbbreviation(\"DE\"),\n//\t\t\tequalTo())\n\n        fail(\"test remains to be implemented\")\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/isUrlTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/24/11\n * Time: 11:29 AM\n */\npackage utils.validation {\npublic class IsUrlTest {\n    public function IsUrlTest() {\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/isValidCreditCardNumberTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/20/11\n * Time: 1:52 PM\n */\npackage utils.validation {\nimport org.hamcrest.assertThat;\nimport org.hamcrest.object.equalTo;\n\nimport utils.validation.isValidCreditCardNumber;\n\npublic class IsValidCreditCardNumberTest {\n\n    [Test]\n    public function ccBelowMinimum13ShouldFail() : void {\n\n        assertThat(isValidCreditCardNumber(\"1234\"), equalTo(false));\n\n    }\n\n    [Test]\n    public function ccAboveMaximum16ShouldFail() : void {\n\n        assertThat(isValidCreditCardNumber(\"123413123123213421341123412423412412341232314\"), equalTo(false));\n\n    }\n\n    //Even CC length integrity testing\n    //Each number is examined\n    //if a number is divisible by 2 with no remainder (even) it gets doubled and added to the first group. If the result is number is greater than 9 then 9 is subtracted.\n    //if a number is divisible by 2 with a remainder (odd) it gets added to the second group\n    //The first group plus the second group should be divisible by 10 with no remainder\n\n    [Test]\n    public function ccEvenNumberLengthWithBadIntegrityShouldFail() : void {\n\n        assertThat(isValidCreditCardNumber(\"12345678901234\"), equalTo(false));\n\n    }\n\n    [Test]\n    public function ccEvenNumberLengthWithGoodIntegrityShouldPass() : void {\n\n        assertThat(isValidCreditCardNumber(\"72345678901234\"), equalTo(true));\n\n    }\n\n    //Odd CC length integrity testing\n    //Each number is examined\n    //if a number is divisible by 1 with no remainder (odd) it gets doubled and added to the first group. If the result is number is greater than 9 then 9 is subtracted.\n    //if a number is divisible by 1 with a remainder (even) it gets added to the second group\n    //The first group plus the second group should be divisible by 10 with no remainder\n\n    [Test]\n    public function ccOddNumberLengthWithBadIntegrityShouldFail() : void {\n\n        assertThat(isValidCreditCardNumber(\"123456789012345\"), equalTo(false));\n\n    }\n\n    [Test]\n    public function ccOddNumberLengthWithGoodIntegrityShouldPass() : void {\n\n        assertThat(isValidCreditCardNumber(\"323456789012345\"), equalTo(true));\n\n    }\n\n}\n}\n"
  },
  {
    "path": "test/utils/validation/isValidExpirationDateTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/20/11\n * Time: 1:34 PM\n */\npackage utils.validation {\nimport org.hamcrest.assertThat;\n\nimport org.hamcrest.object.equalTo;\n\nimport utils.validation.isValidExpirationDate;\n\npublic class IsValidExpirationDateTest {\n\n    [Test]\n    public function expirationOfNextYearShouldPass() : void {\n\n        assertThat(isValidExpirationDate(1, new Date().getFullYear() + 1), equalTo(true));\n\n    }\n\n    [Test]\n    public function expirationOfLastYearShouldFail() : void {\n\n        assertThat(isValidExpirationDate(1, new Date().getFullYear() - 1), equalTo(false));\n\n    }\n\n    [Test]\n    public function expirationOfSameYearButUpcomingMonthShouldPass() : void {\n\n        assertThat(isValidExpirationDate(new Date().getMonth() + 1, new Date().getFullYear()), equalTo(true));\n\n    }\n\n    [Test]\n    public function expirationOfSameYearButPastMonthShouldFail() : void {\n\n        assertThat(isValidExpirationDate(new Date().getMonth() - 1, new Date().getFullYear()), equalTo(false));\n\n    }\n\n    [Test]\n    public function expirationOfUpcomingYearWithMonthOfZeroShouldFail() : void {\n\n        assertThat(isValidExpirationDate(0,new Date().getFullYear() + 1), equalTo(true));\n\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/validation/isValidPhoneNumberTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/3/11\n * Time: 5:32 PM\n */\npackage utils.validation {\nimport org.hamcrest.assertThat;\n\nimport org.hamcrest.object.equalTo;\n\nimport utils.validation.isValidPhoneNumber;\n\npublic class IsValidPhoneNumberTest {\n\n    [Test]\n    public function validNumberPasses() : void {\n\n        assertThat(isValidPhoneNumber(\"123 456-7789\"), equalTo(true));\n\n    }\n\n    [Test]\n    public function validNumberNoDashesPasses() : void {\n\n        assertThat(isValidPhoneNumber(\"123 456 7789\"), equalTo(true));\n\n    }\n\n    //TODO: Should this be the intended behavior?\n    [Test]\n    public function validNumberWithPrefixFails() : void {\n\n        assertThat(isValidPhoneNumber(\"1 123 456-7789\"), equalTo(false));\n\n    }\n\n\n}\n}\n"
  },
  {
    "path": "test/utils/xml/GetNextSiblingTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/3/11\n * Time: 2:28 PM\n */\npackage utils.xml {\nimport org.hamcrest.assertThat;\nimport org.hamcrest.object.equalTo;\n\npublic class GetNextSiblingTest {\n\n    [Test]\n    public function requestedIndexShouldReturnNextNode() : void {\n\n        var x:XML =\n                    <root>\n                        <stuff>value1</stuff>\n                        <stuff>value2</stuff>\n                        <stuff>value3</stuff>\n                    </root>\n\n        var sibling:* = getNextSibling(x.stuff[1]);\n\n        assertThat(sibling, equalTo(x.stuff[2]));\n\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/xml/GetPreviousSiblingTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/3/11\n * Time: 2:08 PM\n */\npackage utils.xml {\nimport org.hamcrest.assertThat;\nimport org.hamcrest.object.equalTo;\n\npublic class GetPreviousSiblingTest {\n\n    [Test]\n    public function callShouldReturnPreviousNode() : void {\n\n        var x:XML =\n                    <root>\n                        <stuff>value1</stuff>\n                        <stuff>value2</stuff>\n                        <stuff>value3</stuff>\n                    </root>\n\n        var sibling:* = getPreviousSibling(x.stuff[2]);\n\n        assertThat(sibling, equalTo(x.stuff[1]));\n\n    }\n}\n}\n"
  },
  {
    "path": "test/utils/xml/GetSiblingByIndexTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/3/11\n * Time: 12:04 PM\n */\npackage utils.xml {\nimport org.hamcrest.assertThat;\nimport org.hamcrest.object.equalTo;\n\npublic class GetSiblingByIndexTest {\n\n    [Test]\n    public function requestedIndexShouldReturnProperNode() : void {\n\n        var x:XML =\n                    <root>\n                        <stuff>value1</stuff>\n                        <stuff>value2</stuff>\n                        <stuff>value3</stuff>\n                    </root>\n\n        var sibling:* = getSiblingByIndex(x.stuff[2], -1);\n\n        assertThat(sibling, equalTo(x.stuff[1]))\n\n    }\n\n}\n}\n"
  },
  {
    "path": "test/utils/xml/isValidXMLTest.as",
    "content": "/**\n * Created by IntelliJ IDEA.\n * User: Ian McLean\n * Date: 5/2/11\n * Time: 4:40 PM\n */\npackage utils.xml {\nimport org.hamcrest.assertThat;\nimport org.hamcrest.object.equalTo;\n\npublic class IsValidXMLTest {\n\n    [Test]\n    public function validXMLShouldReturnTrue() : void {\n\n        var s:String = \"<goodxml></goodxml>\";\n\n        assertThat(isValidXML(s), equalTo(true))\n\n    }\n\n    [Test]\n    public function invalidXMLShouldReturnFalse() : void {\n\n\n        var s:String = \"<badXml></badXmL>\";\n\n        assertThat(isValidXML(s), equalTo(false))\n\n    }\n}\n}\n"
  }
]