Section 1
//MousePoint (com.noodlebox.misc.MousePoint)
package com.noodlebox.misc {
import flash.geom.*;
public dynamic class MousePoint {
public var smoothedPoint:Point;
public var cagedPoint:Point;
public var point:Point;
public var angle:Number;
public var distance:Number;
public var followingPoint:Point;
public function MousePoint(_arg1:Point=null, _arg2:Number=0, _arg3:Number=0, _arg4:Point=null, _arg5:Point=null):void{
this.point = _arg1;
this.smoothedPoint = _arg4;
this.cagedPoint = _arg5;
this.angle = _arg2;
this.distance = _arg3;
if (!this.point){
this.point = new Point(0, 0);
};
if (!this.smoothedPoint){
this.smoothedPoint = new Point(0, 0);
};
if (!this.cagedPoint){
this.cagedPoint = new Point(0, 0);
};
}
}
}//package com.noodlebox.misc
Section 2
//Base (com.noodlebox.util.Base)
package com.noodlebox.util {
import flash.display.*;
public class Base {
private var _canvasHeight:int;
public var canvasHeightH:int;
private var _canvasWidth:int;
public var canvasBD:BitmapData;
public var canvasBM:Bitmap;
public var trip:Boolean;// = false
private var parent:Object;
public var paused:Boolean;// = false
public var t:int;// = 0
public var canvasWidthH:int;
public var children:Array;
public function Base(_arg1:Sprite=null):void{
paused = false;
trip = false;
t = 0;
super();
if (_arg1){
this.parent = _arg1;
};
children = new Array();
}
public function createCanvas(_arg1:Boolean=true, _arg2:uint=0):void{
canvasBD = new BitmapData(canvasWidth, canvasHeight, _arg1, _arg2);
canvasBM = new Bitmap(canvasBD);
}
public function set canvasHeight(_arg1:uint):void{
_canvasHeight = _arg1;
canvasHeightH = (_arg1 / 2);
}
public function get canvasWidth():uint{
return (_canvasWidth);
}
public function subscribe(_arg1:Boolean=true, _arg2:Boolean=true, _arg3:Boolean=true, _arg4:Boolean=false):void{
}
public function get canvasHeight():uint{
return (_canvasHeight);
}
public function setDimensions(_arg1:int, _arg2:int):void{
canvasWidth = _arg1;
canvasHeight = _arg2;
canvasWidthH = (canvasWidth / 2);
canvasHeightH = (canvasHeight / 2);
}
public function set canvasWidth(_arg1:uint):void{
_canvasWidth = _arg1;
canvasWidthH = (_arg1 / 2);
}
public static function getBaseFolderWithSlash(_arg1:Stage, _arg2:String=""):String{
var _local3:String;
_local3 = _arg2;
if (_arg1.root.loaderInfo.parameters.folder != undefined){
_local3 = _arg1.root.loaderInfo.parameters.folder;
};
if (_local3 != ""){
if (_local3.charAt((_local3.length - 1)) != "/"){
_local3 = (_local3 + "/");
};
};
return (_local3);
}
}
}//package com.noodlebox.util
Section 3
//BitmapDataUtil (com.noodlebox.util.BitmapDataUtil)
package com.noodlebox.util {
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import flash.filters.*;
public class BitmapDataUtil {
private static var cacheRect:Rectangle;
private static var cacheBitmapData:BitmapData;
private static var shape:Shape = new Shape();
private static var cacheTarget:BitmapData;
public static function reserveAlpha(_arg1:BitmapData):void{
if (!cacheBitmapData){
cacheBitmapData = new BitmapData(2880, 2880, true, 0);
};
cacheBitmapData.copyPixels(_arg1, _arg1.rect, new Point());
cacheRect = _arg1.rect.clone();
cacheTarget = _arg1;
}
public static function fill(_arg1:BitmapData, _arg2:uint=0):void{
_arg1.fillRect(_arg1.rect, _arg2);
}
public static function flipVertical(_arg1:BitmapData):BitmapData{
var _local2:BitmapData;
var _local3:Matrix;
_local2 = new BitmapData(_arg1.width, _arg1.height, _arg1.transparent, 0);
_local3 = new Matrix();
_local3.scale(1, -1);
_local3.translate(0, _arg1.height);
_local2.draw(_arg1, _local3);
return (_local2);
}
public static function drawSubset(_arg1:BitmapData, _arg2:BitmapData, _arg3:Number=1, _arg4:Number=-1, _arg5:Number=-1):void{
var _local6:Matrix;
if (_arg4 == -1){
_arg4 = Math.random();
};
if (_arg5 == -1){
_arg5 = Math.random();
};
_local6 = new Matrix();
_local6.scale(_arg3, _arg3);
_local6.translate((-(_arg4) * ((_arg3 * _arg2.width) - _arg1.width)), (-(_arg5) * ((_arg3 * _arg2.height) - _arg1.height)));
_arg1.draw(_arg2, _local6);
}
public static function quickHorizontalMirror(_arg1:BitmapData):BitmapData{
var _local2:BitmapData;
var _local3:Matrix;
_local2 = new BitmapData((_arg1.width * 2), _arg1.height, _arg1.transparent, 0);
_local2.draw(_arg1);
_local3 = new Matrix();
_local3.scale(-1, 1);
_local3.translate(_local2.width, 0);
_local2.draw(_arg1, _local3);
return (_local2);
}
public static function cloneDimensions(_arg1:BitmapData, _arg2:uint=0):BitmapData{
return (new BitmapData(_arg1.width, _arg1.height, _arg1.transparent, _arg2));
}
public static function colorTransformAlpha(_arg1:BitmapData, _arg2:Number, _arg3:int=0):void{
_arg1.colorTransform(_arg1.rect, new ColorTransform(1, 1, 1, _arg2, 0, 0, 0, _arg3));
}
public static function crop(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:Boolean=false):BitmapData{
var _local5:BitmapData;
if (_arg1.width < _arg2){
_arg2 = _arg1.width;
};
if (_arg1.height < _arg3){
_arg3 = _arg1.height;
};
_local5 = new BitmapData(_arg2, _arg3, _arg1.transparent, 0);
if (_arg4){
_local5.copyPixels(_arg1, _arg1.rect, new Point(((_arg2 - _arg1.width) / 2), ((_arg3 - _arg1.height) / 2)));
} else {
_local5.copyPixels(_arg1, _local5.rect, new Point());
};
return (_local5);
}
public static function noise(_arg1:BitmapData, _arg2:Number=0.1):void{
var _local3:BitmapData;
_local3 = _arg1.clone();
_arg1.noise((Math.random() * 0xFFFFFF));
_arg1.draw(_local3, null, new ColorTransform(1, 1, 1, (1 - _arg2)));
}
public static function cutOutFlatColors(_arg1:BitmapData, _arg2:uint, _arg3:Object):Array{
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:uint;
var _local8:Rectangle;
var _local9:BitmapData;
var _local10:BitmapData;
var _local11:Object;
if ((_arg3 is Array)){
_local4 = Array(_arg3);
} else {
trace("Warning slow-color finder used in BitmapData.cutOutFlatColors");
_local4 = new Array();
do {
_local7 = _arg1.getPixel32((Math.random() * _arg1.width), (Math.random() * _arg1.height));
if (_local7 != _arg2){
if (_local4.indexOf(_local7) == -1){
_local4.push(_local7);
};
};
} while (_local4.length < _arg3);
};
_local4.sort(0, Array.NUMERIC);
_local5 = new Array();
_local6 = new Array();
_local7 = 0;
while (_local7 < _local4.length) {
_local8 = _arg1.getColorBoundsRect(4294967295, _local4[_local7]);
if (((!((_local8.width == 0))) && (!((_local8.height == 0))))){
_local9 = new BitmapData(_local8.width, _local8.height, true, _local4[_local7]);
_local9.copyPixels(_arg1, _local8, new Point());
_local10 = new BitmapData(_local8.width, _local8.height, true, 0);
_local10.threshold(_local9, _local9.rect, new Point(), "==", _local4[_local7], 4294967295);
_local9.copyChannel(_local10, _local9.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA);
_local11 = {bitmapData:_local9, color:_local4[_local7], rect:_local8, x:_local8.x, y:_local8.y, width:_local8.width, height:_local8.height, xCenter:(_local8.x - (_local8.width / 2)), yCenter:(_local8.y - (_local8.height / 2))};
_local5.push(_local11);
};
_local7++;
};
return (_local5);
}
public static function multiplyBlue(_arg1:BitmapData, _arg2:int):void{
var _local3:Array;
var _local4:int;
_local3 = new Array();
_local4 = 0;
while (_local4 < 0x0100) {
_local3.push(uint((_local4 * _arg2)));
_local4++;
};
_arg1.paletteMap(_arg1, _arg1.rect, new Point(), null, null, _local3, null);
}
public static function multiplyTwoAlphaChannels(_arg1:BitmapData, _arg2:BitmapData):BitmapData{
var _local3:BitmapData;
var _local4:BitmapData;
var _local5:BitmapData;
_local3 = new BitmapData(_arg1.width, _arg1.height, false, 0);
alphaToBlue(_arg1, _local3);
_local4 = new BitmapData(_arg1.width, _arg1.height, false, 0);
alphaToBlue(_arg2, _local4);
_local4.draw(_local3, null, null, "multiply");
_local5 = _arg1.clone();
blueToAlpha(_local4, _local5);
return (_local5);
}
public static function trim(_arg1:BitmapData, _arg2:uint=0):BitmapData{
var _local3:Rectangle;
var _local4:BitmapData;
_local3 = _arg1.getColorBoundsRect(4294967295, _arg2, false);
_local4 = new BitmapData(_local3.width, _local3.height, _arg1.transparent, 0);
_local4.copyPixels(_arg1, _local3, new Point(0, 0));
return (_local4);
}
public static function drawGrid(_arg1:BitmapData, _arg2:int=32, _arg3:uint=4294901760, _arg4:Boolean=true, _arg5:uint=4278255615):void{
var _local6:Rectangle;
var _local7:int;
var _local8:int;
_local7 = 0;
while (_local7 <= Math.floor((_arg1.height / _arg2))) {
_local6 = new Rectangle(0, (_local7 * _arg2), _arg1.width, 1);
_arg1.fillRect(_local6, _arg3);
_local7++;
};
_local8 = 0;
while (_local8 <= Math.floor((_arg1.width / _arg2))) {
_local6 = new Rectangle((_local8 * _arg2), 0, 1, _arg1.height);
_arg1.fillRect(_local6, _arg3);
_local8++;
};
if (_arg4){
_local6 = new Rectangle(0, (_arg1.height - 1), _arg1.width, 1);
_arg1.fillRect(_local6, _arg5);
_local6 = new Rectangle((_arg1.width - 1), 0, 1, _arg1.height);
_arg1.fillRect(_local6, _arg5);
};
}
public static function rotateBy90(_arg1:BitmapData, _arg2:int=1, _arg3:Boolean=true):BitmapData{
var _local4:BitmapData;
var _local5:Matrix;
if ((((_arg2 == 1)) || ((_arg2 == 3)))){
_local4 = new BitmapData(_arg1.height, _arg1.width, _arg1.transparent, 0);
} else {
_local4 = new BitmapData(_arg1.width, _arg1.height, _arg1.transparent, 0);
};
_local5 = new Matrix();
_local5.translate((-(_arg1.width) / 2), (-(_arg1.height) / 2));
_local5.rotate(((_arg2 * Math.PI) / 2));
_local5.scale(1.01, 1.01);
_local5.translate((_local4.width / 2), (_local4.height / 2));
_local4.draw(_arg1, _local5, null, null, null, _arg3);
return (_local4);
}
public static function drawToFit(_arg1:Object, _arg2:BitmapData, _arg3:String="normal", _arg4:Boolean=true):void{
var _local5:Matrix;
_local5 = new Matrix();
if ((_arg1 is DisplayObject)){
_local5.scale((_arg2.width / DisplayObject(_arg1).width), (_arg2.height / DisplayObject(_arg1).height));
_arg2.draw(DisplayObject(_arg1), _local5, null, _arg3, null, _arg4);
} else {
_local5.scale((_arg2.width / BitmapData(_arg1).width), (_arg2.height / BitmapData(_arg1).height));
_arg2.draw(BitmapData(_arg1), _local5, null, _arg3, null, _arg4);
};
}
public static function resize(_arg1:BitmapData, _arg2:int, _arg3:int=-1, _arg4:Boolean=true):BitmapData{
var _local5:BitmapData;
var _local6:Matrix;
if (_arg3 == -1){
_arg3 = (_arg1.height * (_arg2 / _arg1.width));
};
if ((((_arg1.width == _arg2)) && ((_arg1.height == _arg3)))){
_local5 = _arg1;
} else {
_local5 = new BitmapData(_arg2, _arg3, _arg1.transparent, 0);
_local6 = new Matrix();
_local6.scale((_arg2 / _arg1.width), (_arg3 / _arg1.height));
_local5.draw(_arg1, _local6, null, null, null, _arg4);
};
return (_local5);
}
public static function removeAlpha(_arg1:BitmapData, _arg2:uint=0):BitmapData{
var _local3:BitmapData;
_local3 = new BitmapData(_arg1.width, _arg1.height, false, _arg2);
_local3.draw(_arg1);
return (_local3);
}
public static function scrollAndWrap(_arg1:BitmapData, _arg2:int=0, _arg3:int=0):void{
var _local4:BitmapData;
var _local5:int;
var _local6:int;
_local4 = _arg1.clone();
_arg1.fillRect(_arg1.rect, 0);
_local5 = ((_arg2)<0) ? _arg1.width : -(_arg1.width);
_local6 = ((_arg3)<0) ? _arg1.height : -(_arg1.height);
_arg1.copyPixels(_local4, _arg1.rect, new Point(_arg2, _arg3));
_arg1.copyPixels(_local4, _arg1.rect, new Point((_arg2 + _local5), _arg3));
_arg1.copyPixels(_local4, _arg1.rect, new Point((_arg2 + _local5), (_arg3 + _local6)));
_arg1.copyPixels(_local4, _arg1.rect, new Point(_arg2, (_arg3 + _local6)));
}
public static function colorBend(_arg1:BitmapData, _arg2:String="/", _arg3:String="/", _arg4:String="/", _arg5:String="/"):void{
var _local6:Array;
var _local7:Array;
var _local8:Array;
var _local9:Array;
var _local10:uint;
_local6 = new Array();
_local7 = new Array();
_local8 = new Array();
_local9 = new Array();
_local10 = 0;
while (_local10 < 0x0100) {
if (_arg2 == "/"){
_local6.push((_local10 << 16));
};
if (_arg2 == "s"){
_local6.push((uint((MagicMath.sCurve((_local10 / 0xFF)) * 0xFF)) << 16));
};
if (_arg2 == "r"){
_local6.push((uint((MagicMath.rCurve((_local10 / 0xFF)) * 0xFF)) << 16));
};
if (_arg2 == "j"){
_local6.push((uint((MagicMath.jCurve((_local10 / 0xFF)) * 0xFF)) << 16));
};
if (_arg2 == "0"){
_local6.push(0);
};
if (_arg2 == "1"){
_local6.push((0xFF << 16));
};
if (_arg3 == "/"){
_local7.push((_local10 << 8));
};
if (_arg3 == "s"){
_local7.push((uint((MagicMath.sCurve((_local10 / 0xFF)) * 0xFF)) << 8));
};
if (_arg3 == "r"){
_local7.push((uint((MagicMath.rCurve((_local10 / 0xFF)) * 0xFF)) << 8));
};
if (_arg3 == "j"){
_local7.push((uint((MagicMath.jCurve((_local10 / 0xFF)) * 0xFF)) << 8));
};
if (_arg3 == "0"){
_local7.push(0);
};
if (_arg3 == "1"){
_local7.push((0xFF << 8));
};
if (_arg4 == "/"){
_local8.push(_local10);
};
if (_arg4 == "s"){
_local8.push(uint((MagicMath.sCurve((_local10 / 0xFF)) * 0xFF)));
};
if (_arg4 == "r"){
_local8.push(uint((MagicMath.rCurve((_local10 / 0xFF)) * 0xFF)));
};
if (_arg4 == "j"){
_local8.push(uint((MagicMath.jCurve((_local10 / 0xFF)) * 0xFF)));
};
if (_arg4 == "0"){
_local8.push(0);
};
if (_arg4 == "1"){
_local8.push(0xFF);
};
if (_arg5 == "/"){
_local9.push((_local10 << 24));
};
if (_arg5 == "s"){
_local9.push((uint((MagicMath.sCurve((_local10 / 0xFF)) * 0xFF)) << 24));
};
if (_arg5 == "r"){
_local9.push((uint((MagicMath.rCurve((_local10 / 0xFF)) * 0xFF)) << 24));
};
if (_arg5 == "j"){
_local9.push((uint((MagicMath.jCurve((_local10 / 0xFF)) * 0xFF)) << 24));
};
if (_arg5 == "0"){
_local9.push(0);
};
if (_arg5 == "1"){
_local9.push((0xFF << 24));
};
_local10++;
};
_arg1.paletteMap(_arg1, _arg1.rect, new Point(), _local6, _local7, _local8, _local9);
}
public static function tintDown(_arg1:BitmapData, _arg2:uint, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String="normal"):void{
var _local7:String;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:Matrix;
var _local12:String;
var _local13:Shape;
_local7 = GradientType.LINEAR;
_local8 = [_arg2, _arg2];
_local9 = [_arg3, 0];
_local10 = [int((_arg4 * 0xFF)), int((_arg5 * 0xFF))];
_local11 = new Matrix();
_local11.createGradientBox(_arg1.width, _arg1.height, (Math.PI / 2), 0, 0);
_local12 = SpreadMethod.PAD;
_local13 = new Shape();
_local13.graphics.beginGradientFill(_local7, _local8, _local9, _local10, _local11, _local12);
_local13.graphics.drawRect(0, 0, _arg1.width, _arg1.height);
_arg1.draw(_local13, null, null, _arg6, null, true);
}
public static function quickHorizontalTile(_arg1:BitmapData, _arg2:int=2):void{
var _local3:BitmapData;
var _local4:int;
var _local5:Matrix;
_local3 = _arg1.clone();
_local4 = 0;
while (_local4 < _arg2) {
_local5 = new Matrix();
_local5.scale((1 / _arg2), 1);
_local5.translate((_local4 * (_arg1.width / _arg2)), 0);
_arg1.draw(_local3, _local5);
_local4++;
};
}
public static function setRandomPixel(_arg1:BitmapData, _arg2:uint=305419896, _arg3:int=1):void{
var _local4:Boolean;
var _local5:int;
_local4 = ((_arg2)==305419896) ? true : false;
_local5 = 0;
while (_local5 < _arg3) {
if (_local4){
_arg2 = (Math.random() * 4294967295);
};
_arg1.setPixel32((_arg1.width * Math.random()), (_arg1.height * Math.random()), _arg2);
_local5++;
};
}
public static function colorTransformRGB(_arg1:BitmapData, _arg2:Number, _arg3:int=0):void{
_arg1.colorTransform(_arg1.rect, new ColorTransform(_arg2, _arg2, _arg2, 1, _arg3, _arg3, _arg3, 0));
}
public static function addAlpha(_arg1:BitmapData):BitmapData{
var _local2:BitmapData;
_local2 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local2.draw(_arg1);
return (_local2);
}
public static function eraseFromAlpha(_arg1:IBitmapDrawable, _arg2:BitmapData, _arg3:Object=null):void{
var _local4:Matrix;
var _local5:BitmapData;
if (!_arg3){
_arg3 = new Point();
};
if ((_arg3 is Matrix)){
_local4 = Matrix(_arg3);
} else {
_local4 = new Matrix();
_local4.translate(Point(_arg3).x, Point(_arg3).y);
};
_local5 = new BitmapData(_arg2.width, _arg2.height, false, 0);
alphaToBlue(_arg2, _local5);
_local5.draw(_arg1, _local4);
blueToAlpha(_local5, _arg2);
}
public static function fillRoundRect(_arg1:BitmapData, _arg2:int, _arg3:uint, _arg4:Number=1, _arg5:Rectangle=null):void{
_arg2 = (_arg2 * 2);
shape.graphics.clear();
shape.graphics.beginFill(_arg3, _arg4);
if (_arg5){
shape.graphics.drawRoundRect(_arg5.x, _arg5.y, _arg5.width, _arg5.height, _arg2, _arg2);
} else {
shape.graphics.drawRoundRect(0, 0, _arg1.width, _arg1.height, _arg2, _arg2);
};
shape.graphics.endFill();
_arg1.draw(shape);
}
public static function star(_arg1:BitmapData, _arg2:Boolean=true):BitmapData{
var _local3:BitmapData;
var _local4:Matrix;
if ((((_arg1.width > 1440)) || ((_arg1.height > 1440)))){
_arg1 = crop(_arg1, 1440, 1440, false);
};
_local3 = new BitmapData((_arg1.width * 2), (_arg1.height * 2), _arg1.transparent, 0);
_local3.copyPixels(_arg1, _arg1.rect, new Point());
_local4 = new Matrix();
_local4.scale(-1, 1);
_local4.translate(_local3.width, 0);
_local3.draw(_arg1, _local4);
_local4.scale(1, -1);
_local4.translate(0, _local3.height);
_local3.draw(_arg1, _local4);
_local4 = new Matrix();
_local4.scale(1, -1);
_local4.translate(0, _local3.height);
_local3.draw(_arg1, _local4);
return (_local3);
}
public static function glare(_arg1:BitmapData, _arg2:int=16, _arg3:Number=1, _arg4:Number=1, _arg5:String="add"):BitmapData{
var _local6:BitmapData;
var _local7:BitmapData;
_local6 = new BitmapData(_arg1.width, _arg1.height, false, 0xFFFFFF);
_local7 = _arg1.clone();
_local6.draw(_arg1, null, new ColorTransform(_arg4, _arg4, _arg4, 1));
convertToGreyscale(_local6);
blur(_local6, _arg2, 1);
_local7.draw(_local6, null, new ColorTransform(1, 1, 1, _arg3), _arg5);
_local7.copyChannel(_arg1, _local7.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA);
return (_local7);
}
public static function convertToGreyscale(_arg1:BitmapData):void{
var _local2:Array;
var _local3:ColorMatrixFilter;
_local2 = [0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0, 0, 0, 1, 0];
_local3 = new ColorMatrixFilter(_local2);
_arg1.applyFilter(_arg1, _arg1.rect, new Point(), _local3);
}
public static function sliceHorizontally(_arg1:BitmapData, _arg2:int):Array{
var _local3:Array;
var _local4:int;
var _local5:BitmapData;
_local3 = new Array();
_local4 = 0;
while (_local4 < _arg2) {
_local5 = new BitmapData(_arg1.width, (_arg1.height / _arg2), _arg1.transparent, 0);
_local5.copyPixels(_arg1, _arg1.rect, new Point(0, ((-(_local4) * _arg1.height) / _arg2)));
_local3.push(_local5);
_local4++;
};
return (_local3);
}
public static function matrixFill(_arg1:BitmapData, _arg2:BitmapData, _arg3:Matrix=null, _arg4:ColorTransform=null):void{
var _local5:Shape;
_local5 = new Shape();
_local5.graphics.beginBitmapFill(_arg2, _arg3, true, true);
_local5.graphics.drawRect(0, 0, _arg1.width, _arg1.height);
_local5.graphics.endFill();
_arg1.draw(_local5, null, _arg4);
}
public static function alphaToAlpha(_arg1:BitmapData, _arg2:BitmapData):void{
_arg2.copyChannel(_arg1, _arg1.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA);
}
public static function blur(_arg1:BitmapData, _arg2:Number, _arg3:int=1):void{
_arg1.applyFilter(_arg1, _arg1.rect, new Point(), new BlurFilter(_arg2, _arg2, _arg3));
}
public static function blueToAlpha(_arg1:BitmapData, _arg2:BitmapData):void{
_arg2.copyChannel(_arg1, _arg1.rect, new Point(), BitmapDataChannel.BLUE, BitmapDataChannel.ALPHA);
}
public static function tempBitmapData(_arg1:int, _arg2:int, _arg3:Boolean=false, _arg4:uint=4282646528, _arg5:int=0, _arg6:uint=4294901760, _arg7:String="", _arg8:uint=4294967295, _arg9:uint=12):BitmapData{
var _local10:BitmapData;
var _local11:TextField;
_local10 = new BitmapData(_arg1, _arg2, _arg3, _arg6);
_local10.fillRect(new Rectangle(_arg5, _arg5, (_arg1 - (_arg5 * 2)), (_arg2 - (_arg5 * 2))), _arg4);
if (_arg7 != ""){
_local11 = new TextField();
_local11.width = _arg1;
_local11.height = _arg2;
_local11.multiline = true;
_local11.textColor = _arg8;
_local11.text = _arg7;
};
return (_local10);
}
public static function invert(_arg1:BitmapData):void{
var _local2:BitmapData;
_local2 = _arg1.clone();
_arg1.draw(_local2, null, null, "invert");
}
public static function restoreAlpha(_arg1:BitmapData=null):void{
if (_arg1 == null){
_arg1 = cacheTarget;
};
_arg1.copyChannel(cacheBitmapData, _arg1.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA);
}
public static function flipHorizontal(_arg1:BitmapData):BitmapData{
var _local2:BitmapData;
var _local3:Matrix;
_local2 = new BitmapData(_arg1.width, _arg1.height, _arg1.transparent, 0);
_local3 = new Matrix();
_local3.scale(-1, 1);
_local3.translate(_arg1.width, 0);
_local2.draw(_arg1, _local3);
return (_local2);
}
public static function blueFilter(_arg1:BitmapData):void{
_arg1.colorTransform(_arg1.rect, new ColorTransform(0, 0, 1, 1));
}
public static function alphaToBlue(_arg1:BitmapData, _arg2:BitmapData):void{
_arg2.copyChannel(_arg1, _arg1.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.BLUE);
}
public static function tintUp(_arg1:BitmapData, _arg2:uint, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String="normal"):void{
var _local7:String;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:Matrix;
var _local12:String;
var _local13:Shape;
_local7 = GradientType.LINEAR;
_local8 = [_arg2, _arg2];
_local9 = [0, _arg3];
_local10 = [int((_arg4 * 0xFF)), int((_arg5 * 0xFF))];
_local11 = new Matrix();
_local11.createGradientBox(_arg1.width, _arg1.height, (Math.PI / 2), 0, 0);
_local12 = SpreadMethod.PAD;
_local13 = new Shape();
_local13.graphics.beginGradientFill(_local7, _local8, _local9, _local10, _local11, _local12);
_local13.graphics.drawRect(0, 0, _arg1.width, _arg1.height);
_arg1.draw(_local13, null, null, _arg6, null, true);
}
public static function canvasSize(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:uint=0):BitmapData{
var _local6:BitmapData;
_local6 = new BitmapData(_arg2, _arg3, _arg1.transparent, _arg5);
if (_arg4){
_local6.copyPixels(_arg1, _arg1.rect, new Point(((_arg2 - _arg1.width) / 2), ((_arg3 - _arg1.height) / 2)));
} else {
_local6.copyPixels(_arg1, _arg1.rect, new Point());
};
return (_local6);
}
}
}//package com.noodlebox.util
Section 4
//Brush (com.noodlebox.util.Brush)
package com.noodlebox.util {
import flash.geom.*;
import flash.display.*;
public class Brush {
public function Brush():void{
}
public static function makeBlurredBrushes(_arg1:int, _arg2:int, _arg3:uint, _arg4:uint=0, _arg5:uint=0, _arg6:uint=0):Array{
var _local7:Array;
var _local8:int;
_local7 = new Array();
_local8 = 0;
while (_local8 < _arg1) {
_local7.push(makeBlurredBrush(_arg2, _arg3, _arg4, _arg5, _arg6));
_local8++;
};
return (_local7);
}
public static function drawStretchedStroke(_arg1:BitmapData, _arg2:Point, _arg3:Point, _arg4:BitmapData, _arg5:int=16, _arg6:String="normal", _arg7:Boolean=true):void{
var _local8:Matrix;
var _local9:Number;
_local8 = new Matrix();
_local9 = Point.distance(_arg2, _arg3);
_local9 = (_local9 + _arg5);
_local8.translate(0, (-(_arg4.height) / 2));
_local8.scale((_local9 / _arg4.width), 1);
_local8.translate((-(_arg5) / 2), 0);
_local8.rotate(Math.atan2((_arg3.y - _arg2.y), (_arg3.x - _arg2.x)));
_local8.translate(_arg2.x, _arg2.y);
_arg1.draw(_arg4, _local8, null, _arg6, null, _arg7);
}
public static function simpleStroke(_arg1:Point, _arg2:Point, _arg3:int, _arg4:BitmapData, _arg5:BitmapData, _arg6:String="normal"):void{
var _local7:Matrix;
var _local8:Number;
var _local9:Point;
var _local10:Number;
var _local11:int;
_arg1.offset((-(_arg4.width) / 2), (-(_arg4.height) / 2));
_arg2.offset((-(_arg4.width) / 2), (-(_arg4.height) / 2));
if (_arg3 < 0){
_local10 = (Point.distance(_arg1, _arg2) / Math.abs(_arg3));
if (_local10 < 2){
_local10 = 2;
};
_arg3 = _local10;
};
_local7 = new Matrix();
if (_arg6 == "normal"){
_local11 = 0;
while (_local11 < _arg3) {
_local8 = (_local11 / _arg3);
_local9 = Point.interpolate(_arg1, _arg2, _local8);
_arg5.copyPixels(_arg4, _arg4.rect, _local9, null, null, true);
_local11++;
};
} else {
_local11 = 0;
while (_local11 < _arg3) {
_local8 = (_local11 / _arg3);
_local9 = Point.interpolate(_arg1, _arg2, _local8);
_local7.tx = _local9.x;
_local7.ty = _local9.y;
_arg5.draw(_arg4, _local7, null, _arg6);
_local11++;
};
};
}
public static function makeBrush(_arg1:Number, _arg2:int, _arg3:uint=0):BitmapData{
var _local4:BitmapData;
var _local5:Shape;
_local4 = new BitmapData((_arg1 * 2), (_arg1 * 2), true, 0);
_local5 = new Shape();
_local5.graphics.clear();
_local5.graphics.beginFill(0, (_arg2 / 0xFF));
_local5.graphics.drawCircle(_arg1, _arg1, _arg1);
_local5.graphics.endFill();
_local4.draw(_local5);
return (_local4);
}
public static function drawQuickLine(_arg1:Point, _arg2:Point, _arg3:BitmapData, _arg4:uint=0, _arg5:Number=1, _arg6:Number=1, _arg7:Shape=null, _arg8:Boolean=true):void{
var _local9:Graphics;
if (!_arg7){
_arg7 = new Shape();
};
_local9 = _arg7.graphics;
_local9.clear();
_local9.lineStyle(_arg5, _arg4, _arg6);
_local9.moveTo(_arg1.x, _arg1.y);
_local9.lineTo(_arg2.x, _arg2.y);
_arg3.draw(_arg7, null, null, null, null, _arg8);
}
public static function makeBlurredBrush(_arg1:int, _arg2:uint, _arg3:uint=0, _arg4:uint=0, _arg5:uint=0):BitmapData{
var _local6:BitmapData;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:uint;
var _local11:uint;
var _local12:uint;
_local6 = new BitmapData((_arg1 * 2), (_arg1 * 2), true, 0);
_local7 = (_arg1 * 2);
_local8 = _arg1;
_local11 = 0;
while (_local11 < _local7) {
_local12 = 0;
while (_local12 < _local7) {
_local9 = Math.sqrt((((_local11 - _local8) * (_local11 - _local8)) + ((_local12 - _local8) * (_local12 - _local8))));
_local9 = ((_local8 - _local9) / _local8);
if (_local9 < 0){
_local9 = 0;
};
_local9 = (_local9 * _arg2);
_local10 = Math.floor(_local9);
if (Math.random() < (_local9 - _local10)){
_local10 = (_local10 + 1);
};
if (_local10 > 0xFF){
_local10 = 0xFF;
};
_local6.setPixel32(_local11, _local12, uint(((((_arg3 << 16) | (_arg4 << 8)) | _arg5) | (_local10 << 24))));
_local12++;
};
_local11++;
};
return (_local6);
}
}
}//package com.noodlebox.util
Section 5
//LibraryLoader (com.noodlebox.util.LibraryLoader)
package com.noodlebox.util {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class LibraryLoader extends EventDispatcher {
public var assets:Array;
private var assetURLs:Array;
public var waiting:int;// = 0
private var queue:Array;
private var maxFilesAtOnce:int;
public var bytes:int;// = 0
private var assetLoaders:Array;
private var assetNames:Array;
public var complete:Boolean;// = false
public var knownBytesTotal:int;
public function LibraryLoader(_arg1:int=0, _arg2:IEventDispatcher=null, _arg3:int=8):void{
waiting = 0;
complete = false;
bytes = 0;
this.maxFilesAtOnce = _arg3;
this.knownBytesTotal = _arg1;
super(_arg2);
assets = new Array();
assetNames = new Array();
assetLoaders = new Array();
assetURLs = new Array();
queue = new Array();
}
private function loadingError(_arg1:Event):void{
var _local2:LibraryLoaderEvent;
trace(("error" + _arg1));
waiting--;
if (queue.length > 0){
requestNextInQueue();
};
if (waiting == 0){
if (queue.length == 0){
complete = true;
_local2 = new LibraryLoaderEvent(LibraryLoaderEvent.LIBRARY_COMPLETE);
this.dispatchEvent(_local2);
trace((bytes + " total bytes with errors"));
};
};
}
public function replaceAsset(_arg1:Object, _arg2:Object):Boolean{
var _local3:Boolean;
_local3 = false;
if (assets.indexOf(_arg1) != -1){
assets[assets.indexOf(_arg1)] = _arg2;
_local3 = true;
};
return (_local3);
}
public function requestSequence(_arg1:String, _arg2:String="<x>", _arg3:int=3, _arg4:int=1, _arg5:int=32, _arg6:Boolean=false, _arg7:Function=null):void{
var _local8:int;
var _local9:String;
var _local10:String;
_local8 = _arg4;
while (_local8 <= _arg5) {
_local9 = String(_local8);
while (_local9.length < _arg3) {
_local9 = ("0" + _local9);
};
_local10 = _arg1.replace(_arg2, _local9);
request(_local10, null, _arg6, _arg7);
_local8++;
};
}
public function getAssetByName(_arg1:Object){
var _local2:int;
var _local3:int;
var _local4:*;
_local2 = -1;
_local3 = 0;
while (_local3 < assetNames.length) {
if (assetNames[_local3] == _arg1){
if (assets[_local3] != null){
_local2 = _local3;
};
};
_local3++;
};
if (_local2 == -1){
_local4 = null;
} else {
_local4 = assets[_local2];
};
return (_local4);
}
private function loaded(_arg1:Event):void{
var _local2:LoaderInfo;
var _local3:Array;
var _local4:String;
var _local5:BitmapData;
var _local6:int;
var _local7:int;
var _local8:LibraryLoaderEvent;
_local2 = LoaderInfo(_arg1.target);
bytes = (bytes + _local2.bytesTotal);
_local3 = String(_local2.url).split("/");
_local4 = _local3[(_local3.length - 1)];
_local5 = Bitmap(_local2.content).bitmapData;
_local6 = -1;
_local7 = 0;
while (_local7 < assetLoaders.length) {
if (assetLoaders[_local7] == _local2.loader){
_local6 = _local7;
break;
};
_local7++;
};
_local7 = _local6;
trace((((("received=" + _local4) + "=") + _local7) + _local5));
assets[_local7] = _local5;
waiting--;
if (queue.length > 0){
requestNextInQueue();
};
if (waiting == 0){
if (queue.length == 0){
complete = true;
_local8 = new LibraryLoaderEvent(LibraryLoaderEvent.LIBRARY_COMPLETE);
this.dispatchEvent(_local8);
trace((bytes + " total bytes"));
};
};
}
public function request(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Function=null):void{
var _local5:LoaderContext;
var _local6:URLRequest;
var _local7:Loader;
complete = false;
if (waiting > maxFilesAtOnce){
addToQueue(_arg1, _arg2, _arg3, _arg4);
} else {
waiting++;
if (!_arg2){
_arg2 = _arg1;
};
_local5 = new LoaderContext();
_local5.checkPolicyFile = _arg3;
_local6 = new URLRequest(_arg1);
_local7 = new Loader();
_local7.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
if (_arg4 != null){
_local7.contentLoaderInfo.addEventListener(Event.COMPLETE, _arg4);
};
_local7.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadingError);
_local7.load(_local6, _local5);
assets.push(null);
assetNames.push(_arg2);
assetURLs.push(_arg1);
assetLoaders.push(_local7);
trace(("request=" + _arg1));
};
}
public function getBitmapDataByURL(_arg1:String):BitmapData{
return (BitmapData(getAssetByURL(_arg1)));
}
private function requestNextInQueue():void{
request(queue[0].stURL, queue[0].name, queue[0].checkPolicyFile, queue[0].callFunction);
queue.splice(0, 1);
}
public function getStatus():Object{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:LoaderInfo;
_local1 = 0;
_local2 = 0;
_local3 = 0;
while (_local3 < assetLoaders.length) {
if (assetLoaders[_local3]){
_local4 = assetLoaders[_local3].contentLoaderInfo;
_local1 = (_local1 + _local4.bytesLoaded);
_local2 = (_local2 + _local4.bytesTotal);
};
_local3++;
};
return ({l:_local1, t:_local2, r:(_local1 / _local2)});
}
public function addAssetToLibrary(_arg1, _arg2:String="", _arg3:Object=null):void{
if (!_arg3){
_arg3 = _arg2;
};
assets.push(_arg1);
assetNames.push(_arg3);
assetURLs.push(_arg2);
assetLoaders.push(null);
}
private function addToQueue(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Function=null):void{
queue.push({stURL:_arg1, name:_arg2, checkPolicyFile:_arg3, callFunction:_arg4});
trace(("queue=" + _arg1));
}
public function getAssetByURL(_arg1:String){
var _local2:int;
var _local3:int;
var _local4:*;
_local2 = -1;
_local3 = 0;
while (_local3 < assetURLs.length) {
if (assetURLs[_local3].indexOf(_arg1) != -1){
if (assets[_local3] != null){
_local2 = _local3;
};
};
_local3++;
};
if (_local2 == -1){
_local4 = null;
} else {
_local4 = assets[_local2];
};
return (_local4);
}
public static function addZeros(_arg1:String, _arg2:int=3):String{
return (new String((String("000000000000").substr(0, (_arg2 - _arg1.length)) + _arg1)));
}
public static function splitNumbersFromURL(_arg1:String):Array{
var _local2:RegExp;
_local2 = /\d+/g;
return (_arg1.match(_local2));
}
}
}//package com.noodlebox.util
Section 6
//LibraryLoaderEvent (com.noodlebox.util.LibraryLoaderEvent)
package com.noodlebox.util {
import flash.events.*;
public class LibraryLoaderEvent extends Event {
public static const LIBRARY_COMPLETE:String = "LIBRARY_COMPLETE";
public function LibraryLoaderEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package com.noodlebox.util
Section 7
//MagicMath (com.noodlebox.util.MagicMath)
package com.noodlebox.util {
import flash.geom.*;
public class MagicMath {
public static const QUARTERPI:Number = 0.785398163397448;
public static const TWOPI:Number = 6.28318530717959;
public static const HALFPI:Number = 1.5707963267949;
private static var neighbours:Array;
public static function fadeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=1):Number{
var _local5:Number;
_local5 = (((_arg1 - _arg2) * 1) / (_arg3 - _arg2));
if (_local5 < 0){
_local5 = 0;
};
if (_local5 > 1){
_local5 = 1;
};
return ((_local5 * _arg4));
}
public static function random(_arg1:Number=1, _arg2:Boolean=false):Number{
var _local3:Number;
_local3 = (Math.random() * _arg1);
if (_arg2){
if (Math.random() > 0.5){
_local3 = -(_local3);
};
};
return (_local3);
}
public static function resizeRectangleAroundCenter(_arg1:Rectangle, _arg2:int, _arg3:int):Rectangle{
var _local4:Rectangle;
_local4 = _arg1.clone();
_arg1.clone().x = (_local4.x - ((_arg2 - _arg1.width) / 2));
_local4.y = (_local4.y - ((_arg3 - _arg1.height) / 2));
_local4.width = _arg2;
_local4.height = _arg3;
return (_local4);
}
public static function hillCurve(_arg1:Number):Number{
return (((Math.sin(((_arg1 - 0.25) * (Math.PI * 2))) + 1) * 0.5));
}
public static function triangleCurve(_arg1:Number):Number{
if (_arg1 > 0.5){
_arg1 = (1 - _arg1);
};
return (_arg1);
}
public static function pointFromInt(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean=true, _arg5:Boolean=false):Point{
var _local6:Point;
_local6 = new Point();
if (_arg1 >= (_arg2 * _arg3)){
return (null);
};
if (_arg4){
_local6.x = (_arg1 % _arg2);
_local6.y = ((_arg1 - _local6.x) / _arg2);
if (((_arg5) && (isOdd(_local6.y)))){
_local6.x = ((_arg2 - 1) - _local6.x);
};
} else {
_local6.y = (_arg1 % _arg3);
_local6.x = ((_arg1 - _local6.y) / _arg3);
if (((_arg5) && (isOdd(_local6.x)))){
_local6.y = ((_arg3 - 1) - _local6.y);
};
};
return (_local6);
}
public static function sCurve(_arg1:Number):Number{
return (((Math.sin(((_arg1 - 0.5) * Math.PI)) + 1) * 0.5));
}
public static function randomPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Point{
if (_arg3){
return (new Point(((Math.random() * _arg1) * flipper()), ((Math.random() * _arg2) * flipper())));
};
return (new Point((Math.random() * _arg1), (Math.random() * _arg2)));
}
public static function tanCurve(_arg1:Number):Number{
var _local2:Number;
_local2 = Math.sin((_arg1 * Math.PI));
if (_arg1 > 0.5){
_local2 = (1 + (1 - _local2));
};
_local2 = (_local2 * 0.5);
return (_local2);
}
public static function getPixelNeighbour(_arg1:int=-1):Point{
if (!neighbours){
neighbours = new Array(new Point(-1, -1), new Point(0, -1), new Point(1, -1), new Point(1, 0), new Point(1, 1), new Point(0, 1), new Point(-1, 1), new Point(-1, 0));
};
if (_arg1 == -1){
return (randomArrayObject(neighbours));
};
return (neighbours[_arg1]);
}
public static function flipper():int{
var _local1:int;
_local1 = 1;
if (Math.random() >= 0.5){
_local1 = -1;
};
return (_local1);
}
public static function isOdd(_arg1:int):Boolean{
return (Boolean((_arg1 % 2)));
}
public static function pad(_arg1:Number, _arg2:Number, _arg3:Number=1):Number{
return ((_arg2 + (_arg1 * (_arg3 - _arg2))));
}
public static function nothing(_arg1:Number):Number{
return (_arg1);
}
public static function randomAngle():Number{
return ((Math.random() * TWOPI));
}
public static function pow(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Number{
var _local4:Number;
_local4 = Math.pow(_arg1, _arg2);
if (_arg3){
if (_arg1 < 0){
_local4 = -(Math.abs(_local4));
};
};
return (_local4);
}
public static function wrap(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = (_arg1 % _arg2);
if (_local3 < 0){
_local3 = (_local3 + _arg2);
};
return (_local3);
}
public static function nippleCurve(_arg1:Number):Number{
return (Math.sin((_arg1 * Math.PI)));
}
public static function randomArrayIndex(_arg1:Array, _arg2:int=-1):int{
var _local3:int;
do {
_local3 = randomInt((_arg1.length - 1));
} while (_local3 == _arg2);
return (_local3);
}
public static function rCurve(_arg1:Number):Number{
return (Math.sin((_arg1 * (Math.PI * 0.5))));
}
public static function circleCurve(_arg1:Number):Number{
var _local2:Number;
_arg1 = (MagicMath.wrap(_arg1, 1) * 4);
_arg1 = (_arg1 - 2);
if (_arg1 < 0){
_local2 = -(Math.sqrt((-((2 * _arg1)) - (_arg1 * _arg1))));
} else {
_local2 = Math.sqrt(((2 * _arg1) - (_arg1 * _arg1)));
};
return (-(_local2));
}
public static function isEven(_arg1:int):Boolean{
return (!(Boolean((_arg1 % 2))));
}
public static function randomComplexAngle(_arg1:Number=0.1):Number{
return (((((Math.random() * (1 - (_arg1 * 2))) + _arg1) + randomInt(3)) * HALFPI));
}
public static function zigZag(_arg1:Number, _arg2:Number):Number{
var _local3:int;
_local3 = (_arg1 % (_arg2 * 2));
if (_local3 > _arg2){
_local3 = (_arg2 - (_local3 - _arg2));
};
return (_local3);
}
public static function getQuickestWayBetweenTwoAngles(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
_arg1 = (_arg1 + Math.PI);
_arg2 = (_arg2 + Math.PI);
_arg1 = wrap(_arg1, TWOPI);
_arg2 = wrap(_arg2, TWOPI);
_local3 = (_arg2 - _arg1);
if (Math.abs(_local3) > Math.PI){
_local4 = ((TWOPI - Math.abs(_local3)) * -(sign(_local3)));
} else {
_local4 = _local3;
};
return (_local4);
}
public static function snapToZero(_arg1:Number, _arg2:Number=0.5):Number{
var _local3:Number;
_local3 = Math.abs(_arg1);
_local3 = (_local3 - _arg2);
if (_local3 < 0){
_local3 = 0;
};
_local3 = (_local3 * (1 / (1 - _arg2)));
if (_arg1 < 0){
_local3 = -(_local3);
};
return (_local3);
}
public static function randomRadialPoint(_arg1:Number=1, _arg2:Number=1):Point{
var _local3:Number;
var _local4:Number;
_local3 = ((Math.random() * 2) * Math.PI);
_local4 = (_arg2 + (Math.random() * (_arg1 - _arg2)));
return (new Point((Math.sin(_local3) * _local4), (Math.cos(_local3) * _local4)));
}
public static function fadeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=1):Number{
var _local5:Number;
_local5 = (((_arg1 - _arg2) * 1) / (_arg3 - _arg2));
if (_local5 < 0){
_local5 = 0;
};
if (_local5 > 1){
_local5 = 1;
};
return (((1 - _local5) * _arg4));
}
public static function jCurve(_arg1:Number):Number{
return ((Math.sin((((_arg1 * 0.5) - 0.5) * Math.PI)) + 1));
}
public static function randomArrayObject(_arg1:Array, _arg2=null){
var _local3:*;
do {
_local3 = _arg1[randomInt((_arg1.length - 1))];
} while (_local3 == _arg2);
return (_local3);
}
public static function randomPointStep(_arg1:Point, _arg2:int, _arg3:Rectangle):Point{
var _local4:Point;
do {
_local4 = _arg1.add(randomRadialPoint(_arg2, _arg2));
} while (!(_arg3.containsPoint(_local4)));
return (_local4);
}
public static function randomRange(_arg1:Number, _arg2:Number):Number{
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public static function randomInt(_arg1:int):int{
return (Math.floor((Math.random() * (_arg1 + 0.999999999999))));
}
public static function cage(_arg1:Number, _arg2:Number=1, _arg3:Number=0):Number{
if (_arg1 < _arg3){
_arg1 = _arg3;
} else {
if (_arg1 > _arg2){
_arg1 = _arg2;
};
};
return (_arg1);
}
public static function sign(_arg1:Number, _arg2:Boolean=false):int{
var _local3:int;
_local3 = 1;
if (_arg1 < 0){
_local3 = -1;
};
if (_arg1 == 0){
if (_arg2){
_local3 = 0;
};
};
return (_local3);
}
public static function randomQuantizedInt(_arg1:int, _arg2:int){
return ((randomInt(Math.floor((_arg1 / _arg2))) * _arg2));
}
}
}//package com.noodlebox.util
Section 8
//MouseUtil (com.noodlebox.util.MouseUtil)
package com.noodlebox.util {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import com.noodlebox.misc.*;
import flash.ui.*;
public class MouseUtil extends Bitmap {
public const PENCIL:Class;
public const DRAGUP:Class;
public const DRAGDOWN:Class;
public var followingLoc:Point;
public var smoothedLoc:Point;
public var followingStepLength:Number;// = 5
private var uid:uint;// = 0
public var nonIdleFrames:int;// = 0
public var mouseDot:Bitmap;
public var historyData:Array;
public var smoothingRate:Number;// = 0.1
public var newLoc:Point;
public var idleTimeStamp:int;
public var target:DisplayObject;
public var oldLoc:Point;
public var historyLength:int;// = 200
public var history:Array;
public var idleFrames:int;// = 0
public var hidden:Boolean;// = false
public var moved:Boolean;// = false
public var delta:Point;
public var idleTime:int;
public var triggerDistance:int;// = 0
public var angle:Number;// = 0
public var distance:Number;// = 0
public function MouseUtil(_arg1:DisplayObject=null):void{
var _local2:Timer;
PENCIL = MouseUtil_PENCIL;
DRAGDOWN = MouseUtil_DRAGDOWN;
DRAGUP = MouseUtil_DRAGUP;
historyLength = 200;
triggerDistance = 0;
moved = false;
hidden = false;
distance = 0;
angle = 0;
smoothingRate = 0.1;
followingStepLength = 5;
idleFrames = 0;
nonIdleFrames = 0;
mouseDot = new Bitmap(new BitmapData(2, 2, 0, 0));
uid = 0;
super();
if (target){
target = _arg1;
} else {
target = this;
};
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
oldLoc = new Point(target.mouseX, target.mouseY);
newLoc = oldLoc.clone();
smoothedLoc = oldLoc.clone();
followingLoc = oldLoc.clone();
delta = new Point(0, 0);
angle = 0;
idleTimeStamp = getTimer();
initHistory();
_local2 = new Timer(4000, 0);
_local2.addEventListener(TimerEvent.TIMER, onAutoHide);
}
public function hide():void{
Mouse.hide();
hidden = true;
}
public function setHistoryLength(_arg1:int):void{
historyLength = _arg1;
initHistory();
}
public function initHistory():void{
var _local1:int;
var _local2:MousePoint;
historyData = new Array();
history = new Array();
while (_local1 < historyLength) {
_local2 = new MousePoint(newLoc.clone(), 0, 0, newLoc.clone());
_local2.followingPoint = newLoc.clone();
_local2.uid = uid++;
historyData.push(_local2);
history.push(newLoc.clone());
_local1++;
};
}
public function onAutoHide(_arg1:Event):void{
if (hidden){
Mouse.hide();
};
}
public function onEnterFrame(_arg1:Event):void{
var _local2:Number;
var _local3:MousePoint;
newLoc.x = target.mouseX;
newLoc.y = target.mouseY;
mouseDot.x = newLoc.x;
mouseDot.y = newLoc.y;
distance = Point.distance(oldLoc, newLoc);
smoothedLoc.x = (smoothedLoc.x + ((newLoc.x - smoothedLoc.x) * smoothingRate));
smoothedLoc.y = (smoothedLoc.y + ((newLoc.y - smoothedLoc.y) * smoothingRate));
_local2 = Point.distance(followingLoc, newLoc);
if (_local2 > followingStepLength){
followingLoc = new Point((followingLoc.x + (((newLoc.x - followingLoc.x) / _local2) * followingStepLength)), (followingLoc.y + (((newLoc.y - followingLoc.y) / _local2) * followingStepLength)));
} else {
followingLoc = newLoc.clone();
};
if (distance == 0){
moved = false;
idleFrames++;
nonIdleFrames = 0;
} else {
moved = true;
idleTimeStamp = getTimer();
idleFrames = 0;
nonIdleFrames++;
};
if (distance >= triggerDistance){
delta.x = (newLoc.x - oldLoc.x);
delta.y = (newLoc.y - oldLoc.y);
distance = Point.distance(oldLoc, newLoc);
angle = Math.atan2(delta.y, delta.x);
history.splice(0, 0, newLoc.clone());
history.splice(historyLength, 1);
_local3 = new MousePoint(newLoc.clone(), angle, distance, smoothedLoc.clone());
_local3.followingPoint = followingLoc;
_local3.uid = uid++;
historyData.splice(0, 0, _local3);
historyData.splice(historyLength, 1);
oldLoc.x = newLoc.x;
oldLoc.y = newLoc.y;
};
idleTime = (getTimer() - idleTimeStamp);
}
public function show(_arg1:Event):void{
Mouse.show();
hidden = false;
}
}
}//package com.noodlebox.util
Section 9
//MouseUtil_DRAGDOWN (com.noodlebox.util.MouseUtil_DRAGDOWN)
package com.noodlebox.util {
import mx.core.*;
public class MouseUtil_DRAGDOWN extends BitmapAsset {
}
}//package com.noodlebox.util
Section 10
//MouseUtil_DRAGUP (com.noodlebox.util.MouseUtil_DRAGUP)
package com.noodlebox.util {
import mx.core.*;
public class MouseUtil_DRAGUP extends BitmapAsset {
}
}//package com.noodlebox.util
Section 11
//MouseUtil_PENCIL (com.noodlebox.util.MouseUtil_PENCIL)
package com.noodlebox.util {
import mx.core.*;
public class MouseUtil_PENCIL extends BitmapAsset {
}
}//package com.noodlebox.util
Section 12
//SVGParser (com.noodlebox.util.SVGParser)
package com.noodlebox.util {
import flash.geom.*;
public class SVGParser {
public static function parse(_arg1:XML):Array{
var _local2:Array;
var _local3:int;
var _local4:XML;
var _local5:Array;
var _local6:String;
var _local7:Array;
var _local8:int;
var _local9:Array;
var _local10:Point;
_local2 = new Array();
_local3 = 0;
while (_local3 < _arg1.children().length()) {
_local4 = _arg1.children()[_local3];
if (_local4.name() == "rect"){
_local5 = new Array();
_local5.push(new Point(Number(_local4.@x), Number(_local4.@y)));
_local5.push(new Point((Number(_local4.@x) + Number(_local4.@width)), Number(_local4.@y)));
_local5.push(new Point((Number(_local4.@x) + Number(_local4.@width)), (Number(_local4.@y) + Number(_local4.@height))));
_local5.push(new Point(Number(_local4.@x), (Number(_local4.@y) + Number(_local4.@height))));
_local2.push(_local5);
};
if (_local4.name() == "polygon"){
_local5 = new Array();
_local6 = _local4.@points.toString();
_local7 = _local6.split(" ");
_local8 = 0;
while (_local8 < (_local7.length - 1)) {
_local9 = _local7[_local8].split(",");
_local10 = new Point(Number(_local9[0]), Number(_local9[1]));
_local5.push(_local10);
_local8++;
};
_local2.push(_local5);
};
_local3++;
};
return (_local2);
}
}
}//package com.noodlebox.util
Section 13
//Waiter (com.noodlebox.util.Waiter)
package com.noodlebox.util {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Waiter extends Sprite {
public var maxRadius:int;
public var timer:Timer;
public var color:uint;
public var thickness:int;
public var minRadius:int;
public var numberOfBars:int;// = 16
public function Waiter(_arg1:uint=0xFFFFFF, _arg2:int=34, _arg3:int=80, _arg4:int=8):void{
var _local5:Graphics;
var _local6:int;
numberOfBars = 16;
super();
color = _arg1;
minRadius = _arg2;
maxRadius = _arg3;
thickness = _arg4;
_local5 = this.graphics;
_local6 = 0;
while (_local6 < numberOfBars) {
_local5.lineStyle(8, color, (_local6 / numberOfBars), true);
_local5.moveTo((Math.sin((((_local6 / numberOfBars) * Math.PI) * 2)) * minRadius), (Math.cos((((_local6 / numberOfBars) * Math.PI) * 2)) * minRadius));
_local5.lineTo((Math.sin((((_local6 / numberOfBars) * Math.PI) * 2)) * maxRadius), (Math.cos((((_local6 / numberOfBars) * Math.PI) * 2)) * maxRadius));
_local6++;
};
timer = new Timer(50, 0);
timer.addEventListener(TimerEvent.TIMER, onTick);
timer.start();
this.addEventListener(Event.REMOVED_FROM_STAGE, onDispose);
}
public function onTick(_arg1:Event):void{
this.rotation = (this.rotation + (360 / numberOfBars));
}
public function onDispose(_arg1:Event):void{
timer.removeEventListener(TimerEvent.TIMER, onTick);
timer.stop();
timer = null;
}
public function center(_arg1:DisplayObject=null):void{
if (!_arg1){
_arg1 = this.stage;
};
if ((_arg1 is Stage)){
this.x = (Stage(_arg1).stageWidth / 2);
this.y = (Stage(_arg1).stageHeight / 2);
} else {
this.x = (_arg1.x + (_arg1.width / 2));
this.y = (_arg1.y + (_arg1.height / 2));
};
}
}
}//package com.noodlebox.util
Section 14
//MapSVG (logic.MapSVG)
package logic {
public class MapSVG {
public var xml:XML;
public function MapSVG(){
xml = <g>
<rect x="0.5" y="88.5" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
<polygon fill="#FFFFFF" stroke="#000000" points="36.5,214.5 0.5,197.5 0.5,142.5 36.5,142.5 "/>
<rect x="45.5" y="88.5" fill="#FFFFFF" stroke="#000000" width="54" height="27"/>
<polygon fill="#FFFFFF" stroke="#000000" points="92.007,254.244 135.244,245.993 127.993,201.757 83.756,210.007 "/>
<polygon fill="#FFFFFF" stroke="#000000" points="54.5,142.5 54.5,187.5 99.5,187.5 99.5,169.5 135.5,169.5 135.5,142.5 "/>
<rect x="117.5" y="88.5" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
<rect x="207.833" y="1.833" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
<rect x="252.833" y="1.833" fill="#FFFFFF" stroke="#000000" width="54" height="27"/>
<rect x="252.833" y="35.166" fill="#FFFFFF" stroke="#000000" width="54" height="27"/>
<rect x="324.833" y="1.833" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
<polygon fill="#FFFFFF" stroke="#000000" points="180.5,187.5 153.5,187.5 153.5,142.5 179.884,143.254 "/>
<polygon fill="#FFFFFF" stroke="#000000" points="153.5,250.5 180.5,250.5 180.5,205.5 144.5,205.5 "/>
<polygon fill="#FFFFFF" stroke="#000000" points="115.5,268.5 54.5,268.5 54.5,340.5 90.5,340.5 90.5,304.5 126.5,304.5 "/>
<polygon fill="#FFFFFF" stroke="#000000" points="36.5,304.5 0.5,304.5 0.5,215.5 36.5,232.5 "/>
<rect x="0.5" y="308.5" fill="#FFFFFF" stroke="#000000" width="36" height="27"/>
<rect x="0.5" y="340.5" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
<rect x="54.5" y="358.5" fill="#FFFFFF" stroke="#000000" width="36" height="18"/>
<rect x="108.5" y="331.5" fill="#FFFFFF" stroke="#000000" width="36" height="45"/>
<polygon fill="#FFFFFF" stroke="#000000" points="220.451,128.808 156.5,124.5 156.5,88.5 219.5,88.5 "/>
<polygon fill="#FFFFFF" stroke="#000000" points="237.5,187.5 192.5,187.5 191.8,144.988 236.591,149.325 "/>
<polygon fill="#FFFFFF" stroke="#000000" points="287.381,153.663 242.591,149.325 243.5,169.5 288.5,169.5 "/>
<polygon fill="#FFFFFF" stroke="#000000" points="243.5,232.5 243.5,205.5 198.5,205.5 213.5,286.5 288.5,286.5 288.5,241.5 "/>
<rect x="261.5" y="187.5" fill="#FFFFFF" stroke="#000000" width="63" height="27"/>
<polygon fill="#FFFFFF" stroke="#000000" points="289.116,135.747 253.283,132.276 252.5,88.5 288.5,88.5 "/>
<rect x="306.5" y="85.5" fill="#FFFFFF" stroke="#000000" width="54" height="36"/>
<rect x="306.5" y="124.5" fill="#FFFFFF" stroke="#000000" width="54" height="45"/>
<polygon fill="#FFFFFF" stroke="#000000" points="198.5,340.5 198.5,304.5 162.5,304.5 162.5,376.5 243.5,376.5 243.5,340.5 "/>
<rect x="225.5" y="304.5" fill="#FFFFFF" stroke="#000000" width="18" height="18"/>
<rect x="261.5" y="340.5" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
<rect x="315.5" y="340.5" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
<polygon fill="#FFFFFF" stroke="#000000" points="36.5,36.5 36.5,0.5 0.5,0.5 0.5,72.5 81.5,72.5 81.5,36.5 "/>
<rect x="99.5" y="36.5" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
<rect x="153.5" y="36.5" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
<rect x="315.5" y="300.5" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
<rect x="315.5" y="260.5" fill="#FFFFFF" stroke="#000000" width="36" height="36"/>
</g>
;
super();
}
}
}//package logic
Section 15
//SandParticle03 (logic.SandParticle03)
package logic {
import flash.geom.*;
import com.noodlebox.util.*;
public class SandParticle03 {
public var tx:int;
public var texture:int;
public var c:uint;
public var d:int;
public var sy:int;
public var h:uint;
public var m:uint;
public var p:Point;
public var r:Number;
public var a:uint;
public var z:uint;
public var manager;
public function SandParticle03(_arg1):void{
this.manager = _arg1;
}
public function process(_arg1, _arg2):void{
r = (1 - Math.random());
r = ((1 - (r * r)) * 25);
p = MagicMath.randomRadialPoint(r, r);
_arg1 = (_arg1 + (p.x + (MagicMath.randomInt(15) * MagicMath.flipper())));
_arg2 = (_arg2 + (p.y + (MagicMath.randomInt(15) * MagicMath.flipper())));
h = manager.heightbd.getPixel(_arg1, _arg2);
m = manager.mapBD.getPixel(_arg1, _arg2);
if (m != 0){
h++;
tx = (m & 0xFFFF);
texture = ((m >> 16) & 0xFF);
} else {
if (Math.random() > 0.85){
h++;
tx = -1;
} else {
return;
};
};
manager.heightbd.setPixel(_arg1, _arg2, h);
sy = (_arg2 - h);
d = manager.depthbd.getPixel(_arg1, sy);
if ((manager.depthbd.height - _arg2) < d){
if (tx == -1){
c = (h * 1.5);
if (c > 170){
c = 170;
};
c = (0xFF - c);
c = ((c * 0.4) + ((manager.canvasBD.getPixel(_arg1, sy) & 0xFF) * 0.6));
manager.depthbd.setPixel(_arg1, sy, (manager.depthbd.height - _arg2));
manager.canvasBD.setPixel(_arg1, sy, ((c | (c << 8)) | (c << 16)));
} else {
c = manager.textures[texture].getPixel(((tx / 0xFFFF) * manager.textures[texture].width), (manager.textures[texture].height - ((h * 600) / (200 + _arg2))));
if (c != 0){
manager.canvasBD.setPixel(_arg1, sy, c);
manager.depthbd.setPixel(_arg1, sy, (manager.depthbd.height - _arg2));
};
};
};
}
}
}//package logic
Section 16
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "2.0.1.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 17
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "2.0.1.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 18
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 19
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function set height(_arg1:Number):void;
function get scaleY():Number;
function move(_arg1:Number, _arg2:Number):void;
function get scaleX():Number;
function set mask(_arg1:DisplayObject):void;
function set scaleX(_arg1:Number):void;
function set name(_arg1:String):void;
function set scaleY(_arg1:Number):void;
function get visible():Boolean;
function get measuredWidth():Number;
function set visible(_arg1:Boolean):void;
function get alpha():Number;
function get height():Number;
function get width():Number;
function get parent():DisplayObjectContainer;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set y(_arg1:Number):void;
function get x():Number;
function get y():Number;
function set alpha(_arg1:Number):void;
}
}//package mx.core
Section 20
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function get repeaters():Array;
function get instanceIndices():Array;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 21
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 22
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "2.0.1.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local3:DisplayObject;
var _local4:String;
var _local5:Array;
_local3 = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
var _local2:String;
var _local3:int;
var _local4:int;
if (!_arg1){
return (null);
};
_local2 = getQualifiedClassName(_arg1);
_local3 = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
_local4 = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 23
//ReverseArcheology001 (ReverseArcheology001)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import com.noodlebox.util.*;
import logic.*;
import flash.ui.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
public class ReverseArcheology001 extends Sprite {
private const BG:Class;
public var mouseOver:Boolean;// = false
public var depthbd:BitmapData;
public var canvasWidth:int;// = 800
public var mouseUtil:MouseUtil;
public var canvasBD:BitmapData;
public var canvasHeight:int;// = 600
public var heightbd:BitmapData;
public var mapBD:BitmapData;
public var overlayBM:Bitmap;
public var libraryLoader:LibraryLoader;
public var canvasBM:Bitmap;
public var textures:Array;
public var waiter:Waiter;
public var children:Array;
public function ReverseArcheology001(){
BG = ReverseArcheology001_BG;
canvasWidth = 800;
canvasHeight = 600;
mouseOver = false;
super();
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function init(_arg1:Event=null):void{
this.stage.quality = StageQuality.LOW;
removeEventListener(Event.ADDED_TO_STAGE, init);
waiter = new Waiter(0xFFFF);
waiter.center(this.stage);
addChild(waiter);
libraryLoader = new LibraryLoader();
libraryLoader.addEventListener(LibraryLoaderEvent.LIBRARY_COMPLETE, bing);
libraryLoader.requestSequence((Base.getBaseFolderWithSlash(this.stage) + "assets/wall<x>.jpg"), "<x>", 3, 4, 6);
}
public function bing(_arg1:Event=null):void{
var _local2:BitmapData;
var _local3:Bitmap;
var _local4:BitmapData;
var _local5:uint;
var _local6:int;
var _local7:MapSVG;
var _local8:Array;
var _local9:Matrix;
var _local10:int;
var _local11:int;
var _local12:Array;
var _local13:Point;
var _local14:Point;
var _local15:Point;
var _local16:Point;
var _local17:Point;
var _local18:Number;
var _local19:BitmapData;
var _local20:int;
this.removeChild(waiter);
children = new Array();
textures = new Array();
_local2 = libraryLoader.getAssetByURL("wall004").clone();
BitmapDataUtil.convertToGreyscale(_local2);
_local2 = BitmapDataUtil.resize(_local2, 0xFF, 170);
BitmapDataUtil.blur(_local2, 2);
BitmapDataUtil.noise(_local2, 0.03);
BitmapDataUtil.tintDown(_local2, 0xFFFFFF, 0.5, 0, 0.01);
BitmapDataUtil.tintUp(_local2, 0xFFFFFF, 1, 0.5, 1);
textures.push(_local2);
_local2 = libraryLoader.getAssetByURL("wall004").clone();
_local2 = BitmapDataUtil.resize(_local2, 0xFF, 170);
BitmapDataUtil.blur(_local2, 4);
BitmapDataUtil.noise(_local2, 0.5);
BitmapDataUtil.blur(_local2, 2);
BitmapDataUtil.convertToGreyscale(_local2);
BitmapDataUtil.tintDown(_local2, 0xFFFFFF, 0.5, 0, 0.01);
BitmapDataUtil.tintUp(_local2, 0xFFFFFF, 1, 0.5, 1);
textures.push(_local2);
_local2 = libraryLoader.getAssetByURL("wall005").clone();
BitmapDataUtil.convertToGreyscale(_local2);
_local2 = BitmapDataUtil.resize(_local2, 0xFF, 270);
BitmapDataUtil.blur(_local2, 2);
BitmapDataUtil.noise(_local2, 0.03);
BitmapDataUtil.tintDown(_local2, 0xFFFFFF, 0.5, 0, 0.01);
BitmapDataUtil.tintUp(_local2, 0xFFFFFF, 1, 0.5, 1);
textures.push(_local2);
_local2 = libraryLoader.getAssetByURL("wall005").clone();
_local2 = BitmapDataUtil.resize(_local2, 0xFF, 270);
BitmapDataUtil.blur(_local2, 4);
BitmapDataUtil.noise(_local2, 0.5);
BitmapDataUtil.blur(_local2, 2);
BitmapDataUtil.convertToGreyscale(_local2);
BitmapDataUtil.tintDown(_local2, 0xFFFFFF, 0.5, 0, 0.01);
BitmapDataUtil.tintUp(_local2, 0xFFFFFF, 1, 0.5, 1);
textures.push(_local2);
_local2 = libraryLoader.getAssetByURL("wall006").clone();
BitmapDataUtil.convertToGreyscale(_local2);
_local2 = BitmapDataUtil.resize(_local2, 0xFF, 100);
BitmapDataUtil.blur(_local2, 2);
BitmapDataUtil.noise(_local2, 0.03);
BitmapDataUtil.tintDown(_local2, 0xFFFFFF, 0.5, 0, 0.01);
BitmapDataUtil.tintUp(_local2, 0xFFFFFF, 1, 0.5, 1);
textures.push(_local2);
_local2 = libraryLoader.getAssetByURL("wall006").clone();
_local2 = BitmapDataUtil.resize(_local2, 0xFF, 100);
BitmapDataUtil.blur(_local2, 4);
BitmapDataUtil.noise(_local2, 0.5);
BitmapDataUtil.blur(_local2, 2);
BitmapDataUtil.convertToGreyscale(_local2);
BitmapDataUtil.tintDown(_local2, 0xFFFFFF, 0.5, 0, 0.01);
BitmapDataUtil.tintUp(_local2, 0xFFFFFF, 1, 0.5, 1);
textures.push(_local2);
canvasBD = new BitmapData(canvasWidth, canvasHeight, false, 0xFFFFFF);
canvasBM = new Bitmap(canvasBD);
addChild(canvasBM);
overlayBM = new Bitmap(new BitmapData(canvasWidth, canvasHeight, true, 0));
_local3 = Bitmap(new BG());
BitmapDataUtil.noise(_local3.bitmapData, 0.02);
_local3.bitmapData = BitmapDataUtil.flipVertical(_local3.bitmapData);
_local3.bitmapData = BitmapDataUtil.flipHorizontal(_local3.bitmapData);
_local3.blendMode = "multiply";
addChild(_local3);
mapBD = new BitmapData(canvasWidth, canvasHeight, false, 0);
depthbd = new BitmapData(canvasWidth, canvasHeight, false, 0xFFFFFF);
heightbd = new BitmapData(canvasWidth, canvasHeight, 0, 0);
_local4 = new BitmapData(0xFF, 6, 0, 0);
_local5 = 0;
_local6 = 0;
while (_local6 < _local4.height) {
if (_local6 >= (_local4.height / 2)){
_local5 = 1;
};
_local11 = 0;
while (_local11 < _local4.width) {
_local4.setPixel(_local11, _local6, ((_local11 * 0xFF) | (_local5 << 16)));
_local11++;
};
_local6++;
};
_local7 = new MapSVG();
_local8 = SVGParser.parse(_local7.xml);
_local9 = new Matrix();
_local9.translate(-160, -160);
_local9.rotate(MagicMath.randomComplexAngle(0.2));
_local9.scale(2.8, 1.8);
_local9.translate((mapBD.width / 2), (mapBD.height / 2));
_local10 = 0;
while (_local10 < _local8.length) {
_local12 = _local8[_local10];
_local8[_local10].push(_local12[0].clone());
_local15 = _local9.transformPoint(_local12[0]);
_local16 = _local9.transformPoint(_local12[2]);
_local17 = _local9.transformPoint(_local12[3]);
_local15 = _local15.subtract(_local16);
_local16 = _local16.subtract(_local17);
_local18 = MagicMath.getQuickestWayBetweenTwoAngles(Math.atan2(_local15.y, _local15.x), Math.atan2(_local16.y, _local16.x));
_local19 = _local4.clone();
_local4.clone().colorTransform(_local19.rect, new ColorTransform(1, 1, 1, 1, (MagicMath.randomInt(2) * 2), 0));
_local20 = 0;
while (_local20 < _local12.length) {
_local14 = _local12[_local20];
_local14 = _local9.transformPoint(_local14);
if (_local20 != 0){
if (_local18 > 0){
Brush.drawStretchedStroke(mapBD, _local13, _local14, _local19, 3, "normal", false);
} else {
Brush.drawStretchedStroke(mapBD, _local14, _local13, _local19, 3, "normal", false);
};
};
_local13 = _local14.clone();
_local20++;
};
_local10++;
};
_local10 = 0;
while (_local10 < 5000) {
children.push(new SandParticle03(this));
_local10++;
};
stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
stage.addEventListener(Event.MOUSE_LEAVE, onMouseLeave);
mouseUtil = new MouseUtil(this);
mouseUtil.hide();
addChild(mouseUtil.mouseDot);
}
public function onMouseLeave(_arg1:Event):void{
mouseOver = false;
}
public function getNew(_arg1:Object):Object{
var _local2:Object;
_local2 = null;
switch (_arg1.type){
};
return (_local2);
}
public function remove(_arg1:Object):void{
var _local2:int;
_local2 = children.indexOf(_arg1);
if (_local2 != -1){
children.splice(_local2, 1);
};
}
public function add(_arg1:Object):void{
var _local2:Object;
_local2 = getNew(_arg1);
if (_local2){
children.push(_local2);
};
}
public function onEnterFrame(_arg1:Event):void{
var _local2:int;
if (mouseOver){
_local2 = 0;
while (_local2 < children.length) {
children[_local2].process(this.mouseX, this.mouseY);
_local2++;
};
};
}
public function onMouseMove(_arg1:MouseEvent):void{
if (_arg1.buttonDown){
};
mouseOver = true;
}
}
}//package
Section 24
//ReverseArcheology001_BG (ReverseArcheology001_BG)
package {
import mx.core.*;
public class ReverseArcheology001_BG extends BitmapAsset {
}
}//package