Section 1
//BitString (com.adobe.images.BitString)
package com.adobe.images {
public class BitString {
public var len:int;// = 0
public var val:int;// = 0
}
}//package com.adobe.images
Section 2
//JPGEncoder (com.adobe.images.JPGEncoder)
package com.adobe.images {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class JPGEncoder {
private var ZigZag:Array;
private var YTable:Array;
private var UVTable:Array;
private var fdtbl_Y:Array;
private var fdtbl_UV:Array;
private var YDC_HT:Array;
private var UVDC_HT:Array;
private var YAC_HT:Array;
private var UVAC_HT:Array;
private var std_dc_luminance_nrcodes:Array;
private var std_dc_luminance_values:Array;
private var std_ac_luminance_nrcodes:Array;
private var std_ac_luminance_values:Array;
private var std_dc_chrominance_nrcodes:Array;
private var std_dc_chrominance_values:Array;
private var std_ac_chrominance_nrcodes:Array;
private var std_ac_chrominance_values:Array;
private var bitcode:Array;
private var category:Array;
private var byteout:ByteArray;
private var bytenew:int;// = 0
private var bytepos:int;// = 7
private var DU:Array;
private var YDU:Array;
private var UDU:Array;
private var VDU: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 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 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 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 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 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 writeByte(_arg1:int):void{
byteout.writeByte(_arg1);
}
private function writeWord(_arg1:int):void{
writeByte(((_arg1 >> 8) & 0xFF));
writeByte((_arg1 & 0xFF));
}
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);
}
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 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 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 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++;
};
}
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 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++;
};
}
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);
}
}
}//package com.adobe.images
Section 3
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public static function encode(_arg1:Object):String{
var _local2:JSONEncoder = new JSONEncoder(_arg1);
return (_local2.getString());
}
public static function decode(_arg1:String){
var _local2:JSONDecoder = new JSONDecoder(_arg1);
return (_local2.getValue());
}
}
}//package com.adobe.serialization.json
Section 4
//JSONDecoder (com.adobe.serialization.json.JSONDecoder)
package com.adobe.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(_arg1:String){
tokenizer = new JSONTokenizer(_arg1);
nextToken();
value = parseValue();
}
public function getValue(){
return (value);
}
private function nextToken():JSONToken{
return ((token = tokenizer.getNextToken()));
}
private function parseArray():Array{
var _local1:Array = new Array();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
while (true) {
_local1.push(parseValue());
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting ] or , but found " + token.value));
};
};
return (null);
}
private function parseObject():Object{
var _local2:String;
var _local1:Object = new Object();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
while (true) {
if (token.type == JSONTokenType.STRING){
_local2 = String(token.value);
nextToken();
if (token.type == JSONTokenType.COLON){
nextToken();
_local1[_local2] = parseValue();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting } or , but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting : but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting string but found " + token.value));
};
};
return (null);
}
private function parseValue():Object{
switch (token.type){
case JSONTokenType.LEFT_BRACE:
return (parseObject());
case JSONTokenType.LEFT_BRACKET:
return (parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (token.value);
default:
tokenizer.parseError(("Unexpected " + token.value));
};
return (null);
}
}
}//package com.adobe.serialization.json
Section 5
//JSONEncoder (com.adobe.serialization.json.JSONEncoder)
package com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(_arg1){
jsonString = convertToString(_arg1);
}
public function getString():String{
return (jsonString);
}
private function convertToString(_arg1):String{
if ((_arg1 is String)){
return (escapeString((_arg1 as String)));
};
if ((_arg1 is Number)){
return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null");
} else {
if ((_arg1 is Boolean)){
return ((_arg1) ? "true" : "false");
} else {
if ((_arg1 is Array)){
return (arrayToString((_arg1 as Array)));
};
if ((((_arg1 is Object)) && (!((_arg1 == null))))){
return (objectToString(_arg1));
};
};
};
return ("null");
}
private function escapeString(_arg1:String):String{
var _local3:String;
var _local6:String;
var _local7:String;
var _local2 = "";
var _local4:Number = _arg1.length;
var _local5:int;
while (_local5 < _local4) {
_local3 = _arg1.charAt(_local5);
switch (_local3){
case "\"":
_local2 = (_local2 + "\\\"");
break;
case "\\":
_local2 = (_local2 + "\\\\");
break;
case "\b":
_local2 = (_local2 + "\\b");
break;
case "\f":
_local2 = (_local2 + "\\f");
break;
case "\n":
_local2 = (_local2 + "\\n");
break;
case "\r":
_local2 = (_local2 + "\\r");
break;
case "\t":
_local2 = (_local2 + "\\t");
break;
default:
if (_local3 < " "){
_local6 = _local3.charCodeAt(0).toString(16);
_local7 = ((_local6.length == 2)) ? "00" : "000";
_local2 = (_local2 + (("\\u" + _local7) + _local6));
} else {
_local2 = (_local2 + _local3);
};
};
_local5++;
};
return ((("\"" + _local2) + "\""));
}
private function arrayToString(_arg1:Array):String{
var _local2 = "";
var _local3:int;
while (_local3 < _arg1.length) {
if (_local2.length > 0){
_local2 = (_local2 + ",");
};
_local2 = (_local2 + convertToString(_arg1[_local3]));
_local3++;
};
return ((("[" + _local2) + "]"));
}
private function objectToString(_arg1:Object):String{
var value:Object;
var key:String;
var v:XML;
var o = _arg1;
var s = "";
var classInfo:XML = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(key) + ":") + convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(v.@name.toString()) + ":") + convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
}
}//package com.adobe.serialization.json
Section 6
//JSONParseError (com.adobe.serialization.json.JSONParseError)
package com.adobe.serialization.json {
public class JSONParseError extends Error {
private var _location:int;
private var _text:String;
public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){
super(_arg1);
_location = _arg2;
_text = _arg3;
}
public function get location():int{
return (_location);
}
public function get text():String{
return (_text);
}
}
}//package com.adobe.serialization.json
Section 7
//JSONToken (com.adobe.serialization.json.JSONToken)
package com.adobe.serialization.json {
public class JSONToken {
private var _type:int;
private var _value:Object;
public function JSONToken(_arg1:int=-1, _arg2:Object=null){
_type = _arg1;
_value = _arg2;
}
public function get type():int{
return (_type);
}
public function set type(_arg1:int):void{
_type = _arg1;
}
public function get value():Object{
return (_value);
}
public function set value(_arg1:Object):void{
_value = _arg1;
}
}
}//package com.adobe.serialization.json
Section 8
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer)
package com.adobe.serialization.json {
public class JSONTokenizer {
private var obj:Object;
private var jsonString:String;
private var loc:int;
private var ch:String;
public function JSONTokenizer(_arg1:String){
jsonString = _arg1;
loc = 0;
nextChar();
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var _local1:JSONToken = new JSONToken();
skipIgnored();
switch (ch){
case "{":
_local1.type = JSONTokenType.LEFT_BRACE;
_local1.value = "{";
nextChar();
break;
case "}":
_local1.type = JSONTokenType.RIGHT_BRACE;
_local1.value = "}";
nextChar();
break;
case "[":
_local1.type = JSONTokenType.LEFT_BRACKET;
_local1.value = "[";
nextChar();
break;
case "]":
_local1.type = JSONTokenType.RIGHT_BRACKET;
_local1.value = "]";
nextChar();
break;
case ",":
_local1.type = JSONTokenType.COMMA;
_local1.value = ",";
nextChar();
break;
case ":":
_local1.type = JSONTokenType.COLON;
_local1.value = ":";
nextChar();
break;
case "t":
_local2 = ((("t" + nextChar()) + nextChar()) + nextChar());
if (_local2 == "true"){
_local1.type = JSONTokenType.TRUE;
_local1.value = true;
nextChar();
} else {
parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + nextChar()) + nextChar()) + nextChar()) + nextChar());
if (_local3 == "false"){
_local1.type = JSONTokenType.FALSE;
_local1.value = false;
nextChar();
} else {
parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + nextChar()) + nextChar()) + nextChar());
if (_local4 == "null"){
_local1.type = JSONTokenType.NULL;
_local1.value = null;
nextChar();
} else {
parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
_local1 = readString();
break;
default:
if (((isDigit(ch)) || ((ch == "-")))){
_local1 = readNumber();
} else {
if (ch == ""){
return (null);
};
parseError((("Unexpected " + ch) + " encountered"));
};
};
return (_local1);
}
private function readString():JSONToken{
var _local3:String;
var _local4:int;
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.STRING;
var _local2 = "";
nextChar();
while (((!((ch == "\""))) && (!((ch == ""))))) {
if (ch == "\\"){
nextChar();
switch (ch){
case "\"":
_local2 = (_local2 + "\"");
break;
case "/":
_local2 = (_local2 + "/");
break;
case "\\":
_local2 = (_local2 + "\\");
break;
case "b":
_local2 = (_local2 + "\b");
break;
case "f":
_local2 = (_local2 + "\f");
break;
case "n":
_local2 = (_local2 + "\n");
break;
case "r":
_local2 = (_local2 + "\r");
break;
case "t":
_local2 = (_local2 + "\t");
break;
case "u":
_local3 = "";
_local4 = 0;
while (_local4 < 4) {
if (!isHexDigit(nextChar())){
parseError((" Excepted a hex digit, but found: " + ch));
};
_local3 = (_local3 + ch);
_local4++;
};
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16)));
break;
default:
_local2 = (_local2 + ("\\" + ch));
};
} else {
_local2 = (_local2 + ch);
};
nextChar();
};
if (ch == ""){
parseError("Unterminated string literal");
};
nextChar();
_local1.value = _local2;
return (_local1);
}
private function readNumber():JSONToken{
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.NUMBER;
var _local2 = "";
if (ch == "-"){
_local2 = (_local2 + "-");
nextChar();
};
if (!isDigit(ch)){
parseError("Expecting a digit");
};
if (ch == "0"){
_local2 = (_local2 + ch);
nextChar();
if (isDigit(ch)){
parseError("A digit cannot immediately follow 0");
};
} else {
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if (ch == "."){
_local2 = (_local2 + ".");
nextChar();
if (!isDigit(ch)){
parseError("Expecting a digit");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if ((((ch == "e")) || ((ch == "E")))){
_local2 = (_local2 + "e");
nextChar();
if ((((ch == "+")) || ((ch == "-")))){
_local2 = (_local2 + ch);
nextChar();
};
if (!isDigit(ch)){
parseError("Scientific notation number needs exponent value");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
var _local3:Number = Number(_local2);
if (((isFinite(_local3)) && (!(isNaN(_local3))))){
_local1.value = _local3;
return (_local1);
};
parseError((("Number " + _local3) + " is not valid!"));
return (null);
}
private function nextChar():String{
return ((ch = jsonString.charAt(loc++)));
}
private function skipIgnored():void{
skipWhite();
skipComments();
skipWhite();
}
private function skipComments():void{
if (ch == "/"){
nextChar();
switch (ch){
case "/":
do {
nextChar();
} while (((!((ch == "\n"))) && (!((ch == "")))));
nextChar();
break;
case "*":
nextChar();
while (true) {
if (ch == "*"){
nextChar();
if (ch == "/"){
nextChar();
break;
};
} else {
nextChar();
};
if (ch == ""){
parseError("Multi-line comment not closed");
};
};
break;
default:
parseError((("Unexpected " + ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function skipWhite():void{
while (isWhiteSpace(ch)) {
nextChar();
};
}
private function isWhiteSpace(_arg1:String):Boolean{
return ((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n"))));
}
private function isDigit(_arg1:String):Boolean{
return ((((_arg1 >= "0")) && ((_arg1 <= "9"))));
}
private function isHexDigit(_arg1:String):Boolean{
var _local2:String = _arg1.toUpperCase();
return (((isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F"))))));
}
public function parseError(_arg1:String):void{
throw (new JSONParseError(_arg1, loc, jsonString));
}
}
}//package com.adobe.serialization.json
Section 9
//JSONTokenType (com.adobe.serialization.json.JSONTokenType)
package com.adobe.serialization.json {
public class JSONTokenType {
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACE:int = 1;
public static const RIGHT_BRACE:int = 2;
public static const LEFT_BRACKET:int = 3;
public static const RIGHT_BRACKET:int = 4;
public static const COLON:int = 6;
public static const TRUE:int = 7;
public static const FALSE:int = 8;
public static const NULL:int = 9;
public static const STRING:int = 10;
public static const NUMBER:int = 11;
}
}//package com.adobe.serialization.json
Section 10
//StringUtil (com.adobe.utils.StringUtil)
package com.adobe.utils {
public class StringUtil {
public static function stringsAreEqual(_arg1:String, _arg2:String, _arg3:Boolean):Boolean{
if (_arg3){
return ((_arg1 == _arg2));
};
return ((_arg1.toUpperCase() == _arg2.toUpperCase()));
}
public static function trim(_arg1:String):String{
return (StringUtil.ltrim(StringUtil.rtrim(_arg1)));
}
public static function ltrim(_arg1:String):String{
var _local2:Number = _arg1.length;
var _local3:Number = 0;
while (_local3 < _local2) {
if (_arg1.charCodeAt(_local3) > 32){
return (_arg1.substring(_local3));
};
_local3++;
};
return ("");
}
public static function rtrim(_arg1:String):String{
var _local2:Number = _arg1.length;
var _local3:Number = _local2;
while (_local3 > 0) {
if (_arg1.charCodeAt((_local3 - 1)) > 32){
return (_arg1.substring(0, _local3));
};
_local3--;
};
return ("");
}
public static function beginsWith(_arg1:String, _arg2:String):Boolean{
return ((_arg2 == _arg1.substring(0, _arg2.length)));
}
public static function endsWith(_arg1:String, _arg2:String):Boolean{
return ((_arg2 == _arg1.substring((_arg1.length - _arg2.length))));
}
public static function remove(_arg1:String, _arg2:String):String{
return (StringUtil.replace(_arg1, _arg2, ""));
}
public static function replace(_arg1:String, _arg2:String, _arg3:String):String{
var _local9:Number;
var _local4:String = new String();
var _local5:Boolean;
var _local6:Number = _arg1.length;
var _local7:Number = _arg2.length;
var _local8:Number = 0;
while (_local8 < _local6) {
if (_arg1.charAt(_local8) == _arg2.charAt(0)){
_local5 = true;
_local9 = 0;
while (_local9 < _local7) {
if (_arg1.charAt((_local8 + _local9)) != _arg2.charAt(_local9)){
_local5 = false;
break;
};
_local9++;
};
//unresolved if
_local4 = (_local4 + _arg3);
_local8 = (_local8 + (_local7 - 1));
} else {
_local4 = (_local4 + _arg1.charAt(_local8));
};
_local8++;
};
return (_local4);
}
}
}//package com.adobe.utils
Section 11
//APIEvent (com.girlgames.dressup.api.APIEvent)
package com.girlgames.dressup.api {
import flash.events.*;
public class APIEvent extends Event {
public var actionType:String;
public function APIEvent(_arg1:String, _arg2:String){
this.actionType = _arg2;
super(_arg1);
}
}
}//package com.girlgames.dressup.api
Section 12
//ApiUI (com.girlgames.dressup.api.ApiUI)
package com.girlgames.dressup.api {
import flash.events.*;
import flash.display.*;
import com.girlgames.dressup.*;
public class ApiUI {
private var stateSaver:StateSaver;
private var signupMessage:SignUpMessageMc;
private var messageWin:ErrorMessageMc;
private var selectScreen:SelectScreenShotMc;
private var placement:Object;
private var saveBtn:MButton;
private var selectSreenWin:SelectScreenWin;
private var game:DressupGame;
private var content:ApiMovieClip;
public function ApiUI(_arg1:Stage, _arg2:DressupGame, _arg3:StateSaver, _arg4:Object=null, _arg5:MovieClip=null){
MousePointer.init(_arg1);
this.stateSaver = _arg3;
this.placement = _arg4;
this.game = _arg2;
if (_arg5){
this.content = (_arg5 as ApiMovieClip);
} else {
this.content = new ApiMovieClip();
this.game.addChild(this.content);
};
this.saveBtn = new MButton(this.content.saveBtn);
this.saveBtn.addActionListener(this.onSave1);
if (!this.content.stage){
this.content.addEventListener(Event.ADDED_TO_STAGE, this.onUIAdedToStage);
} else {
this.content.stage.addEventListener(MouseEvent.MOUSE_DOWN, this.onStageMouseDown);
};
this.messageWin = new ErrorMessageMc();
this.messageWin.addEventListener(MouseEvent.MOUSE_DOWN, this.blockMouse);
this.messageWin.yesBtn.addEventListener(MouseEvent.CLICK, this.onStageMouseDown);
this.signupMessage = new SignUpMessageMc();
this.signupMessage.addEventListener(MouseEvent.MOUSE_DOWN, this.blockMouse);
this.signupMessage.noBtn.addEventListener(MouseEvent.CLICK, this.onStageMouseDown);
this.signupMessage.yesBtn.addEventListener(MouseEvent.CLICK, this.onSignUP);
this.selectScreen = new SelectScreenShotMc();
this.selectScreen.addEventListener(MouseEvent.MOUSE_DOWN, this.blockMouse);
this.selectScreen.noBtn.addEventListener(MouseEvent.CLICK, this.onScreenNo);
this.selectScreen.yesBtn.addEventListener(MouseEvent.CLICK, this.onScreenYes);
_arg2.addEventListener(DressupGame.EDIT_EVENT, this.onEdit);
this.stateSaver.addEventListener(StateSaver.ACTION_COMPLTE, this.onActionComplete);
this.selectSreenWin = new SelectScreenWin(this.game);
this.selectSreenWin.saveBtn.addActionListener(this.onSave);
this.selectSreenWin.visible = false;
this.saveBtn.enabled = false;
if (this.placement){
if (this.placement.pl){
switch (this.placement.pl){
case "tl":
this.content.x = 0;
this.content.y = 0;
break;
case "tr":
this.content.x = (this.game.WIDTH - this.content.width);
this.content.y = 0;
break;
case "bl":
this.content.x = 0;
this.content.y = (this.game.HEIGHT - this.content.height);
break;
case "br":
this.content.x = (this.game.WIDTH - this.content.width);
this.content.y = (this.game.HEIGHT - this.content.height);
break;
default:
throw (new Error("bad placement format, see docs!!!"));
};
} else {
if (((parseFloat(this.placement.x)) && (parseFloat(this.placement.y)))){
this.content.x = parseFloat(this.placement.x);
this.content.y = parseFloat(this.placement.y);
} else {
throw (new Error("bad placement format, see docs!!!"));
};
};
} else {
this.content.x = (this.game.WIDTH - this.content.width);
this.content.y = (this.game.HEIGHT - this.content.height);
};
}
private function onSave(_arg1:Event=null):void{
this.content.visible = true;
this.selectSreenWin.visible = false;
if (this.stateSaver.mode != StateSaver.MODE_USER){
this.showSignupMessage();
} else {
this.saveBtn.enabled = false;
this.stateSaver.sendCommand(StateSaver.STORE_DATA);
};
}
private function onEdit(_arg1:Event):void{
if (!this.saveBtn.enabled){
this.saveBtn.enabled = true;
};
}
private function onScreenNo(_arg1:MouseEvent):void{
this.selectScreen.visible = false;
this.stateSaver.screenShot = null;
this.onSave();
}
private function onActionComplete(_arg1:APIEvent):void{
this.stateSaver.console.print(_arg1.actionType);
var _local2 = "";
if (this.stateSaver.error == "1"){
if (!this.stateSaver.errorDescription){
_local2 = this.stateSaver.dafaultErrorMessage;
} else {
_local2 = this.stateSaver.errorDescription;
};
this.showMessage(_local2);
return;
};
if (this.game.edited){
this.saveBtn.enabled = true;
};
_local2 = this.stateSaver.successDescription;
this.stateSaver.console.print(_local2);
if (_local2){
this.showMessage(_local2);
};
}
private function showMessage(_arg1:String):void{
var _local2:Stage = this.content.stage;
_local2.addChild(this.messageWin);
this.messageWin.x = ((_local2.stageWidth - this.messageWin.width) / 2);
this.messageWin.y = ((_local2.stageHeight - this.messageWin.height) / 2);
this.messageWin.visible = true;
this.messageWin.msgtxt.text = _arg1;
}
private function showSreenMsg():void{
var _local1:Stage = this.content.stage;
_local1.addChild(this.selectScreen);
this.selectScreen.x = ((_local1.stageWidth - this.selectScreen.width) / 2);
this.selectScreen.y = ((_local1.stageHeight - this.selectScreen.height) / 2);
this.selectScreen.visible = true;
}
private function blockMouse(_arg1:MouseEvent):void{
_arg1.stopPropagation();
_arg1.stopImmediatePropagation();
}
private function showSignupMessage():void{
var _local1:Stage = this.content.stage;
_local1.addChild(this.signupMessage);
this.signupMessage.x = ((_local1.stageWidth - this.signupMessage.width) / 2);
this.signupMessage.y = ((_local1.stageHeight - this.signupMessage.height) / 2);
this.signupMessage.visible = true;
}
private function showSelectionWindow():void{
this.selectScreen.visible = false;
var _local1:Stage = this.content.stage;
_local1.addChild(this.selectSreenWin);
this.selectSreenWin.visible = true;
this.content.visible = false;
}
private function onStageMouseDown(_arg1:MouseEvent):void{
if (this.selectSreenWin.visible){
return;
};
if (this.messageWin.visible){
this.messageWin.visible = false;
};
if (this.signupMessage.visible){
this.signupMessage.visible = false;
};
if (this.selectScreen){
this.selectScreen.visible = false;
};
this.selectSreenWin.visible = false;
}
private function onUIAdedToStage(_arg1:Event):void{
this.content.removeEventListener(Event.ADDED_TO_STAGE, this.onUIAdedToStage);
}
private function onSignUP(_arg1:MouseEvent):void{
this.stateSaver.navigateSignUp();
}
private function onSave1(_arg1:Event):void{
this.showSreenMsg();
}
private function onScreenYes(_arg1:MouseEvent):void{
this.showSelectionWindow();
}
}
}//package com.girlgames.dressup.api
Section 13
//EventSender (com.girlgames.dressup.api.EventSender)
package com.girlgames.dressup.api {
public class EventSender {
private var _listeners:Array;
private var _type:Class;
public function EventSender(_arg1:Class=null){
this._listeners = [];
super();
this._type = _arg1;
}
public function sendEvent(_arg1:Object=null):void{
var _local3:Function;
if ((((this._type == null)) || ((_arg1 is this._type)))){
if (arguments.length == 0){
for each (_local3 in this._listeners) {
_local3();
};
} else {
for each (_local3 in this._listeners) {
_local3(_arg1);
};
};
} else {
throw (new TypeError("The eventObject has incorrect event type!"));
};
}
public function addListener(_arg1:Function):void{
if (!this.hasListener(_arg1)){
this._listeners.push(_arg1);
} else {
throw (new Error("List already contain such listener"));
};
}
public function setListener(_arg1:Function):void{
this._listeners = [_arg1];
}
public function removeListener(_arg1:Function):void{
if (this.hasListener(_arg1)){
this._listeners.splice(this._listeners.indexOf(_arg1), 1);
} else {
throw (new Error("List doesn't contain such listener"));
};
}
public function removeListeners():void{
this._listeners = [];
}
public function hasListeners():Boolean{
return ((this._listeners.length > 0));
}
public function hasListener(_arg1:Function):Boolean{
return ((this._listeners.indexOf(_arg1) >= 0));
}
}
}//package com.girlgames.dressup.api
Section 14
//JPEGEncoder (com.girlgames.dressup.api.JPEGEncoder)
package com.girlgames.dressup.api {
import flash.display.*;
import flash.utils.*;
public class JPEGEncoder {
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 JPEGEncoder(_arg1:Number=50):void{
this.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];
this.YTable = new Array(64);
this.UVTable = new Array(64);
this.fdtbl_Y = new Array(64);
this.fdtbl_UV = new Array(64);
this.std_dc_luminance_nrcodes = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0];
this.std_dc_luminance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
this.std_ac_luminance_nrcodes = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125];
this.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];
this.std_dc_chrominance_nrcodes = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0];
this.std_dc_chrominance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
this.std_ac_chrominance_nrcodes = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119];
this.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];
this.bitcode = new Array(0xFFFF);
this.category = new Array(0xFFFF);
this.DU = new Array(64);
this.YDU = new Array(64);
this.UDU = new Array(64);
this.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)));
};
this.initHuffmanTbl();
this.initCategoryNumber();
this.initQuantTables(_local2);
}
private function initHuffmanTbl():void{
this.YDC_HT = this.computeHuffmanTbl(this.std_dc_luminance_nrcodes, this.std_dc_luminance_values);
this.UVDC_HT = this.computeHuffmanTbl(this.std_dc_chrominance_nrcodes, this.std_dc_chrominance_values);
this.YAC_HT = this.computeHuffmanTbl(this.std_ac_luminance_nrcodes, this.std_ac_luminance_values);
this.UVAC_HT = this.computeHuffmanTbl(this.std_ac_chrominance_nrcodes, this.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));
this.YDU[_local4] = ((((0.299 * _local8) + (0.587 * _local9)) + (0.114 * _local10)) - 128);
this.UDU[_local4] = (((-0.16874 * _local8) + (-0.33126 * _local9)) + (0.5 * _local10));
this.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)))){
this.bytenew = (this.bytenew | uint((1 << this.bytepos)));
};
_local3--;
this.bytepos--;
if (this.bytepos < 0){
if (this.bytenew == 0xFF){
this.writeByte(0xFF);
this.writeByte(0);
} else {
this.writeByte(this.bytenew);
};
this.bytepos = 7;
this.bytenew = 0;
};
};
}
private function writeWord(_arg1:int):void{
this.writeByte(((_arg1 >> 8) & 0xFF));
this.writeByte((_arg1 & 0xFF));
}
private function writeByte(_arg1:int):void{
this.byteout.writeByte(_arg1);
}
private function writeDHT():void{
var _local1:int;
this.writeWord(65476);
this.writeWord(418);
this.writeByte(0);
_local1 = 0;
while (_local1 < 16) {
this.writeByte(this.std_dc_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
this.writeByte(this.std_dc_luminance_values[_local1]);
_local1++;
};
this.writeByte(16);
_local1 = 0;
while (_local1 < 16) {
this.writeByte(this.std_ac_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
this.writeByte(this.std_ac_luminance_values[_local1]);
_local1++;
};
this.writeByte(1);
_local1 = 0;
while (_local1 < 16) {
this.writeByte(this.std_dc_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
this.writeByte(this.std_dc_chrominance_values[_local1]);
_local1++;
};
this.writeByte(17);
_local1 = 0;
while (_local1 < 16) {
this.writeByte(this.std_ac_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
this.writeByte(this.std_ac_chrominance_values[_local1]);
_local1++;
};
}
public function encode(_arg1:BitmapData):ByteArray{
var _local6:int;
var _local7:BitString;
this.byteout = new ByteArray();
this.bytenew = 0;
this.bytepos = 7;
this.writeWord(65496);
this.writeAPP0();
this.writeDQT();
this.writeSOF0(_arg1.width, _arg1.height);
this.writeDHT();
this.writeSOS();
var _local2:Number = 0;
var _local3:Number = 0;
var _local4:Number = 0;
this.bytenew = 0;
this.bytepos = 7;
var _local5:int;
while (_local5 < _arg1.height) {
_local6 = 0;
while (_local6 < _arg1.width) {
this.RGB2YUV(_arg1, _local6, _local5);
_local2 = this.processDU(this.YDU, this.fdtbl_Y, _local2, this.YDC_HT, this.YAC_HT);
_local3 = this.processDU(this.UDU, this.fdtbl_UV, _local3, this.UVDC_HT, this.UVAC_HT);
_local4 = this.processDU(this.VDU, this.fdtbl_UV, _local4, this.UVDC_HT, this.UVAC_HT);
_local6 = (_local6 + 8);
};
_local5 = (_local5 + 8);
};
if (this.bytepos >= 0){
_local7 = new BitString();
_local7.len = (this.bytepos + 1);
_local7.val = ((1 << (this.bytepos + 1)) - 1);
this.writeBits(_local7);
};
this.writeWord(65497);
return (this.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) {
this.category[(32767 + _local3)] = _local4;
this.bitcode[(32767 + _local3)] = new BitString();
this.bitcode[(32767 + _local3)].len = _local4;
this.bitcode[(32767 + _local3)].val = _local3;
_local3++;
};
_local3 = -((_local2 - 1));
while (_local3 <= -(_local1)) {
this.category[(32767 + _local3)] = _local4;
this.bitcode[(32767 + _local3)] = new BitString();
this.bitcode[(32767 + _local3)].len = _local4;
this.bitcode[(32767 + _local3)].val = ((_local2 - 1) + _local3);
_local3++;
};
_local1 = (_local1 << 1);
_local2 = (_local2 << 1);
_local4++;
};
}
private function writeDQT():void{
var _local1:int;
this.writeWord(65499);
this.writeWord(132);
this.writeByte(0);
_local1 = 0;
while (_local1 < 64) {
this.writeByte(this.YTable[_local1]);
_local1++;
};
this.writeByte(1);
_local1 = 0;
while (_local1 < 64) {
this.writeByte(this.UVTable[_local1]);
_local1++;
};
}
private function writeAPP0():void{
this.writeWord(65504);
this.writeWord(16);
this.writeByte(74);
this.writeByte(70);
this.writeByte(73);
this.writeByte(70);
this.writeByte(0);
this.writeByte(1);
this.writeByte(1);
this.writeByte(0);
this.writeWord(1);
this.writeWord(1);
this.writeByte(0);
this.writeByte(0);
}
private function writeSOS():void{
this.writeWord(65498);
this.writeWord(12);
this.writeByte(3);
this.writeByte(1);
this.writeByte(0);
this.writeByte(2);
this.writeByte(17);
this.writeByte(3);
this.writeByte(17);
this.writeByte(0);
this.writeByte(63);
this.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 = this.fDCTQuant(_arg1, _arg2);
_local8 = 0;
while (_local8 < 64) {
this.DU[this.ZigZag[_local8]] = _local9[_local8];
_local8++;
};
var _local10:int = (this.DU[0] - _arg3);
_arg3 = this.DU[0];
if (_local10 == 0){
this.writeBits(_arg4[0]);
} else {
this.writeBits(_arg4[this.category[(32767 + _local10)]]);
this.writeBits(this.bitcode[(32767 + _local10)]);
};
var _local11 = 63;
while ((((_local11 > 0)) && ((this.DU[_local11] == 0)))) {
_local11--;
};
if (_local11 == 0){
this.writeBits(_local6);
return (_arg3);
};
_local8 = 1;
while (_local8 <= _local11) {
_local12 = _local8;
while ((((this.DU[_local8] == 0)) && ((_local8 <= _local11)))) {
_local8++;
};
_local13 = (_local8 - _local12);
if (_local13 >= 16){
_local14 = 1;
while (_local14 <= (_local13 / 16)) {
this.writeBits(_local7);
_local14++;
};
_local13 = int((_local13 & 15));
};
this.writeBits(_arg5[((_local13 * 16) + this.category[(32767 + this.DU[_local8])])]);
this.writeBits(this.bitcode[(32767 + this.DU[_local8])]);
_local8++;
};
if (_local11 != 63){
this.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;
};
};
this.YTable[this.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;
};
};
this.UVTable[this.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) {
this.fdtbl_Y[_local2] = (1 / (((this.YTable[this.ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
this.fdtbl_UV[_local2] = (1 / (((this.UVTable[this.ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
_local2++;
_local8++;
};
_local7++;
};
}
private function writeSOF0(_arg1:int, _arg2:int):void{
this.writeWord(65472);
this.writeWord(17);
this.writeByte(8);
this.writeWord(_arg2);
this.writeWord(_arg1);
this.writeByte(3);
this.writeByte(1);
this.writeByte(17);
this.writeByte(0);
this.writeByte(2);
this.writeByte(17);
this.writeByte(1);
this.writeByte(3);
this.writeByte(17);
this.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.girlgames.dressup.api
class BitString {
public var val:int;// = 0
public var len:int;// = 0
private function BitString(){
}
}
Section 15
//MButton (com.girlgames.dressup.api.MButton)
package com.girlgames.dressup.api {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class MButton extends Sprite {
public var textF:TextField;
private var _enabled:Boolean;// = true
public var hint:String;
private var actionFunc:Function;// = null
public var textFormat:TextFormat;
private var pressed:Boolean;// = false
public var content:MovieClip;
public static const ACTION:String = "action";
public function MButton(_arg1:MovieClip){
this.content = _arg1;
this.content.parent.addChild(this);
addChild(this.content);
this.x = this.content.x;
this.y = this.content.y;
this.content.x = 0;
this.content.y = 0;
this.content.gotoAndStop(1);
addEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDown);
addEventListener(MouseEvent.ROLL_OVER, this.onMouseOver);
addEventListener(MouseEvent.ROLL_OUT, this.onMouseOut);
addEventListener(MouseEvent.MOUSE_UP, this.onMouseUp);
}
public function get enabled():Boolean{
return (this._enabled);
}
public function set enabled(_arg1:Boolean):void{
this._enabled = _arg1;
if (_arg1){
this.content.gotoAndStop(1);
} else {
this.content.gotoAndStop(4);
};
}
public function addActionListener(_arg1:Function):void{
addEventListener(MButton.ACTION, _arg1);
}
private function onMouseDown(_arg1:MouseEvent):void{
if (!this._enabled){
return;
};
this.content.gotoAndStop(3);
this.pressed = true;
}
private function onMouseUp(_arg1:MouseEvent):void{
if (!this._enabled){
return;
};
if (hitTestPoint(stage.mouseX, stage.mouseY)){
this.content.gotoAndStop(2);
if (this.pressed){
this.onMouseClick();
};
} else {
this.content.gotoAndStop(1);
};
this.pressed = false;
}
private function onMouseOut(_arg1:MouseEvent):void{
if (!this._enabled){
return;
};
this.content.gotoAndStop(1);
}
private function onMouseClick(_arg1:MouseEvent=null):void{
if (!this._enabled){
return;
};
dispatchEvent(new Event(MButton.ACTION));
}
public function removeActionListener(_arg1:Function):void{
removeEventListener(MButton.ACTION, _arg1);
}
private function onMouseOver(_arg1:MouseEvent):void{
if (!this._enabled){
return;
};
this.content.gotoAndStop(2);
}
public function setEnabled(_arg1:Boolean):void{
this._enabled = _arg1;
if (_arg1){
this.content.gotoAndStop(1);
} else {
this.content.gotoAndStop(4);
};
}
}
}//package com.girlgames.dressup.api
Section 16
//MultipartFormDataEncoder (com.girlgames.dressup.api.MultipartFormDataEncoder)
package com.girlgames.dressup.api {
import flash.utils.*;
public class MultipartFormDataEncoder {
private var finished:Boolean;
private var _boundary:String;
private var _postData:ByteArray;
public function MultipartFormDataEncoder(){
this._postData = new ByteArray();
this._postData.endian = Endian.BIG_ENDIAN;
this._boundary = "";
var _local1:int;
while (_local1 < 32) {
this._boundary = (this._boundary + String.fromCharCode(int((97 + (Math.random() * 25)))));
_local1++;
};
}
private function writeDoubleDash():void{
this._postData.writeShort(0x2D2D);
}
public function addParameter(_arg1:String, _arg2:Object):void{
if (_arg2 == null){
_arg2 = "";
};
this.writeBoundary();
this.writeLinebreak();
this.writeString((("Content-Disposition: form-data; name=\"" + _arg1) + "\""));
this.writeLinebreak();
this.writeLinebreak();
this._postData.writeUTFBytes(_arg2.toString());
this.writeLinebreak();
}
public function get data():ByteArray{
if (!this.finished){
this.finish();
};
return (this._postData);
}
public function addParameters(_arg1:Object):void{
var _local2:String;
for (_local2 in _arg1) {
this.addParameter(_local2, _arg1[_local2]);
};
}
private function writeLinebreak():void{
this._postData.writeShort(3338);
}
private function writeString(_arg1:String):void{
var _local2:int;
while (_local2 < _arg1.length) {
this._postData.writeByte(_arg1.charCodeAt(_local2));
_local2++;
};
}
public function get boundary():String{
return (this._boundary);
}
private function writeBoundary():void{
var _local1:int = this._boundary.length;
this.writeDoubleDash();
var _local2:int;
while (_local2 < _local1) {
this._postData.writeByte(this._boundary.charCodeAt(_local2));
_local2++;
};
}
private function finish():void{
this.writeBoundary();
this.writeDoubleDash();
}
public function addFile(_arg1:String, _arg2:String, _arg3:ByteArray, _arg4:String="application/octet-stream"):void{
this.writeBoundary();
this.writeLinebreak();
this.writeString((("Content-Disposition: form-data; name=\"" + _arg1) + "\"; filename=\""));
this._postData.writeUTFBytes(_arg2);
this.writeString("\"");
this.writeLinebreak();
this.writeString(("Content-Type: " + _arg4));
this.writeLinebreak();
this.writeLinebreak();
this._postData.writeBytes(_arg3);
this.writeLinebreak();
}
}
}//package com.girlgames.dressup.api
Section 17
//SelectionBox (com.girlgames.dressup.api.SelectionBox)
package com.girlgames.dressup.api {
import flash.events.*;
import flash.display.*;
import com.girlgames.dressup.*;
import flash.geom.*;
public class SelectionBox {
private var _content:McSelection;
private var maxWidth:Number;
private var minW:Number;// = 4
private var pointerLocked:Boolean;// = false
private var _moveEvent:EventSender;
public var ratio:Number;
private var _bounds:Rectangle;
private var isMove:Boolean;// = false
private var _startMoveEvent:EventSender;
private var maxHeight:Number;
private var boxBg:Sprite;
public var movePointer:McMovePointer;
private var minH:Number;// = 4
private var _finishMoveEvent:EventSender;
private var _markers:Array;
public var screenRect:Rectangle;
public static const MARGIN:int = 4;
public static const MIN_SIZE:int = 2;
public function SelectionBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this._content = new McSelection();
this._markers = [];
this._bounds = new Rectangle(0, 0, 0, 0);
this._moveEvent = new EventSender();
this._startMoveEvent = new EventSender();
this._finishMoveEvent = new EventSender();
super();
this.maxWidth = _arg1;
this.maxHeight = _arg2;
this.minW = _arg3;
this.minH = _arg4;
this.movePointer = new McMovePointer();
this.createResizeMarker(this._content.mcBottomLeft, 1, 0, 1, 1, -45);
this.createResizeMarker(this._content.mcBottomRight, 0, 0, 1, 1, 45);
this.createResizeMarker(this._content.mcTopLeft, 1, 1, 1, 1, 45);
this.createResizeMarker(this._content.mcTopRight, 0, 1, 1, 1, -45);
this.boxBg = new Sprite();
this._content.addChild(this.boxBg);
this.boxBg.x = MARGIN;
this.boxBg.y = MARGIN;
this.boxBg.addEventListener(MouseEvent.MOUSE_DOWN, this.onBgMouseDown);
this.boxBg.addEventListener(MouseEvent.MOUSE_UP, this.onBgMouseUP);
this.boxBg.addEventListener(MouseEvent.ROLL_OVER, this.onMouseRollOver);
this.boxBg.addEventListener(MouseEvent.ROLL_OUT, this.onMouseRollOut);
this.ratio = (_arg3 / _arg4);
this.screenRect = new Rectangle(0, 0, _arg3, _arg4);
}
public function get content():McSelection{
return (this._content);
}
private function onBgMouseDown(_arg1:MouseEvent):void{
this.isMove = true;
this._content.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onBgMouseMove);
this._content.stage.addEventListener(MouseEvent.MOUSE_UP, this.onBgMouseUP);
this._content.startDrag();
}
public function stopMove():void{
var _local1:ResizeMarker;
var _local2:Rectangle;
for each (_local1 in this._markers) {
_local1.stopMove();
};
if (this.isMove){
this._content.stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onBgMouseMove);
this._content.stage.removeEventListener(MouseEvent.MOUSE_UP, this.onBgMouseUP);
this._content.stopDrag();
_local2 = new Rectangle((this._content.x + MARGIN), (this._content.y + MARGIN), this._bounds.width, this._bounds.height);
this.bounds = _local2;
};
this.isMove = false;
}
public function get moveEvent():EventSender{
return (this._moveEvent);
}
private function onMouseRollOver(_arg1:MouseEvent):void{
if (!this.pointerLocked){
MousePointer.setIcon(this.movePointer);
this.onLockPointer(true);
};
}
private function onBgMouseUP(_arg1:MouseEvent):void{
this.stopMove();
}
public function get startMoveEvent():EventSender{
return (this._startMoveEvent);
}
private function createRotaionMarker(_arg1:Sprite):void{
}
public function set visible(_arg1:Boolean):void{
this._content.visible = _arg1;
}
private function createResizeMarker(_arg1:Sprite, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):void{
var _local7:ResizeMarker = new ResizeMarker(_arg1);
_local7.pointer.rotation = _arg6;
_local7.moveHandler = this.onMarkerMove;
_local7.startMoveHandler = this._startMoveEvent.sendEvent;
_local7.finishMoveHandler = this._finishMoveEvent.sendEvent;
_local7.lockPointerHandler = this.onLockPointer;
_local7.canMoveX = _arg2;
_local7.canMoveY = _arg3;
_local7.canSizeX = _arg4;
_local7.canSizeY = _arg5;
this._markers.push(_local7);
}
private function onLockPointer(_arg1:Boolean):void{
var _local2:ResizeMarker;
for each (_local2 in this._markers) {
_local2.pointerLocked = _arg1;
};
this.pointerLocked = _arg1;
}
private function onMarkerMove(_arg1:ResizeMarker):void{
var _local2:Rectangle = this._bounds.clone();
_local2.x = (_local2.x + _arg1.moveX);
_local2.y = (_local2.y + _arg1.moveY);
_local2.width = (_local2.width + _arg1.sizeX);
_local2.height = (_local2.height + _arg1.sizeY);
_local2.width = Math.max(_local2.width, this.minW);
_local2.height = Math.max(_local2.height, this.minH);
this._moveEvent.sendEvent(_local2);
}
private function onMouseRollOut(_arg1:MouseEvent):void{
if (!this.isMove){
this.onLockPointer(false);
MousePointer.resetIcon();
};
}
public function get bounds():Rectangle{
return (this._bounds);
}
private function onBgMouseMove(_arg1:MouseEvent):void{
var _local2:Rectangle;
if (this.isMove){
_local2 = new Rectangle((this._content.x + MARGIN), (this._content.y + MARGIN), this._bounds.width, this._bounds.height);
this.moveEvent.sendEvent(_local2);
};
}
public function get finishMoveEvent():EventSender{
return (this._finishMoveEvent);
}
public function set bounds(_arg1:Rectangle):void{
this._bounds = _arg1;
var _local2:Rectangle = this._bounds.clone();
_local2.left = (_local2.left - MARGIN);
_local2.top = (_local2.top - MARGIN);
_local2.right = (_local2.right + MARGIN);
_local2.bottom = (_local2.bottom + MARGIN);
this._content.x = _local2.x;
this._content.y = _local2.y;
this._content.mcRect.width = _local2.width;
this._content.mcRect.height = _local2.height;
this._content.mcBottomLeft.y = _local2.height;
this._content.mcBottomRight.x = _local2.width;
this._content.mcBottomRight.y = _local2.height;
this._content.mcTopRight.x = _local2.width;
this.boxBg.x = MARGIN;
this.boxBg.y = MARGIN;
this.boxBg.graphics.clear();
this.boxBg.graphics.beginFill(0xFFFFFF, 0);
this.boxBg.graphics.drawRect(0, 0, this._bounds.width, this._bounds.height);
this.boxBg.graphics.endFill();
}
}
}//package com.girlgames.dressup.api
import flash.events.*;
import flash.display.*;
import com.girlgames.dressup.*;
class ResizeMarker {
private var _content:Sprite;
public var pointer:McResizePointer;
public var canMoveX:int;
public var canSizeX:int;
public var canSizeY:int;
private var _mouseX:int;
private var _isMoving:Boolean;// = false
public var lockPointerHandler:Function;
public var sizeY:int;
public var finishMoveHandler:Function;
public var moveX:int;
public var moveY:int;
public var pointerLocked:Boolean;// = false
private var _mouseY:int;
public var sizeX:int;
public var canMoveY:int;
public var moveHandler:Function;
public var startMoveHandler:Function;
private function ResizeMarker(_arg1:Sprite){
this.pointer = new McResizePointer();
super();
this._content = _arg1;
this._content.cacheAsBitmap = true;
this._content.addEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDown);
this._content.addEventListener(MouseEvent.MOUSE_OVER, this.onMouseOver);
this._content.addEventListener(MouseEvent.MOUSE_OUT, this.onMouseOut);
this.pointer.cacheAsBitmap = true;
}
private function onMouseOver(_arg1:MouseEvent):void{
if (!this.pointerLocked){
MousePointer.setIcon(this.pointer);
};
}
private function onMouseMove(_arg1:MouseEvent):void{
if (!this._isMoving){
this._isMoving = true;
this.startMoveHandler();
};
var _local2:int = (this._content.mouseX - this._mouseX);
var _local3:int = (this._content.mouseY - this._mouseY);
this.moveX = (this.canMoveX * _local2);
this.moveY = (this.canMoveY * _local3);
this.sizeX = ((this.canSizeX * _local2) * (this.canMoveX) ? -1 : 1);
this.sizeY = ((this.canSizeY * _local3) * (this.canMoveY) ? -1 : 1);
this.moveHandler(this);
this._mouseX = this._content.mouseX;
this._mouseY = this._content.mouseY;
}
public function stopMove():void{
if (this._isMoving){
this._isMoving = false;
this.finishMoveHandler();
this._content.stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
this._content.stage.removeEventListener(MouseEvent.MOUSE_UP, this.onMouseUP);
this.lockPointerHandler(false);
if (!this._content.hitTestPoint(this._content.stage.mouseX, this._content.stage.mouseY)){
MousePointer.resetIcon();
};
};
}
private function onMouseUP(_arg1:MouseEvent):void{
if (this._isMoving){
this._isMoving = false;
this.finishMoveHandler();
};
this._content.stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
this._content.stage.removeEventListener(MouseEvent.MOUSE_UP, this.onMouseUP);
this.lockPointerHandler(false);
if (!this._content.hitTestPoint(this._content.stage.mouseX, this._content.stage.mouseY)){
MousePointer.resetIcon();
};
}
private function onMouseDown(_arg1:MouseEvent):void{
this._mouseX = this._content.mouseX;
this._mouseY = this._content.mouseY;
this._content.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMove);
this._content.stage.addEventListener(MouseEvent.MOUSE_UP, this.onMouseUP);
this.lockPointerHandler(true);
}
private function onMouseOut(_arg1:MouseEvent):void{
if (!this.pointerLocked){
MousePointer.resetIcon();
};
}
}
Section 18
//SelectScreenWin (com.girlgames.dressup.api.SelectScreenWin)
package com.girlgames.dressup.api {
import flash.events.*;
import flash.display.*;
import com.girlgames.dressup.*;
import flash.geom.*;
public class SelectScreenWin extends Sprite {
private var a:Number;// = 0.3
private var color:uint;// = 16764159
public var saveBtn:MButton;
private var game:DressupGame;
private var bw:Number;// = 250
private var selectionBox:SelectionBox;
public function SelectScreenWin(_arg1:DressupGame){
this.game = _arg1;
this.selectionBox = new SelectionBox(this.game.WIDTH, this.game.HEIGHT, StateSaver.instance.screenwidth, StateSaver.instance.screenheight);
addChild(this.selectionBox.content);
var _local2:Rectangle = new Rectangle(((this.game.WIDTH - this.bw) / 2), 100, this.bw, 600);
this.selectionBox.moveEvent.setListener(this.onSelectionMove);
this.selectionBox.finishMoveEvent.setListener(this.onBoxFinishMove);
StateSaver.instance.stage.addEventListener(Event.MOUSE_LEAVE, this.onMouseLeave);
this.onSelectionMove(_local2);
var _local3:SaveBtnWinMc = new SaveBtnWinMc();
addChild(_local3);
this.saveBtn = new MButton(_local3);
this.saveBtn.x = ((this.game.WIDTH - this.saveBtn.width) / 2);
this.saveBtn.y = ((this.game.HEIGHT - this.saveBtn.height) - 10);
this.saveBtn.addActionListener(this.onSaveBtn);
}
private function onSaveBtn(_arg1:Event):void{
StateSaver.instance.createScreenShot(this.selectionBox.bounds);
}
private function onBoxFinishMove():void{
this.onSelectionMove(this.selectionBox.bounds);
}
private function onMouseLeave(_arg1:Event):void{
this.selectionBox.stopMove();
}
private function onSelectionMove(_arg1:Rectangle):void{
if ((((((((this.game.stage.mouseX < 0)) || ((this.game.stage.mouseY < 0)))) || ((this.game.stage.mouseX > this.game.WIDTH)))) || ((this.game.stage.mouseY > this.game.HEIGHT)))){
this.selectionBox.stopMove();
};
graphics.clear();
if (_arg1.height > this.game.HEIGHT){
_arg1.height = this.game.HEIGHT;
};
if (_arg1.y < 0){
_arg1.y = 0;
};
var _local2:Rectangle = _arg1;
var _local3:Rectangle = this.selectionBox.screenRect;
var _local4:Number = (_arg1.width / _arg1.height);
if (_local4 > 1){
_local3.height = _arg1.height;
_local3.width = (_arg1.height * this.selectionBox.ratio);
} else {
_local3.width = _arg1.width;
_local3.height = (_arg1.width / this.selectionBox.ratio);
if (_local3.height > this.game.HEIGHT){
_local3.height = (this.game.HEIGHT - SelectionBox.MARGIN);
_local3.width = (_local3.height * this.selectionBox.ratio);
};
};
_local3.x = _arg1.x;
_local3.y = _arg1.y;
this.selectionBox.bounds = _local3;
this.checkBounds();
}
private function checkBounds():void{
var _local1:Rectangle = this.selectionBox.bounds.clone();
var _local2:int = SelectionBox.MARGIN;
_local1.x = Math.max(_local1.x, _local2);
_local1.y = Math.max(_local1.y, _local2);
_local1.x = Math.min(_local1.x, Math.max((this.game.WIDTH - _local1.width), _local2));
_local1.y = Math.min(_local1.y, Math.max((this.game.HEIGHT - _local1.height), _local2));
_local1.width = Math.min(_local1.width, this.game.WIDTH);
_local1.height = Math.min(_local1.height, this.game.HEIGHT);
this.selectionBox.bounds = _local1;
}
}
}//package com.girlgames.dressup.api
Section 19
//StateSaver (com.girlgames.dressup.api.StateSaver)
package com.girlgames.dressup.api {
import flash.events.*;
import flash.display.*;
import com.girlgames.dressup.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import gemslibe.debug.utils.*;
import com.adobe.serialization.json.*;
import flash.external.*;
import flash.system.*;
public class StateSaver extends EventDispatcher {
private var actionRequest:URLLoader;
public var serviceUrl:String;// = ""
public var stage:Stage;
public var screenShot:ByteArray;
public var game:DressupGame;
public var dataobj:Object;
private var clipToSave:MovieClip;
public var state:String;// = "default"
public var screenheight:Number;// = 151
public var error:String;// = ""
public var mode:String;// = "guest"
public var data:String;// = ""
private var qualityValue:Number;// = 80
public var owner:String;// = "no"
private var requestObject;
private var playerVersion:Number;
private var timeOutId:int;
public var action:String;// = "loaddata"
public var dafaultErrorMessage:String;// = "Sorry, the service is unvailable at the moment, please try again later."
public var domain:String;// = ""
public var console:Console;
public var screenwidth:Number;// = 196
public var regurl:String;
public var timeout:Number;// = 20000
public var errorDescription:String;// = ""
public var dataUrl:String;// = ""
private var defaultSnapShotName:String;// = "snapshot.jpg"
public var doload:String;// = "no"
public var successDescription:String;// = ""
private var playerVersionStr:String;
public var serviceData:String;
public static const LOAD_DATA:String = "loaddata";
public static const ACTION_COMPLTE:String = "action_complete";
public static const MODE_USER:String = "user";
public static const STORE_DATA:String = "storedata";
public static const INIT_EVENT:String = "saver_init_event";
public static const MODE_EXTRNAL:String = "external";
public static const OWNER_NO:String = "no";
public static const REG_DATA:String = "regdata";
public static const OWNER_YES:String = "yes";
public static const MODE_GUEST:String = "guest";
public static const version:String = "rev. 6";
public static var instance:StateSaver = new (StateSaver);
;
public function StateSaver(){
this.dataobj = {};
super();
if (instance != null){
throw (new Error("An instance of StateSaver already exists."));
};
}
public function navigateSignUp():void{
this.sendCommand(REG_DATA);
}
private function onActionTimeOut():void{
if (this.timeOutId){
clearTimeout(this.timeOutId);
this.timeOutId = 0;
};
this.actionRequest.close();
this.errorDescription = this.dafaultErrorMessage;
this.error = "1";
dispatchEvent(new APIEvent(StateSaver.ACTION_COMPLTE, this.action));
}
public function createScreenShot(_arg1:Rectangle):ByteArray{
var _local2:BitmapData = new BitmapData(this.game.WIDTH, this.game.HEIGHT);
_local2.draw(this.game.character, null, null, null, null, true);
var _local3:BitmapData = new BitmapData(_arg1.width, _arg1.height);
_local3.copyPixels(_local2, _arg1, new Point());
var _local4:Bitmap = new Bitmap(_local3, "auto", true);
var _local5:Number = (this.screenwidth / _arg1.width);
var _local6:BitmapData = new BitmapData(this.screenwidth, this.screenheight, false);
var _local7:Matrix = new Matrix();
_local7.scale(_local5, _local5);
_local6.draw(_local4, _local7, null, null, null, true);
var _local8:JPEGEncoder = new JPEGEncoder(90);
var _local9:ByteArray = _local8.encode(_local6);
_local2.dispose();
_local3.dispose();
_local6.dispose();
this.screenShot = _local9;
return (_local9);
}
private function onLoaderComplete(_arg1:URLLoader, _arg2:String):void{
var obj:Object;
var loader = _arg1;
var $action = _arg2;
this.console.print("loader complete");
if (this.timeOutId){
clearTimeout(this.timeOutId);
this.timeOutId = 0;
};
this.console.print(loader.data);
try {
obj = JSON.decode(loader.data);
} catch(e:Error) {
error = "1";
errorDescription = ("Error: " + e);
dispatchEvent(new APIEvent(StateSaver.ACTION_COMPLTE, $action));
return;
};
this.error = obj.error.toString();
if (obj.errordescription){
this.errorDescription = obj.errordescription;
};
if (obj.successdescription){
this.successDescription = obj.successdescription;
};
if (obj.dataobj){
this.dataobj = obj.dataobj;
};
if (obj.servicedata){
this.serviceData = obj.servicedata;
};
this.data = obj.data;
this.dataUrl = obj.dataurl;
if (this.data){
this.setState(this.data);
};
dispatchEvent(new APIEvent(StateSaver.ACTION_COMPLTE, $action));
}
public function sendCommand(_arg1:String):void{
var loader:URLLoader;
var $action = _arg1;
if (!this.serviceUrl){
return;
};
this.error = "";
this.errorDescription = "";
this.successDescription = "";
this.dataUrl = "";
this.requestObject = new MultipartFormDataEncoder();
this.data = StateSaver.instance.getDataToStore();
this.console.print(("data=" + this.data));
switch ($action){
case LOAD_DATA:
this.action = LOAD_DATA;
this.addVariableToRequest("action", $action);
if (this.serviceData){
this.addVariableToRequest("servicedata", this.serviceData);
};
break;
case STORE_DATA:
this.action = STORE_DATA;
this.addVariableToRequest("action", $action);
if (this.serviceData){
this.addVariableToRequest("servicedata", this.serviceData);
};
if (this.screenShot){
this.addVariableToRequest("screenshot", this.screenShot);
};
this.addVariableToRequest("data", this.data);
break;
case REG_DATA:
this.action = REG_DATA;
this.addVariableToRequest("action", $action);
if (this.serviceData){
this.addVariableToRequest("servicedata", this.serviceData);
};
if (this.screenShot){
this.addVariableToRequest("screenshot", this.screenShot);
};
this.addVariableToRequest("data", this.data);
break;
};
this.console.print(("SEND_ACTION=" + $action), this.serviceData);
if (this.timeOutId){
clearTimeout(this.timeOutId);
};
if (this.timeout){
this.timeOutId = setTimeout(this.onActionTimeOut, this.timeout);
};
this.console.print(("timeOutId=" + this.timeOutId));
var req:URLRequest = new URLRequest(this.serviceUrl);
req.method = URLRequestMethod.POST;
if ((this.requestObject is URLVariables)){
req.data = this.requestObject;
} else {
if ((this.requestObject is MultipartFormDataEncoder)){
req.data = MultipartFormDataEncoder(this.requestObject).data;
req.contentType = ("multipart/form-data; boundary=" + MultipartFormDataEncoder(this.requestObject).boundary);
};
};
if ($action != REG_DATA){
loader = new URLLoader(req);
this.actionRequest = loader;
loader.addEventListener(Event.COMPLETE, function (_arg1:Event):void{
onLoaderComplete((_arg1.target as URLLoader), $action);
});
loader.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
onLoaderError(_arg1, $action);
});
this.actionRequest = loader;
loader.load(req);
} else {
if (this.timeOutId){
clearTimeout(this.timeOutId);
this.timeOutId = 0;
};
req.url = this.regurl;
navigateToURL(req, "_blank");
};
}
public function getDomain():String{
var url:String;
var str:String;
var ind:int;
try {
url = String(ExternalInterface.call("function(){ var afk = document.location.href; return afk; }"));
this.console.print(("domainExternal=" + url));
if (url.toString() == "null"){
return (this.stage.loaderInfo.loaderURL);
};
return (url);
} catch(e:Error) {
str = e.toString();
console.print(str);
ind = str.lastIndexOf("://");
if (ind >= 0){
console.print("domain found");
return (str.substring(ind));
};
};
return (this.stage.loaderInfo.loaderURL);
}
public function initialize(_arg1:Stage, _arg2:MovieClip, _arg3:DressupGame):void{
this.stage = _arg1;
this.game = _arg3;
this.console = new Console(this.stage, true);
this.clipToSave = _arg2;
this.playerVersionStr = Capabilities.version;
this.playerVersion = Number(this.playerVersionStr.substring((this.playerVersionStr.indexOf(",") - 2), this.playerVersionStr.indexOf(",")));
var _local4:String = this.getDomain();
var _local5:int = (_local4.indexOf("://") + 3);
var _local6:int = _local4.indexOf("/", _local5);
_local4 = _local4.substring(0, _local6);
this.regurl = (_local4 + "/register.html");
this.parseFlashVars();
this.console.print(this.serviceData);
this.action = StateSaver.LOAD_DATA;
dispatchEvent(new Event(StateSaver.INIT_EVENT));
if (this.doload == "yes"){
if (this.data != ""){
this.setState(this.data);
} else {
this.sendCommand(StateSaver.LOAD_DATA);
};
};
}
private function setDomain(_arg1:String):void{
var _local2:int = (_arg1.indexOf("://") + 3);
var _local3:int = _arg1.indexOf("/", _local2);
this.domain = _arg1.substring(_local2, _local3);
var _local4:Array = this.domain.split(".");
if (_local4.length == 4){
this.domain = ((((_local4[1] + ".") + _local4[2]) + ".") + _local4[3]);
} else {
if (_local4.length == 3){
this.domain = ((_local4[1] + ".") + _local4[2]);
} else {
if (_local4.length == 2){
this.domain = ((_local4[0] + ".") + _local4[1]);
};
};
};
this.domain = ((((this.domain.length > 0)) && ((this.domain.indexOf("file://") < 0)))) ? this.domain : "local";
}
public function setState(_arg1:String):void{
var s:String;
var ta2:Array;
var clo:Clothes;
var str = _arg1;
if (!this.stage){
throw (new Error("StateSaver does not initialized"));
};
this.game.editEventLocked = true;
this.console.print(("SetState=" + str));
var ta:Array = str.split(";");
var clips:Array = new Array();
var i:int;
while (i < ta.length) {
ta2 = ta[i].split("=");
clips[ta2[0]] = ta2[1];
i = (i + 1);
};
for (s in clips) {
if (!s){
} else {
try {
clo = this.game.getClothesByName(s);
clo.setVisibleByName(clips[s]);
} catch(e:Error) {
};
};
};
this.game.editEventLocked = false;
}
private function parseFlashVars():void{
var keyStr:String;
var valueStr:String;
var paramObj:Object;
try {
paramObj = this.stage.loaderInfo.parameters;
for (keyStr in paramObj) {
valueStr = String(paramObj[keyStr]);
if (keyStr == "serviceurl"){
this.serviceUrl = valueStr;
} else {
if (keyStr == "servicedata"){
this.serviceData = valueStr;
} else {
if (keyStr == "timeout"){
this.timeout = parseFloat(valueStr);
} else {
if (keyStr == "owner"){
this.owner = valueStr;
} else {
if (keyStr == "mode"){
this.mode = valueStr;
} else {
if (keyStr == "doload"){
this.doload = valueStr;
} else {
if (keyStr == "loaddata"){
this.data = valueStr;
} else {
if (keyStr == "regurl"){
this.regurl = valueStr;
} else {
if (keyStr == "screenheight"){
this.screenheight = parseFloat(valueStr);
} else {
if (keyStr == "screenwidth"){
this.screenwidth = parseFloat(valueStr);
continue;
};
};
};
};
};
};
};
};
};
};
};
} catch(error:Error) {
trace(("error=" + error));
throw (new Error(("Problem with parsing vars: " + error)));
};
}
private function onLoaderError(_arg1:IOErrorEvent, _arg2:String):void{
this.console.print(_arg1);
this.error = "1";
dispatchEvent(new APIEvent(StateSaver.ACTION_COMPLTE, _arg2));
}
private function addVariableToRequest(_arg1:String, _arg2:Object):void{
var _local3:MultipartFormDataEncoder;
if ((this.requestObject is URLVariables)){
this.requestObject[_arg1] = _arg2;
} else {
if ((this.requestObject is MultipartFormDataEncoder)){
_local3 = MultipartFormDataEncoder(this.requestObject);
if (_arg1 == "screenshot"){
this.console.print("screeenAdedd");
_local3.addFile("screenshot", "screenshot.jpg", (_arg2 as ByteArray));
} else {
_local3.addParameter(_arg1, _arg2);
};
};
};
}
public function getDataToStore():String{
var _local2:Clothes;
if (!this.stage){
throw (new Error("StateSaver does not initialized"));
};
var _local1 = "";
for each (_local2 in this.game.clothes) {
trace(("current=" + _local2.currentVisible));
if (_local2.currentVisible){
_local1 = (_local1 + (((_local2.name + "=") + _local2.currentVisible.name) + ";"));
};
};
this.console.print(("getDtataToStore=" + _local1));
return (_local1);
}
}
}//package com.girlgames.dressup.api
Section 20
//Clothes (com.girlgames.dressup.Clothes)
package com.girlgames.dressup {
import flash.events.*;
import flash.display.*;
public class Clothes extends EventDispatcher {
private var game:DressupGame;
public var eventsLocked:Boolean;// = false
private var clothes:Array;
public var name:String;
private var _useHandCursor:Boolean;// = true
private var _defaultVisible:MovieClip;
private var _buttonMode:Boolean;// = true
private var _currentVisible:MovieClip;
private var _currentVisibleIndex:int;// = -1
private var _canDisapear:Boolean;// = true
public var content:MovieClip;
public function Clothes(_arg1:MovieClip, _arg2:DressupGame, _arg3:Boolean=true, _arg4:Boolean=true, _arg5:Boolean=true){
var _local7:DisplayObject;
this.clothes = new Array();
super();
this.content = _arg1;
this.game = _arg2;
this.name = _arg1.name;
this._canDisapear = _arg3;
this._useHandCursor = _arg4;
this._buttonMode = _arg5;
var _local6:int;
while (_local6 < _arg1.numChildren) {
_local7 = _arg1.getChildAt(_local6);
if ((_local7 is MovieClip)){
MovieClip(_local7).useHandCursor = this._useHandCursor;
MovieClip(_local7).buttonMode = this._buttonMode;
_local7.visible = false;
MovieClip(_local7).stop();
this.clothes.push(_local7);
};
_local6++;
};
if (this._canDisapear){
_local6 = 0;
while (_local6 < this.clothes.length) {
this.clothes[_local6].addEventListener(MouseEvent.CLICK, this.onChildClick);
_local6++;
};
};
}
public function get currentVisible():MovieClip{
return (this._currentVisible);
}
public function set buttonMode(_arg1:Boolean):void{
var _local3:MovieClip;
this._buttonMode = _arg1;
this.content.useHandCursor = this._useHandCursor;
var _local2:int;
while (_local2 < this.clothes.length) {
_local3 = this.clothes[_local2];
_local3.buttonMode = this._buttonMode;
_local2++;
};
}
public function setPrevVisible(_arg1:Boolean=true):MovieClip{
if (this._currentVisibleIndex == -1){
this.setVisibleByIndex((this.clothes.length - 1), _arg1);
return (this._currentVisible);
};
if (!this._currentVisible){
this.setVisibleByIndex(this._currentVisibleIndex, _arg1);
} else {
if ((((this._currentVisibleIndex == 0)) && (this._canDisapear))){
this.turnOffCurrentVisible();
this._currentVisibleIndex = (this.clothes.length - 1);
return (this._currentVisible);
};
if ((((this._currentVisibleIndex == 0)) && (!(this._canDisapear)))){
this.setVisibleByIndex((this.clothes.length - 1), _arg1);
return (this._currentVisible);
};
this.setVisibleByIndex((this._currentVisibleIndex - 1), _arg1);
};
return (this._currentVisible);
}
public function set currentVisibleIndex(_arg1:int):void{
this._currentVisibleIndex = _arg1;
}
public function get useHandCursor():Boolean{
return (this._useHandCursor);
}
private function onChildClick(_arg1:MouseEvent):void{
_arg1.currentTarget.visible = false;
this._currentVisible = null;
if (!this.eventsLocked){
this.game.dispatchEvent(new Event(DressupGame.EDIT_EVENT));
};
}
public function setDefaultVisibleByName(_arg1:String):void{
this._defaultVisible = this.setVisibleByName(_arg1);
}
public function setVisibleByName(_arg1:String, _arg2:Boolean=true):MovieClip{
var _local3:MovieClip = this.content[_arg1];
if (!_local3){
throw (new Error("element not found"));
};
this.setVisibleByInstance(_local3, _arg2);
return (this._currentVisible);
}
public function setVisibleByInstance(_arg1:MovieClip, _arg2:Boolean=true):MovieClip{
if (this.clothes.indexOf(_arg1) < 0){
throw (new Error(((((_arg1.toString() + " ") + _arg1.name) + " not found in ") + this.name)));
};
_arg1.visible = true;
if (((_arg2) && (this._currentVisible))){
this._currentVisible.visible = false;
};
this._currentVisible = _arg1;
this._currentVisible.play();
this._currentVisible.visible = true;
this._currentVisibleIndex = this.clothes.indexOf(_arg1);
this.game.dispatchEvent(new Event(DressupGame.EDIT_EVENT));
return (this._currentVisible);
}
public function setDefaultVisibleByInstance(_arg1:MovieClip):void{
this._defaultVisible = this.setVisibleByInstance(_arg1);
}
public function turnOffCurrentVisible():void{
if (!this._canDisapear){
return;
};
if (this._currentVisible){
this._currentVisible.visible = false;
this._currentVisible.stop();
this._currentVisible = null;
if (!this.eventsLocked){
this.game.dispatchEvent(new Event(DressupGame.EDIT_EVENT));
};
};
}
public function set canDisapear(_arg1:Boolean):void{
var _local2:int;
this._canDisapear = _arg1;
if (this._canDisapear){
_local2 = 0;
while (_local2 < this.clothes.length) {
this.clothes[_local2].addEventListener(MouseEvent.CLICK, this.onChildClick);
_local2++;
};
} else {
_local2 = 0;
while (_local2 < this.clothes.length) {
this.clothes[_local2].removeEventListener(MouseEvent.CLICK, this.onChildClick);
_local2++;
};
};
}
public function turnOnLastVisible():MovieClip{
if (this._currentVisibleIndex >= 0){
this.setVisibleByIndex(this._currentVisibleIndex);
};
return (this._currentVisible);
}
public function get canDisapear():Boolean{
return (this._canDisapear);
}
public function setVisibleByIndex(_arg1:int, _arg2:Boolean=true):MovieClip{
trace("setVisibleByIndex", _arg1);
var _local3:MovieClip = this.clothes[_arg1];
if (((_arg2) && (this.currentVisible))){
this.currentVisible.visible = false;
};
this._currentVisibleIndex = _arg1;
_local3.visible = true;
this._currentVisible = _local3;
this._currentVisible.play();
if (!this.eventsLocked){
this.game.dispatchEvent(new Event(DressupGame.EDIT_EVENT));
};
return (this._currentVisible);
}
public function get currentVisibleIndex():int{
return (this._currentVisibleIndex);
}
public function get buttonMode():Boolean{
return (this._buttonMode);
}
public function get defaultVisible():MovieClip{
return (this._defaultVisible);
}
public function set useHandCursor(_arg1:Boolean):void{
var _local3:MovieClip;
this._useHandCursor = _arg1;
this.content.useHandCursor = this._useHandCursor;
var _local2:int;
while (_local2 < this.clothes.length) {
_local3 = this.clothes[_local2];
_local3.useHandCursor = this._useHandCursor;
_local2++;
};
}
public function setNextVisible(_arg1:Boolean=true):MovieClip{
trace(this._currentVisibleIndex);
if (this._currentVisibleIndex == -1){
this.setVisibleByIndex(0, _arg1);
return (this._currentVisible);
};
if (!this._currentVisible){
this.setVisibleByIndex(this._currentVisibleIndex, _arg1);
} else {
if ((((this._currentVisibleIndex == (this.clothes.length - 1))) && (this._canDisapear))){
this.turnOffCurrentVisible();
this._currentVisibleIndex = 0;
return (this._currentVisible);
};
if ((((this._currentVisibleIndex == (this.clothes.length - 1))) && (!(this._canDisapear)))){
this.setVisibleByIndex(0, _arg1);
return (this._currentVisible);
};
this.setVisibleByIndex((this._currentVisibleIndex + 1), _arg1);
};
return (this._currentVisible);
}
public function setDefaultVisibleFirstElement():void{
var _local1:DisplayObject = this.clothes[0];
this.setDefaultVisibleByInstance((_local1 as MovieClip));
}
}
}//package com.girlgames.dressup
Section 21
//DressupGame (com.girlgames.dressup.DressupGame)
package com.girlgames.dressup {
import flash.display.*;
import com.girlgames.dressup.api.*;
public class DressupGame extends Sprite {
public var skipClips:Array;
public var WIDTH:Number;
public var HEIGHT:Number;
public var clothes:Array;
public var character:MovieClip;
public var edited:Boolean;// = false
private var _editEventLocked:Boolean;// = false
public static const EDIT_EVENT:String = "dressup_edit_event";
public function DressupGame(_arg1:Number, _arg2:Number){
this.clothes = new Array();
this.skipClips = new Array();
super();
this.WIDTH = _arg1;
this.HEIGHT = _arg2;
}
private function checkChildren(_arg1:MovieClip):void{
var _local3:DisplayObject;
var _local2:int;
while (_local2 < _arg1.numChildren) {
_local3 = _arg1.getChildAt(_local2);
if ((((_local3.name.indexOf("instance") >= 0)) && ((_local3 is MovieClip)))){
throw (new Error((("MovieClip: \"" + _arg1.name) + "\" , children have dynamic names")));
};
_local2++;
};
}
private function checkCharacter(_arg1:MovieClip):void{
var _local3:DisplayObject;
var _local2:int;
while (_local2 < _arg1.numChildren) {
_local3 = _arg1.getChildAt(_local2);
if (((((((_local3.name) && ((_local3.name.indexOf("instance") < 0)))) && ((_local3 is MovieClip)))) && ((this.skipClips.indexOf(_local3) < 0)))){
this.checkChildren((_local3 as MovieClip));
};
_local2++;
};
}
public function getClothesByName(_arg1:String):Clothes{
var _local2:Clothes = this.clothes[_arg1];
if (!_local2){
throw (new Error((("Clothes \"" + _arg1) + "\" not found")));
};
return (_local2);
}
public function initApi(_arg1:Stage, _arg2:Object=null, _arg3:MovieClip=null):void{
StateSaver.instance.initialize(_arg1, this.character, this);
var _local4:ApiUI = new ApiUI(_arg1, this, StateSaver.instance, _arg2);
}
public function set editEventLocked(_arg1:Boolean):void{
var _local2:Clothes;
this._editEventLocked = _arg1;
for each (_local2 in this.clothes) {
_local2.eventsLocked = this._editEventLocked;
};
}
public function addClothes(_arg1:Clothes):void{
this.clothes[_arg1.name] = _arg1;
trace("clothe addd=", _arg1.name);
}
public function get editEventLocked():Boolean{
return (this._editEventLocked);
}
public function skipClip(... _args):void{
var _local2:MovieClip;
for each (_local2 in _args) {
this.skipClips.push(_local2);
};
}
public function init(_arg1:MovieClip):void{
this.character = _arg1;
this.checkCharacter(this.character);
}
}
}//package com.girlgames.dressup
Section 22
//MousePointer (com.girlgames.dressup.MousePointer)
package com.girlgames.dressup {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.ui.*;
public class MousePointer {
private static var _list:Dictionary = new Dictionary(true);
private static var _icon:MovieClip;
private static var _stage:Stage;
private static function update():void{
_icon.x = _stage.mouseX;
_icon.y = _stage.mouseY;
}
private static function onSpriteDown(_arg1:MouseEvent):void{
var _local2:DisplayObject = DisplayObject(_arg1.currentTarget);
if (_icon){
_icon.gotoAndStop(2);
};
}
private static function onSpriteOver(_arg1:MouseEvent):void{
var _local2:SpriteInfo = _list[_arg1.currentTarget];
setIconClass(_local2.iconClass, _local2.hideMouse);
}
public static function resetIcon():void{
if (_icon){
_stage.removeChild(_icon);
_stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_icon = null;
};
Mouse.show();
}
public static function registerObject(_arg1:DisplayObject, _arg2:Class, _arg3:Boolean=true):void{
var _local4:SpriteInfo = new SpriteInfo();
_local4.iconClass = _arg2;
_local4.hideMouse = _arg3;
_arg1.addEventListener(MouseEvent.MOUSE_OVER, onSpriteOver);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, onSpriteOut);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, onSpriteDown);
_arg1.addEventListener(MouseEvent.MOUSE_UP, onSpriteUp);
if (_arg1.hitTestPoint(_stage.mouseX, _stage.mouseY, true)){
setIconClass(_local4.iconClass, _local4.hideMouse);
};
_list[_arg1] = _local4;
}
public static function setIcon(_arg1:MovieClip, _arg2:Boolean=true):void{
resetIcon();
_icon = _arg1;
_icon.mouseEnabled = false;
_icon.mouseChildren = false;
_icon.stop();
_stage.addChild(_icon);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
if (_arg2){
Mouse.hide();
};
update();
}
private static function onSpriteUp(_arg1:MouseEvent):void{
var _local2:DisplayObject = DisplayObject(_arg1.currentTarget);
if (_icon){
_icon.gotoAndStop(1);
};
}
private static function onMouseMove(_arg1:MouseEvent):void{
update();
_arg1.updateAfterEvent();
}
private static function onSpriteOut(_arg1:MouseEvent):void{
resetIcon();
}
public static function init(_arg1:Stage):void{
_stage = _arg1;
}
public static function unRegisterObject(_arg1:DisplayObject):void{
_arg1.removeEventListener(MouseEvent.MOUSE_OVER, onSpriteOver);
_arg1.removeEventListener(MouseEvent.MOUSE_OUT, onSpriteOut);
delete _list[_arg1];
}
public static function set stage(_arg1:Stage):void{
_stage = _arg1;
}
public static function setIconClass(_arg1:Class, _arg2:Boolean=true):void{
var _local3:MovieClip = new (_arg1);
setIcon(_local3, _arg2);
}
}
}//package com.girlgames.dressup
class SpriteInfo {
public var hideMouse:Boolean;
public var iconClass:Class;
private function SpriteInfo(){
}
}
Section 23
//mcGGLogoAnim_8 (ControlPanel_fla.mcGGLogoAnim_8)
package ControlPanel_fla {
import flash.display.*;
public dynamic class mcGGLogoAnim_8 extends MovieClip {
public function mcGGLogoAnim_8(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package ControlPanel_fla
Section 24
//ToolBar (gemslibe.debug.utils.console.ToolBar)
package gemslibe.debug.utils.console {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import gemslibe.debug.utils.*;
public class ToolBar extends Sprite {
private var drag:Boolean;// = false
private var bg:Sprite;
private var console:Console;
private var marker:Sprite;
public function ToolBar(_arg1:Console){
this.bg = new Sprite();
this.marker = new Sprite();
super();
this.console = _arg1;
addChild(this.bg);
this.bg.graphics.beginFill(0, 0.9);
this.bg.graphics.drawRect(0, 0, _arg1.stage.stageWidth, 10);
this.bg.graphics.endFill();
this.marker.graphics.beginFill(0, 0.9);
this.marker.graphics.drawRect(0, 0, _arg1.stage.stageWidth, 10);
this.marker.graphics.endFill();
this.bg.addEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDown);
_arg1.stage.addEventListener(MouseEvent.MOUSE_UP, this.onMouseUp);
}
private function onMouseUp(_arg1:MouseEvent):void{
if (this.drag){
this.marker.stopDrag();
this.console.setHeight(this.marker.y);
this.console.stage.removeChild(this.marker);
};
this.drag = false;
}
private function onMouseDown(_arg1:MouseEvent):void{
this.marker.startDrag(false, new Rectangle(0, 0, 0, (this.console.stage.stageHeight - this.height)));
this.console.stage.addChild(this.marker);
this.marker.y = (this.console.stage.mouseY - this.mouseY);
this.drag = true;
}
}
}//package gemslibe.debug.utils.console
Section 25
//Console (gemslibe.debug.utils.Console)
package gemslibe.debug.utils {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import gemslibe.debug.utils.console.*;
import flash.system.*;
import flash.ui.*;
import flash.profiler.*;
public class Console extends Sprite {
private var msk:Sprite;
private var masked:Sprite;
private var f2:TextFormat;
private var f3:TextFormat;
private var f1:TextFormat;
private var bar:ToolBar;
private var history:ArrayedQueue;
private var functions:HashMap;
private var linecount:int;// = 0
private var f_print:TextFormat;
private var background:Sprite;
private var fpsWin:FpsWin;
private var historyID:int;// = 0
private var enabled:Boolean;
private var input:TextField;
private var console:TextField;
private var shoeRedrawRegions:Boolean;// = false
private var flashTraces:Boolean;
private var fps:Boolean;// = false
private var cHeight:Number;// = 120
private var numbering:TextField;
public function Console(_arg1:Stage, _arg2:Boolean=false){
this.background = new Sprite();
this.msk = new Sprite();
this.masked = new Sprite();
this.console = new TextField();
this.input = new TextField();
this.numbering = new TextField();
this.f1 = new TextFormat();
this.f2 = new TextFormat();
this.f3 = new TextFormat();
this.f_print = new TextFormat();
this.functions = new HashMap();
this.history = new ArrayedQueue(2);
super();
var _local3:Stage = _arg1;
_local3.addEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown);
_local3.addEventListener(Event.RESIZE, this.onResize);
_local3.addChild(this);
this.flashTraces = _arg2;
this.disable();
this.addChild(this.background);
this.addChild(this.input);
this.addChild(this.masked);
this.masked.addChild(this.console);
this.masked.addChild(this.numbering);
this.bar = new ToolBar(this);
this.addChild(this.bar);
this.setHeight(120);
this.setUpTextfields();
this.redraw();
this.addEventListener(MouseEvent.MOUSE_WHEEL, this.onMouseWheel);
this.print("Type \"-help\" for a list of available commands");
}
public function enable():void{
this.visible = true;
this.enabled = true;
}
private function scrollDown():void{
if ((this.console.y + this.console.height) > this.background.height){
this.console.y = (this.console.y - 56);
this.numbering.y = (this.numbering.y - 56);
};
}
private function exec():void{
var _local1:Array = this.input.text.substr(2, this.input.text.length).split(" ");
var _local2:String = _local1[0];
var _local3:String = _local1[1];
var _local4:String = _local1[2];
var _local5:String = _local1[3];
switch (_local2){
case "-c":
case "-clear":
this.console.text = "";
this.numbering.text = "";
this.linecount = 0;
this.print("Type \"-help\" for a list of available commands");
break;
case "-h":
case "-help":
this.write();
this.print("");
this.print(" Available Commands ");
this.print("------------------------------------------------------------------------------------------------------------------------");
this.print(" -fps show fps and used memory");
this.print(" -sysmon enables system monitor for watching fps and used memory");
this.print(" -srr show redraw regions");
this.print(" -framerate [value] set frame rate");
this.print(" -help -h displays this information");
this.print(" -clear -c clears the list");
this.print(" -copy copyright");
this.print(" -sys gets system information");
this.print("");
this.print(" Use \"PageUp\" & \"PageDown\" on the keyboard to scroll the list");
this.print("");
break;
case "-srr":
this.shoeRedrawRegions = !(this.shoeRedrawRegions);
showRedrawRegions(this.shoeRedrawRegions);
break;
case "-copy":
this.write();
this.print("Copyright (c) 2009 GemsLibe inc. http://gemslibe.com");
break;
case "-sys":
this.write();
this.print("");
this.print(" System Information ");
this.print("------------------------------------------------------------------------------------------------------------------------");
this.print((" Language: " + Capabilities.language));
this.print((" OS: " + Capabilities.os));
this.print((" Pixel aspect ratio: " + Capabilities.pixelAspectRatio));
this.print((" Player type: " + Capabilities.playerType));
this.print((" Screen DPI: " + Capabilities.screenDPI));
this.print((((" Screen resolution: " + Capabilities.screenResolutionX) + " x ") + Capabilities.screenResolutionY));
this.print((" Version: " + Capabilities.version));
this.print((" Debugger: " + Capabilities.isDebugger));
this.print("");
this.print(((" Memory usage: " + (System.totalMemory / 0x0400)) + " Kb"));
this.print("");
break;
case "-fps":
this.showFps();
break;
case "-sysmon":
SystemMonitor.init(this);
SystemMonitor.show();
break;
case "-framerate":
if (_local3){
this.stage.frameRate = parseFloat(_local3);
};
break;
default:
this.write();
if (_local2 != ""){
if (this.functions.containsKey(_local2)){
if (!_local3){
var _local6 = this.functions;
_local6[_local2]();
} else {
_local6 = this.functions;
_local6[_local2](_local3.split(","));
};
} else {
this.print((_local2 + ": command not recognized"));
};
};
break;
};
this.historyAdd(this.input.text);
this.historyID = -1;
this.input.text = "] ";
this.update();
}
public function setHeight(_arg1:Number):void{
this.cHeight = _arg1;
this.bar.y = _arg1;
this.scrollRect = new Rectangle(0, 0, stage.stageWidth, (_arg1 + this.bar.height));
this.redraw();
}
public function register(_arg1:Function, _arg2:String):void{
this.functions.put(_arg2, _arg1);
}
public function print(... _args):void{
var _local3:String;
var _local4:*;
var _local5:int;
var _local6:int;
this.linecount++;
this.numbering.appendText((this.linecount + "\n"));
var _local2 = "] ";
for each (_local4 in _args) {
if (_local4 == null){
_local3 = "null";
} else {
if (_local4 == undefined){
_local3 = "undefined";
} else {
_local3 = _local4.toString();
};
};
_local2 = (_local2 + (_local3 + ", "));
};
_local2 = _local2.substring(0, (_local2.length - 2));
_local2 = (_local2 + "\n");
_local5 = this.console.length;
_local6 = (_local5 + _local2.length);
this.console.appendText(_local2);
this.console.setTextFormat(this.f_print, _local5, _local6);
this.update();
if (this.flashTraces){
trace(_args);
};
}
private function setUpTextfields():void{
this.f1.font = "_sans";
this.f1.color = 0xFCC000;
this.f1.bold = true;
this.f1.size = 11;
this.input.type = "dynamic";
this.input.multiline = false;
this.input.defaultTextFormat = this.f1;
this.input.text = "] ";
this.f2.font = "_sans";
this.f2.color = 8439036;
this.f2.bold = false;
this.f2.size = 11;
this.console.type = "dynamic";
this.console.multiline = true;
this.console.autoSize = TextFieldAutoSize.LEFT;
this.console.defaultTextFormat = this.f2;
this.console.setTextFormat(this.f2);
this.f3.font = "_sans";
this.f3.color = 0x555555;
this.f3.size = 11;
this.f3.bold = false;
this.f3.align = "right";
this.numbering.type = "dynamic";
this.numbering.selectable = false;
this.numbering.multiline = true;
this.numbering.autoSize = TextFieldAutoSize.RIGHT;
this.numbering.defaultTextFormat = this.f3;
this.numbering.x = 36;
this.f_print.font = "_sans";
this.f_print.color = 0xCCCCCC;
this.f_print.size = 11;
this.f_print.bold = false;
}
private function showFps():void{
if (!this.fps){
this.fpsWin = new FpsWin();
stage.addChild(this.fpsWin);
} else {
this.fpsWin.destroy();
};
this.fps = !(this.fps);
}
public function unregister(_arg1):void{
if (getQualifiedSuperclassName(_arg1) == "Function"){
this.functions.remove(this.functions.getKey(_arg1));
} else {
this.functions.remove(_arg1);
};
}
private function onKeyDown(_arg1:KeyboardEvent):void{
var _local2 = "";
if (_arg1.charCode != 0){
if (_arg1.ctrlKey){
_local2 = (_local2 + "CTRL + ");
};
if (_arg1.altKey){
_local2 = (_local2 + "ALT + ");
};
if (_arg1.shiftKey){
_local2 = (_local2 + "SHIFT + ");
};
_local2 = (_local2 + _arg1.charCode.toString());
};
if (_arg1.keyCode == Keyboard.F2){
if (this.enabled){
this.disable();
} else {
this.enable();
};
return;
};
switch (_local2){
case "CTRL + SHIFT + 126":
if (this.enabled){
this.disable();
} else {
this.enable();
};
break;
case "13":
if (this.enabled){
this.exec();
};
break;
case "8":
if (((this.enabled) && ((this.input.text.length > 2)))){
this.input.text = this.input.text.substr(0, (this.input.text.length - 1));
};
break;
case "27":
if (this.enabled){
this.disable();
};
break;
default:
if (this.enabled){
if (_arg1.keyCode == 33){
this.scrollUp();
} else {
if (_arg1.keyCode == 34){
this.scrollDown();
};
};
if (_arg1.keyCode == 38){
this.historyUp();
} else {
if (_arg1.keyCode == 40){
this.historyDown();
};
};
this.input.appendText(String.fromCharCode(_arg1.charCode));
};
break;
};
}
private function scrollUp():void{
if ((this.console.y + 56) <= this.background.height){
this.console.y = (this.console.y + 56);
this.numbering.y = (this.numbering.y + 56);
};
}
private function historyUp():void{
if (this.historyID < (this.history.size - 1)){
this.historyID++;
this.input.text = this.history.getAt(((this.history.size - 1) - this.historyID));
};
}
private function update():void{
var _local1:RegExp;
var _local2:RegExp;
if (this.console.numLines >= 1000){
_local1 = /(^]\s.*\s*)/g;
this.console.text = this.console.text.replace(_local1, "");
_local2 = /(^.*\s*)/g;
this.numbering.text = this.numbering.text.replace(_local2, "");
};
this.console.y = ((this.background.height - this.console.textHeight) - 22);
this.numbering.y = ((this.background.height - this.numbering.textHeight) - 22);
}
private function historyDown():void{
if (this.historyID > 0){
this.historyID--;
this.input.text = this.history.getAt(((this.history.size - 1) - this.historyID));
};
}
private function write():void{
this.linecount++;
this.numbering.appendText((this.linecount + "\n"));
var _local1 = (this.input.text + "\n");
var _local2:int = this.console.length;
var _local3:int = (_local2 + _local1.length);
this.console.appendText(_local1);
this.console.setTextFormat(this.f2, _local2, _local3);
}
public function disable():void{
this.visible = false;
this.enabled = false;
}
private function historyAdd(_arg1:String):void{
if (this.history.size == (this.history.maxSize - 1)){
this.history.dequeue();
this.history.dispose();
this.history.enqueue(_arg1);
} else {
this.history.enqueue(_arg1);
};
}
private function onResize(_arg1:Event):void{
this.redraw();
}
private function onMouseWheel(_arg1:MouseEvent):void{
if (_arg1.delta > 0){
this.scrollUp();
} else {
this.scrollDown();
};
}
private function redraw():void{
var w:Number = stage.stageWidth;
var h:Number = stage.stageHeight;
var _local2 = this.background.graphics;
with (_local2) {
clear();
beginFill(0, 0.8);
drawRect(0, 0, w, cHeight);
endFill();
beginFill(0, 1);
drawRect(0, 0, 40, cHeight);
endFill();
};
_local2 = this.msk.graphics;
with (_local2) {
clear();
beginFill(0, 0.9);
drawRect(0, 4, w, cHeight);
endFill();
};
this.input.width = (w - 52);
this.input.height = 18;
this.input.x = 46;
this.input.y = (this.background.height - 20);
this.console.width = (w - 52);
this.console.x = 46;
this.console.y = 0;
this.console.cacheAsBitmap = false;
this.numbering.y = 0;
this.numbering.cacheAsBitmap = false;
this.msk.cacheAsBitmap = false;
this.masked.mask = this.msk;
this.update();
}
}
}//package gemslibe.debug.utils
class ArrayedQueue {
private var _size:int;
private var _que:Array;
private var _front:int;
private var _count:int;
private var _divisor:int;
private function ArrayedQueue(_arg1:int){
if (_arg1 < 3){
_arg1 = 3;
};
this._size = (1 << _arg1);
this._divisor = (this._size - 1);
this.clear();
}
public function get size():int{
return (this._count);
}
public function isEmpty():Boolean{
return ((this._count == 0));
}
public function get maxSize():int{
return (this._size);
}
public function dispose():void{
if (!this._front){
this._que[int((this._size - 1))] = null;
} else {
this._que[int((this._front - 1))] = null;
};
}
public function enqueue(_arg1):Boolean{
if (this._size != this._count){
this._que[int(((this._count++ + this._front) & this._divisor))] = _arg1;
return (true);
};
return (false);
}
public function getAt(_arg1:int){
if (_arg1 >= this._count){
return (null);
};
return (this._que[int(((_arg1 + this._front) & this._divisor))]);
}
public function toString():String{
return ((("[ArrayedQueue, size=" + this.size) + "]"));
}
public function clear():void{
this._que = new Array(this._size);
this._front = (this._count = 0);
}
public function contains(_arg1):Boolean{
var _local2:int;
while (_local2 < this._count) {
if (this._que[int(((_local2 + this._front) & this._divisor))] === _arg1){
return (true);
};
_local2++;
};
return (false);
}
public function setAt(_arg1:int, _arg2):void{
if (_arg1 >= this._count){
return;
};
this._que[int(((_arg1 + this._front) & this._divisor))] = _arg2;
}
public function dequeue(){
var _local1:*;
if (this._count > 0){
_local1 = this._que[this._front++];
if (this._front == this._size){
this._front = 0;
};
this._count--;
return (_local1);
};
return (null);
}
public function peek(){
return (this._que[this._front]);
}
}
Section 26
//FpsWin (gemslibe.debug.utils.FpsWin)
package gemslibe.debug.utils {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.system.*;
public dynamic class FpsWin extends Sprite {
private var s:int;
private var timer:Timer;
private var f1:TextFormat;
private var f2:TextFormat;
private var startTime:Number;
private var fpsField:TextField;
private var numFrames:Number;// = 0
private var memField:TextField;
private var cnt:int;// = 0
private var t:int;
public function FpsWin(){
this.f1 = new TextFormat();
this.f2 = new TextFormat();
this.timer = new Timer(500);
this.startTime = getTimer();
super();
var _local2 = this.graphics;
with (_local2) {
beginFill(0, 0.7);
drawRect(0, 0, 60, 40);
endFill();
};
this.fpsField = new TextField();
this.memField = new TextField();
this.f1.font = "_sans";
this.f1.color = 0xCC00;
this.f1.bold = true;
this.f1.size = 11;
this.f2.font = "_sans";
this.f2.color = 1035264;
this.f2.bold = true;
this.f2.size = 11;
this.fpsField.type = "dynamic";
this.fpsField.multiline = false;
this.fpsField.defaultTextFormat = this.f1;
this.fpsField.text = "";
this.fpsField.selectable = false;
this.memField.type = "dynamic";
this.memField.multiline = false;
this.memField.defaultTextFormat = this.f2;
this.memField.text = "";
this.memField.selectable = false;
this.memField.y = 20;
this.memField.x = 5;
this.fpsField.x = 5;
this.fpsField.y = 2;
this.addChild(this.memField);
this.addChild(this.fpsField);
this.timer.addEventListener(TimerEvent.TIMER, this.onTick);
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
this.timer.start();
this.addEventListener(MouseEvent.MOUSE_DOWN, this.onDown);
this.addEventListener(MouseEvent.MOUSE_UP, this.onUp);
this.t = getTimer();
}
private function onUp(_arg1:Event):void{
this.stopDrag();
}
private function onTick(_arg1:Event):void{
this.memField.text = ((System.totalMemory / 0x0400) + " Kb");
}
private function onDown(_arg1:Event):void{
this.startDrag();
}
private function onEnterFrame(_arg1:Event):void{
this.s++;
if (!(this.s = (this.s % stage.frameRate))){
this.fpsField.text = ((("fps: " + Math.round(((stage.frameRate * 1000) / (getTimer() - this.t)))) + "/") + stage.frameRate);
this.t = getTimer();
};
}
public function destroy():void{
this.timer.stop();
this.timer.removeEventListener(TimerEvent.TIMER, this.onTick);
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
this.removeEventListener(MouseEvent.MOUSE_DOWN, this.onDown);
this.removeEventListener(MouseEvent.MOUSE_UP, this.onUp);
this.parent.removeChild(this);
}
}
}//package gemslibe.debug.utils
Section 27
//HashMap (gemslibe.debug.utils.HashMap)
package gemslibe.debug.utils {
import flash.utils.*;
public dynamic class HashMap extends Dictionary implements IMap {
public function HashMap(_arg1:Boolean=true){
super(_arg1);
}
public function containsKey(_arg1:String):Boolean{
return (!((this[_arg1] == null)));
}
public function size():int{
var _local2:String;
var _local1:int;
for (_local2 in this) {
if (this[_local2] != null){
_local1++;
};
};
return (_local1);
}
public function isEmpty():Boolean{
var _local2:String;
var _local1:int;
for (_local2 in this) {
if (this[_local2] != null){
_local1++;
};
};
return ((_local1 <= 0));
}
public function remove(_arg1:String):void{
this[_arg1] = null;
}
public function clear():void{
var _local1:String;
for (_local1 in this) {
this[_local1] = null;
};
}
public function put(_arg1:String, _arg2):void{
this[_arg1] = _arg2;
}
public function getKey(_arg1):String{
var _local2:String;
for (_local2 in this) {
if (this[_local2] == _arg1){
return (_local2);
};
};
return (null);
}
public function containsValue(_arg1):Boolean{
var _local2:String;
for (_local2 in this) {
if (this[_local2] == _arg1){
return (true);
};
};
return (false);
}
public function getValue(_arg1:String){
if (this[_arg1] != null){
return (this[_arg1]);
};
}
}
}//package gemslibe.debug.utils
Section 28
//IMap (gemslibe.debug.utils.IMap)
package gemslibe.debug.utils {
public interface IMap {
function containsKey(_arg1:String):Boolean;
function size():int;
function containsValue(_arg1):Boolean;
function isEmpty():Boolean;
function remove(_arg1:String):void;
function getKey(_arg1):String;
function getValue(_arg1:String);
function clear():void;
function put(_arg1:String, _arg2):void;
}
}//package gemslibe.debug.utils
Section 29
//SystemMonitor (gemslibe.debug.utils.SystemMonitor)
package gemslibe.debug.utils {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class SystemMonitor {
public static var started:Boolean = false;
private static var initTime:int;
public static var memList:Array = [];
public static var history:int = 60;
private static var itvTime:int;
public static var minMem:Number;
public static var fpsList:Array = [];
private static var frameCount:int;
private static var totalCount:int;
public static var inited:Boolean = false;
public static var minFps:Number;
public static var maxMem:Number;
public static var refreshRate:Number = 1;
public static var displayed:Boolean = false;
public static var maxFps:Number;
private static var currentTime:int;
private static var frame:Sprite;
private static var content:MonContent;
private static var stage:Stage;
private static function addEvent(_arg1:EventDispatcher, _arg2:String, _arg3:Function):void{
_arg1.addEventListener(_arg2, _arg3, false, 0, true);
}
public static function stop():void{
if (!started){
return;
};
started = false;
removeEvent(frame, Event.ENTER_FRAME, draw);
}
public static function get averageFps():Number{
return ((totalCount / runningTime));
}
public static function init(_arg1:InteractiveObject):void{
if (inited){
return;
};
inited = true;
stage = _arg1.stage;
content = new MonContent();
frame = new Sprite();
minFps = Number.MAX_VALUE;
maxFps = Number.MIN_VALUE;
minMem = Number.MAX_VALUE;
maxMem = Number.MIN_VALUE;
start();
}
public static function get currentMem():Number{
return (((System.totalMemory / 0x0400) / 1000));
}
private static function get runningTime():Number{
return (((currentTime - initTime) / 1000));
}
private static function get intervalTime():Number{
return (((currentTime - itvTime) / 1000));
}
private static function updateDisplay():void{
updateMinMax();
content.update(runningTime, minFps, maxFps, minMem, maxMem, currentFps, currentMem, averageFps, fpsList, memList, history);
}
public static function get currentFps():Number{
return ((frameCount / intervalTime));
}
public static function hide():void{
displayed = false;
stage.removeChild(content);
}
private static function draw(_arg1:Event=null):void{
currentTime = getTimer();
frameCount++;
totalCount++;
if (intervalTime >= refreshRate){
if (displayed){
updateDisplay();
} else {
updateMinMax();
};
fpsList.unshift(currentFps);
memList.unshift(currentMem);
if (fpsList.length > history){
fpsList.pop();
};
if (memList.length > history){
memList.pop();
};
itvTime = currentTime;
frameCount = 0;
};
}
public static function gc():void{
try {
System.gc();
new LocalConnection().connect("foo");
new LocalConnection().connect("foo");
} catch(e:Error) {
};
}
public static function start():void{
if (started){
return;
};
started = true;
initTime = (itvTime = getTimer());
totalCount = (frameCount = 0);
addEvent(frame, Event.ENTER_FRAME, draw);
}
private static function updateMinMax():void{
if (!(currentFps > 0)){
return;
};
minFps = Math.min(currentFps, minFps);
maxFps = Math.max(currentFps, maxFps);
minMem = Math.min(currentMem, minMem);
maxMem = Math.max(currentMem, maxMem);
}
private static function removeEvent(_arg1:EventDispatcher, _arg2:String, _arg3:Function):void{
_arg1.removeEventListener(_arg2, _arg3);
}
public static function show():void{
displayed = true;
stage.addChild(content);
updateDisplay();
}
}
}//package gemslibe.debug.utils
import flash.events.*;
import flash.display.*;
import flash.text.*;
class MonContent extends Sprite {
private var maxFpsTxtBx:TextField;
private var minMemTxtBx:TextField;
private var fps:Shape;
private var box:Shape;
private var minFpsTxtBx:TextField;
private var maxMemTxtBx:TextField;
private var infoTxtBx:TextField;
private var mb:Shape;
private function MonContent():void{
this.fps = new Shape();
this.mb = new Shape();
this.box = new Shape();
this.mouseChildren = false;
this.mouseEnabled = false;
this.fps.x = 65;
this.fps.y = 45;
this.mb.x = 65;
this.mb.y = 90;
var _local1:TextFormat = new TextFormat("_sans", 9, 0xAAAAAA);
this.infoTxtBx = new TextField();
this.infoTxtBx.autoSize = TextFieldAutoSize.LEFT;
this.infoTxtBx.defaultTextFormat = new TextFormat("_sans", 11, 0xCCCCCC);
this.infoTxtBx.y = 98;
this.minFpsTxtBx = new TextField();
this.minFpsTxtBx.autoSize = TextFieldAutoSize.LEFT;
this.minFpsTxtBx.defaultTextFormat = _local1;
this.minFpsTxtBx.x = 7;
this.minFpsTxtBx.y = 37;
this.maxFpsTxtBx = new TextField();
this.maxFpsTxtBx.autoSize = TextFieldAutoSize.LEFT;
this.maxFpsTxtBx.defaultTextFormat = _local1;
this.maxFpsTxtBx.x = 7;
this.maxFpsTxtBx.y = 5;
this.minMemTxtBx = new TextField();
this.minMemTxtBx.autoSize = TextFieldAutoSize.LEFT;
this.minMemTxtBx.defaultTextFormat = _local1;
this.minMemTxtBx.x = 7;
this.minMemTxtBx.y = 83;
this.maxMemTxtBx = new TextField();
this.maxMemTxtBx.autoSize = TextFieldAutoSize.LEFT;
this.maxMemTxtBx.defaultTextFormat = _local1;
this.maxMemTxtBx.x = 7;
this.maxMemTxtBx.y = 50;
addChild(this.box);
addChild(this.infoTxtBx);
addChild(this.minFpsTxtBx);
addChild(this.maxFpsTxtBx);
addChild(this.minMemTxtBx);
addChild(this.maxMemTxtBx);
addChild(this.fps);
addChild(this.mb);
this.addEventListener(Event.ADDED_TO_STAGE, this.added, false, 0, true);
this.addEventListener(Event.REMOVED_FROM_STAGE, this.removed, false, 0, true);
}
private function added(_arg1:Event):void{
this.resize();
stage.addEventListener(Event.RESIZE, this.resize, false, 0, true);
}
private function removed(_arg1:Event):void{
stage.removeEventListener(Event.RESIZE, this.resize);
}
private function resize(_arg1:Event=null):void{
var _local2:Graphics = this.box.graphics;
_local2.clear();
_local2.beginFill(0, 0.5);
_local2.drawRect(0, 0, stage.stageWidth, 120);
_local2.lineStyle(1, 0xFFFFFF, 0.2);
_local2.moveTo(65, 45);
_local2.lineTo(65, 10);
_local2.moveTo(65, 45);
_local2.lineTo((stage.stageWidth - 15), 45);
_local2.moveTo(65, 90);
_local2.lineTo(65, 55);
_local2.moveTo(65, 90);
_local2.lineTo((stage.stageWidth - 15), 90);
_local2.endFill();
this.infoTxtBx.x = ((stage.stageWidth - this.infoTxtBx.width) - 20);
}
public function update(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Array, _arg10:Array, _arg11:int):void{
var _local19:Number;
if (_arg1 >= 1){
this.minFpsTxtBx.text = (_arg2.toFixed(3) + " Fps");
this.maxFpsTxtBx.text = (_arg3.toFixed(3) + " Fps");
this.minMemTxtBx.text = (_arg4.toFixed(3) + " Mb");
this.maxMemTxtBx.text = (_arg5.toFixed(3) + " Mb");
};
this.infoTxtBx.text = (((((("Current Fps " + _arg6.toFixed(3)) + " | Average Fps ") + _arg8.toFixed(3)) + " | Memory Used ") + _arg7.toFixed(3)) + " Mb");
this.infoTxtBx.x = ((stage.stageWidth - this.infoTxtBx.width) - 20);
var _local12:Graphics = this.fps.graphics;
_local12.clear();
_local12.lineStyle(1, 0x33FF00, 0.7);
var _local13:int;
var _local14:int = _arg9.length;
var _local15 = 35;
var _local16:int = (stage.stageWidth - 80);
var _local17:Number = (_local16 / (_arg11 - 1));
var _local18:Number = (_arg3 - _arg2);
_local13 = 0;
while (_local13 < _local14) {
_local19 = ((_arg9[_local13] - _arg2) / _local18);
if (_local13 == 0){
_local12.moveTo(0, (-(_local19) * _local15));
} else {
_local12.lineTo((_local13 * _local17), (-(_local19) * _local15));
};
_local13++;
};
_local12 = this.mb.graphics;
_local12.clear();
_local12.lineStyle(1, 26367, 0.7);
_local13 = 0;
_local14 = _arg10.length;
_local18 = (_arg5 - _arg4);
_local13 = 0;
while (_local13 < _local14) {
_local19 = ((_arg10[_local13] - _arg4) / _local18);
if (_local13 == 0){
_local12.moveTo(0, (-(_local19) * _local15));
} else {
_local12.lineTo((_local13 * _local17), (-(_local19) * _local15));
};
_local13++;
};
}
}
Section 30
//buttonCelebrityAnim_47 (Girl_fla.buttonCelebrityAnim_47)
package Girl_fla {
import flash.display.*;
public dynamic class buttonCelebrityAnim_47 extends MovieClip {
public function buttonCelebrityAnim_47(){
addFrameScript(7, this.frame8);
}
function frame8(){
stop();
}
}
}//package Girl_fla
Section 31
//buttonJobsAnim_49 (Girl_fla.buttonJobsAnim_49)
package Girl_fla {
import flash.display.*;
public dynamic class buttonJobsAnim_49 extends MovieClip {
public function buttonJobsAnim_49(){
addFrameScript(7, this.frame8);
}
function frame8(){
stop();
}
}
}//package Girl_fla
Section 32
//buttonKidsAnim_45 (Girl_fla.buttonKidsAnim_45)
package Girl_fla {
import flash.display.*;
public dynamic class buttonKidsAnim_45 extends MovieClip {
public function buttonKidsAnim_45(){
addFrameScript(7, this.frame8);
}
function frame8(){
stop();
}
}
}//package Girl_fla
Section 33
//buttonMakeupAnim_39 (Girl_fla.buttonMakeupAnim_39)
package Girl_fla {
import flash.display.*;
public dynamic class buttonMakeupAnim_39 extends MovieClip {
public function buttonMakeupAnim_39(){
addFrameScript(7, this.frame8);
}
function frame8(){
stop();
}
}
}//package Girl_fla
Section 34
//buttonNewAnim_34 (Girl_fla.buttonNewAnim_34)
package Girl_fla {
import flash.display.*;
public dynamic class buttonNewAnim_34 extends MovieClip {
public function buttonNewAnim_34(){
addFrameScript(7, this.frame8);
}
function frame8(){
stop();
}
}
}//package Girl_fla
Section 35
//buttonPopularAnim_43 (Girl_fla.buttonPopularAnim_43)
package Girl_fla {
import flash.display.*;
public dynamic class buttonPopularAnim_43 extends MovieClip {
public function buttonPopularAnim_43(){
addFrameScript(7, this.frame8);
}
function frame8(){
stop();
}
}
}//package Girl_fla
Section 36
//buttonWorldAnim_41 (Girl_fla.buttonWorldAnim_41)
package Girl_fla {
import flash.display.*;
public dynamic class buttonWorldAnim_41 extends MovieClip {
public function buttonWorldAnim_41(){
addFrameScript(7, this.frame8);
}
function frame8(){
stop();
}
}
}//package Girl_fla
Section 37
//mcButtonAnim_39 (Girl_fla.mcButtonAnim_39)
package Girl_fla {
import flash.display.*;
public dynamic class mcButtonAnim_39 extends MovieClip {
public function mcButtonAnim_39(){
addFrameScript(5, this.frame6);
}
function frame6(){
stop();
}
}
}//package Girl_fla
Section 38
//mcGGLogoAnim_36 (Girl_fla.mcGGLogoAnim_36)
package Girl_fla {
import flash.display.*;
public dynamic class mcGGLogoAnim_36 extends MovieClip {
public function mcGGLogoAnim_36(){
addFrameScript(8, this.frame9);
}
function frame9(){
stop();
}
}
}//package Girl_fla
Section 39
//mcIconCelebrityAnim_12 (Girl_fla.mcIconCelebrityAnim_12)
package Girl_fla {
import flash.display.*;
public dynamic class mcIconCelebrityAnim_12 extends MovieClip {
public function mcIconCelebrityAnim_12(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package Girl_fla
Section 40
//mcIconJobsAnim_7 (Girl_fla.mcIconJobsAnim_7)
package Girl_fla {
import flash.display.*;
public dynamic class mcIconJobsAnim_7 extends MovieClip {
public function mcIconJobsAnim_7(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package Girl_fla
Section 41
//mcIconKidsAnim_28 (Girl_fla.mcIconKidsAnim_28)
package Girl_fla {
import flash.display.*;
public dynamic class mcIconKidsAnim_28 extends MovieClip {
public function mcIconKidsAnim_28(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package Girl_fla
Section 42
//mcIconMakeupAnim_32 (Girl_fla.mcIconMakeupAnim_32)
package Girl_fla {
import flash.display.*;
public dynamic class mcIconMakeupAnim_32 extends MovieClip {
public function mcIconMakeupAnim_32(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package Girl_fla
Section 43
//mcIconNewAnim_19 (Girl_fla.mcIconNewAnim_19)
package Girl_fla {
import flash.display.*;
public dynamic class mcIconNewAnim_19 extends MovieClip {
public function mcIconNewAnim_19(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package Girl_fla
Section 44
//mcIconPopularAnim_24 (Girl_fla.mcIconPopularAnim_24)
package Girl_fla {
import flash.display.*;
public dynamic class mcIconPopularAnim_24 extends MovieClip {
public function mcIconPopularAnim_24(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package Girl_fla
Section 45
//mcIconWorldAnim_16 (Girl_fla.mcIconWorldAnim_16)
package Girl_fla {
import flash.display.*;
public dynamic class mcIconWorldAnim_16 extends MovieClip {
public function mcIconWorldAnim_16(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package Girl_fla
Section 46
//mcProgressBar_2 (Girl_fla.mcProgressBar_2)
package Girl_fla {
import flash.display.*;
public dynamic class mcProgressBar_2 extends MovieClip {
public function mcProgressBar_2(){
addFrameScript(99, this.frame100);
}
function frame100(){
stop();
}
}
}//package Girl_fla
Section 47
//playButtonAnim_9 (Girl_fla.playButtonAnim_9)
package Girl_fla {
import flash.display.*;
public dynamic class playButtonAnim_9 extends MovieClip {
public function playButtonAnim_9(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package Girl_fla
Section 48
//MultipartURLLoaderEvent (ru.inspirit.net.events.MultipartURLLoaderEvent)
package ru.inspirit.net.events {
import flash.events.*;
public class MultipartURLLoaderEvent extends Event {
public var bytesWritten:uint;// = 0
public var bytesTotal:uint;// = 0
public static const DATA_PREPARE_PROGRESS:String = "dataPrepareProgress";
public static const DATA_PREPARE_COMPLETE:String = "dataPrepareComplete";
public function MultipartURLLoaderEvent(_arg1:String, _arg2:uint=0, _arg3:uint=0){
super(_arg1);
bytesTotal = _arg3;
bytesWritten = _arg2;
}
}
}//package ru.inspirit.net.events
Section 49
//MultipartURLLoader (ru.inspirit.net.MultipartURLLoader)
package ru.inspirit.net {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import ru.inspirit.net.events.*;
import flash.errors.*;
public class MultipartURLLoader extends EventDispatcher {
private var _loader:URLLoader;
private var _boundary:String;
private var _variableNames:Array;
private var _fileNames:Array;
private var _variables:Dictionary;
private var _files:Dictionary;
private var _async:Boolean;// = false
private var _path:String;
private var _data:ByteArray;
private var _prepared:Boolean;// = false
private var asyncWriteTimeoutId:Number;
private var asyncFilePointer:uint;// = 0
private var totalFilesSize:uint;// = 0
private var writtenBytes:uint;// = 0
public var requestHeaders:Array;
protected var uploadResponse:Object;
public static const EVENT_UPLOAD_FINISHED:String = "EVENT_UPLOAD_FINISHED";
public static var BLOCK_SIZE:uint = 65536;
public function MultipartURLLoader(){
uploadResponse = {};
super();
_fileNames = new Array();
_files = new Dictionary();
_variableNames = new Array();
_variables = new Dictionary();
_loader = new URLLoader();
requestHeaders = new Array();
}
public function load(_arg1:String, _arg2:Boolean=false):void{
if ((((_arg1 == null)) || ((_arg1 == "")))){
throw (new IllegalOperationError("You cant load without specifing PATH"));
};
_path = _arg1;
_async = _arg2;
if (_async){
if (!_prepared){
constructPostDataAsync();
} else {
doSend();
};
} else {
_data = constructPostData();
doSend();
};
}
public function startLoad():void{
if ((((((_path == null)) || ((_path == "")))) || ((_async == false)))){
throw (new IllegalOperationError("You can use this method only if loading asynchronous."));
};
if (((!(_prepared)) && (_async))){
throw (new IllegalOperationError("You should prepare data before sending when using asynchronous."));
};
doSend();
}
public function prepareData():void{
constructPostDataAsync();
}
public function close():void{
try {
_loader.close();
} catch(e:Error) {
};
}
public function addVariable(_arg1:String, _arg2:Object=""):void{
if (_variableNames.indexOf(_arg1) == -1){
_variableNames.push(_arg1);
};
_variables[_arg1] = _arg2;
_prepared = false;
}
public function addFile(_arg1:ByteArray, _arg2:String, _arg3:String="Filedata", _arg4:String="application/octet-stream"):void{
var _local5:FilePart;
if (_fileNames.indexOf(_arg2) == -1){
_fileNames.push(_arg2);
_files[_arg2] = new FilePart(_arg1, _arg2, _arg3, _arg4);
totalFilesSize = (totalFilesSize + _arg1.length);
} else {
_local5 = (_files[_arg2] as FilePart);
totalFilesSize = (totalFilesSize - _local5.fileContent.length);
_local5.fileContent = _arg1;
_local5.fileName = _arg2;
_local5.dataField = _arg3;
_local5.contentType = _arg4;
totalFilesSize = (totalFilesSize + _arg1.length);
};
_prepared = false;
}
public function clearVariables():void{
_variableNames = new Array();
_variables = new Dictionary();
_prepared = false;
}
public function clearFiles():void{
var _local1:String;
for each (_local1 in _fileNames) {
(_files[_local1] as FilePart).dispose();
};
_fileNames = new Array();
_files = new Dictionary();
totalFilesSize = 0;
_prepared = false;
}
public function dispose():void{
clearInterval(asyncWriteTimeoutId);
removeListener();
close();
_loader = null;
_boundary = null;
_variableNames = null;
_variables = null;
_fileNames = null;
_files = null;
requestHeaders = null;
_data = null;
}
public function getBoundary():String{
var _local1:int;
if (_boundary == null){
_boundary = "";
_local1 = 0;
while (_local1 < 32) {
_boundary = (_boundary + String.fromCharCode(int((97 + (Math.random() * 25)))));
_local1++;
};
};
return (_boundary);
}
public function get ASYNC():Boolean{
return (_async);
}
public function get PREPARED():Boolean{
return (_prepared);
}
public function get dataFormat():String{
return (_loader.dataFormat);
}
public function set dataFormat(_arg1:String):void{
if (((((!((_arg1 == URLLoaderDataFormat.BINARY))) && (!((_arg1 == URLLoaderDataFormat.TEXT))))) && (!((_arg1 == URLLoaderDataFormat.VARIABLES))))){
throw (new IllegalOperationError("Illegal URLLoader Data Format"));
};
_loader.dataFormat = _arg1;
}
public function get loader():URLLoader{
return (_loader);
}
private function doSend():void{
var _local1:URLRequest = new URLRequest();
_local1.url = _path;
_local1.method = URLRequestMethod.POST;
_local1.data = _data;
_local1.requestHeaders.push(new URLRequestHeader("Content-type", ("multipart/form-data; boundary=" + getBoundary())));
if (requestHeaders.length){
_local1.requestHeaders = _local1.requestHeaders.concat(requestHeaders);
};
addListener();
_loader.load(_local1);
}
private function constructPostDataAsync():void{
clearInterval(asyncWriteTimeoutId);
_data = new ByteArray();
_data.endian = Endian.BIG_ENDIAN;
_data = constructVariablesPart(_data);
asyncFilePointer = 0;
writtenBytes = 0;
_prepared = false;
if (_fileNames.length){
nextAsyncLoop();
} else {
_data = closeDataObject(_data);
_prepared = true;
dispatchEvent(new MultipartURLLoaderEvent(MultipartURLLoaderEvent.DATA_PREPARE_COMPLETE));
};
}
private function constructPostData():ByteArray{
var _local1:ByteArray = new ByteArray();
_local1.endian = Endian.BIG_ENDIAN;
_local1 = constructVariablesPart(_local1);
_local1 = constructFilesPart(_local1);
_local1 = closeDataObject(_local1);
return (_local1);
}
private function closeDataObject(_arg1:ByteArray):ByteArray{
_arg1 = BOUNDARY(_arg1);
_arg1 = DOUBLEDASH(_arg1);
return (_arg1);
}
private function constructVariablesPart(_arg1:ByteArray):ByteArray{
var _local2:uint;
var _local3:String;
var _local4:String;
for each (_local4 in _variableNames) {
_arg1 = BOUNDARY(_arg1);
_arg1 = LINEBREAK(_arg1);
_local3 = (("Content-Disposition: form-data; name=\"" + _local4) + "\"");
_local2 = 0;
while (_local2 < _local3.length) {
_arg1.writeByte(_local3.charCodeAt(_local2));
_local2++;
};
_arg1 = LINEBREAK(_arg1);
_arg1 = LINEBREAK(_arg1);
_arg1.writeUTFBytes(_variables[_local4]);
_arg1 = LINEBREAK(_arg1);
};
return (_arg1);
}
private function constructFilesPart(_arg1:ByteArray):ByteArray{
var _local2:uint;
var _local3:String;
var _local4:String;
if (_fileNames.length){
for each (_local4 in _fileNames) {
_arg1 = getFilePartHeader(_arg1, (_files[_local4] as FilePart));
_arg1 = getFilePartData(_arg1, (_files[_local4] as FilePart));
if (_local2 != (_fileNames.length - 1)){
_arg1 = LINEBREAK(_arg1);
};
_local2++;
};
_arg1 = closeFilePartsData(_arg1);
};
return (_arg1);
}
private function closeFilePartsData(_arg1:ByteArray):ByteArray{
var _local2:uint;
var _local3:String;
_arg1 = LINEBREAK(_arg1);
_arg1 = BOUNDARY(_arg1);
_arg1 = LINEBREAK(_arg1);
_local3 = "Content-Disposition: form-data; name=\"Upload\"";
_local2 = 0;
while (_local2 < _local3.length) {
_arg1.writeByte(_local3.charCodeAt(_local2));
_local2++;
};
_arg1 = LINEBREAK(_arg1);
_arg1 = LINEBREAK(_arg1);
_local3 = "Submit Query";
_local2 = 0;
while (_local2 < _local3.length) {
_arg1.writeByte(_local3.charCodeAt(_local2));
_local2++;
};
_arg1 = LINEBREAK(_arg1);
return (_arg1);
}
private function getFilePartHeader(_arg1:ByteArray, _arg2:FilePart):ByteArray{
var _local3:uint;
var _local4:String;
_arg1 = BOUNDARY(_arg1);
_arg1 = LINEBREAK(_arg1);
_local4 = "Content-Disposition: form-data; name=\"Filename\"";
_local3 = 0;
while (_local3 < _local4.length) {
_arg1.writeByte(_local4.charCodeAt(_local3));
_local3++;
};
_arg1 = LINEBREAK(_arg1);
_arg1 = LINEBREAK(_arg1);
_arg1.writeUTFBytes(_arg2.fileName);
_arg1 = LINEBREAK(_arg1);
_arg1 = BOUNDARY(_arg1);
_arg1 = LINEBREAK(_arg1);
_local4 = (("Content-Disposition: form-data; name=\"" + _arg2.dataField) + "\"; filename=\"");
_local3 = 0;
while (_local3 < _local4.length) {
_arg1.writeByte(_local4.charCodeAt(_local3));
_local3++;
};
_arg1.writeUTFBytes(_arg2.fileName);
_arg1 = QUOTATIONMARK(_arg1);
_arg1 = LINEBREAK(_arg1);
_local4 = ("Content-Type: " + _arg2.contentType);
_local3 = 0;
while (_local3 < _local4.length) {
_arg1.writeByte(_local4.charCodeAt(_local3));
_local3++;
};
_arg1 = LINEBREAK(_arg1);
_arg1 = LINEBREAK(_arg1);
return (_arg1);
}
private function getFilePartData(_arg1:ByteArray, _arg2:FilePart):ByteArray{
_arg1.writeBytes(_arg2.fileContent, 0, _arg2.fileContent.length);
return (_arg1);
}
private function onProgress(_arg1:ProgressEvent):void{
dispatchEvent(_arg1);
}
private function onComplete(_arg1:Event):void{
try {
uploadResponse = _arg1.target.data;
} catch(e:Error) {
};
removeListener();
dispatchEvent(_arg1);
}
public function getUploadResponse():Object{
return (uploadResponse);
}
private function onIOError(_arg1:IOErrorEvent):void{
removeListener();
dispatchEvent(_arg1);
}
private function onSecurityError(_arg1:SecurityErrorEvent):void{
removeListener();
dispatchEvent(_arg1);
}
private function onHTTPStatus(_arg1:HTTPStatusEvent):void{
dispatchEvent(_arg1);
}
private function addListener():void{
_loader.addEventListener(Event.COMPLETE, onComplete, false, 0, false);
_loader.addEventListener(ProgressEvent.PROGRESS, onProgress, false, 0, false);
_loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, false);
_loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus, false, 0, false);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError, false, 0, false);
}
private function removeListener():void{
_loader.removeEventListener(Event.COMPLETE, onComplete);
_loader.removeEventListener(ProgressEvent.PROGRESS, onProgress);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
_loader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
}
private function BOUNDARY(_arg1:ByteArray):ByteArray{
var _local2:int = getBoundary().length;
_arg1 = DOUBLEDASH(_arg1);
var _local3:int;
while (_local3 < _local2) {
_arg1.writeByte(_boundary.charCodeAt(_local3));
_local3++;
};
return (_arg1);
}
private function LINEBREAK(_arg1:ByteArray):ByteArray{
_arg1.writeShort(3338);
return (_arg1);
}
private function QUOTATIONMARK(_arg1:ByteArray):ByteArray{
_arg1.writeByte(34);
return (_arg1);
}
private function DOUBLEDASH(_arg1:ByteArray):ByteArray{
_arg1.writeShort(0x2D2D);
return (_arg1);
}
private function nextAsyncLoop():void{
var _local1:FilePart;
if (asyncFilePointer < _fileNames.length){
_local1 = (_files[_fileNames[asyncFilePointer]] as FilePart);
_data = getFilePartHeader(_data, _local1);
asyncWriteTimeoutId = setTimeout(writeChunkLoop, 10, _data, _local1.fileContent, 0);
asyncFilePointer++;
} else {
_data = closeFilePartsData(_data);
_data = closeDataObject(_data);
_prepared = true;
dispatchEvent(new MultipartURLLoaderEvent(MultipartURLLoaderEvent.DATA_PREPARE_PROGRESS, totalFilesSize, totalFilesSize));
dispatchEvent(new MultipartURLLoaderEvent(MultipartURLLoaderEvent.DATA_PREPARE_COMPLETE));
};
}
private function writeChunkLoop(_arg1:ByteArray, _arg2:ByteArray, _arg3:uint=0):void{
var _local4:uint = Math.min(BLOCK_SIZE, (_arg2.length - _arg3));
_arg1.writeBytes(_arg2, _arg3, _local4);
if ((((_local4 < BLOCK_SIZE)) || (((_arg3 + _local4) >= _arg2.length)))){
_arg1 = LINEBREAK(_arg1);
nextAsyncLoop();
return;
};
_arg3 = (_arg3 + _local4);
writtenBytes = (writtenBytes + _local4);
if (((writtenBytes % BLOCK_SIZE) * 2) == 0){
dispatchEvent(new MultipartURLLoaderEvent(MultipartURLLoaderEvent.DATA_PREPARE_PROGRESS, writtenBytes, totalFilesSize));
};
asyncWriteTimeoutId = setTimeout(writeChunkLoop, 10, _arg1, _arg2, _arg3);
}
}
}//package ru.inspirit.net
import flash.utils.*;
class FilePart {
public var fileContent:ByteArray;
public var fileName:String;
public var dataField:String;
public var contentType:String;
private function FilePart(_arg1:ByteArray, _arg2:String, _arg3:String="Filedata", _arg4:String="application/octet-stream"){
this.fileContent = _arg1;
this.fileName = _arg2;
this.dataField = _arg3;
this.contentType = _arg4;
}
public function dispose():void{
fileContent = null;
fileName = null;
dataField = null;
contentType = null;
}
}
Section 50
//ApiMovieClip (ApiMovieClip)
package {
import flash.display.*;
public dynamic class ApiMovieClip extends MovieClip {
public var saveBtn:SaveBtnMc;
}
}//package
Section 51
//banner_logo_mc (banner_logo_mc)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class banner_logo_mc extends MovieClip {
public var linkLogo:SimpleButton;
public var linkButton:SimpleButton;
public var link01:SimpleButton;
public var link02:SimpleButton;
public var link03:SimpleButton;
public var link04:SimpleButton;
public var link05:SimpleButton;
public var link06:SimpleButton;
public var link07:SimpleButton;
public var url01;
public var url02;
public var url03;
public var url04;
public var url05;
public var url06;
public var url07;
public var logoUrl;
public var buttonUrl;
public function banner_logo_mc(){
addFrameScript(0, this.frame1);
}
public function fl_link01Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url01), "_blank");
dispatchEvent(new Event("bar_referral"));
}
public function fl_link02Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url02), "_blank");
dispatchEvent(new Event("bar_referral"));
}
public function fl_link03Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url03), "_blank");
dispatchEvent(new Event("bar_referral"));
}
public function fl_link04Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url04), "_blank");
dispatchEvent(new Event("bar_referral"));
}
public function fl_link05Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url05), "_blank");
dispatchEvent(new Event("bar_referral"));
}
public function fl_link06Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url06), "_blank");
dispatchEvent(new Event("bar_referral"));
}
public function fl_link07Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url07), "_blank");
dispatchEvent(new Event("bar_referral"));
}
public function fl_LogoClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.logoUrl), "_blank");
dispatchEvent(new Event("bar_referral"));
}
public function fl_ButtonClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.buttonUrl), "_blank");
dispatchEvent(new Event("bar_referral"));
}
function frame1(){
this.url01 = "http://www.dressup.com/new-games/";
this.url02 = "http://www.dressup.com/popular-games/";
this.url03 = "http://www.dressup.com/world-tour/";
this.url04 = "http://www.dressup.com/celebrity/";
this.url05 = "http://www.dressup.com/jobs/";
this.url06 = "http://www.dressup.com/makeup/";
this.url07 = "http://www.dressup.com/kids/";
this.logoUrl = "http://www.dressup.com/";
this.buttonUrl = "http://www.dressup.com/";
this.link01.addEventListener(MouseEvent.CLICK, this.fl_link01Click);
this.link02.addEventListener(MouseEvent.CLICK, this.fl_link02Click);
this.link03.addEventListener(MouseEvent.CLICK, this.fl_link03Click);
this.link04.addEventListener(MouseEvent.CLICK, this.fl_link04Click);
this.link05.addEventListener(MouseEvent.CLICK, this.fl_link05Click);
this.link06.addEventListener(MouseEvent.CLICK, this.fl_link06Click);
this.link07.addEventListener(MouseEvent.CLICK, this.fl_link07Click);
this.linkLogo.addEventListener(MouseEvent.CLICK, this.fl_LogoClick);
this.linkButton.addEventListener(MouseEvent.CLICK, this.fl_ButtonClick);
}
}
}//package
Section 52
//Comments (Comments)
package {
public class Comments {
public static const COMMENT:Array = ["Hey, dude this is a cool game!", "I designed this little outfit myself", "Do you like my design?", "Do you even fashion?", "My new favorite dressup game is this dressup game!", "Love this game, L O V E", "Me Gusto!", "So you think you can fashion?", "You go girl!", "Wild Wild Wild game", "This will be me one day", "She's so beautiful, we are all really so beautiful", "One of my favorite sites!", "Fave new game of 2013", "Think you can do better? you can't it's science", "Do you have better style then this? i bet you don't", "Can you style this doll cooler then me?", "Do you like my fashion? I like my fashion", "Isn't she beautiful?", "Do you wish you were her?", "Do you like girl games?", "Do you like dressups?", "Do you even fashion"];
public static function getRandomComment():String{
var _local1:uint = int((COMMENT.length * Math.random()));
return ((COMMENT[_local1] as String));
}
}
}//package
Section 53
//ControlPanel (ControlPanel)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.external.*;
public class ControlPanel extends Sprite {
public const _x:int = 380;
public const _y:int = 25;
public var _content:ControlPanelMC;
protected var fbCameraButton:SimpleButton;
public function ControlPanel(){
_content = new ControlPanelMC();
super();
addChild(_content);
if (isPhotoSharingEnabled()){
_content.btnFoto.visible = false;
fbCameraButton = new fbCamera();
fbCameraButton.x = _content.btnFoto.x;
fbCameraButton.y = _content.btnFoto.y;
fbCameraButton.width = _content.btnFoto.width;
fbCameraButton.height = _content.btnFoto.height;
_content.addChild(fbCameraButton);
} else {
fbCameraButton = (_content.btnFoto as SimpleButton);
};
fbCameraButton.addEventListener(MouseEvent.CLICK, onFoto);
_content.btnReset.addEventListener(MouseEvent.CLICK, onReset);
_content.btnLogo.addEventListener(MouseEvent.CLICK, onLogo);
_content.btnBack.addEventListener(MouseEvent.CLICK, onBack);
_content.btnBack.visible = false;
_content.btnLogo.visible = false;
}
public function hideLogoBtn():void{
if (_content.btnLogo.visible){
_content.btnLogo.visible = false;
_content.btnReset.visible = true;
};
}
private function onLogo(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.girlgames.com/"), "_blank");
}
private function onBack(_arg1:MouseEvent):void{
Main.d.mainMc.buttons.visible = true;
fbCameraButton.visible = true;
_content.btnLogo.visible = false;
_content.btnLogo.x = _x;
_content.btnLogo.y = _y;
_content.btnBack.visible = false;
_content.btnReset.visible = true;
}
private function onFoto(_arg1:MouseEvent):void{
Main.d.mainMc.buttons.visible = false;
_content.btnBack.visible = true;
_content.btnBack.x = (_content.btnReset.x + 10);
_content.btnBack.y = (_content.btnReset.y - 20);
fbCameraButton.visible = false;
_content.btnLogo.visible = true;
_content.btnLogo.x = (fbCameraButton.x - 20);
_content.btnLogo.y = (fbCameraButton.y + 20);
_content.btnReset.visible = false;
if (isPhotoSharingEnabled()){
dispatchEvent(new Event("capture"));
};
}
private function onReset(_arg1:MouseEvent):void{
Main.d.resetAll();
_content.btnReset.visible = false;
_content.btnLogo.visible = true;
_content.btnLogo.x = (_content.btnReset.x - 5);
_content.btnLogo.y = (_content.btnReset.y - 15);
}
protected function isPhotoSharingEnabled():Boolean{
var enable:Boolean;
var retval:Boolean;
if (ExternalInterface.available){
try {
enable = ExternalInterface.call("useFaceBookPhotoUpload");
retval = enable;
} catch(e:Error) {
};
};
return (retval);
}
}
}//package
Section 54
//ControlPanelMC (ControlPanelMC)
package {
import flash.display.*;
public dynamic class ControlPanelMC extends MovieClip {
public var btnLogo:SimpleButton;
public var btnReset:SimpleButton;
public var btnFoto:SimpleButton;
public var btnBack:SimpleButton;
}
}//package
Section 55
//Dressup (Dressup)
package {
import flash.events.*;
import flash.display.*;
import com.girlgames.dressup.*;
import flash.utils.*;
import flash.geom.*;
import flash.external.*;
public class Dressup extends DressupGame {
protected const SHORT_URL:String = "";
protected const TRACK_URL:String = "?utm_source=facebook&utm_medium=feedpost&utm_campaign=photouploadv2";
public var mainMc:MainMovie;
private var cp:ControlPanel;
protected var canSharePhoto:Boolean;// = true
protected var photoDialogBox:PhotoShareUI;
protected var photoBackFill:Sprite;
protected var captureRect:Rectangle;
protected var gameURL:String;// = ""
public function Dressup(){
var _local5:DisplayObject;
var _local6:Clothes;
mainMc = new MainMovie();
cp = new ControlPanel();
captureRect = new Rectangle(0, 0, 750, 540);
super(760, 550);
mainMc.scrollRect = new Rectangle(0, 0, 760, 550);
addChild(mainMc);
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
addChild(cp);
cp.addEventListener("capture", eventSavePhoto);
skipClip(mainMc.mc.girl);
var _local1:MovieClip = mainMc.mc;
var _local2:int;
while (_local2 < _local1.numChildren) {
_local5 = _local1.getChildAt(_local2);
if (((((((_local5.name) && ((_local5.name.indexOf("instance") < 0)))) && ((_local5 is MovieClip)))) && ((skipClips.indexOf(_local5) < 0)))){
_local6 = new Clothes((_local5 as MovieClip), this);
addClothes(_local6);
};
_local2++;
};
var _local3:Clothes = getClothesByName("bg");
_local3.setDefaultVisibleFirstElement();
_local3.buttonMode = false;
_local3.useHandCursor = false;
_local3.canDisapear = false;
var _local4:Clothes = getClothesByName("hair");
_local4.setDefaultVisibleFirstElement();
_local4.canDisapear = false;
_local4.useHandCursor = false;
_local4.buttonMode = false;
_local2 = 0;
while (_local2 < mainMc.buttons.numChildren) {
_local5 = mainMc.buttons.getChildAt(_local2);
if ((((_local5 is SimpleButton)) && ((_local5.name.indexOf("instance") < 0)))){
_local5.addEventListener(MouseEvent.CLICK, onButtonClick);
};
_local2++;
};
}
public function resetAll():void{
var _local1:Clothes;
for each (_local1 in clothes) {
if (((!((_local1.name == "hair"))) && (!((_local1.name == "bg"))))){
_local1.turnOffCurrentVisible();
};
};
}
private function onButtonClick(_arg1:MouseEvent):void{
var _local4:Clothes;
cp.hideLogoBtn();
var _local2:String = _arg1.target.name;
if (_local2 == "kofta"){
_local4 = getClothesByName("top");
_local4.turnOffCurrentVisible();
};
if (_local2 == "top"){
_local4 = getClothesByName("kofta");
_local4.turnOffCurrentVisible();
};
if (_local2 == "pants"){
_local4 = getClothesByName("skirt");
_local4.turnOffCurrentVisible();
};
if (_local2 == "skirt"){
_local4 = getClothesByName("pants");
_local4.turnOffCurrentVisible();
};
var _local3:Clothes = getClothesByName(_arg1.target.name);
_local3.setNextVisible();
}
private function onAddedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
init(mainMc.mc);
}
protected function getAccessToken():String{
return (getJSString("getFBAccessToken"));
}
protected function getGameURL():String{
var _local1:String = getJSString("getGameURL");
var _local2:String = _local1.split("?")[0];
_local2 = (_local2 + TRACK_URL);
return (_local2);
}
protected function getJSString(_arg1:String):String{
var at:String;
var functionName = _arg1;
var retVal = "";
if (ExternalInterface.available){
try {
at = ExternalInterface.call(functionName);
retVal = at;
} catch(e:Error) {
};
//unresolved jump
};
return (retVal);
}
protected function eventSavePhoto(_arg1:Event=null):void{
var e = _arg1;
if (canSharePhoto){
if (PhotoShare.captureImage("dressup", this, 1, captureRect)){
if (((!((getAccessToken() == null))) && ((getAccessToken().length > 10)))){
autoSharePhoto();
} else {
try {
ExternalInterface.call("fbLogin");
setTimeout(autoSharePhoto, 20000);
} catch(e:Error) {
};
};
//unresolved jump
};
};
if (ExternalInterface.available){
try {
ExternalInterface.call("flashCameraClick");
} catch(e:Error) {
};
};
}
protected function autoSharePhoto():void{
var _local2:String;
var _local3:Number;
var _local1:String = getAccessToken();
if (_local1.length > 10){
_local2 = Comments.getRandomComment();
_local2 = (_local2 + " ");
_local2 = (_local2 + getGameURL());
_local3 = (new Date().date * Math.random());
_local2 = (_local2 + ("&id=" + _local3.toString()));
PhotoShare.postOnFacebook("dressup", getAccessToken(), _local2);
};
}
}
}//package
Section 56
//ErrorMessageMc (ErrorMessageMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ErrorMessageMc extends MovieClip {
public var yesBtn:SimpleButton;
public var msgtxt:TextField;
}
}//package
Section 57
//fbCamera (fbCamera)
package {
import flash.display.*;
public dynamic class fbCamera extends SimpleButton {
}
}//package
Section 58
//LinkBaner (LinkBaner)
package {
import flash.display.*;
public class LinkBaner extends Sprite {
private var _content:banner_logo_mc;
public function LinkBaner(){
_content = new banner_logo_mc();
super();
addChild(_content);
_content.x = 0;
_content.y = 0;
init();
}
private function init():void{
}
}
}//package
Section 59
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
public class Main extends Sprite {
public static var d:Dressup;
public function Main():void{
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function init(_arg1:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
var _local2:LinkBaner = new LinkBaner();
addChild(_local2);
_local2.y = 550;
d = new Dressup();
addChild(d);
}
}
}//package
Section 60
//MainMovie (MainMovie)
package {
import flash.display.*;
public dynamic class MainMovie extends MovieClip {
public var buttons:MovieClip;
public var mc:MovieClip;
}
}//package
Section 61
//McMovePointer (McMovePointer)
package {
import flash.display.*;
public dynamic class McMovePointer extends MovieClip {
}
}//package
Section 62
//McResizePointer (McResizePointer)
package {
import flash.display.*;
public dynamic class McResizePointer extends MovieClip {
}
}//package
Section 63
//McSelection (McSelection)
package {
import flash.display.*;
public dynamic class McSelection extends MovieClip {
public var mcBottomLeft:MovieClip;
public var mcBottomRight:MovieClip;
public var mcTopRight:MovieClip;
public var mcTopLeft:MovieClip;
public var mcRect:MovieClip;
}
}//package
Section 64
//PhotoShare (PhotoShare)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import com.adobe.images.*;
import com.adobe.serialization.json.*;
import ru.inspirit.net.*;
public class PhotoShare extends EventDispatcher {
protected var mCaptures:Object;
protected var mFileUploader:MultipartURLLoader;
protected static var mInstance:PhotoShare;
public function PhotoShare(){
init();
}
protected function init():void{
mCaptures = new Object();
mFileUploader = new MultipartURLLoader();
mFileUploader.addEventListener(Event.COMPLETE, eventPhotoUploadComplete);
}
protected function captureImage_(_arg1:String, _arg2:Sprite, _arg3:Number=1, _arg4:Rectangle=null):Boolean{
var area:Rectangle;
var sWidth:Number;
var sHeight:Number;
var sX:Number;
var sY:Number;
var sRect:Rectangle;
var stillScreen:BitmapData;
var matrix:Matrix;
var captureBitmap:BitmapData;
var id_ = _arg1;
var image_ = _arg2;
var scale_ = _arg3;
var area_ = _arg4;
var returnVal:Boolean;
try {
if (area_ != null){
area = area_;
} else {
area = new Rectangle(0, 0, image_.width, image_.height);
};
sWidth = (scale_ * area.width);
sHeight = (scale_ * area.height);
sX = (scale_ * area.x);
sY = (scale_ * area.y);
sRect = new Rectangle(sX, sY, sWidth, sHeight);
stillScreen = new BitmapData((sX + sWidth), (sY + sHeight), false);
matrix = new Matrix();
matrix.scale(scale_, scale_);
stillScreen.draw(image_, matrix, null, null, null, true);
captureBitmap = new BitmapData(sWidth, sHeight, false);
captureBitmap.copyPixels(stillScreen, sRect, new Point());
mCaptures[id_] = captureBitmap;
returnVal = true;
} catch(err:Error) {
};
return (returnVal);
}
protected function getImage_(_arg1:String):BitmapData{
if (mCaptures[_arg1]){
return ((mCaptures[_arg1] as BitmapData));
};
return (new BitmapData(1, 1, false, 0xFFFFFF));
}
protected function uploadImage_(_arg1:String, _arg2:String, _arg3:Object=null, _arg4:Number=75):void{
var a:String;
var val:*;
var id = _arg1;
var url = _arg2;
var postVars = _arg3;
var jpegQuality = _arg4;
var encoder:JPGEncoder = new JPGEncoder(jpegQuality);
var byteData:ByteArray = encoder.encode((mCaptures[id] as BitmapData));
mFileUploader.clearFiles();
mFileUploader.clearVariables();
try {
mFileUploader.addFile(byteData, "Photo");
if (postVars != null){
for (a in postVars) {
val = postVars[a];
mFileUploader.addVariable(a, val);
};
};
mFileUploader.addEventListener(IOErrorEvent.IO_ERROR, eventErrorTrap);
mFileUploader.load(url);
} catch(err1:Error) {
};
}
protected function eventErrorTrap(_arg1:IOErrorEvent):void{
}
protected function postOnFacebook_(_arg1:String, _arg2:String, _arg3:String="", _arg4:String="me", _arg5:Number=75):void{
var _local6 = (("https://graph.facebook.com/" + _arg4) + "/photos");
_local6 = (_local6 + ("?access_token=" + _arg2));
var _local7:Object = new Object();
_local7.message = _arg3;
uploadImage_(_arg1, _local6, _local7, _arg5);
}
protected function eventPhotoUploadComplete(_arg1:Event):void{
var _local3:String;
var _local4:Object;
var _local2:Object = mFileUploader.getUploadResponse();
if (_local2 != null){
try {
_local3 = String(_local2);
_local3.replace("/n", "");
_local4 = JSON.decode(_local3);
} catch(e:Error) {
};
//unresolved jump
};
}
public static function captureImage(_arg1:String, _arg2:Sprite, _arg3:Number=1, _arg4:Rectangle=null):Boolean{
return (instance().captureImage_(_arg1, _arg2, _arg3, _arg4));
}
public static function getImage(_arg1:String):BitmapData{
return (instance().getImage_(_arg1));
}
public static function uploadImage(_arg1:String, _arg2:String, _arg3:Object=null, _arg4:uint=75):void{
instance().uploadImage_(_arg1, _arg2, _arg3, _arg4);
}
public static function postOnFacebook(_arg1:String, _arg2:String, _arg3:String="", _arg4:String="me", _arg5:Number=75):void{
instance().postOnFacebook_(_arg1, _arg2, _arg3, _arg4, _arg5);
}
protected static function instance():PhotoShare{
if (!mInstance){
mInstance = new (PhotoShare);
};
return (mInstance);
}
}
}//package
Section 65
//photoShareDialog (photoShareDialog)
package {
import flash.display.*;
import flash.text.*;
public dynamic class photoShareDialog extends MovieClip {
public var mcPreview:MovieClip;
public var txtMessage:TextField;
public var cover:MovieClip;
public var btnCancel:SimpleButton;
public var btnShare:SimpleButton;
}
}//package
Section 66
//PhotoShareUI (PhotoShareUI)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import com.adobe.utils.*;
public class PhotoShareUI extends Sprite {
protected var mAsset:MovieClip;
protected var mPreviewArea:MovieClip;
protected var mPreviewBitmap:Bitmap;
protected var mShareButton:SimpleButton;
protected var mCancelButton:SimpleButton;
protected var mUserMessage:TextField;
public static const EVENT_CANCEL_CLICK:String = "EVENT_CANCEL_CLICK";
public static const EVENT_SHARE_CLICK:String = "EVENT_SHARE_CLICK";
public function PhotoShareUI(){
init();
}
protected function init():void{
mAsset = new photoShareDialog();
addChild(mAsset);
mPreviewArea = (mAsset.getChildByName("mcPreview") as MovieClip);
mPreviewArea.visible = false;
try {
mPreviewBitmap = new Bitmap(PhotoShare.getImage("preview"));
mPreviewBitmap.x = mPreviewArea.x;
mPreviewBitmap.y = mPreviewArea.y;
addChild(mPreviewBitmap);
} catch(e:Error) {
};
mUserMessage = (mAsset.getChildByName("txtMessage") as TextField);
mUserMessage.addEventListener(Event.CHANGE, eventTextChange);
mUserMessage.text = "";
mCancelButton = (mAsset.getChildByName("btnCancel") as SimpleButton);
mCancelButton.addEventListener(MouseEvent.CLICK, eventCancelClick);
mShareButton = (mAsset.getChildByName("btnShare") as SimpleButton);
mShareButton.addEventListener(MouseEvent.CLICK, eventShareClick);
allowShare(false);
}
protected function allowShare(_arg1:Boolean):void{
mShareButton.enabled = _arg1;
mShareButton.mouseEnabled = _arg1;
if (_arg1){
mShareButton.alpha = 1;
} else {
mShareButton.alpha = 0.5;
};
}
public function getUserMessage():String{
return (mUserMessage.text);
}
public function exit():void{
try {
mPreviewBitmap.bitmapData.dispose();
} catch(e:Error) {
};
try {
removeChild(mPreviewBitmap);
} catch(e2:Error) {
};
mShareButton.removeEventListener(MouseEvent.CLICK, eventShareClick);
mCancelButton.removeEventListener(MouseEvent.CLICK, eventCancelClick);
}
protected function eventCancelClick(_arg1:MouseEvent):void{
dispatchEvent(new Event(EVENT_CANCEL_CLICK));
}
protected function eventShareClick(_arg1:MouseEvent):void{
allowShare(false);
dispatchEvent(new Event(EVENT_SHARE_CLICK));
}
protected function eventTextChange(_arg1:Event):void{
if (StringUtil.trim(mUserMessage.text).length > 0){
allowShare(true);
} else {
allowShare(false);
};
}
}
}//package
Section 67
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Preloader extends Sprite {
private var preloader:PreloaderMC;
private var lb:LinkBaner;
private var tp:int;// = 0
private var mainClassFound:Boolean;// = false
private var startInterval:int;
public function Preloader(){
preloader = new PreloaderMC();
lb = new LinkBaner();
super();
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function init(_arg1:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
addChild(preloader);
preloader.useHandCursor = true;
preloader.buttonMode = true;
preloader.mouseChildren = true;
preloader.addEventListener(Event.ENTER_FRAME, mainUpdate, false);
preloader.addEventListener(Event.ENTER_FRAME, addPlayButtonHitCode, false);
}
private function mainUpdate(_arg1:Event):void{
var _local3:Class;
var _local4:Number;
var _local2:Number = Math.floor(((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100));
if (((((isNaN(_local2)) || ((_local2 == Number.POSITIVE_INFINITY)))) || ((_local2 == Number.NEGATIVE_INFINITY)))){
_local2 = Math.floor(((this.stage.loaderInfo.bytesLoaded / this.stage.loaderInfo.bytesTotal) * 100));
};
if (((((isNaN(_local2)) || ((_local2 == Number.POSITIVE_INFINITY)))) || ((_local2 == Number.NEGATIVE_INFINITY)))){
try {
_local3 = (getDefinitionByName("Main") as Class);
mainClassFound = true;
} catch(e:Error) {
};
} else {
if (preloader.loader){
_local4 = (_local2 * 0.01);
preloader.loader.gotoAndStop(int((preloader.loader.totalFrames * _local4)));
};
};
if ((((_local2 == 100)) || (mainClassFound))){
if ((preloader.loader.currentFrame / preloader.loader.totalFrames) == 1){
preloader.removeEventListener(Event.ENTER_FRAME, mainUpdate);
preloader.addEventListener(Event.ENTER_FRAME, handleClose);
preloader.loader.stop();
preloader.loader.gotoAndPlay(1);
preloader.play();
};
};
}
private function startUp():void{
var mainClass:Class;
try {
mainClass = (getDefinitionByName("Main") as Class);
} catch(e:Error) {
startInterval = setTimeout(startUp, 200);
return;
};
addChild((new (mainClass) as DisplayObject));
}
private function addPlayButtonHitCode(_arg1:Event):void{
if (preloader.buttonPlay){
preloader.buttonPlay.addEventListener(MouseEvent.MOUSE_DOWN, advanceToClose, false, 0, true);
preloader.removeEventListener(Event.ENTER_FRAME, addPlayButtonHitCode);
};
}
private function advanceToClose(_arg1:Event):void{
preloader.buttonPlay.removeEventListener(MouseEvent.MOUSE_DOWN, advanceToClose);
preloader.play();
}
private function handleClose(_arg1:Event):void{
if (preloader){
if (preloader.currentFrame == preloader.totalFrames){
startUp();
preloader.removeEventListener(Event.ENTER_FRAME, handleClose);
cleanup();
};
};
}
private function cleanup(_arg1:Event=null):void{
removeChild(preloader);
if (preloader.buttonPlay){
preloader.buttonPlay.removeEventListener(MouseEvent.MOUSE_UP, advanceToClose, false);
};
}
}
}//package
Section 68
//PreloaderMC (PreloaderMC)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class PreloaderMC extends MovieClip {
public var button05:SimpleButton;
public var loader:MovieClip;
public var button02:SimpleButton;
public var button03:SimpleButton;
public var button01:SimpleButton;
public var fullScreenClick:SimpleButton;
public var button06:SimpleButton;
public var buttonPlay:SimpleButton;
public var button07:SimpleButton;
public var button04:SimpleButton;
public var fullScreenUrl;
public var url01;
public var url02;
public var url03;
public var url04;
public var url05;
public var url06;
public var url07;
public function PreloaderMC(){
addFrameScript(0, this.frame1, 50, this.frame51, 120, this.frame121, 149, this.frame150);
}
public function fl_FullScreenClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.fullScreenUrl), "_blank");
}
public function fl_button01Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url01), "_blank");
}
public function fl_button02Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url02), "_blank");
}
public function fl_button03Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url03), "_blank");
}
public function fl_button04Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url04), "_blank");
}
public function fl_button05Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url05), "_blank");
}
public function fl_button06Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url06), "_blank");
}
public function fl_button07Click(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.url07), "_blank");
}
function frame1(){
this.fullScreenUrl = "http://www.dressup.com/";
this.fullScreenClick.addEventListener(MouseEvent.CLICK, this.fl_FullScreenClick);
}
function frame51(){
this.url01 = "http://www.dressup.com/new-games/";
this.url02 = "http://www.dressup.com/popular-games/";
this.url03 = "http://www.dressup.com/world-tour/";
this.url04 = "http://www.dressup.com/celebrity/";
this.url05 = "http://www.dressup.com/jobs/";
this.url06 = "http://www.dressup.com/makeup/";
this.url07 = "http://www.dressup.com/kids/";
this.button01.addEventListener(MouseEvent.CLICK, this.fl_button01Click);
this.button02.addEventListener(MouseEvent.CLICK, this.fl_button02Click);
this.button03.addEventListener(MouseEvent.CLICK, this.fl_button03Click);
this.button04.addEventListener(MouseEvent.CLICK, this.fl_button04Click);
this.button05.addEventListener(MouseEvent.CLICK, this.fl_button05Click);
this.button06.addEventListener(MouseEvent.CLICK, this.fl_button06Click);
this.button07.addEventListener(MouseEvent.CLICK, this.fl_button07Click);
}
function frame121(){
stop();
}
function frame150(){
stop();
}
}
}//package
Section 69
//SaveBtnMc (SaveBtnMc)
package {
import flash.display.*;
public dynamic class SaveBtnMc extends MovieClip {
}
}//package
Section 70
//SaveBtnWinMc (SaveBtnWinMc)
package {
import flash.display.*;
public dynamic class SaveBtnWinMc extends MovieClip {
}
}//package
Section 71
//SelectScreenShotMc (SelectScreenShotMc)
package {
import flash.display.*;
public dynamic class SelectScreenShotMc extends MovieClip {
public var yesBtn:SimpleButton;
public var noBtn:SimpleButton;
}
}//package
Section 72
//SignUpMessageMc (SignUpMessageMc)
package {
import flash.display.*;
public dynamic class SignUpMessageMc extends MovieClip {
public var yesBtn:SimpleButton;
public var noBtn:SimpleButton;
}
}//package