Section 1
//BitString (com.adobe.images.BitString)
package com.adobe.images {
public class BitString {
public var val:int;// = 0
public var len:int;// = 0
}
}//package com.adobe.images
Section 2
//JPGEncoder (com.adobe.images.JPGEncoder)
package com.adobe.images {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class JPGEncoder {
private var fdtbl_UV:Array;
private var std_ac_chrominance_values:Array;
private var std_dc_chrominance_values:Array;
private var ZigZag:Array;
private var YDC_HT:Array;
private var YAC_HT:Array;
private var bytenew:int;// = 0
private var fdtbl_Y:Array;
private var std_ac_chrominance_nrcodes:Array;
private var DU:Array;
private var std_ac_luminance_values:Array;
private var std_dc_chrominance_nrcodes:Array;
private var UVTable:Array;
private var YDU:Array;
private var UDU:Array;
private var byteout:ByteArray;
private var UVAC_HT:Array;
private var UVDC_HT:Array;
private var bytepos:int;// = 7
private var VDU:Array;
private var std_ac_luminance_nrcodes:Array;
private var std_dc_luminance_values:Array;
private var YTable:Array;
private var std_dc_luminance_nrcodes:Array;
private var bitcode:Array;
private var category:Array;
public function JPGEncoder(_arg1:Number=50){
ZigZag = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63];
YTable = new Array(64);
UVTable = new Array(64);
fdtbl_Y = new Array(64);
fdtbl_UV = new Array(64);
std_dc_luminance_nrcodes = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0];
std_dc_luminance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
std_ac_luminance_nrcodes = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125];
std_ac_luminance_values = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250];
std_dc_chrominance_nrcodes = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0];
std_dc_chrominance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
std_ac_chrominance_nrcodes = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119];
std_ac_chrominance_values = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
bitcode = new Array(0xFFFF);
category = new Array(0xFFFF);
DU = new Array(64);
YDU = new Array(64);
UDU = new Array(64);
VDU = new Array(64);
super();
if (_arg1 <= 0){
_arg1 = 1;
};
if (_arg1 > 100){
_arg1 = 100;
};
var _local2:int;
if (_arg1 < 50){
_local2 = int((5000 / _arg1));
} else {
_local2 = int((200 - (_arg1 * 2)));
};
initHuffmanTbl();
initCategoryNumber();
initQuantTables(_local2);
}
private function initHuffmanTbl():void{
YDC_HT = computeHuffmanTbl(std_dc_luminance_nrcodes, std_dc_luminance_values);
UVDC_HT = computeHuffmanTbl(std_dc_chrominance_nrcodes, std_dc_chrominance_values);
YAC_HT = computeHuffmanTbl(std_ac_luminance_nrcodes, std_ac_luminance_values);
UVAC_HT = computeHuffmanTbl(std_ac_chrominance_nrcodes, std_ac_chrominance_values);
}
private function RGB2YUV(_arg1:BitmapData, _arg2:int, _arg3:int):void{
var _local6:int;
var _local7:uint;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local4:int;
var _local5:int;
while (_local5 < 8) {
_local6 = 0;
while (_local6 < 8) {
_local7 = _arg1.getPixel32((_arg2 + _local6), (_arg3 + _local5));
_local8 = Number(((_local7 >> 16) & 0xFF));
_local9 = Number(((_local7 >> 8) & 0xFF));
_local10 = Number((_local7 & 0xFF));
YDU[_local4] = ((((0.299 * _local8) + (0.587 * _local9)) + (0.114 * _local10)) - 128);
UDU[_local4] = (((-0.16874 * _local8) + (-0.33126 * _local9)) + (0.5 * _local10));
VDU[_local4] = (((0.5 * _local8) + (-0.41869 * _local9)) + (-0.08131 * _local10));
_local4++;
_local6++;
};
_local5++;
};
}
private function writeBits(_arg1:BitString):void{
var _local2:int = _arg1.val;
var _local3:int = (_arg1.len - 1);
while (_local3 >= 0) {
if ((_local2 & uint((1 << _local3)))){
bytenew = (bytenew | uint((1 << bytepos)));
};
_local3--;
bytepos--;
if (bytepos < 0){
if (bytenew == 0xFF){
writeByte(0xFF);
writeByte(0);
} else {
writeByte(bytenew);
};
bytepos = 7;
bytenew = 0;
};
};
}
private function writeWord(_arg1:int):void{
writeByte(((_arg1 >> 8) & 0xFF));
writeByte((_arg1 & 0xFF));
}
private function writeByte(_arg1:int):void{
byteout.writeByte(_arg1);
}
private function writeDHT():void{
var _local1:int;
writeWord(65476);
writeWord(418);
writeByte(0);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_dc_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
writeByte(std_dc_luminance_values[_local1]);
_local1++;
};
writeByte(16);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_ac_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
writeByte(std_ac_luminance_values[_local1]);
_local1++;
};
writeByte(1);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_dc_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
writeByte(std_dc_chrominance_values[_local1]);
_local1++;
};
writeByte(17);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_ac_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
writeByte(std_ac_chrominance_values[_local1]);
_local1++;
};
}
public function encode(_arg1:BitmapData):ByteArray{
var _local6:int;
var _local7:BitString;
byteout = new ByteArray();
bytenew = 0;
bytepos = 7;
writeWord(65496);
writeAPP0();
writeDQT();
writeSOF0(_arg1.width, _arg1.height);
writeDHT();
writeSOS();
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:Number = 0;
bytenew = 0;
bytepos = 7;
var _local5:int;
while (_local5 < _arg1.height) {
_local6 = 0;
while (_local6 < _arg1.width) {
RGB2YUV(_arg1, _local6, _local5);
_local2 = processDU(YDU, fdtbl_Y, _local2, YDC_HT, YAC_HT);
_local3 = processDU(UDU, fdtbl_UV, _local3, UVDC_HT, UVAC_HT);
_local4 = processDU(VDU, fdtbl_UV, _local4, UVDC_HT, UVAC_HT);
_local6 = (_local6 + 8);
};
_local5 = (_local5 + 8);
};
if (bytepos >= 0){
_local7 = new BitString();
_local7.len = (bytepos + 1);
_local7.val = ((1 << (bytepos + 1)) - 1);
writeBits(_local7);
};
writeWord(65497);
return (byteout);
}
private function initCategoryNumber():void{
var _local3:int;
var _local1 = 1;
var _local2 = 2;
var _local4 = 1;
while (_local4 <= 15) {
_local3 = _local1;
while (_local3 < _local2) {
category[(32767 + _local3)] = _local4;
bitcode[(32767 + _local3)] = new BitString();
bitcode[(32767 + _local3)].len = _local4;
bitcode[(32767 + _local3)].val = _local3;
_local3++;
};
_local3 = -((_local2 - 1));
while (_local3 <= -(_local1)) {
category[(32767 + _local3)] = _local4;
bitcode[(32767 + _local3)] = new BitString();
bitcode[(32767 + _local3)].len = _local4;
bitcode[(32767 + _local3)].val = ((_local2 - 1) + _local3);
_local3++;
};
_local1 = (_local1 << 1);
_local2 = (_local2 << 1);
_local4++;
};
}
private function writeDQT():void{
var _local1:int;
writeWord(65499);
writeWord(132);
writeByte(0);
_local1 = 0;
while (_local1 < 64) {
writeByte(YTable[_local1]);
_local1++;
};
writeByte(1);
_local1 = 0;
while (_local1 < 64) {
writeByte(UVTable[_local1]);
_local1++;
};
}
private function writeAPP0():void{
writeWord(65504);
writeWord(16);
writeByte(74);
writeByte(70);
writeByte(73);
writeByte(70);
writeByte(0);
writeByte(1);
writeByte(1);
writeByte(0);
writeWord(1);
writeWord(1);
writeByte(0);
writeByte(0);
}
private function writeSOS():void{
writeWord(65498);
writeWord(12);
writeByte(3);
writeByte(1);
writeByte(0);
writeByte(2);
writeByte(17);
writeByte(3);
writeByte(17);
writeByte(0);
writeByte(63);
writeByte(0);
}
private function processDU(_arg1:Array, _arg2:Array, _arg3:Number, _arg4:Array, _arg5:Array):Number{
var _local8:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local6:BitString = _arg5[0];
var _local7:BitString = _arg5[240];
var _local9:Array = fDCTQuant(_arg1, _arg2);
_local8 = 0;
while (_local8 < 64) {
DU[ZigZag[_local8]] = _local9[_local8];
_local8++;
};
var _local10:int = (DU[0] - _arg3);
_arg3 = DU[0];
if (_local10 == 0){
writeBits(_arg4[0]);
} else {
writeBits(_arg4[category[(32767 + _local10)]]);
writeBits(bitcode[(32767 + _local10)]);
};
var _local11 = 63;
while ((((_local11 > 0)) && ((DU[_local11] == 0)))) {
_local11--;
};
if (_local11 == 0){
writeBits(_local6);
return (_arg3);
};
_local8 = 1;
while (_local8 <= _local11) {
_local12 = _local8;
while ((((DU[_local8] == 0)) && ((_local8 <= _local11)))) {
_local8++;
};
_local13 = (_local8 - _local12);
if (_local13 >= 16){
_local14 = 1;
while (_local14 <= (_local13 / 16)) {
writeBits(_local7);
_local14++;
};
_local13 = int((_local13 & 15));
};
writeBits(_arg5[((_local13 * 16) + category[(32767 + DU[_local8])])]);
writeBits(bitcode[(32767 + DU[_local8])]);
_local8++;
};
if (_local11 != 63){
writeBits(_local6);
};
return (_arg3);
}
private function initQuantTables(_arg1:int):void{
var _local2:int;
var _local3:Number;
var _local8:int;
var _local4:Array = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99];
_local2 = 0;
while (_local2 < 64) {
_local3 = Math.floor((((_local4[_local2] * _arg1) + 50) / 100));
if (_local3 < 1){
_local3 = 1;
} else {
if (_local3 > 0xFF){
_local3 = 0xFF;
};
};
YTable[ZigZag[_local2]] = _local3;
_local2++;
};
var _local5:Array = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99];
_local2 = 0;
while (_local2 < 64) {
_local3 = Math.floor((((_local5[_local2] * _arg1) + 50) / 100));
if (_local3 < 1){
_local3 = 1;
} else {
if (_local3 > 0xFF){
_local3 = 0xFF;
};
};
UVTable[ZigZag[_local2]] = _local3;
_local2++;
};
var _local6:Array = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379];
_local2 = 0;
var _local7:int;
while (_local7 < 8) {
_local8 = 0;
while (_local8 < 8) {
fdtbl_Y[_local2] = (1 / (((YTable[ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
fdtbl_UV[_local2] = (1 / (((UVTable[ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
_local2++;
_local8++;
};
_local7++;
};
}
private function writeSOF0(_arg1:int, _arg2:int):void{
writeWord(65472);
writeWord(17);
writeByte(8);
writeWord(_arg2);
writeWord(_arg1);
writeByte(3);
writeByte(1);
writeByte(17);
writeByte(0);
writeByte(2);
writeByte(17);
writeByte(1);
writeByte(3);
writeByte(17);
writeByte(1);
}
private function computeHuffmanTbl(_arg1:Array, _arg2:Array):Array{
var _local7:int;
var _local3:int;
var _local4:int;
var _local5:Array = new Array();
var _local6 = 1;
while (_local6 <= 16) {
_local7 = 1;
while (_local7 <= _arg1[_local6]) {
_local5[_arg2[_local4]] = new BitString();
_local5[_arg2[_local4]].val = _local3;
_local5[_arg2[_local4]].len = _local6;
_local4++;
_local3++;
_local7++;
};
_local3 = (_local3 * 2);
_local6++;
};
return (_local5);
}
private function fDCTQuant(_arg1:Array, _arg2:Array):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:int;
_local22 = 0;
while (_local22 < 8) {
_local3 = (_arg1[(_local23 + 0)] + _arg1[(_local23 + 7)]);
_local10 = (_arg1[(_local23 + 0)] - _arg1[(_local23 + 7)]);
_local4 = (_arg1[(_local23 + 1)] + _arg1[(_local23 + 6)]);
_local9 = (_arg1[(_local23 + 1)] - _arg1[(_local23 + 6)]);
_local5 = (_arg1[(_local23 + 2)] + _arg1[(_local23 + 5)]);
_local8 = (_arg1[(_local23 + 2)] - _arg1[(_local23 + 5)]);
_local6 = (_arg1[(_local23 + 3)] + _arg1[(_local23 + 4)]);
_local7 = (_arg1[(_local23 + 3)] - _arg1[(_local23 + 4)]);
_local11 = (_local3 + _local6);
_local14 = (_local3 - _local6);
_local12 = (_local4 + _local5);
_local13 = (_local4 - _local5);
_arg1[(_local23 + 0)] = (_local11 + _local12);
_arg1[(_local23 + 4)] = (_local11 - _local12);
_local15 = ((_local13 + _local14) * 0.707106781);
_arg1[(_local23 + 2)] = (_local14 + _local15);
_arg1[(_local23 + 6)] = (_local14 - _local15);
_local11 = (_local7 + _local8);
_local12 = (_local8 + _local9);
_local13 = (_local9 + _local10);
_local19 = ((_local11 - _local13) * 0.382683433);
_local16 = ((0.5411961 * _local11) + _local19);
_local18 = ((1.306562965 * _local13) + _local19);
_local17 = (_local12 * 0.707106781);
_local20 = (_local10 + _local17);
_local21 = (_local10 - _local17);
_arg1[(_local23 + 5)] = (_local21 + _local16);
_arg1[(_local23 + 3)] = (_local21 - _local16);
_arg1[(_local23 + 1)] = (_local20 + _local18);
_arg1[(_local23 + 7)] = (_local20 - _local18);
_local23 = (_local23 + 8);
_local22++;
};
_local23 = 0;
_local22 = 0;
while (_local22 < 8) {
_local3 = (_arg1[(_local23 + 0)] + _arg1[(_local23 + 56)]);
_local10 = (_arg1[(_local23 + 0)] - _arg1[(_local23 + 56)]);
_local4 = (_arg1[(_local23 + 8)] + _arg1[(_local23 + 48)]);
_local9 = (_arg1[(_local23 + 8)] - _arg1[(_local23 + 48)]);
_local5 = (_arg1[(_local23 + 16)] + _arg1[(_local23 + 40)]);
_local8 = (_arg1[(_local23 + 16)] - _arg1[(_local23 + 40)]);
_local6 = (_arg1[(_local23 + 24)] + _arg1[(_local23 + 32)]);
_local7 = (_arg1[(_local23 + 24)] - _arg1[(_local23 + 32)]);
_local11 = (_local3 + _local6);
_local14 = (_local3 - _local6);
_local12 = (_local4 + _local5);
_local13 = (_local4 - _local5);
_arg1[(_local23 + 0)] = (_local11 + _local12);
_arg1[(_local23 + 32)] = (_local11 - _local12);
_local15 = ((_local13 + _local14) * 0.707106781);
_arg1[(_local23 + 16)] = (_local14 + _local15);
_arg1[(_local23 + 48)] = (_local14 - _local15);
_local11 = (_local7 + _local8);
_local12 = (_local8 + _local9);
_local13 = (_local9 + _local10);
_local19 = ((_local11 - _local13) * 0.382683433);
_local16 = ((0.5411961 * _local11) + _local19);
_local18 = ((1.306562965 * _local13) + _local19);
_local17 = (_local12 * 0.707106781);
_local20 = (_local10 + _local17);
_local21 = (_local10 - _local17);
_arg1[(_local23 + 40)] = (_local21 + _local16);
_arg1[(_local23 + 24)] = (_local21 - _local16);
_arg1[(_local23 + 8)] = (_local20 + _local18);
_arg1[(_local23 + 56)] = (_local20 - _local18);
_local23++;
_local22++;
};
_local22 = 0;
while (_local22 < 64) {
_arg1[_local22] = Math.round((_arg1[_local22] * _arg2[_local22]));
_local22++;
};
return (_arg1);
}
}
}//package com.adobe.images
Section 3
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.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 4
//ButtonAsset (mx.core.ButtonAsset)
package mx.core {
public class ButtonAsset extends FlexSimpleButton implements IFlexAsset, IFlexDisplayObject {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function ButtonAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
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 5
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 6
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 7
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.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 8
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexMovieClip(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 9
//FlexSimpleButton (mx.core.FlexSimpleButton)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSimpleButton extends SimpleButton {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexSimpleButton(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 10
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexSprite(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 11
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 12
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 13
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 14
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 15
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
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;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 16
//MovieClipLoaderAsset (mx.core.MovieClipLoaderAsset)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
public class MovieClipLoaderAsset extends MovieClipAsset implements IFlexAsset, IFlexDisplayObject {
protected var initialHeight:Number;// = 0
private var loader:Loader;// = null
private var initialized:Boolean;// = false
protected var initialWidth:Number;// = 0
private var requestedHeight:Number;
private var requestedWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipLoaderAsset(){
var _local1:LoaderContext = new LoaderContext();
_local1.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in _local1)){
_local1["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.loadBytes(movieClipData, _local1);
addChild(loader);
}
override public function get width():Number{
if (!initialized){
return (initialWidth);
};
return (super.width);
}
override public function set width(_arg1:Number):void{
if (!initialized){
requestedWidth = _arg1;
} else {
loader.width = _arg1;
};
}
override public function get measuredHeight():Number{
return (initialHeight);
}
private function completeHandler(_arg1:Event):void{
initialized = true;
initialWidth = loader.width;
initialHeight = loader.height;
if (!isNaN(requestedWidth)){
loader.width = requestedWidth;
};
if (!isNaN(requestedHeight)){
loader.height = requestedHeight;
};
dispatchEvent(_arg1);
}
override public function set height(_arg1:Number):void{
if (!initialized){
requestedHeight = _arg1;
} else {
loader.height = _arg1;
};
}
override public function get measuredWidth():Number{
return (initialWidth);
}
override public function get height():Number{
if (!initialized){
return (initialHeight);
};
return (super.height);
}
public function get movieClipData():ByteArray{
return (null);
}
}
}//package mx.core
Section 17
//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 18
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function SpriteAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
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;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 19
//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 = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _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{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 20
//Bezier (Singularity.Geom.Bezier)
package Singularity.Geom {
import Singularity.Numeric.*;
public class Bezier {
private var __pascal:Array;
private var __coef:Coef;
private var __binomial:Binomial;
private var __useCoef:Boolean;
private var __y:Array;
private var __invalidate:Boolean;
private var __x:Array;
public function Bezier(){
__x = new Array();
__y = new Array();
__pascal = new Array();
__binomial = new Binomial();
__coef = new Coef();
__useCoef = false;
__invalidate = false;
}
private function __naiveY(_arg1:Number):Number{
var _local2:Number = (1 - _arg1);
var _local3:Number = 0;
var _local4:uint = __y.length;
var _local5:uint;
while (_local5 < _local4) {
_local3 = (_local3 + (((__pascal[_local5] * __y[_local5]) * Math.pow(_local2, ((_local4 - _local5) - 1))) * Math.pow(_arg1, _local5)));
_local5++;
};
return (_local3);
}
public function getX(_arg1:Number):Number{
var _local2:Number = _arg1;
_local2 = ((_local2)<0) ? 0 : _local2;
_local2 = ((_local2)>1) ? 1 : _local2;
if (__invalidate){
__computeCoef();
};
return ((__useCoef) ? __coef.getX(_local2) : __naiveX(_local2));
}
public function addControlPoint(_arg1:Number, _arg2:Number):void{
__x.push(_arg1);
__y.push(_arg2);
__invalidate = true;
}
private function __computeCoef():void{
var _local1:int;
var _local2:Number;
var _local3:int;
var _local4:Object;
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (!__useCoef){
__pascal.splice(0);
__pascal = __binomial.getRow((__x.length - 1));
} else {
__coef.reset();
_local1 = (__x.length - 1);
_local2 = __factorial(_local1);
_local3 = 0;
while (_local3 <= _local1) {
_local4 = __summation(_local3);
_local5 = _local4.x;
_local6 = _local4.y;
_local7 = (_local2 / __factorial((_local1 - _local3)));
_local5 = (_local5 * _local7);
_local6 = (_local6 * _local7);
__coef.addCoef(_local5, _local6);
_local3++;
};
};
__invalidate = false;
}
private function __factorial(_arg1:int):Number{
if (_arg1 == 0){
return (1);
};
var _local2:int = _arg1;
var _local3:int = _arg1;
while (--_local2 > 0) {
_local3 = (_local3 * _local2);
};
return (Number(_local3));
}
public function reset():void{
__x.splice(0);
__y.splice(0);
__pascal.splice(0);
__coef.reset();
}
public function getY(_arg1:Number):Number{
var _local2:Number = _arg1;
_local2 = ((_local2)<0) ? 0 : _local2;
_local2 = ((_local2)>1) ? 1 : _local2;
if (__invalidate){
__computeCoef();
};
return ((__useCoef) ? __coef.getY(_local2) : __naiveY(_local2));
}
private function __naiveX(_arg1:Number):Number{
var _local2:Number = (1 - _arg1);
var _local3:Number = 0;
var _local4:uint = __x.length;
var _local5:uint;
while (_local5 < _local4) {
_local3 = (_local3 + (((__pascal[_local5] * __x[_local5]) * Math.pow(_local2, ((_local4 - _local5) - 1))) * Math.pow(_arg1, _local5)));
_local5++;
};
return (_local3);
}
private function __summation(_arg1:int):Object{
var _local7:Number;
var _local8:Number;
var _local2:Number = 1;
var _local3:Number = (((_arg1 % 2))==0) ? 1 : -1;
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:int;
while (_local6 <= _arg1) {
_local7 = __factorial((_arg1 - _local6));
_local8 = (_local2 * _local7);
_local4 = (_local4 + ((_local3 * __x[_local6]) / _local8));
_local5 = (_local5 + ((_local3 * __y[_local6]) / _local8));
_local2 = (_local2 * Number((_local6 + 1)));
_local3 = (_local3 * -1);
_local6++;
};
return ({x:_local4, y:_local5});
}
public function set useCoef(_arg1:Boolean):void{
__useCoef = _arg1;
__invalidate = true;
}
}
}//package Singularity.Geom
Section 21
//Coef (Singularity.Geom.Coef)
package Singularity.Geom {
public class Coef {
private var __len:int;
private var __cY:Array;
private var __cX:Array;
public function Coef(){
__cX = new Array();
__cY = new Array();
__len = 0;
}
public function getX(_arg1:Number):Number{
var _local2:Number;
var _local3:int;
if (__len > 1){
_local2 = __cX[(__len - 1)];
_local3 = (__len - 2);
while (_local3 >= 0) {
_local2 = ((_arg1 * _local2) + __cX[_local3]);
_local3--;
};
return (_local2);
//unresolved jump
};
return (__cX[0]);
}
public function getCoef(_arg1:uint):Object{
return ({X:__cX[_arg1], Y:__cY[_arg1]});
}
public function get degree():uint{
return (__cX.length);
}
public function addCoef(_arg1:Number, _arg2:Number):void{
__cX.push(_arg1);
__cY.push(_arg2);
__len++;
}
public function reset():void{
__cX.splice(0);
__cY.splice(0);
__len = 0;
}
public function getY(_arg1:Number):Number{
var _local2:Number;
var _local3:int;
if (__len > 1){
_local2 = __cY[(__len - 1)];
_local3 = (__len - 2);
while (_local3 >= 0) {
_local2 = ((_arg1 * _local2) + __cY[_local3]);
_local3--;
};
return (_local2);
//unresolved jump
};
return (__cY[0]);
}
}
}//package Singularity.Geom
Section 22
//Binomial (Singularity.Numeric.Binomial)
package Singularity.Numeric {
public class Binomial {
private var __row:Array;
private var __n:uint;
public function Binomial(){
__n = 2;
__row = [1, 2];
}
private function __fillOut():Array{
var _local4:uint;
var _local1:uint = (__n % 2);
var _local2:uint = (((__n + 2) - _local1) / 2);
var _local3:Array = __row.slice(0, (_local2 + 1));
if (_local1 == 0){
_local4 = 0;
while (_local4 < (_local2 - 1)) {
_local3[(_local2 + _local4)] = _local3[((_local2 - _local4) - 2)];
_local4++;
};
} else {
_local4 = 0;
while (_local4 < _local2) {
_local3[(_local2 + _local4)] = _local3[((_local2 - _local4) - 1)];
_local4++;
};
};
return (_local3);
}
private function __forward(_arg1:uint):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local2:uint = (__n + 1);
while (_local2 <= _arg1) {
_local3 = (_local2 % 2);
_local4 = (((_local2 + 2) - _local3) / 2);
_local5 = __row[0];
if (_local3 == 1){
_local6 = 1;
while (_local6 < _local4) {
_local7 = (__row[_local6] + _local5);
_local5 = __row[_local6];
__row[_local6] = _local7;
_local6++;
};
} else {
_local6 = 1;
while (_local6 < (_local4 - 1)) {
_local7 = (__row[_local6] + _local5);
_local5 = __row[_local6];
__row[_local6] = _local7;
_local6++;
};
__row[(_local4 - 1)] = (2 * _local5);
};
_local2++;
};
}
private function __reverse(_arg1:uint):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local2:uint = (__n - 1);
while (_local2 >= _arg1) {
_local3 = (_local2 % 2);
_local4 = (((_local2 + 2) - _local3) / 2);
_local5 = 1;
while (_local5 < _local4) {
__row[_local5] = (__row[_local5] - __row[(_local5 - 1)]);
_local5++;
};
_local2--;
};
}
public function getRow(_arg1:uint):Array{
var _local2:Array;
switch (_arg1){
case 0:
return ([1]);
case 1:
return ([1, 1]);
case 2:
return ([1, 2, 1]);
default:
_local2 = ((_arg1)==__n) ? __fillOut() : __recurse(_arg1);
return (_local2);
};
}
public function coef(_arg1:uint, _arg2:uint):uint{
if (_arg2 > _arg1){
return (0);
};
if (_arg2 == _arg1){
return (1);
};
if (__n != _arg1){
__recurse(_arg1);
};
var _local3:uint = (__n % 2);
var _local4:uint = (((__n + 2) - _local3) / 2);
return (((_arg2)>=_local4) ? __row[(_arg1 - _arg2)] : __row[_arg2]);
}
private function __recurse(_arg1:uint):Array{
if (_arg1 > __n){
__forward(_arg1);
} else {
if ((_arg1 - 2) <= (__n - _arg1)){
__row[1] = 2;
__n = 2;
__forward(_arg1);
} else {
__reverse(_arg1);
};
};
__n = _arg1;
return (__fillOut());
}
}
}//package Singularity.Numeric
Section 23
//Archer (Archer)
package {
import flash.display.*;
import flash.geom.*;
import Singularity.Geom.*;
public class Archer extends Sprite {
private var _vX:Number;
private var _vY:Number;
public var color:uint;
private var _targetX:Number;
private var _targetY:Number;
private var _attraction:Number;
private var _arch:Bezier;
private var _pos:Number;// = 0
public function Archer(_arg1:uint, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Point, _arg7:Number=0.05){
color = _arg1;
x = _arg2;
y = _arg3;
_vX = _arg4;
_vY = _arg5;
_targetX = _arg6.x;
_targetY = _arg6.y;
_attraction = _arg7;
graphics.beginFill(_arg1);
graphics.drawCircle(0, 0, 1);
_arch = new Bezier();
_arch.addControlPoint(_arg2, _arg3);
var _local8:Number = (_arg2 + (25 * _arg5));
var _local9:Number = (_arg3 - (25 * _arg5));
_arch.addControlPoint(_local8, _local9);
_arch.addControlPoint(_arg6.x, _arg6.y);
}
public function step():Boolean{
_pos = (_pos + 0.05);
if (_pos > 1.5){
return (false);
};
x = _arch.getX(_pos);
y = _arch.getY(_pos);
return (true);
}
}
}//package
Section 24
//ButtonBar (ButtonBar)
package {
import flash.events.*;
import flash.net.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
public class ButtonBar extends Sprite {
private var _backwardDown:Boolean;// = false
public var loaded:MovieClip;
private var _timer:Timer;
public var scrubber:MovieClip;
private var _forwardDown:Boolean;// = false
public var sound:Sound;
private var Asset:Class;
private var _pausePoint:Number;// = 0
private var _isPlaying:Boolean;
public var forwardButton:SimpleButton;
public var siteURL:String;
private var _asset:Sprite;
public var playPauseButton:MovieClip;
public var backwardButton:SimpleButton;
public var soundChannel:SoundChannel;
public function ButtonBar(_arg1:String){
Asset = ButtonBar_Asset;
siteURL = _arg1;
sound = new Sound();
sound.addEventListener(IOErrorEvent.IO_ERROR, _handleError);
sound.load(new URLRequest((siteURL + "visualizer.mp3")));
_isPlaying = false;
_asset = new Asset();
addChild(_asset);
addEventListener(Event.ADDED_TO_STAGE, added);
super();
}
public function stop():void{
soundChannel.stop();
_timer.stop();
}
private function update(_arg1:Event):void{
if (_isPlaying){
_pausePoint = soundChannel.position;
};
var _local2:int = Math.ceil((sound.length / (sound.bytesLoaded / sound.bytesTotal)));
var _local3:uint = Math.round((100 * (_pausePoint / _local2)));
scrubber.gotoAndStop(_local3);
var _local4:int = Math.round((100 * (sound.bytesLoaded / sound.bytesTotal)));
loaded.gotoAndStop(_local4);
if (_forwardDown){
soundChannel.stop();
_pausePoint = Math.min(_local2, (_pausePoint + 5000));
if (_isPlaying){
soundChannel = sound.play(_pausePoint);
};
} else {
if (_backwardDown){
soundChannel.stop();
_pausePoint = Math.max(0, (_pausePoint - 5000));
if (_isPlaying){
soundChannel = sound.play(_pausePoint);
};
};
};
}
private function _clickPlayPause(_arg1:MouseEvent=null):void{
var _local2:SoundTransform;
if (_isPlaying){
_pausePoint = soundChannel.position;
soundChannel.stop();
_isPlaying = false;
playPauseButton.gotoAndStop("play_over");
} else {
if (!_isPlaying){
soundChannel = sound.play(_pausePoint);
_local2 = soundChannel.soundTransform;
_local2.volume = 0.7;
soundChannel.soundTransform = _local2;
_isPlaying = true;
playPauseButton.gotoAndStop("pause_over");
};
};
}
private function _outPlayPause(_arg1:MouseEvent):void{
if (_isPlaying){
playPauseButton.gotoAndStop("pause_over");
} else {
if (!_isPlaying){
playPauseButton.gotoAndStop("play_over");
};
};
}
private function added(_arg1:Event):void{
var event = _arg1;
removeEventListener(Event.ADDED_TO_STAGE, added);
playPauseButton = (_asset.getChildByName("playPauseButton") as MovieClip);
backwardButton = (_asset.getChildByName("backwardButton") as SimpleButton);
forwardButton = (_asset.getChildByName("forwardButton") as SimpleButton);
scrubber = (_asset.getChildByName("scrubber") as MovieClip);
loaded = (_asset.getChildByName("loaded") as MovieClip);
scrubber.stop();
playPauseButton.gotoAndStop("play_over");
playPauseButton.addEventListener(MouseEvent.MOUSE_OVER, _overPlayPause);
playPauseButton.addEventListener(MouseEvent.MOUSE_OUT, _outPlayPause);
playPauseButton.addEventListener(MouseEvent.CLICK, _clickPlayPause);
backwardButton.addEventListener(MouseEvent.MOUSE_DOWN, function (_arg1:Event):void{
_backwardDown = true;
});
backwardButton.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:Event):void{
_backwardDown = false;
});
backwardButton.addEventListener(MouseEvent.MOUSE_OUT, function (_arg1:Event):void{
_backwardDown = false;
});
forwardButton.addEventListener(MouseEvent.MOUSE_DOWN, function (_arg1:Event):void{
_forwardDown = true;
});
forwardButton.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:Event):void{
_forwardDown = false;
});
forwardButton.addEventListener(MouseEvent.MOUSE_OUT, function (_arg1:Event):void{
_forwardDown = false;
});
_timer = new Timer(100);
_timer.addEventListener(TimerEvent.TIMER, update);
_timer.start();
}
private function _handleError(_arg1:IOErrorEvent):void{
trace("stream eror handled.");
}
private function _overPlayPause(_arg1:MouseEvent):void{
if (_isPlaying){
playPauseButton.gotoAndStop("pause_down");
} else {
if (!_isPlaying){
playPauseButton.gotoAndStop("play_down");
};
};
}
}
}//package
Section 25
//ButtonBar_Asset (ButtonBar_Asset)
package {
import flash.display.*;
import mx.core.*;
public class ButtonBar_Asset extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 26
//CageTheElephant (CageTheElephant)
package {
import flash.events.*;
import flash.net.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import com.adobe.images.*;
import flash.media.*;
import flash.external.*;
public class CageTheElephant extends Sprite {
private var DownloadButton:Class;
private var _archerAgo:uint;// = 1
private var _buttonBar:ButtonBar;
private var VisualizerFrame:Class;
private var _archers:Array;
private var _canvasLayer:Sprite;
private var _spectrumBytes:ByteArray;
private var _splotchPalette:Array;
private var HEIGHT:uint;// = 484
private var _spectrumPalette:Array;
private var _splotcher:Splotcher;
private var _drawButton:SimpleButton;
private var aButtonDown:Boolean;// = false
private var _lineLayer:Sprite;
private var Background:Class;
private var _lineLayerBitmapData:BitmapData;
private var _history:Array;
private var _canvasBitmapData:BitmapData;
private var _centerX:Number;
private var _centerY:Number;
private var _mouseDown:Boolean;// = false
private var Part10:Class;
private var Part11:Class;
private var _currentArcher:uint;// = 0
private var _circlesPalette:Array;
private var FacebookPostButton:Class;
private var _follower:Follower;
private var Part1:Class;
private var Part2:Class;
private var Part3:Class;
private var Part4:Class;
private var Part5:Class;
private var Part6:Class;
private var Part7:Class;
private var Part8:Class;
private var _canvasBitmap:Bitmap;
private var Part9:Class;
private var _theta:Number;// = 0.098174770424681
private var WIDTH:uint;// = 722
private var _numSplotches:uint;
public var siteURL:String;
private var DrawButton:Class;
private var ClearButton:Class;
private var Parts:Class;
private var _eqLayer:Sprite;
private var _followerLayer:Sprite;
private var _drawing:Boolean;// = false
public function CageTheElephant(){
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:Number;
Background = CageTheElephant_Background;
VisualizerFrame = CageTheElephant_VisualizerFrame;
DrawButton = CageTheElephant_DrawButton;
DownloadButton = CageTheElephant_DownloadButton;
ClearButton = CageTheElephant_ClearButton;
FacebookPostButton = CageTheElephant_FacebookPostButton;
Part1 = CageTheElephant_Part1;
Part2 = CageTheElephant_Part2;
Part3 = CageTheElephant_Part3;
Part4 = CageTheElephant_Part4;
Part5 = CageTheElephant_Part5;
Part6 = CageTheElephant_Part6;
Part7 = CageTheElephant_Part7;
Part8 = CageTheElephant_Part8;
Part9 = CageTheElephant_Part9;
Part10 = CageTheElephant_Part10;
Part11 = CageTheElephant_Part11;
Parts = CageTheElephant_Parts;
_splotchPalette = new Array(3092891, 13889018, 15462772, 16753590, 5425892, 16192048, 12903192, 2607087, 14108328, 1096418, 14754934);
_spectrumPalette = new Array();
super();
var _local1:Bitmap = new Background();
graphics.beginBitmapFill(_local1.bitmapData);
graphics.drawRect(0, 0, WIDTH, HEIGHT);
_circlesPalette = [new Part1(), new Part2(), new Part3(), new Part4(), new Part5(), new Part6(), new Part7(), new Part8(), new Part9(), new Part10(), new Part11()];
var _local2:uint = (0x0100 / _splotchPalette.length);
var _local3:uint;
while (_local3 < 0x0100) {
_local6 = Math.floor((_local3 / _local2));
_local7 = _splotchPalette[_local6];
_local8 = _splotchPalette[(_local6 + 1)];
_local9 = ((_local3 % _local2) / _local2);
_spectrumPalette.push(interpolateColor(_local7, _local8, _local9));
_local3++;
};
_canvasLayer = new Sprite();
_lineLayer = new Sprite();
_lineLayerBitmapData = new BitmapData(WIDTH, HEIGHT, true, 0);
var _local4:Bitmap = new Bitmap(_lineLayerBitmapData);
_lineLayer.addChild(_local4);
_canvasLayer.addChild(_lineLayer);
_canvasBitmapData = new BitmapData(WIDTH, HEIGHT, true, 0);
_canvasBitmap = new Bitmap(_canvasBitmapData);
_canvasLayer.addChild(_canvasBitmap);
_archers = new Array();
var _local5:Sprite = new VisualizerFrame();
addChild(_local5);
addEventListener(Event.ENTER_FRAME, frame);
addEventListener(Event.ADDED_TO_STAGE, added);
}
private function added(_arg1:Event):void{
siteURL = root.loaderInfo.parameters.siteURL;
_buttonBar = new ButtonBar(siteURL);
_buttonBar.x = 73;
_buttonBar.y = 393;
addChild(_buttonBar);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
stage.addEventListener(MouseEvent.CLICK, click);
_centerX = (this.WIDTH / 2);
_centerY = (this.HEIGHT / 2);
_follower = new Follower(_centerX, _centerY, ((20 * Math.random()) - 10), ((20 * Math.random()) - 10), (0.05 + (5E-5 * Math.random())));
_spectrumBytes = new ByteArray();
_splotcher = new Splotcher(_spectrumBytes, _follower, _canvasBitmapData);
_splotcher.randomProbability = 0.7;
_eqLayer = new Sprite();
addChild(_eqLayer);
_canvasLayer.addChild(_splotcher);
_canvasLayer.addChild(_lineLayer);
_canvasLayer.addChild(_canvasBitmap);
addChild(_canvasLayer);
_history = new Array();
var _local2:uint;
while (_local2 < 100) {
_history.push(new Point(_centerX, _centerY));
_local2++;
};
_followerLayer = new Sprite();
_followerLayer.addChild(_follower);
addChild(_followerLayer);
_eqLayer.x = _centerX;
_eqLayer.y = _centerY;
_drawButton = new DrawButton();
_drawButton.x = _centerX;
_drawButton.y = _centerY;
addChild(_drawButton);
stage.addEventListener(MouseEvent.CLICK, _startDrawing);
addChild(_buttonBar);
}
private function mouseUp(_arg1:MouseEvent=null):void{
_mouseDown = false;
}
private function _startDrawing(_arg1:MouseEvent=null):void{
removeChild(_eqLayer);
_splotcher.randomProbability = 0.2;
_splotcher.setSpectrum(this._spectrumBytes);
var _local2:SimpleButton = new FacebookPostButton();
_local2.addEventListener(MouseEvent.CLICK, _facebookJPG);
_local2.x = 599;
_local2.y = 414;
addChild(_local2);
var _local3:SimpleButton = new DownloadButton();
_local3.addEventListener(MouseEvent.CLICK, _downloadJPG);
_local3.x = 517;
_local3.y = 424;
addChild(_local3);
var _local4:SimpleButton = new ClearButton();
_local4.addEventListener(MouseEvent.CLICK, _clear);
_local4.x = 445;
_local4.y = 430;
addChild(_local4);
_drawing = true;
stage.removeEventListener(MouseEvent.CLICK, _startDrawing);
removeChild(_drawButton);
}
private function analyzeSpectrum(_arg1:TimerEvent=null):void{
var event = _arg1;
try {
SoundMixer.computeSpectrum(_spectrumBytes, true, 0);
} catch(e:Error) {
trace(e);
};
}
private function _drawRadialSpectrum():void{
var len:Number;
_eqLayer.graphics.clear();
_eqLayer.rotation = (_eqLayer.rotation + 0.5);
var angle:Number = 0;
try {
len = (300 * _spectrumBytes.readFloat());
} catch(error:Error) {
trace("error reading float from byteArray");
};
_eqLayer.graphics.moveTo((len * Math.cos(angle)), (len * Math.sin(angle)));
var i:uint = 1;
while (i < 0x0100) {
try {
len = (300 * _spectrumBytes.readFloat());
} catch(error:Error) {
trace("error reading float from byteArray");
};
angle = (angle + _theta);
_eqLayer.graphics.lineStyle(3, _spectrumPalette[i], 0.5);
_eqLayer.graphics.lineTo((len * Math.cos(angle)), (len * Math.sin(angle)));
i = (i + 4);
};
graphics.lineStyle(1);
}
private function keyUp(_arg1:KeyboardEvent):void{
switch (String.fromCharCode(_arg1.keyCode)){
case "A":
aButtonDown = false;
break;
};
}
private function _clear(_arg1:MouseEvent):void{
trace("clear");
_canvasLayer.removeChild(_canvasBitmap);
_canvasLayer.removeChild(_lineLayer);
_lineLayer = new Sprite();
_lineLayerBitmapData = new BitmapData(WIDTH, HEIGHT, true, 0);
var _local2:Bitmap = new Bitmap(_lineLayerBitmapData);
_lineLayer.addChild(_local2);
_canvasLayer.addChild(_lineLayer);
_canvasBitmapData = new BitmapData(WIDTH, HEIGHT, true, 0);
_canvasBitmap = new Bitmap(_canvasBitmapData);
_canvasLayer.addChild(_canvasBitmap);
_splotcher.setCanvas(_canvasBitmap, _canvasBitmapData);
}
private function frame(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local7:Number;
var _local8:Number;
var _local10:Sprite;
var _local11:Number;
var _local12:Archer;
analyzeSpectrum();
if (!_drawing){
_drawRadialSpectrum();
return;
};
var _local4:uint;
_local2 = _follower.x;
_local3 = _follower.y;
_history.unshift(new Point(_follower.x, _follower.y));
_history.pop();
var _local5:Sprite = new Sprite();
if (_follower.step()){
_local10 = _circlesPalette[Math.floor((Math.random() * _circlesPalette.length))];
_local10.x = _follower.x;
_local10.y = _follower.y;
_local11 = ((1 + (_follower.distance / 700)) + (0.3 * Math.random()));
_local10.scaleX = _local11;
_local10.scaleY = _local11;
_local10.rotation = ((Math.random() * 2) * Math.PI);
_local5.addChild(_local10);
if (this._mouseDown){
_canvasBitmapData.draw(_local5);
};
};
if (aButtonDown){
_local12 = new Archer(_splotchPalette[(_currentArcher++ % _splotchPalette.length)], _follower.x, _follower.y, -(_follower.vY), _follower.vX, _history[_archerAgo]);
_archers.push(_local12);
if (_archerAgo < 99){
_archerAgo = (_archerAgo + 2);
};
} else {
_archerAgo = 1;
};
var _local6:uint = _archers.length;
var _local9:uint;
while (_local9 < _local6) {
_local7 = _archers[_local9].x;
_local8 = _archers[_local9].y;
if (!_archers[_local9].step()){
_archers.splice(_local9, 1);
_local6--;
} else {
_local5 = new Sprite();
_local5.graphics.lineStyle(0.1, _archers[_local9].color);
_local5.graphics.moveTo(_local7, _local8);
_local5.graphics.lineTo(_archers[_local9].x, _archers[_local9].y);
_lineLayerBitmapData.draw(_local5);
_local5 = null;
};
_local9++;
};
}
private function _downloadJPG(_arg1:MouseEvent):void{
(_arg1.target as SimpleButton).removeEventListener(MouseEvent.CLICK, _downloadJPG);
_buttonBar.stop();
var _local2:URLLoader = new URLLoader();
_local2.addEventListener(Event.COMPLETE, _downloadJPGComplete);
_local2.load(_createSaveJPGRequest());
}
private function click(_arg1:MouseEvent=null):void{
}
private function _facebookJPG(_arg1:MouseEvent):void{
(_arg1.target as SimpleButton).removeEventListener(MouseEvent.CLICK, _facebookJPG);
_buttonBar.stop();
var _local2:URLLoader = new URLLoader();
_local2.addEventListener(Event.COMPLETE, _facebookJPGComplete);
_local2.load(_createSaveJPGRequest());
}
private function keyDown(_arg1:KeyboardEvent):void{
_mouseDown = false;
switch (String.fromCharCode(_arg1.keyCode)){
case "A":
aButtonDown = true;
break;
};
}
private function _createSaveJPGRequest():URLRequest{
var _local1:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, false, 15396055);
_local1.draw(_canvasLayer);
var _local2:JPGEncoder = new JPGEncoder(85);
var _local3:ByteArray = _local2.encode(_local1);
var _local4:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
var _local5:URLRequest = new URLRequest((siteURL + "scripts/save_bytearray.php"));
_local5.requestHeaders.push(_local4);
_local5.method = URLRequestMethod.POST;
_local5.data = _local3;
return (_local5);
}
private function _downloadJPGComplete(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
ExternalInterface.call("downloadJPGComplete", _local2.data);
}
private function _facebookJPGComplete(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
ExternalInterface.call("facebookJPGComplete", _local2.data);
}
private function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = ((_arg1 >> 24) & 0xFF);
var _local6:uint = ((_arg1 >> 16) & 0xFF);
var _local7:uint = ((_arg1 >> 8) & 0xFF);
var _local8:uint = (_arg1 & 0xFF);
var _local9:uint = ((_arg2 >> 24) & 0xFF);
var _local10:uint = ((_arg2 >> 16) & 0xFF);
var _local11:uint = ((_arg2 >> 8) & 0xFF);
var _local12:uint = (_arg2 & 0xFF);
var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3));
var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3));
var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3));
var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3));
var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
private function mouseDown(_arg1:MouseEvent=null):void{
_mouseDown = true;
}
}
}//package
Section 27
//CageTheElephant_Background (CageTheElephant_Background)
package {
import mx.core.*;
public class CageTheElephant_Background extends BitmapAsset {
}
}//package
Section 28
//CageTheElephant_ClearButton (CageTheElephant_ClearButton)
package {
import mx.core.*;
public class CageTheElephant_ClearButton extends ButtonAsset {
}
}//package
Section 29
//CageTheElephant_DownloadButton (CageTheElephant_DownloadButton)
package {
import mx.core.*;
public class CageTheElephant_DownloadButton extends ButtonAsset {
}
}//package
Section 30
//CageTheElephant_DrawButton (CageTheElephant_DrawButton)
package {
import mx.core.*;
public class CageTheElephant_DrawButton extends ButtonAsset {
}
}//package
Section 31
//CageTheElephant_FacebookPostButton (CageTheElephant_FacebookPostButton)
package {
import mx.core.*;
public class CageTheElephant_FacebookPostButton extends ButtonAsset {
}
}//package
Section 32
//CageTheElephant_Part1 (CageTheElephant_Part1)
package {
import mx.core.*;
public class CageTheElephant_Part1 extends SpriteAsset {
}
}//package
Section 33
//CageTheElephant_Part10 (CageTheElephant_Part10)
package {
import mx.core.*;
public class CageTheElephant_Part10 extends SpriteAsset {
}
}//package
Section 34
//CageTheElephant_Part11 (CageTheElephant_Part11)
package {
import mx.core.*;
public class CageTheElephant_Part11 extends SpriteAsset {
}
}//package
Section 35
//CageTheElephant_Part2 (CageTheElephant_Part2)
package {
import mx.core.*;
public class CageTheElephant_Part2 extends SpriteAsset {
}
}//package
Section 36
//CageTheElephant_Part3 (CageTheElephant_Part3)
package {
import mx.core.*;
public class CageTheElephant_Part3 extends SpriteAsset {
}
}//package
Section 37
//CageTheElephant_Part4 (CageTheElephant_Part4)
package {
import mx.core.*;
public class CageTheElephant_Part4 extends SpriteAsset {
}
}//package
Section 38
//CageTheElephant_Part5 (CageTheElephant_Part5)
package {
import mx.core.*;
public class CageTheElephant_Part5 extends SpriteAsset {
}
}//package
Section 39
//CageTheElephant_Part6 (CageTheElephant_Part6)
package {
import mx.core.*;
public class CageTheElephant_Part6 extends SpriteAsset {
}
}//package
Section 40
//CageTheElephant_Part7 (CageTheElephant_Part7)
package {
import mx.core.*;
public class CageTheElephant_Part7 extends SpriteAsset {
}
}//package
Section 41
//CageTheElephant_Part8 (CageTheElephant_Part8)
package {
import mx.core.*;
public class CageTheElephant_Part8 extends SpriteAsset {
}
}//package
Section 42
//CageTheElephant_Part9 (CageTheElephant_Part9)
package {
import mx.core.*;
public class CageTheElephant_Part9 extends SpriteAsset {
}
}//package
Section 43
//CageTheElephant_Parts (CageTheElephant_Parts)
package {
import mx.core.*;
import flash.utils.*;
public class CageTheElephant_Parts extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function CageTheElephant_Parts(){
dataClass = CageTheElephant_Parts_dataClass;
super();
initialWidth = (11000 / 20);
initialHeight = (8000 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 44
//CageTheElephant_Parts_dataClass (CageTheElephant_Parts_dataClass)
package {
import mx.core.*;
public class CageTheElephant_Parts_dataClass extends ByteArrayAsset {
}
}//package
Section 45
//CageTheElephant_VisualizerFrame (CageTheElephant_VisualizerFrame)
package {
import mx.core.*;
public class CageTheElephant_VisualizerFrame extends SpriteAsset {
}
}//package
Section 46
//EmbedManager (EmbedManager)
package {
import flash.events.*;
public class EmbedManager extends EventDispatcher {
private var green_splotch:Class;
private var blue_lines_1:Class;
private var blue_lines_2:Class;
private var red_smear:Class;
private var black_loops:Class;
private var blue_lines_3:Class;
private var blue_smear:Class;
private var pink_water_splotch_02:Class;
private var black_spot_02:Class;
private var black_spot_01:Class;
private var pink_water_splotch_01:Class;
protected var _assets:Array;
private var pink_splotch_01:Class;
private var pink_splotch_02:Class;
private var pink_splotch_03:Class;
private var pink_splotch_04:Class;
private var pink_splotch_05:Class;
private var purple_splotch:Class;
private var blue_asterix:Class;
private var black_splatters_01:Class;
private var black_splatters_02:Class;
private var red_lines:Class;
private var black_blue_smear:Class;
private var light_blue_splotch:Class;
private var blue_eyeball_01:Class;
private var pink_lines:Class;
private var blue_eyeball_03:Class;
private var blue_eyeball_02:Class;
private static var instance:EmbedManager = new (EmbedManager);
;
public function EmbedManager(_arg1:IEventDispatcher=null){
_assets = new Array();
black_blue_smear = EmbedManager_black_blue_smear;
black_loops = EmbedManager_black_loops;
black_splatters_01 = EmbedManager_black_splatters_01;
black_splatters_02 = EmbedManager_black_splatters_02;
black_spot_01 = EmbedManager_black_spot_01;
black_spot_02 = EmbedManager_black_spot_02;
blue_asterix = EmbedManager_blue_asterix;
blue_eyeball_01 = EmbedManager_blue_eyeball_01;
blue_eyeball_02 = EmbedManager_blue_eyeball_02;
blue_eyeball_03 = EmbedManager_blue_eyeball_03;
blue_smear = EmbedManager_blue_smear;
green_splotch = EmbedManager_green_splotch;
light_blue_splotch = EmbedManager_light_blue_splotch;
pink_lines = EmbedManager_pink_lines;
pink_splotch_01 = EmbedManager_pink_splotch_01;
pink_splotch_02 = EmbedManager_pink_splotch_02;
pink_splotch_03 = EmbedManager_pink_splotch_03;
pink_splotch_04 = EmbedManager_pink_splotch_04;
pink_splotch_05 = EmbedManager_pink_splotch_05;
pink_water_splotch_01 = EmbedManager_pink_water_splotch_01;
pink_water_splotch_02 = EmbedManager_pink_water_splotch_02;
purple_splotch = EmbedManager_purple_splotch;
red_lines = EmbedManager_red_lines;
red_smear = EmbedManager_red_smear;
blue_lines_1 = EmbedManager_blue_lines_1;
blue_lines_2 = EmbedManager_blue_lines_2;
blue_lines_3 = EmbedManager_blue_lines_3;
_assets.push(new black_blue_smear());
_assets.push(new black_loops());
_assets.push(new black_splatters_01());
_assets.push(new black_splatters_02());
_assets.push(new black_spot_01());
_assets.push(new black_spot_02());
_assets.push(new blue_asterix());
_assets.push(new blue_eyeball_01());
_assets.push(new blue_eyeball_02());
_assets.push(new blue_eyeball_03());
_assets.push(new blue_smear());
_assets.push(new green_splotch());
_assets.push(new light_blue_splotch());
_assets.push(new pink_lines());
_assets.push(new pink_splotch_01());
_assets.push(new pink_splotch_02());
_assets.push(new pink_splotch_03());
_assets.push(new pink_splotch_04());
_assets.push(new pink_splotch_05());
_assets.push(new pink_water_splotch_01());
_assets.push(new pink_water_splotch_02());
_assets.push(new purple_splotch());
_assets.push(new red_lines());
_assets.push(new red_smear());
_assets.push(new blue_lines_1());
_assets.push(new blue_lines_2());
_assets.push(new blue_lines_3());
super(null);
if (instance){
throw (new Error("EmbedManager and can only be accessed through EmbedManager.getInstance()"));
};
}
public function numAssets():uint{
return (_assets.length);
}
public function getAsset(_arg1:uint):Object{
return (_assets[_arg1]);
}
public static function getInstance():EmbedManager{
return (instance);
}
}
}//package
Section 47
//EmbedManager_black_blue_smear (EmbedManager_black_blue_smear)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_black_blue_smear extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 48
//EmbedManager_black_loops (EmbedManager_black_loops)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_black_loops extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 49
//EmbedManager_black_splatters_01 (EmbedManager_black_splatters_01)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_black_splatters_01 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 50
//EmbedManager_black_splatters_02 (EmbedManager_black_splatters_02)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_black_splatters_02 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 51
//EmbedManager_black_spot_01 (EmbedManager_black_spot_01)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_black_spot_01 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 52
//EmbedManager_black_spot_02 (EmbedManager_black_spot_02)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_black_spot_02 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 53
//EmbedManager_blue_asterix (EmbedManager_blue_asterix)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_blue_asterix extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 54
//EmbedManager_blue_eyeball_01 (EmbedManager_blue_eyeball_01)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_blue_eyeball_01 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 55
//EmbedManager_blue_eyeball_02 (EmbedManager_blue_eyeball_02)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_blue_eyeball_02 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 56
//EmbedManager_blue_eyeball_03 (EmbedManager_blue_eyeball_03)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_blue_eyeball_03 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 57
//EmbedManager_blue_lines_1 (EmbedManager_blue_lines_1)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_blue_lines_1 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 58
//EmbedManager_blue_lines_2 (EmbedManager_blue_lines_2)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_blue_lines_2 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 59
//EmbedManager_blue_lines_3 (EmbedManager_blue_lines_3)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_blue_lines_3 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 60
//EmbedManager_blue_smear (EmbedManager_blue_smear)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_blue_smear extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 61
//EmbedManager_green_splotch (EmbedManager_green_splotch)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_green_splotch extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 62
//EmbedManager_light_blue_splotch (EmbedManager_light_blue_splotch)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_light_blue_splotch extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 63
//EmbedManager_pink_lines (EmbedManager_pink_lines)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_pink_lines extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 64
//EmbedManager_pink_splotch_01 (EmbedManager_pink_splotch_01)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_pink_splotch_01 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 65
//EmbedManager_pink_splotch_02 (EmbedManager_pink_splotch_02)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_pink_splotch_02 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 66
//EmbedManager_pink_splotch_03 (EmbedManager_pink_splotch_03)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_pink_splotch_03 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 67
//EmbedManager_pink_splotch_04 (EmbedManager_pink_splotch_04)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_pink_splotch_04 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 68
//EmbedManager_pink_splotch_05 (EmbedManager_pink_splotch_05)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_pink_splotch_05 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 69
//EmbedManager_pink_water_splotch_01 (EmbedManager_pink_water_splotch_01)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_pink_water_splotch_01 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 70
//EmbedManager_pink_water_splotch_02 (EmbedManager_pink_water_splotch_02)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_pink_water_splotch_02 extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 71
//EmbedManager_purple_splotch (EmbedManager_purple_splotch)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_purple_splotch extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 72
//EmbedManager_red_lines (EmbedManager_red_lines)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_red_lines extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 73
//EmbedManager_red_smear (EmbedManager_red_smear)
package {
import flash.display.*;
import mx.core.*;
public class EmbedManager_red_smear extends SpriteAsset {
public var scrubber:DisplayObject;
public var playPauseButton:DisplayObject;
public var loaded:DisplayObject;
public var backwardButton:DisplayObject;
public var forwardButton:DisplayObject;
}
}//package
Section 74
//Follower (Follower)
package {
import flash.display.*;
public class Follower extends Sprite {
public var squareMode:Boolean;// = false
public var vX:Number;
public var vY:Number;
public var speed:Number;
private var _factor:Number;
public var distance:Number;
public function Follower(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0.01, _arg6:uint=0){
var _x = _arg1;
var _y = _arg2;
var _vx = _arg3;
var _vy = _arg4;
var factor = _arg5;
var color = _arg6;
var _local8 = graphics;
with (_local8) {
beginFill(color);
drawCircle(0, 0, 2);
};
x = _x;
y = _y;
vX = _vx;
vY = _vy;
_factor = factor;
super();
}
public function step():Boolean{
if ((((((((stage.mouseX < -10)) || ((stage.mouseX > (stage.stageWidth + 10))))) || ((stage.mouseY < -10)))) || ((stage.mouseY > (stage.stageHeight + 10))))){
return (false);
};
var _local1:Number = Math.atan2(this.mouseY, this.mouseX);
distance = Math.sqrt(((this.mouseX * this.mouseX) + (this.mouseY * this.mouseY)));
var _local2:Number = 0.8;
if (distance < 5){
return (false);
};
speed = Math.min((2 + (distance / 10)), 6);
vX = ((speed * Math.cos(_local1)) + (_local2 * vX));
vY = ((speed * Math.sin(_local1)) + (_local2 * vY));
vX = (vX / (1 + _local2));
vY = (vY / (1 + _local2));
if (squareMode){
if (Math.abs(vX) > Math.abs(vY)){
x = (x + vX);
} else {
y = (y + vY);
};
} else {
x = (x + vX);
y = (y + vY);
};
return (true);
}
}
}//package
Section 75
//Splotcher (Splotcher)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.filters.*;
import flash.errors.*;
public class Splotcher extends Sprite {
private var _stageHeight:Number;
private var _stageWidth:Number;
private var _canvasBitmap:Bitmap;
private var _canvasBitmapData:BitmapData;
private var _timer:Timer;
private var _numSplotcheSamples:uint;
private var _spectrumBytes:ByteArray;
private var _centerX:Number;
private var _centerY:Number;
private var _currentSize:Number;
public var randomProbability:Number;// = 1
private var _splotchGroups:Array;
private var _follower:Follower;
private var _splotchQueue:Array;
public function Splotcher(_arg1:ByteArray, _arg2:Follower, _arg3:BitmapData=null){
_splotchGroups = [[0, 1], [2, 3], [4, 5], [6, 7, 8, 9], [10, 11, 12], [13, 14, 15, 16, 17, 18], [19, 20], [21, 22, 23], [24, 25, 26]];
_spectrumBytes = _arg1;
_follower = _arg2;
_canvasBitmapData = _arg3;
_stageWidth = _arg3.width;
_stageHeight = _arg3.height;
_numSplotcheSamples = EmbedManager.getInstance().numAssets();
_timer = new Timer(50);
_timer.addEventListener(TimerEvent.TIMER, _interval);
addEventListener(Event.ADDED_TO_STAGE, added);
super();
}
private function added(_arg1:Event=null):void{
if (!_stageWidth){
_stageWidth = stage.stageWidth;
_stageHeight = stage.stageHeight;
};
_centerX = (_stageWidth / 2);
_centerY = (_stageHeight / 2);
if (_canvasBitmapData == null){
this._canvasBitmapData = new BitmapData(_stageWidth, _stageHeight, true, 0);
this._canvasBitmap = new Bitmap(this._canvasBitmapData);
addChild(this._canvasBitmap);
};
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
_timer.start();
}
public function stop():void{
_timer.stop();
}
private function _queueSplotches(_arg1:uint, _arg2:uint):void{
var _local3:Array = _splotchGroups[_arg1];
_splotchQueue = new Array();
var _local4:uint;
var _local5:uint;
while (_local5 < _arg2) {
_local4 = Math.floor((Math.random() * _local3.length));
_splotchQueue.push(_local3[_local4]);
_local5++;
};
_currentSize = 0.9;
}
public function clear():void{
if (_canvasBitmap){
if (contains(_canvasBitmap)){
removeChild(this._canvasBitmap);
this._canvasBitmapData = new BitmapData(_stageWidth, _stageHeight, true, 0);
this._canvasBitmap = new Bitmap(this._canvasBitmapData);
addChild(this._canvasBitmap);
};
};
}
public function setCanvas(_arg1:Bitmap, _arg2:BitmapData):void{
this._canvasBitmap = _arg1;
this._canvasBitmapData = _arg2;
}
private function keyDown(_arg1:KeyboardEvent):void{
switch (String.fromCharCode(_arg1.charCode)){
case "c":
_queueSplotches(0, 1);
break;
case "p":
_queueSplotches(1, 3);
break;
case "g":
_queueSplotches(2, 7);
break;
case "e":
_queueSplotches(3, 3);
break;
case "t":
_queueSplotches(4, 4);
break;
case "h":
_queueSplotches(5, 8);
break;
case "l":
_queueSplotches(6, 2);
break;
case "n":
_queueSplotches(8, 2);
break;
};
}
public function setSpectrum(_arg1:ByteArray):void{
this._spectrumBytes = _arg1;
}
private function _interval(_arg1:TimerEvent):void{
var _local3:uint;
var _local4:Sprite;
var _local5:Sprite;
if (Math.random() < randomProbability){
_randomSplotch();
};
if (!(_splotchQueue is Array)){
return;
};
var _local2:uint = this._splotchQueue.length;
if (_local2 > 0){
_local3 = _splotchQueue.pop();
_local4 = (EmbedManager.getInstance().getAsset(_local3) as Sprite);
_local4.scaleX = _currentSize;
_local4.scaleY = _currentSize;
_currentSize = (_currentSize * 0.7);
_local4.x = this._follower.x;
_local4.y = this._follower.y;
_local4.rotation = (360 * Math.random());
_local4.alpha = 0.9;
_local5 = new Sprite();
_local5.addChild(_local4);
this._canvasBitmapData.draw(_local5);
};
}
private function _randomSplotch():void{
var floats:Array;
var idx:uint = (Math.random() * _numSplotcheSamples);
var sp:Sprite = (EmbedManager.getInstance().getAsset(idx) as Sprite);
sp.x = (20 + (Math.random() * (this._stageWidth - 40)));
sp.y = (20 + (Math.random() * (this._stageHeight - 40)));
floats = new Array();
try {
floats.push(_spectrumBytes.readFloat());
floats.push(_spectrumBytes.readFloat());
} catch(e:EOFError) {
trace("EOFError");
floats.push(Math.random());
floats.push((Math.random() * 0.5));
};
sp.rotation = (180 * Math.pow(floats[0], 2));
sp.scaleX = (2 * Math.pow(floats[1], 2));
sp.scaleY = sp.scaleX;
var temp:Sprite = new Sprite();
temp.addChild(sp);
var bx:Number = (0.01 * Math.abs((sp.x - _centerX)));
var by:Number = (0.01 * Math.abs((sp.y - _centerY)));
var f:BlurFilter = new BlurFilter(bx, by);
temp.filters = [f];
if (_canvasBitmapData){
this._canvasBitmapData.draw(temp);
};
}
}
}//package