Section 1
//BitString (com.adobe.images.BitString)
package com.adobe.images {
public class BitString {
public var val:int;// = 0
public var len:int;// = 0
public function BitString(){
len = 0;
val = 0;
super();
}
}
}//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 fdtbl_UV:Array;
private var std_ac_chrominance_values:Array;
private var std_dc_chrominance_nrcodes:Array;
private var std_dc_chrominance_values:Array;
private var ZigZag:Array;
private var YDC_HT:Array;
private var bytenew:int;// = 0
private var fdtbl_Y:Array;
private var YAC_HT:Array;
private var std_ac_chrominance_nrcodes:Array;
private var DU:Array;
private var std_ac_luminance_values:Array;
private var UVTable:Array;
private var UDU:Array;
private var YDU:Array;
private var byteout:ByteArray;
private var UVAC_HT:Array;
private var UVDC_HT:Array;
private var bytepos:int;// = 7
private var VDU:Array;
private var std_ac_luminance_nrcodes:Array;
private var std_dc_luminance_values:Array;
private var YTable:Array;
private var std_dc_luminance_nrcodes:Array;
private var bitcode:Array;
private var category:Array;
public function JPGEncoder(_arg1:Number=50){
var _local2:int;
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);
bytenew = 0;
bytepos = 7;
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;
};
_local2 = 0;
if (_arg1 < 50){
_local2 = int((5000 / _arg1));
} else {
_local2 = int((200 - (_arg1 * 2)));
};
initHuffmanTbl();
initCategoryNumber();
initQuantTables(_local2);
}
private function RGB2YUV(_arg1:BitmapData, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:uint;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = 0;
_local5 = 0;
while (_local5 < 8) {
_local6 = 0;
while (_local6 < 8) {
_local7 = _arg1.getPixel32((_arg2 + _local6), (_arg3 + _local5));
_local8 = Number(((_local7 >> 16) & 0xFF));
_local9 = Number(((_local7 >> 8) & 0xFF));
_local10 = Number((_local7 & 0xFF));
YDU[_local4] = ((((0.299 * _local8) + (0.587 * _local9)) + (0.114 * _local10)) - 128);
UDU[_local4] = (((-0.16874 * _local8) + (-0.33126 * _local9)) + (0.5 * _local10));
VDU[_local4] = (((0.5 * _local8) + (-0.41869 * _local9)) + (-0.08131 * _local10));
_local4++;
_local6++;
};
_local5++;
};
}
private function writeWord(_arg1:int):void{
writeByte(((_arg1 >> 8) & 0xFF));
writeByte((_arg1 & 0xFF));
}
private function writeByte(_arg1:int):void{
byteout.writeByte(_arg1);
}
private function writeDHT():void{
var _local1:int;
writeWord(65476);
writeWord(418);
writeByte(0);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_dc_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
writeByte(std_dc_luminance_values[_local1]);
_local1++;
};
writeByte(16);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_ac_luminance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
writeByte(std_ac_luminance_values[_local1]);
_local1++;
};
writeByte(1);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_dc_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 11) {
writeByte(std_dc_chrominance_values[_local1]);
_local1++;
};
writeByte(17);
_local1 = 0;
while (_local1 < 16) {
writeByte(std_ac_chrominance_nrcodes[(_local1 + 1)]);
_local1++;
};
_local1 = 0;
while (_local1 <= 161) {
writeByte(std_ac_chrominance_values[_local1]);
_local1++;
};
}
private function writeBits(_arg1:BitString):void{
var _local2:int;
var _local3:int;
_local2 = _arg1.val;
_local3 = (_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 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);
}
public function encode(_arg1:BitmapData):ByteArray{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:BitString;
byteout = new ByteArray();
bytenew = 0;
bytepos = 7;
writeWord(65496);
writeAPP0();
writeDQT();
writeSOF0(_arg1.width, _arg1.height);
writeDHT();
writeSOS();
_local2 = 0;
_local3 = 0;
_local4 = 0;
bytenew = 0;
bytepos = 7;
_local5 = 0;
while (_local5 < _arg1.height) {
_local6 = 0;
while (_local6 < _arg1.width) {
RGB2YUV(_arg1, _local6, _local5);
_local2 = processDU(YDU, fdtbl_Y, _local2, YDC_HT, YAC_HT);
_local3 = processDU(UDU, fdtbl_UV, _local3, UVDC_HT, UVAC_HT);
_local4 = processDU(VDU, fdtbl_UV, _local4, UVDC_HT, UVAC_HT);
_local6 = (_local6 + 8);
};
_local5 = (_local5 + 8);
};
if (bytepos >= 0){
_local7 = new BitString();
_local7.len = (bytepos + 1);
_local7.val = ((1 << (bytepos + 1)) - 1);
writeBits(_local7);
};
writeWord(65497);
return (byteout);
}
private function initCategoryNumber():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 1;
_local2 = 2;
_local4 = 1;
while (_local4 <= 15) {
_local3 = _local1;
while (_local3 < _local2) {
category[(32767 + _local3)] = _local4;
bitcode[(32767 + _local3)] = new BitString();
bitcode[(32767 + _local3)].len = _local4;
bitcode[(32767 + _local3)].val = _local3;
_local3++;
};
_local3 = -((_local2 - 1));
while (_local3 <= -(_local1)) {
category[(32767 + _local3)] = _local4;
bitcode[(32767 + _local3)] = new BitString();
bitcode[(32767 + _local3)].len = _local4;
bitcode[(32767 + _local3)].val = ((_local2 - 1) + _local3);
_local3++;
};
_local1 = (_local1 << 1);
_local2 = (_local2 << 1);
_local4++;
};
}
private function writeDQT():void{
var _local1:int;
writeWord(65499);
writeWord(132);
writeByte(0);
_local1 = 0;
while (_local1 < 64) {
writeByte(YTable[_local1]);
_local1++;
};
writeByte(1);
_local1 = 0;
while (_local1 < 64) {
writeByte(UVTable[_local1]);
_local1++;
};
}
private function writeAPP0():void{
writeWord(65504);
writeWord(16);
writeByte(74);
writeByte(70);
writeByte(73);
writeByte(70);
writeByte(0);
writeByte(1);
writeByte(1);
writeByte(0);
writeWord(1);
writeWord(1);
writeByte(0);
writeByte(0);
}
private function writeSOS():void{
writeWord(65498);
writeWord(12);
writeByte(3);
writeByte(1);
writeByte(0);
writeByte(2);
writeByte(17);
writeByte(3);
writeByte(17);
writeByte(0);
writeByte(63);
writeByte(0);
}
private function processDU(_arg1:Array, _arg2:Array, _arg3:Number, _arg4:Array, _arg5:Array):Number{
var _local6:BitString;
var _local7:BitString;
var _local8:int;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
_local6 = _arg5[0];
_local7 = _arg5[240];
_local9 = fDCTQuant(_arg1, _arg2);
_local8 = 0;
while (_local8 < 64) {
DU[ZigZag[_local8]] = _local9[_local8];
_local8++;
};
_local10 = (DU[0] - _arg3);
_arg3 = DU[0];
if (_local10 == 0){
writeBits(_arg4[0]);
} else {
writeBits(_arg4[category[(32767 + _local10)]]);
writeBits(bitcode[(32767 + _local10)]);
};
_local11 = 63;
while ((((_local11 > 0)) && ((DU[_local11] == 0)))) {
_local11--;
};
if (_local11 == 0){
writeBits(_local6);
return (_arg3);
};
_local8 = 1;
while (_local8 <= _local11) {
_local12 = _local8;
while ((((DU[_local8] == 0)) && ((_local8 <= _local11)))) {
_local8++;
};
_local13 = (_local8 - _local12);
if (_local13 >= 16){
_local14 = 1;
while (_local14 <= (_local13 / 16)) {
writeBits(_local7);
_local14++;
};
_local13 = int((_local13 & 15));
};
writeBits(_arg5[((_local13 * 16) + category[(32767 + DU[_local8])])]);
writeBits(bitcode[(32767 + DU[_local8])]);
_local8++;
};
if (_local11 != 63){
writeBits(_local6);
};
return (_arg3);
}
private function initQuantTables(_arg1:int):void{
var _local2:int;
var _local3:Number;
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:int;
var _local8:int;
_local4 = [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++;
};
_local5 = [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++;
};
_local6 = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379];
_local2 = 0;
_local7 = 0;
while (_local7 < 8) {
_local8 = 0;
while (_local8 < 8) {
fdtbl_Y[_local2] = (1 / (((YTable[ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
fdtbl_UV[_local2] = (1 / (((UVTable[ZigZag[_local2]] * _local6[_local7]) * _local6[_local8]) * 8));
_local2++;
_local8++;
};
_local7++;
};
}
private function writeSOF0(_arg1:int, _arg2:int):void{
writeWord(65472);
writeWord(17);
writeByte(8);
writeWord(_arg2);
writeWord(_arg1);
writeByte(3);
writeByte(1);
writeByte(17);
writeByte(0);
writeByte(2);
writeByte(17);
writeByte(1);
writeByte(3);
writeByte(17);
writeByte(1);
}
private function computeHuffmanTbl(_arg1:Array, _arg2:Array):Array{
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:int;
var _local7:int;
_local3 = 0;
_local4 = 0;
_local5 = new Array();
_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;
_local23 = 0;
_local22 = 0;
while (_local22 < 8) {
_local3 = (_arg1[(_local23 + 0)] + _arg1[(_local23 + 7)]);
_local10 = (_arg1[(_local23 + 0)] - _arg1[(_local23 + 7)]);
_local4 = (_arg1[(_local23 + 1)] + _arg1[(_local23 + 6)]);
_local9 = (_arg1[(_local23 + 1)] - _arg1[(_local23 + 6)]);
_local5 = (_arg1[(_local23 + 2)] + _arg1[(_local23 + 5)]);
_local8 = (_arg1[(_local23 + 2)] - _arg1[(_local23 + 5)]);
_local6 = (_arg1[(_local23 + 3)] + _arg1[(_local23 + 4)]);
_local7 = (_arg1[(_local23 + 3)] - _arg1[(_local23 + 4)]);
_local11 = (_local3 + _local6);
_local14 = (_local3 - _local6);
_local12 = (_local4 + _local5);
_local13 = (_local4 - _local5);
_arg1[(_local23 + 0)] = (_local11 + _local12);
_arg1[(_local23 + 4)] = (_local11 - _local12);
_local15 = ((_local13 + _local14) * 0.707106781);
_arg1[(_local23 + 2)] = (_local14 + _local15);
_arg1[(_local23 + 6)] = (_local14 - _local15);
_local11 = (_local7 + _local8);
_local12 = (_local8 + _local9);
_local13 = (_local9 + _local10);
_local19 = ((_local11 - _local13) * 0.382683433);
_local16 = ((0.5411961 * _local11) + _local19);
_local18 = ((1.306562965 * _local13) + _local19);
_local17 = (_local12 * 0.707106781);
_local20 = (_local10 + _local17);
_local21 = (_local10 - _local17);
_arg1[(_local23 + 5)] = (_local21 + _local16);
_arg1[(_local23 + 3)] = (_local21 - _local16);
_arg1[(_local23 + 1)] = (_local20 + _local18);
_arg1[(_local23 + 7)] = (_local20 - _local18);
_local23 = (_local23 + 8);
_local22++;
};
_local23 = 0;
_local22 = 0;
while (_local22 < 8) {
_local3 = (_arg1[(_local23 + 0)] + _arg1[(_local23 + 56)]);
_local10 = (_arg1[(_local23 + 0)] - _arg1[(_local23 + 56)]);
_local4 = (_arg1[(_local23 + 8)] + _arg1[(_local23 + 48)]);
_local9 = (_arg1[(_local23 + 8)] - _arg1[(_local23 + 48)]);
_local5 = (_arg1[(_local23 + 16)] + _arg1[(_local23 + 40)]);
_local8 = (_arg1[(_local23 + 16)] - _arg1[(_local23 + 40)]);
_local6 = (_arg1[(_local23 + 24)] + _arg1[(_local23 + 32)]);
_local7 = (_arg1[(_local23 + 24)] - _arg1[(_local23 + 32)]);
_local11 = (_local3 + _local6);
_local14 = (_local3 - _local6);
_local12 = (_local4 + _local5);
_local13 = (_local4 - _local5);
_arg1[(_local23 + 0)] = (_local11 + _local12);
_arg1[(_local23 + 32)] = (_local11 - _local12);
_local15 = ((_local13 + _local14) * 0.707106781);
_arg1[(_local23 + 16)] = (_local14 + _local15);
_arg1[(_local23 + 48)] = (_local14 - _local15);
_local11 = (_local7 + _local8);
_local12 = (_local8 + _local9);
_local13 = (_local9 + _local10);
_local19 = ((_local11 - _local13) * 0.382683433);
_local16 = ((0.5411961 * _local11) + _local19);
_local18 = ((1.306562965 * _local13) + _local19);
_local17 = (_local12 * 0.707106781);
_local20 = (_local10 + _local17);
_local21 = (_local10 - _local17);
_arg1[(_local23 + 40)] = (_local21 + _local16);
_arg1[(_local23 + 24)] = (_local21 - _local16);
_arg1[(_local23 + 8)] = (_local20 + _local18);
_arg1[(_local23 + 56)] = (_local20 - _local18);
_local23++;
_local22++;
};
_local22 = 0;
while (_local22 < 64) {
_arg1[_local22] = Math.round((_arg1[_local22] * _arg2[_local22]));
_local22++;
};
return (_arg1);
}
}
}//package com.adobe.images
Section 3
//BaseTile (com.evilfree.solarola.tiles.BaseTile)
package com.evilfree.solarola.tiles {
import flash.display.*;
public class BaseTile extends MovieClip {
private var _type:String;
public var gColor:MovieClip;
public var color:Number;
private var myData:XML;
public function setData(_arg1:XML){
myData = _arg1;
_type = myData.@type;
switch (_type){
case "gate":
color = Number(myData.@color);
break;
};
}
public function set type(_arg1:String){
_type = _arg1;
}
public function get type():String{
return (_type);
}
}
}//package com.evilfree.solarola.tiles
Section 4
//TraceTile (com.evilfree.solarola.tiles.TraceTile)
package com.evilfree.solarola.tiles {
import flash.display.*;
import flash.events.*;
import org.cove.ape.*;
public class TraceTile extends MovieClip {
private var tileDisplay:MovieClip;
private var myRotator:Rotator;
private var myIndex:Number;
public function TraceTile(_arg1:uint){
myIndex = _arg1;
tileDisplay = new TileTrace();
addChild(tileDisplay);
}
public function setRotator(_arg1:Rotator){
myRotator = _arg1;
if (myRotator.bTestMode == true){
tileDisplay.addEventListener(MouseEvent.CLICK, tileClicked);
tileDisplay.addEventListener(MouseEvent.ROLL_OVER, tileRolled);
tileDisplay.addEventListener(MouseEvent.ROLL_OUT, tileRolled);
tileDisplay.buttonMode = true;
};
}
private function tileRolled(_arg1:Event){
if (_arg1.type == MouseEvent.ROLL_OVER){
tileDisplay.gotoAndStop(2);
} else {
tileDisplay.gotoAndStop(1);
};
}
public function tileClicked(_arg1:Event){
var _local2:Number;
var _local3:XML;
var _local4:XML;
_local4 = myRotator.getLevelXML();
if ((((myRotator.currentTileType == 6)) || ((myRotator.currentTileType == 7)))){
trace("start");
} else {
_local3 = _local4.tiles.tPiece[myIndex];
if (_local3.@type == "none"){
switch (myRotator.currentTileType){
case 1:
_local3.@type = "wazGoal";
break;
case 3:
_local3.@type = "gate";
_local3.@color = "0x0000FF";
break;
case 4:
_local3.@type = "gate";
_local3.@color = "0xFF0000";
break;
case 5:
_local3.@type = "gate";
_local3.@color = "0x008800";
break;
case 6:
_local3.@type = "gate";
_local3.@color = "0xFF0000";
break;
case 7:
_local3.@type = "gate";
_local3.@color = "0x008800";
break;
default:
_local3.@type = "wizGoal";
break;
};
} else {
_local3.@type = "none";
delete _local3.@color;
};
};
myRotator.drawTiles();
}
}
}//package com.evilfree.solarola.tiles
Section 5
//BaseWall (com.evilfree.solarola.walls.BaseWall)
package com.evilfree.solarola.walls {
import flash.display.*;
import flash.events.*;
import org.cove.ape.*;
import fl.motion.*;
public class BaseWall {
private var startX:Number;
private var thisWidth:Number;
public var type:String;
private var rectParticle:RectangleParticle;
public var rowNum:Number;
public var columnNum:Number;
private var thisY:Number;
private var orientation:String;
private var myRotator:Rotator;
public var color:Number;
private var thisHeight:Number;
private var wallActive:Boolean;
private var startY:Number;
private var arrayIndex:Number;
private var thisX:Number;
private var bridgeGroup:Bridge;
public function BaseWall(_arg1:Rotator, _arg2:String){
myRotator = _arg1;
wallActive = true;
type = _arg2;
startX = 0;
startY = 0;
}
function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public function remove(){
if ((((type == "gate")) || ((type == "standard")))){
myRotator.removeParticle(rectParticle);
};
if (type == "bridge"){
myRotator.removeCollidable(bridgeGroup);
APEngine.removeGroup(bridgeGroup);
};
}
public function setRandomPosition(){
if ((((type == "gate")) || ((type == "standard")))){
startX = ((thisX + (Math.random() * 1400)) - 700);
startY = ((thisY + (Math.random() * 1400)) - 2000);
rectParticle.alwaysRepaint = true;
rectParticle.px = startX;
rectParticle.py = startY;
rectParticle.visible = false;
};
if (type == "bridge"){
APEngine.removeGroup(bridgeGroup);
};
}
public function createBridge(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
bridgeGroup = new Bridge(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function moveIn(_arg1:Number){
if ((((type == "gate")) || ((type == "standard")))){
if (_arg1 < 31){
rectParticle.visible = true;
rectParticle.px = easeOut(_arg1, startX, (thisX - startX), 30);
rectParticle.py = easeOut(_arg1, startY, (thisY - startY), 30);
};
if (_arg1 == 31){
rectParticle.alwaysRepaint = false;
rectParticle.collidable = true;
};
};
if ((((type == "bridge")) && ((_arg1 == 31)))){
APEngine.addGroup(bridgeGroup);
};
}
public function hideWall(){
if (type == "gate"){
if (wallActive == false){
return;
};
wallActive = false;
myRotator.removeParticle(rectParticle);
};
}
public function closeGate(){
showWall();
}
public function freeWall(){
var _local1:Vector;
if ((((type == "gate")) || ((type == "standard")))){
rectParticle.fixed = false;
rectParticle.velocity = new Vector(((Math.random() * 16) - 8), ((Math.random() * 20) - 10));
};
if (type == "bridge"){
bridgeGroup.release();
};
}
public function addToDisplay(){
if ((((type == "gate")) || ((type == "standard")))){
myRotator.addParticle(rectParticle);
};
if (type == "bridge"){
myRotator.addCollidable(bridgeGroup);
APEngine.addGroup(bridgeGroup);
};
}
public function createWallRect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Boolean=false, _arg7:Number=1, _arg8:Number=0.3, _arg9:Number=0){
rectParticle = new RectangleParticle(_arg1, _arg2, _arg3, _arg4, 0, true);
rectParticle.collidable = false;
orientation = "vertical";
if (_arg3 > _arg4){
orientation = "horizontal";
};
thisX = _arg1;
thisY = _arg2;
thisWidth = _arg3;
thisHeight = _arg4;
}
public function openGate(_arg1:Number){
if (_arg1 == color){
hideWall();
};
}
public function setStyle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:MovieClip;
var _local6:Color;
if ((((type == "gate")) || ((type == "standard")))){
rectParticle.setStyle(_arg1, _arg2, _arg3, _arg4);
};
if ((((type == "standard")) || ("gate"))){
if (orientation == "horizontal"){
_local5 = new StandardWall();
_local5.wl.x = (-(thisWidth) / 2);
_local5.wr.x = (thisWidth / 2);
_local5.wm.width = (thisWidth - 10);
_local5.rotation = 90;
rectParticle.setDisplay(_local5);
};
if (orientation == "vertical"){
_local5 = new StandardWall();
_local5.wl.y = (-(thisHeight) / 2);
_local5.wr.y = (thisHeight / 2);
_local5.wl.rotation = 90;
_local5.wr.rotation = 90;
_local5.wm.width = (thisHeight - 10);
_local5.wm.rotation = 90;
rectParticle.setDisplay(_local5);
};
if (type == "gate"){
_local6 = new Color();
_local6.setTint(_arg2, 0.6);
_local5.wm.transform.colorTransform = _local6;
};
};
}
public function showWall(){
if (type == "gate"){
if (wallActive){
return;
};
wallActive = true;
myRotator.addParticle(rectParticle);
};
}
}
}//package com.evilfree.solarola.walls
Section 6
//Bridge (com.evilfree.solarola.walls.Bridge)
package com.evilfree.solarola.walls {
import org.cove.ape.*;
public class Bridge extends Group {
public var circleList:Array;
public var columnNum:Number;
public var rowNum:Number;
public var color:Number;
public var type:String;
public function Bridge(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Array;
var _local16:int;
var _local17:Number;
var _local18:Number;
var _local19:Boolean;
var _local20:CircleParticle;
var _local21:CircleParticle;
var _local22:CircleParticle;
var _local23:SpringConstraint;
super();
_local6 = 0xFF0000;
_local7 = 0;
_local8 = 0;
_local9 = (_arg3 - _arg1);
_local10 = (_arg4 - _arg2);
_local11 = 2;
_local12 = _arg5;
_local13 = (_local9 / _local12);
_local14 = (_local10 / _local12);
circleList = [];
_local15 = [];
trace(("xstep:" + _local13));
_local17 = _arg1;
_local18 = _arg2;
trace(_local17);
_local16 = 0;
while (_local16 <= _local12) {
_local19 = false;
if ((((_local16 == 0)) || ((_local16 == _local12)))){
_local19 = true;
};
_local20 = new CircleParticle(_local17, _local18, _local11, _local19);
_local20.mass = 3;
circleList.push(_local20);
addParticle(_local20);
_local17 = (_local17 + _local13);
_local18 = (_local18 + _local14);
_local16++;
};
_local16 = 1;
while (_local16 <= _local12) {
_local21 = circleList[(_local16 - 1)];
_local22 = circleList[_local16];
_local23 = new SpringConstraint(_local21, _local22, 1, true, 5, 0.9);
if ((((_local16 == 1)) || ((_local16 == _local12)))){
_local23.fixedEndLimit = 0.25;
};
_local15.push(_local23);
addConstraint(_local23);
_local16++;
};
}
public function release(){
var _local1:CircleParticle;
_local1 = circleList[0];
_local1.fixed = false;
_local1.velocity = new Vector(((Math.random() * 16) - 8), ((Math.random() * 20) - 10));
_local1 = circleList[(circleList.length - 1)];
_local1.fixed = false;
_local1.velocity = new Vector(((Math.random() * 16) - 8), ((Math.random() * 20) - 10));
}
public function setStyle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
}
public function closeGate(){
}
public function openGate(_arg1:Number){
}
}
}//package com.evilfree.solarola.walls
Section 7
//TraceLine (com.evilfree.solarola.walls.TraceLine)
package com.evilfree.solarola.walls {
import flash.display.*;
import flash.events.*;
import org.cove.ape.*;
public class TraceLine extends MovieClip {
public var color:Number;
private var myRotator:Rotator;
private var wallActive:Boolean;
private var thisHeight:Number;
private var thisY:Number;
private var myIndex:Number;
public var type:String;
private var thisX:Number;
private var thisWidth:Number;
private var orientation:String;
public function TraceLine(_arg1:uint, _arg2:String){
var _local3:MovieClip;
super();
myIndex = _arg1;
orientation = _arg2;
if (orientation == "horizontal"){
_local3 = new hTraceLine();
} else {
_local3 = new vTraceLine();
};
addChild(_local3);
}
public function setRotator(_arg1:Rotator){
myRotator = _arg1;
if (myRotator.bTestMode == true){
this.addEventListener(MouseEvent.CLICK, gridWallClicked);
this.buttonMode = true;
};
}
public function gridWallClicked(_arg1:Event){
var _local2:Number;
var _local3:XML;
var _local4:XML;
_local4 = myRotator.getLevelXML();
if (orientation == "horizontal"){
_local3 = _local4.hWalls.wPiece[myIndex];
if (_local3.@type == "none"){
switch (myRotator.currentWallType){
case 1:
_local3.@type = "bridge";
break;
case 3:
_local3.@type = "gate";
_local3.@color = "0x0000FF";
break;
case 4:
_local3.@type = "gate";
_local3.@color = "0xFF0000";
break;
case 5:
_local3.@type = "gate";
_local3.@color = "0x008800";
break;
default:
_local3.@type = "standard";
break;
};
} else {
_local3.@type = "none";
delete _local3.@color;
};
_local2 = Number(_local3.@y);
myRotator.removeRow(_local2);
myRotator.drawRow(_local2);
} else {
_local3 = _local4.vWalls.wPiece[myIndex];
if (_local3.@type == "none"){
switch (myRotator.currentWallType){
case 1:
_local3.@type = "bridge";
break;
case 3:
_local3.@type = "gate";
_local3.@color = "0x0000FF";
break;
case 4:
_local3.@type = "gate";
_local3.@color = "0xFF0000";
break;
case 5:
_local3.@type = "gate";
_local3.@color = "0x008800";
break;
default:
_local3.@type = "standard";
break;
};
} else {
_local3.@type = "none";
};
_local2 = Number(_local3.@x);
myRotator.removeColumn(_local2);
myRotator.drawColumn(_local2);
};
}
}
}//package com.evilfree.solarola.walls
Section 8
//AboutMenu (com.evilfree.solarola.AboutMenu)
package com.evilfree.solarola {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class AboutMenu extends MovieClip {
public var closeButton:SimpleButton;
private var lText:LocalText;
public var mobileLink:MovieClip;
public function receiveLocalText(_arg1:LocalText){
lText = _arg1;
mobileLink.local.text = ((lText.getText("About 1") + "\n") + lText.getText("Site"));
mobileLink.addEventListener(MouseEvent.MOUSE_UP, showMobile);
mobileLink.buttonMode = true;
mobileLink.mouseChildren = false;
}
public function showMobile(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.eidosmobile.com/solarola/");
navigateToURL(_local2, "_blank");
}
}
}//package com.evilfree.solarola
Section 9
//CreditsMenu (com.evilfree.solarola.CreditsMenu)
package com.evilfree.solarola {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class CreditsMenu extends MovieClip {
public var credits2:TextField;
public var closeButton:SimpleButton;
public var gimme5logo:MovieClip;
private var lText:LocalText;
public var evilfreeLogo:MovieClip;
public var credits1:TextField;
public var credits3:TextField;
public function showEvilFree(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.evilfree.com/redirect.php?from=AR3");
navigateToURL(_local2, "_blank");
}
public function showGimme5(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.gimme5games.com");
navigateToURL(_local2, "_blank");
}
public function receiveLocalText(_arg1:LocalText){
lText = _arg1;
credits1.text = lText.getText("credits2");
credits2.text = lText.getText("credits3");
credits3.text = lText.getText("credits4");
evilfreeLogo.addEventListener(MouseEvent.MOUSE_UP, showEvilFree);
gimme5logo.addEventListener(MouseEvent.MOUSE_UP, showGimme5);
evilfreeLogo.buttonMode = true;
gimme5logo.buttonMode = true;
}
}
}//package com.evilfree.solarola
Section 10
//LevelSelectButton (com.evilfree.solarola.LevelSelectButton)
package com.evilfree.solarola {
import flash.display.*;
import flash.text.*;
public class LevelSelectButton extends MovieClip {
private var state_mc:MovieClip;
private var ln:TextField;
public var currentState:int;
public var myNum:Number;
public var levelPreview:MovieClip;
public var levelNumber:TextField;
public function LevelSelectButton(){
myNum = 5;
currentState = 0;
}
public function getNum(){
return (myNum);
}
public function setState(_arg1:int){
if (((!((state_mc == null))) && (this.contains(state_mc)))){
this.removeChild(state_mc);
};
trace(("Set State: " + _arg1));
switch (_arg1){
case 0:
currentState = 0;
break;
case 1:
state_mc = new LevelLocked();
state_mc.x = -43;
state_mc.y = -43;
this.addChild(state_mc);
currentState = 1;
break;
case 2:
state_mc = new LevelDone();
state_mc.x = -43;
state_mc.y = -43;
this.addChild(state_mc);
currentState = 2;
break;
};
}
public function setLevel(_arg1:Number){
this.levelPreview.gotoAndStop(_arg1);
this.levelNumber.text = ("" + _arg1);
}
}
}//package com.evilfree.solarola
Section 11
//LocalText (com.evilfree.solarola.LocalText)
package com.evilfree.solarola {
import flash.events.*;
import flash.net.*;
public class LocalText {
private var language:String;
private var textXML:XML;
public function LocalText(_arg1:XML){
var tXML = _arg1;
super();
trace("Creating new local Text");
textXML = tXML;
trace(("Text xml:" + textXML.text.(@key == "play").language.(@key == "en").toString()));
}
public function getText(_arg1:String):String{
var myKey = _arg1;
trace(((("my key:" + myKey) + " my language:") + language));
return (textXML.text.(@key == myKey).language.(@key == language).toString());
}
public function textComplete(_arg1:Event){
trace("text complete");
textXML = XML(_arg1.currentTarget.data);
trace(textXML.toString());
}
public function setLanguage(_arg1:String){
trace(("language is:" + _arg1));
language = _arg1;
}
}
}//package com.evilfree.solarola
Section 12
//PauseMenu (com.evilfree.solarola.PauseMenu)
package com.evilfree.solarola {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
public class PauseMenu extends MovieClip {
public var pause6:TextField;
public var pause3:TextField;
public var pause4:TextField;
public var pause5:TextField;
public var pause7:TextField;
public var pause2:TextField;
public var pause8:TextField;
private var selectedFilter:GlowFilter;
private var pauseItemSelected:Number;
public var pause1:TextField;
public var pButton1:MovieClip;
public var pButton2:MovieClip;
public var pButton3:MovieClip;
public var pButton5:MovieClip;
private var solaRolaRef:SolaRola;
public var pButton4:MovieClip;
public var pButton6:MovieClip;
private var selectedMainFilter:GlowFilter;
private var unselectedFilter:GlowFilter;
private var lText:LocalText;
private var unselectedMainFilter:GlowFilter;
public function PauseMenu(){
unselectedFilter = new GlowFilter(11520480, 1, 4, 4, 75, 1, false, false);
selectedFilter = new GlowFilter(5208997, 1, 4, 4, 75, 1, false, false);
unselectedMainFilter = new GlowFilter(9961988, 1, 4, 4, 75, 1, false, false);
selectedMainFilter = new GlowFilter(0xFF0000, 1, 4, 4, 75, 1, false, false);
}
public function showPauseMenu(_arg1:Boolean){
if (_arg1 == true){
switch (this.stage.quality){
case "LOW":
pause7.text = String(lText.getText("Pause Menu 9"));
break;
case "MEDIUM":
pause7.text = String(lText.getText("Pause Menu 8"));
break;
case "HIGH":
pause7.text = String(lText.getText("Pause Menu 7"));
break;
};
this.visible = true;
} else {
this.visible = false;
};
}
private function toggleQuality(){
switch (this.stage.quality){
case "LOW":
this.stage.quality = StageQuality.MEDIUM;
solaRolaRef.currentGameQuality = StageQuality.MEDIUM;
break;
case "MEDIUM":
this.stage.quality = StageQuality.HIGH;
solaRolaRef.currentGameQuality = StageQuality.HIGH;
break;
case "HIGH":
this.stage.quality = StageQuality.LOW;
solaRolaRef.currentGameQuality = StageQuality.LOW;
break;
};
switch (this.stage.quality){
case "LOW":
pause7.text = String(lText.getText("Pause Menu 9"));
break;
case "MEDIUM":
pause7.text = String(lText.getText("Pause Menu 8"));
break;
case "HIGH":
pause7.text = String(lText.getText("Pause Menu 7"));
break;
};
}
private function pauseClick(_arg1:MouseEvent){
menuClick(_arg1.currentTarget.name.charAt(7));
}
private function menuClick(_arg1:uint){
var _local2:URLRequest;
switch (_arg1){
case 1:
solaRolaRef.doPause();
break;
case 2:
_local2 = new URLRequest(SolaRola.cMoreGamesLink);
navigateToURL(_local2, "_blank");
break;
case 3:
solaRolaRef.doMainMenu();
solaRolaRef.doPause();
break;
case 4:
solaRolaRef.resetRotator();
solaRolaRef.doPause();
break;
case 5:
toggleQuality();
break;
case 6:
solaRolaRef.showPopupScreen(0);
break;
};
}
public function interceptMenuPress(_arg1:Boolean, _arg2:Boolean, _arg3:Boolean){
var _local4:*;
if (_arg3 == false){
if (_arg1 == true){
pauseItemSelected--;
if (pauseItemSelected < 1){
pauseItemSelected = 6;
};
} else {
if (_arg2 == true){
pauseItemSelected++;
if (pauseItemSelected > 6){
pauseItemSelected = 1;
};
};
};
} else {
menuClick(pauseItemSelected);
};
_local4 = 1;
while (_local4 <= 8) {
if ((((_local4 == 1)) || ((_local4 == 7)))){
this[("pause" + _local4)].filters = [unselectedMainFilter];
} else {
this[("pause" + _local4)].filters = [unselectedFilter];
};
_local4++;
};
if (pauseItemSelected == 5){
pause6.filters = [selectedFilter];
pause7.filters = [selectedMainFilter];
} else {
if (pauseItemSelected == 6){
pause8.filters = [selectedFilter];
} else {
this[("pause" + (pauseItemSelected + 1))].filters = [selectedFilter];
};
};
}
public function receiveLocalText(_arg1:LocalText){
lText = _arg1;
pause1.text = lText.getText("Game Paused");
pause2.text = String(lText.getText("Pause Menu 1"));
pause3.text = String(lText.getText("Pause Menu 2"));
pause4.text = String(lText.getText("Pause Menu 3"));
pause5.text = String(lText.getText("Pause Menu 4"));
pause6.text = String(lText.getText("Pause Menu 6"));
pause7.text = String(lText.getText("Pause Menu 7"));
pause8.text = String(lText.getText("Pause Menu 5"));
}
private function pauseRoll(_arg1:MouseEvent){
var _local2:*;
_local2 = 1;
while (_local2 <= 8) {
if ((((_local2 == 1)) || ((_local2 == 7)))){
this[("pause" + _local2)].filters = [unselectedMainFilter];
} else {
this[("pause" + _local2)].filters = [unselectedFilter];
};
_local2++;
};
pauseItemSelected = _arg1.currentTarget.name.charAt(7);
if (pauseItemSelected == 5){
pause6.filters = [selectedFilter];
pause7.filters = [selectedMainFilter];
} else {
if (pauseItemSelected == 6){
pause8.filters = [selectedFilter];
} else {
this[("pause" + (pauseItemSelected + 1))].filters = [selectedFilter];
};
};
}
public function setSolaRef(_arg1:SolaRola){
var _local2:*;
solaRolaRef = _arg1;
_local2 = 1;
while (_local2 <= 6) {
this[("pButton" + _local2)].addEventListener(MouseEvent.CLICK, pauseClick);
this[("pButton" + _local2)].addEventListener(MouseEvent.ROLL_OVER, pauseRoll);
this[("pButton" + _local2)].buttonMode = true;
_local2++;
};
_local2 = 1;
while (_local2 <= 8) {
if ((((_local2 == 1)) || ((_local2 == 7)))){
this[("pause" + _local2)].filters = [unselectedMainFilter];
} else {
this[("pause" + _local2)].filters = [unselectedFilter];
};
this[("pause" + _local2)].mouseEnabled = false;
_local2++;
};
pauseItemSelected = 1;
pause2.filters = [selectedFilter];
}
}
}//package com.evilfree.solarola
Section 13
//WellDoneMenu (com.evilfree.solarola.WellDoneMenu)
package com.evilfree.solarola {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.filters.*;
public class WellDoneMenu extends MovieClip {
public var nextLevelButton:MovieClip;
private var selectedFilter:GlowFilter;
public var yourLevel:TextField;
private var scoreCurrentTime:Number;
public var submitScoreButton:MovieClip;
private var scoreCurrentLevel:Number;
public var bestTimeScore:TextField;
public var wellDone:TextField;
public var replayLevelButton:MovieClip;
public var wellDoneBack:MovieClip;
private var scoreCurrentString:String;
public var hiScores:HiScores;
public var actualLevel:TextField;
public var yourTime:TextField;
private var solaRolaRef:SolaRola;
private var lText:LocalText;
private var selectedMainFilter:GlowFilter;
private var unselectedFilter:GlowFilter;
public var bestTime:TextField;
public var actualTimeScore:TextField;
private var unselectedMainFilter:GlowFilter;
private var menuItemSelected:Number;
public var buttonSubmit:MovieClip;
public var levelSelectButton:MovieClip;
public function WellDoneMenu(){
unselectedFilter = new GlowFilter(11520480, 1, 4, 4, 75, 1, false, false);
selectedFilter = new GlowFilter(5208997, 1, 4, 4, 75, 1, false, false);
unselectedMainFilter = new GlowFilter(9961988, 1, 4, 4, 75, 1, false, false);
selectedMainFilter = new GlowFilter(0xFF0000, 1, 4, 4, 75, 1, false, false);
}
private function mouseClick(_arg1:MouseEvent){
menuClick(_arg1.currentTarget.name);
}
public function showMenu(_arg1:Boolean){
if (_arg1 == true){
this.visible = true;
} else {
this.visible = false;
};
}
public function updateWellDoneText(){
showStuff();
scoreCurrentLevel = solaRolaRef.getCurrentLevel();
scoreCurrentTime = solaRolaRef.getFrameCount();
scoreCurrentString = convertTimeToSecondsText(scoreCurrentTime);
hiScores.visible = false;
actualLevel.text = ((String((solaRolaRef.getCurrentLevel() + 1)) + "/") + String(SolaRola.cMaxNumberOfLevels));
if (solaRolaRef.userStatsSO.data[("level" + solaRolaRef.getCurrentLevel())] == null){
solaRolaRef.userStatsSO.data[("level" + solaRolaRef.getCurrentLevel())] = solaRolaRef.getFrameCount();
} else {
if (solaRolaRef.userStatsSO.data[("level" + solaRolaRef.getCurrentLevel())] > solaRolaRef.getFrameCount()){
solaRolaRef.userStatsSO.data[("level" + solaRolaRef.getCurrentLevel())] = solaRolaRef.getFrameCount();
};
};
actualTimeScore.text = convertTimeToSecondsText(solaRolaRef.getFrameCount());
bestTimeScore.text = convertTimeToSecondsText(solaRolaRef.userStatsSO.data[("level" + solaRolaRef.getCurrentLevel())]);
}
private function menuClick(_arg1:String){
switch (_arg1){
case "buttonSubmit":
showSubmit();
trace("Submit");
break;
case "levelSelectButton":
solaRolaRef.bDisableKeyPresses = false;
solaRolaRef.playMode = "play";
solaRolaRef.rotator.showLevelSelector();
solaRolaRef.rotator.updateLevelButtons();
solaRolaRef.bDeconstructing = false;
break;
case "replayLevelButton":
solaRolaRef.bDisableKeyPresses = false;
solaRolaRef.playMode = "play";
solaRolaRef.rotator.loadNextLevel();
solaRolaRef.bDeconstructing = false;
break;
case "nextLevelButton":
solaRolaRef.bDisableKeyPresses = false;
solaRolaRef.playMode = "play";
solaRolaRef.rotator.currentLevelNum++;
solaRolaRef.rotator.loadNextLevel();
solaRolaRef.bDeconstructing = false;
break;
};
}
private function showStuff(){
wellDone.visible = true;
yourLevel.visible = true;
yourTime.visible = true;
bestTime.visible = true;
wellDoneBack.visible = true;
buttonSubmit.visible = true;
submitScoreButton.visible = true;
}
private function showSubmit(){
solaRolaRef.bDisableKeyPresses = true;
hideStuff();
scoreCurrentTime = Math.round(((scoreCurrentTime * 1000) / 30));
trace(("Score Level:" + scoreCurrentLevel));
trace(("Score Time:" + scoreCurrentTime));
trace(("Score String:" + scoreCurrentString));
hiScores.setDetails(17, scoreCurrentLevel, "solarola", true, scoreCurrentTime, scoreCurrentString, "seconds!");
}
public function receiveLocalText(_arg1:LocalText){
lText = _arg1;
yourLevel.text = lText.getText("Level");
wellDone.text = lText.getText("well done");
yourTime.text = lText.getText("your time");
bestTime.text = lText.getText("best time");
buttonSubmit.local.text = lText.getText("submit");
levelSelectButton.local.text = lText.getText("level select");
replayLevelButton.local.text = lText.getText("replay level");
nextLevelButton.local.text = lText.getText("next level");
}
public function interceptMenuPress(_arg1:Boolean, _arg2:Boolean, _arg3:Boolean){
if (_arg3 == false){
if (_arg1 == true){
menuItemSelected--;
if (menuItemSelected < 1){
menuItemSelected = 4;
};
} else {
if (_arg2 == true){
menuItemSelected++;
if (menuItemSelected > 4){
menuItemSelected = 1;
};
};
};
} else {
switch (menuItemSelected){
case 1:
menuClick("buttonSubmit");
break;
case 2:
menuClick("levelSelectButton");
break;
case 3:
menuClick("replayLevelButton");
break;
case 4:
menuClick("nextLevelButton");
break;
};
};
this.buttonSubmit.local.filters = [unselectedMainFilter];
this.levelSelectButton.local.filters = [unselectedFilter];
this.replayLevelButton.local.filters = [unselectedFilter];
this.nextLevelButton.local.filters = [unselectedFilter];
switch (menuItemSelected){
case 1:
this.buttonSubmit.local.filters = [selectedMainFilter];
break;
case 2:
this.levelSelectButton.local.filters = [selectedFilter];
break;
case 3:
this.replayLevelButton.local.filters = [selectedFilter];
break;
case 4:
this.nextLevelButton.local.filters = [selectedFilter];
break;
};
}
private function convertTimeToSecondsText(_arg1:Number):String{
var _local2:Number;
var _local3:String;
_local2 = (_arg1 / 30);
_local2 = (Math.round((_local2 * 10)) / 10);
_local3 = _local2.toString();
if (_local3.indexOf(".") == -1){
_local3 = (_local3 + ".0");
};
return (_local3);
}
private function mouseRoll(_arg1:MouseEvent){
this.buttonSubmit.local.filters = [unselectedMainFilter];
this.levelSelectButton.local.filters = [unselectedFilter];
this.replayLevelButton.local.filters = [unselectedFilter];
this.nextLevelButton.local.filters = [unselectedFilter];
switch (_arg1.currentTarget.name){
case "buttonSubmit":
menuItemSelected = 1;
this.buttonSubmit.local.filters = [selectedMainFilter];
break;
case "levelSelectButton":
menuItemSelected = 2;
this.levelSelectButton.local.filters = [selectedFilter];
break;
case "replayLevelButton":
menuItemSelected = 3;
this.replayLevelButton.local.filters = [selectedFilter];
break;
case "nextLevelButton":
menuItemSelected = 4;
this.nextLevelButton.local.filters = [selectedFilter];
break;
};
}
private function hideStuff(){
wellDone.visible = false;
yourLevel.visible = false;
yourTime.visible = false;
bestTime.visible = false;
wellDoneBack.visible = false;
buttonSubmit.visible = false;
submitScoreButton.visible = false;
}
public function setSolaRef(_arg1:SolaRola){
solaRolaRef = _arg1;
this.buttonSubmit.addEventListener(MouseEvent.CLICK, mouseClick);
this.buttonSubmit.addEventListener(MouseEvent.ROLL_OVER, mouseRoll);
this.buttonSubmit.buttonMode = true;
this.levelSelectButton.addEventListener(MouseEvent.CLICK, mouseClick);
this.levelSelectButton.addEventListener(MouseEvent.ROLL_OVER, mouseRoll);
this.levelSelectButton.buttonMode = true;
this.replayLevelButton.addEventListener(MouseEvent.CLICK, mouseClick);
this.replayLevelButton.addEventListener(MouseEvent.ROLL_OVER, mouseRoll);
this.replayLevelButton.buttonMode = true;
this.nextLevelButton.addEventListener(MouseEvent.CLICK, mouseClick);
this.nextLevelButton.addEventListener(MouseEvent.ROLL_OVER, mouseRoll);
this.nextLevelButton.buttonMode = true;
this.buttonSubmit.local.filters = [unselectedMainFilter];
this.buttonSubmit.local.mouseEnabled = false;
this.levelSelectButton.local.filters = [unselectedFilter];
this.levelSelectButton.local.mouseEnabled = false;
this.replayLevelButton.local.filters = [unselectedFilter];
this.replayLevelButton.local.mouseEnabled = false;
this.nextLevelButton.local.filters = [selectedFilter];
this.nextLevelButton.local.mouseEnabled = false;
menuItemSelected = 4;
}
}
}//package com.evilfree.solarola
Section 14
//BaseScrollPane (fl.containers.BaseScrollPane)
package fl.containers {
import fl.core.*;
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import fl.events.*;
public class BaseScrollPane extends UIComponent {
protected var defaultLineScrollSize:Number;// = 4
protected var _maxHorizontalScrollPosition:Number;// = 0
protected var vScrollBar:Boolean;
protected var disabledOverlay:Shape;
protected var hScrollBar:Boolean;
protected var availableWidth:Number;
protected var _verticalPageScrollSize:Number;// = 0
protected var vOffset:Number;// = 0
protected var _verticalScrollBar:ScrollBar;
protected var useFixedHorizontalScrolling:Boolean;// = false
protected var contentWidth:Number;// = 0
protected var contentHeight:Number;// = 0
protected var _horizontalPageScrollSize:Number;// = 0
protected var background:DisplayObject;
protected var _useBitmpScrolling:Boolean;// = false
protected var contentPadding:Number;// = 0
protected var availableHeight:Number;
protected var _horizontalScrollBar:ScrollBar;
protected var contentScrollRect:Rectangle;
protected var _horizontalScrollPolicy:String;
protected var _verticalScrollPolicy:String;
protected static const SCROLL_BAR_STYLES:Object = {upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {repeatDelay:500, repeatInterval:35, skin:"ScrollPane_upSkin", contentPadding:0, disabledAlpha:0.5};
public function BaseScrollPane(){
contentWidth = 0;
contentHeight = 0;
contentPadding = 0;
vOffset = 0;
_maxHorizontalScrollPosition = 0;
_horizontalPageScrollSize = 0;
_verticalPageScrollSize = 0;
defaultLineScrollSize = 4;
useFixedHorizontalScrolling = false;
_useBitmpScrolling = false;
super();
}
protected function handleWheel(_arg1:MouseEvent):void{
if (((((!(enabled)) || (!(_verticalScrollBar.visible)))) || ((contentHeight <= availableHeight)))){
return;
};
_verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * verticalLineScrollSize));
setVerticalScrollPosition(_verticalScrollBar.scrollPosition);
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _arg1.delta, horizontalScrollPosition));
}
public function get verticalScrollPosition():Number{
return (_verticalScrollBar.scrollPosition);
}
protected function drawDisabledOverlay():void{
if (enabled){
if (contains(disabledOverlay)){
removeChild(disabledOverlay);
};
} else {
disabledOverlay.x = (disabledOverlay.y = contentPadding);
disabledOverlay.width = availableWidth;
disabledOverlay.height = availableHeight;
disabledOverlay.alpha = (getStyleValue("disabledAlpha") as Number);
addChild(disabledOverlay);
};
}
public function set verticalScrollPosition(_arg1:Number):void{
drawNow();
_verticalScrollBar.scrollPosition = _arg1;
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
}
protected function setContentSize(_arg1:Number, _arg2:Number):void{
if ((((((contentWidth == _arg1)) || (useFixedHorizontalScrolling))) && ((contentHeight == _arg2)))){
return;
};
contentWidth = _arg1;
contentHeight = _arg2;
invalidate(InvalidationType.SIZE);
}
public function get horizontalScrollPosition():Number{
return (_horizontalScrollBar.scrollPosition);
}
public function get horizontalScrollBar():ScrollBar{
return (_horizontalScrollBar);
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
_verticalScrollBar.enabled = _arg1;
_horizontalScrollBar.enabled = _arg1;
super.enabled = _arg1;
}
public function get verticalLineScrollSize():Number{
return (_verticalScrollBar.lineScrollSize);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
protected function calculateAvailableSize():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = ScrollBar.WIDTH;
_local2 = (contentPadding = Number(getStyleValue("contentPadding")));
_local3 = ((height - (2 * _local2)) - vOffset);
vScrollBar = (((_verticalScrollPolicy == ScrollPolicy.ON)) || ((((_verticalScrollPolicy == ScrollPolicy.AUTO)) && ((contentHeight > _local3)))));
_local4 = ((width - (vScrollBar) ? _local1 : 0) - (2 * _local2));
_local5 = (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - _local4);
hScrollBar = (((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_local5 > 0)))));
if (hScrollBar){
_local3 = (_local3 - _local1);
};
if (((((((hScrollBar) && (!(vScrollBar)))) && ((_verticalScrollPolicy == ScrollPolicy.AUTO)))) && ((contentHeight > _local3)))){
vScrollBar = true;
_local4 = (_local4 - _local1);
};
availableHeight = (_local3 + vOffset);
availableWidth = _local4;
}
public function get maxVerticalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentHeight - availableHeight)));
}
public function set horizontalScrollPosition(_arg1:Number):void{
drawNow();
_horizontalScrollBar.scrollPosition = _arg1;
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
}
public function get horizontalLineScrollSize():Number{
return (_horizontalScrollBar.lineScrollSize);
}
public function set verticalPageScrollSize(_arg1:Number):void{
_verticalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function get useBitmapScrolling():Boolean{
return (_useBitmpScrolling);
}
protected function handleScroll(_arg1:ScrollEvent):void{
if (_arg1.target == _verticalScrollBar){
setVerticalScrollPosition(_arg1.position);
} else {
setHorizontalScrollPosition(_arg1.position);
};
}
public function set verticalLineScrollSize(_arg1:Number):void{
_verticalScrollBar.lineScrollSize = _arg1;
}
public function get verticalScrollBar():ScrollBar{
return (_verticalScrollBar);
}
protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function set horizontalPageScrollSize(_arg1:Number):void{
_horizontalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STATE)){
drawLayout();
};
updateChildren();
super.draw();
}
public function set horizontalScrollPolicy(_arg1:String):void{
_horizontalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function configUI():void{
var _local1:Graphics;
super.configUI();
contentScrollRect = new Rectangle(0, 0, 85, 85);
_verticalScrollBar = new ScrollBar();
_verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_verticalScrollBar.visible = false;
_verticalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_verticalScrollBar);
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
_horizontalScrollBar = new ScrollBar();
_horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL;
_horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_horizontalScrollBar.visible = false;
_horizontalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_horizontalScrollBar);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
disabledOverlay = new Shape();
_local1 = disabledOverlay.graphics;
_local1.beginFill(0xFFFFFF);
_local1.drawRect(0, 0, width, height);
_local1.endFill();
addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);
}
protected function calculateContentWidth():void{
}
public function get verticalPageScrollSize():Number{
if (isNaN(availableHeight)){
drawNow();
};
return (((((_verticalPageScrollSize == 0)) && (!(isNaN(availableHeight))))) ? availableHeight : _verticalPageScrollSize);
}
protected function drawLayout():void{
calculateAvailableSize();
calculateContentWidth();
background.width = width;
background.height = height;
if (vScrollBar){
_verticalScrollBar.visible = true;
_verticalScrollBar.x = ((width - ScrollBar.WIDTH) - contentPadding);
_verticalScrollBar.y = contentPadding;
_verticalScrollBar.height = availableHeight;
} else {
_verticalScrollBar.visible = false;
};
_verticalScrollBar.setScrollProperties(availableHeight, 0, (contentHeight - availableHeight), verticalPageScrollSize);
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
if (hScrollBar){
_horizontalScrollBar.visible = true;
_horizontalScrollBar.x = contentPadding;
_horizontalScrollBar.y = ((height - ScrollBar.WIDTH) - contentPadding);
_horizontalScrollBar.width = availableWidth;
} else {
_horizontalScrollBar.visible = false;
};
_horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), horizontalPageScrollSize);
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
drawDisabledOverlay();
}
protected function drawBackground():void{
var _local1:DisplayObject;
_local1 = background;
background = getDisplayObjectInstance(getStyleValue("skin"));
background.width = width;
background.height = height;
addChildAt(background, 0);
if (((!((_local1 == null))) && (!((_local1 == background))))){
removeChild(_local1);
};
}
public function set horizontalLineScrollSize(_arg1:Number):void{
_horizontalScrollBar.lineScrollSize = _arg1;
}
public function get horizontalPageScrollSize():Number{
if (isNaN(availableWidth)){
drawNow();
};
return (((((_horizontalPageScrollSize == 0)) && (!(isNaN(availableWidth))))) ? availableWidth : _horizontalPageScrollSize);
}
public function get maxHorizontalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentWidth - availableWidth)));
}
protected function setStyles():void{
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
}
protected function updateChildren():void{
_verticalScrollBar.enabled = (_horizontalScrollBar.enabled = enabled);
_verticalScrollBar.drawNow();
_horizontalScrollBar.drawNow();
}
public function set verticalScrollPolicy(_arg1:String):void{
_verticalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set useBitmapScrolling(_arg1:Boolean):void{
_useBitmpScrolling = _arg1;
invalidate(InvalidationType.STATE);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.containers
Section 15
//CellRenderer (fl.controls.listClasses.CellRenderer)
package fl.controls.listClasses {
import fl.controls.*;
import flash.events.*;
public class CellRenderer extends LabelButton implements ICellRenderer {
protected var _data:Object;
protected var _listData:ListData;
private static var defaultStyles:Object = {upSkin:"CellRenderer_upSkin", downSkin:"CellRenderer_downSkin", overSkin:"CellRenderer_overSkin", disabledSkin:"CellRenderer_disabledSkin", selectedDisabledSkin:"CellRenderer_selectedDisabledSkin", selectedUpSkin:"CellRenderer_selectedUpSkin", selectedDownSkin:"CellRenderer_selectedDownSkin", selectedOverSkin:"CellRenderer_selectedOverSkin", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public function CellRenderer():void{
toggle = true;
focusEnabled = false;
}
override protected function toggleSelected(_arg1:MouseEvent):void{
}
override public function get selected():Boolean{
return (super.selected);
}
public function set listData(_arg1:ListData):void{
_listData = _arg1;
label = _listData.label;
setStyle("icon", _listData.icon);
}
override public function set selected(_arg1:Boolean):void{
super.selected = _arg1;
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function get listData():ListData{
return (_listData);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
super.setSize(_arg1, _arg2);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = 0;
if (icon != null){
icon.x = _local1;
icon.y = Math.round(((height - icon.height) >> 1));
_local2 = (icon.width + _local1);
};
if (label.length > 0){
textField.visible = true;
_local3 = Math.max(0, ((width - _local2) - (_local1 * 2)));
textField.width = _local3;
textField.height = (textField.textHeight + 4);
textField.x = (_local2 + _local1);
textField.y = Math.round(((height - textField.height) >> 1));
} else {
textField.visible = false;
};
background.width = width;
background.height = height;
}
public function get data():Object{
return (_data);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls.listClasses
Section 16
//ICellRenderer (fl.controls.listClasses.ICellRenderer)
package fl.controls.listClasses {
public interface ICellRenderer {
function setSize(_arg1:Number, _arg2:Number):void;
function get listData():ListData;
function get data():Object;
function setMouseState(_arg1:String):void;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function set data(_arg1:Object):void;
function set selected(_arg1:Boolean):void;
function set listData(_arg1:ListData):void;
function get selected():Boolean;
}
}//package fl.controls.listClasses
Section 17
//ListData (fl.controls.listClasses.ListData)
package fl.controls.listClasses {
import fl.core.*;
public class ListData {
protected var _index:uint;
protected var _owner:UIComponent;
protected var _label:String;
protected var _icon:Object;// = null
protected var _row:uint;
protected var _column:uint;
public function ListData(_arg1:String, _arg2:Object, _arg3:UIComponent, _arg4:uint, _arg5:uint, _arg6:uint=0){
_icon = null;
super();
_label = _arg1;
_icon = _arg2;
_owner = _arg3;
_index = _arg4;
_row = _arg5;
_column = _arg6;
}
public function get owner():UIComponent{
return (_owner);
}
public function get label():String{
return (_label);
}
public function get row():uint{
return (_row);
}
public function get index():uint{
return (_index);
}
public function get icon():Object{
return (_icon);
}
public function get column():uint{
return (_column);
}
}
}//package fl.controls.listClasses
Section 18
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import fl.events.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 19
//Button (fl.controls.Button)
package fl.controls {
import fl.core.*;
import flash.display.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 20
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 21
//CheckBox (fl.controls.CheckBox)
package fl.controls {
import flash.display.*;
public class CheckBox extends LabelButton {
private static var defaultStyles:Object = {icon:null, upIcon:"CheckBox_upIcon", downIcon:"CheckBox_downIcon", overIcon:"CheckBox_overIcon", disabledIcon:"CheckBox_disabledIcon", selectedDisabledIcon:"CheckBox_selectedDisabledIcon", focusRectSkin:null, focusRectPadding:null, selectedUpIcon:"CheckBox_selectedUpIcon", selectedDownIcon:"CheckBox_selectedDownIcon", selectedOverIcon:"CheckBox_selectedOverIcon", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public static var createAccessibilityImplementation:Function;
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = (background.x - _local2);
uiFocusRect.y = (background.y - _local2);
uiFocusRect.width = (background.width + (_local2 << 1));
uiFocusRect.height = (background.height + (_local2 << 1));
};
}
override public function get autoRepeat():Boolean{
return (false);
}
override public function set autoRepeat(_arg1:Boolean):void{
}
override public function set toggle(_arg1:Boolean):void{
throw (new Error("Warning: You cannot change a CheckBox's toggle."));
}
override public function get toggle():Boolean{
return (true);
}
override protected function configUI():void{
var _local1:Shape;
var _local2:Graphics;
super.configUI();
super.toggle = true;
_local1 = new Shape();
_local2 = _local1.graphics;
_local2.beginFill(0, 0);
_local2.drawRect(0, 0, 100, 100);
_local2.endFill();
background = (_local1 as DisplayObject);
addChildAt(background, 0);
}
override protected function drawLayout():void{
var _local1:Number;
super.drawLayout();
_local1 = Number(getStyleValue("textPadding"));
switch (_labelPlacement){
case ButtonLabelPlacement.RIGHT:
icon.x = _local1;
textField.x = (icon.x + (icon.width + _local1));
background.width = ((textField.x + textField.width) + _local1);
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.LEFT:
icon.x = ((width - icon.width) - _local1);
textField.x = (((width - icon.width) - (_local1 * 2)) - textField.width);
background.width = ((textField.width + icon.width) + (_local1 * 3));
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.TOP:
case ButtonLabelPlacement.BOTTOM:
background.width = (Math.max(textField.width, icon.width) + (_local1 * 2));
background.height = ((textField.height + icon.height) + (_local1 * 3));
break;
};
background.x = Math.min((icon.x - _local1), (textField.x - _local1));
background.y = Math.min((icon.y - _local1), (textField.y - _local1));
}
override protected function drawBackground():void{
}
override protected function initializeAccessibility():void{
if (CheckBox.createAccessibilityImplementation != null){
CheckBox.createAccessibilityImplementation(this);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 22
//ComboBox (fl.controls.ComboBox)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import fl.data.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class ComboBox extends UIComponent implements IFocusManagerComponent {
protected var _dropdownWidth:Number;
protected var highlightedCell:int;// = -1
protected var _prompt:String;
protected var isOpen:Boolean;// = false
protected var list:List;
protected var _rowCount:uint;// = 5
protected var currentIndex:int;
protected var isKeyDown:Boolean;// = false
protected var _labels:Array;
protected var background:BaseButton;
protected var inputField:TextInput;
protected var listOverIndex:uint;
protected var editableValue:String;
protected var _editable:Boolean;// = false
private var collectionItemImport:SimpleCollectionItem;
protected static const BACKGROUND_STYLES:Object = {overSkin:"overSkin", downSkin:"downSkin", upSkin:"upSkin", disabledSkin:"disabledSkin", repeatInterval:"repeatInterval"};
protected static const LIST_STYLES:Object = {upSkin:"comboListUpSkin", overSkin:"comboListOverSkin", downSkin:"comobListDownSkin", disabledSkin:"comboListDisabledSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval", textFormat:"textFormat", disabledAlpha:"disabledAlpha", skin:"listSkin"};
private static var defaultStyles:Object = {upSkin:"ComboBox_upSkin", downSkin:"ComboBox_downSkin", overSkin:"ComboBox_overSkin", disabledSkin:"ComboBox_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:3, buttonWidth:24, disabledAlpha:null, listSkin:null};
public static var createAccessibilityImplementation:Function;
public function ComboBox(){
_rowCount = 5;
_editable = false;
isOpen = false;
highlightedCell = -1;
isKeyDown = false;
super();
}
protected function drawList():void{
list.rowCount = Math.max(0, Math.min(_rowCount, list.dataProvider.length));
}
public function set imeMode(_arg1:String):void{
inputField.imeMode = _arg1;
}
public function get dropdown():List{
return (list);
}
public function get dropdownWidth():Number{
return (list.width);
}
public function sortItemsOn(_arg1:String, _arg2:Object=null){
return (list.sortItemsOn(_arg1, _arg2));
}
protected function onEnter(_arg1:ComponentEvent):void{
_arg1.stopPropagation();
}
public function removeItemAt(_arg1:uint):void{
list.removeItemAt(_arg1);
invalidate(InvalidationType.DATA);
}
public function open():void{
currentIndex = selectedIndex;
if (((isOpen) || ((length == 0)))){
return;
};
dispatchEvent(new Event(Event.OPEN));
isOpen = true;
addEventListener(Event.ENTER_FRAME, addCloseListener, false, 0, true);
positionList();
list.scrollToSelected();
stage.addChild(list);
}
public function get selectedItem():Object{
return (list.selectedItem);
}
public function set text(_arg1:String):void{
if (!editable){
return;
};
inputField.text = _arg1;
}
public function get labelField():String{
return (list.labelField);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
var _local3:uint;
var _local4:Number;
var _local5:int;
isKeyDown = true;
if (_arg1.ctrlKey){
switch (_arg1.keyCode){
case Keyboard.UP:
if (highlightedCell > -1){
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
close();
break;
case Keyboard.DOWN:
open();
break;
};
return;
};
_arg1.stopPropagation();
_local2 = Math.max(((calculateAvailableHeight() / list.rowHeight) << 0), 1);
_local3 = selectedIndex;
_local4 = ((highlightedCell)==-1) ? selectedIndex : highlightedCell;
_local5 = -1;
switch (_arg1.keyCode){
case Keyboard.SPACE:
if (isOpen){
close();
} else {
open();
};
return;
case Keyboard.ESCAPE:
if (isOpen){
if (highlightedCell > -1){
selectedIndex = selectedIndex;
};
close();
};
return;
case Keyboard.UP:
_local5 = Math.max(0, (_local4 - 1));
break;
case Keyboard.DOWN:
_local5 = Math.min((length - 1), (_local4 + 1));
break;
case Keyboard.PAGE_UP:
_local5 = Math.max((_local4 - _local2), 0);
break;
case Keyboard.PAGE_DOWN:
_local5 = Math.min((_local4 + _local2), (length - 1));
break;
case Keyboard.HOME:
_local5 = 0;
break;
case Keyboard.END:
_local5 = (length - 1);
break;
case Keyboard.ENTER:
if (((_editable) && ((highlightedCell == -1)))){
editableValue = inputField.text;
selectedIndex = -1;
} else {
if (((isOpen) && ((highlightedCell > -1)))){
editableValue = null;
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
};
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER));
close();
return;
default:
if (editable){
break;
};
_local5 = list.getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), _local4);
break;
};
if (_local5 > -1){
if (isOpen){
highlightCell(_local5);
inputField.text = list.itemToLabel(getItemAt(_local5));
} else {
highlightCell();
selectedIndex = _local5;
dispatchEvent(new Event(Event.CHANGE));
};
};
}
public function set dropdownWidth(_arg1:Number):void{
_dropdownWidth = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
super.focusInHandler(_arg1);
if (editable){
stage.focus = inputField.textField;
};
}
protected function onStageClick(_arg1:MouseEvent):void{
if (!isOpen){
return;
};
if (((!(contains((_arg1.target as DisplayObject)))) && (!(list.contains((_arg1.target as DisplayObject)))))){
if (highlightedCell != -1){
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
close();
};
}
protected function handleDataChange(_arg1:DataChangeEvent):void{
invalidate(InvalidationType.DATA);
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
isKeyDown = false;
}
protected function onListItemUp(_arg1:MouseEvent):void{
var _local2:*;
stage.removeEventListener(MouseEvent.MOUSE_UP, onListItemUp);
if (((!((_arg1.target is ICellRenderer))) || (!(list.contains((_arg1.target as DisplayObject)))))){
return;
};
editableValue = null;
_local2 = selectedIndex;
selectedIndex = _arg1.target.listData.index;
if (_local2 != selectedIndex){
dispatchEvent(new Event(Event.CHANGE));
};
close();
}
public function removeAll():void{
list.removeAll();
inputField.text = "";
invalidate(InvalidationType.DATA);
}
public function set selectedItem(_arg1:Object):void{
list.selectedItem = _arg1;
invalidate(InvalidationType.SELECTED);
}
protected function highlightCell(_arg1:int=-1):void{
var _local2:ICellRenderer;
if (highlightedCell > -1){
_local2 = list.itemToCellRenderer(getItemAt(highlightedCell));
if (_local2 != null){
_local2.setMouseState("up");
};
};
if (_arg1 == -1){
return;
};
list.scrollToIndex(_arg1);
list.drawNow();
_local2 = list.itemToCellRenderer(getItemAt(_arg1));
if (_local2 != null){
_local2.setMouseState("over");
highlightedCell = _arg1;
};
}
public function itemToLabel(_arg1:Object):String{
if (_arg1 == null){
return ("");
};
return (list.itemToLabel(_arg1));
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
list.addItemAt(_arg1, _arg2);
invalidate(InvalidationType.DATA);
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
return (list.replaceItemAt(_arg1, _arg2));
}
protected function showPrompt():void{
inputField.text = _prompt;
}
public function set rowCount(_arg1:uint):void{
_rowCount = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get restrict():String{
return (inputField.restrict);
}
protected function setEmbedFonts():void{
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
inputField.textField.embedFonts = _local1;
};
}
public function sortItems(... _args){
return (list.sortItems.apply(list, _args));
}
public function set labelField(_arg1:String):void{
list.labelField = _arg1;
invalidate(InvalidationType.DATA);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
drawTextField();
}
public function set prompt(_arg1:String):void{
if (_arg1 == ""){
_prompt = null;
} else {
_prompt = _arg1;
};
invalidate(InvalidationType.STATE);
}
public function get length():int{
return (list.length);
}
protected function drawTextField():void{
inputField.setStyle("upSkin", "");
inputField.setStyle("disabledSkin", "");
inputField.enabled = enabled;
inputField.editable = _editable;
inputField.textField.selectable = ((enabled) && (_editable));
inputField.mouseEnabled = (inputField.mouseChildren = ((enabled) && (_editable)));
inputField.focusEnabled = false;
if (_editable){
inputField.addEventListener(FocusEvent.FOCUS_IN, onInputFieldFocus, false, 0, true);
inputField.addEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut, false, 0, true);
} else {
inputField.removeEventListener(FocusEvent.FOCUS_IN, onInputFieldFocus);
inputField.removeEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut);
};
}
protected function onInputFieldFocusOut(_arg1:FocusEvent):void{
inputField.removeEventListener(ComponentEvent.ENTER, onEnter);
selectedIndex = selectedIndex;
}
protected function passEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
public function get imeMode():String{
return (inputField.imeMode);
}
public function get labelFunction():Function{
return (list.labelFunction);
}
protected function calculateAvailableHeight():Number{
var _local1:Number;
_local1 = Number(getStyleValue("contentPadding"));
return ((list.height - (_local1 * 2)));
}
public function get selectedIndex():int{
return (list.selectedIndex);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
isKeyDown = false;
if (isOpen){
if (((!(_arg1.relatedObject)) || (!(list.contains(_arg1.relatedObject))))){
if (((!((highlightedCell == -1))) && (!((highlightedCell == selectedIndex))))){
selectedIndex = highlightedCell;
dispatchEvent(new Event(Event.CHANGE));
};
close();
};
};
super.focusOutHandler(_arg1);
}
public function get selectedLabel():String{
if (editableValue != null){
return (editableValue);
};
if (selectedIndex == -1){
return (null);
};
return (itemToLabel(selectedItem));
}
public function get text():String{
return (inputField.text);
}
protected function onListChange(_arg1:Event):void{
editableValue = null;
dispatchEvent(_arg1);
invalidate(InvalidationType.SELECTED);
if (isKeyDown){
return;
};
close();
}
protected function onToggleListVisibility(_arg1:MouseEvent):void{
_arg1.stopPropagation();
dispatchEvent(_arg1);
if (isOpen){
close();
} else {
open();
stage.addEventListener(MouseEvent.MOUSE_UP, onListItemUp, false, 0, true);
};
}
override protected function draw():void{
var _local1:*;
_local1 = selectedIndex;
if ((((_local1 == -1)) && (((((!((prompt == null))) || (editable))) || ((length == 0)))))){
_local1 = Math.max(-1, Math.min(_local1, (length - 1)));
} else {
editableValue = null;
_local1 = Math.max(0, Math.min(_local1, (length - 1)));
};
if (list.selectedIndex != _local1){
list.selectedIndex = _local1;
invalidate(InvalidationType.SELECTED, false);
};
if (isInvalid(InvalidationType.STYLES)){
setStyles();
setEmbedFonts();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.STATE)){
drawTextFormat();
drawLayout();
invalidate(InvalidationType.DATA);
};
if (isInvalid(InvalidationType.DATA)){
drawList();
invalidate(InvalidationType.SELECTED, true);
};
if (isInvalid(InvalidationType.SELECTED)){
if ((((_local1 == -1)) && (!((editableValue == null))))){
inputField.text = editableValue;
} else {
if (_local1 > -1){
if (length > 0){
inputField.horizontalScrollPosition = 0;
inputField.text = itemToLabel(list.selectedItem);
};
} else {
if ((((_local1 == -1)) && (!((_prompt == null))))){
showPrompt();
} else {
inputField.text = "";
};
};
};
if (((((editable) && ((selectedIndex > -1)))) && ((stage.focus == inputField.textField)))){
inputField.setSelection(0, inputField.length);
};
};
drawTextField();
super.draw();
}
public function addItem(_arg1:Object):void{
list.addItem(_arg1);
invalidate(InvalidationType.DATA);
}
public function get rowCount():uint{
return (_rowCount);
}
override protected function configUI():void{
super.configUI();
background = new BaseButton();
background.focusEnabled = false;
copyStylesToChild(background, BACKGROUND_STYLES);
background.addEventListener(MouseEvent.MOUSE_DOWN, onToggleListVisibility, false, 0, true);
addChild(background);
inputField = new TextInput();
inputField.focusTarget = (this as IFocusManagerComponent);
inputField.focusEnabled = false;
inputField.addEventListener(Event.CHANGE, onTextInput, false, 0, true);
addChild(inputField);
list = new List();
list.focusEnabled = false;
copyStylesToChild(list, LIST_STYLES);
list.addEventListener(Event.CHANGE, onListChange, false, 0, true);
list.addEventListener(ListEvent.ITEM_CLICK, onListChange, false, 0, true);
list.addEventListener(ListEvent.ITEM_ROLL_OUT, passEvent, false, 0, true);
list.addEventListener(ListEvent.ITEM_ROLL_OVER, passEvent, false, 0, true);
list.verticalScrollBar.addEventListener(Event.SCROLL, passEvent, false, 0, true);
}
protected function positionList():void{
var _local1:Point;
_local1 = localToGlobal(new Point(0, 0));
list.x = _local1.x;
if (((_local1.y + height) + list.height) > stage.stageHeight){
list.y = (_local1.y - list.height);
} else {
list.y = (_local1.y + height);
};
}
public function get value():String{
var _local1:Object;
if (editableValue != null){
return (editableValue);
};
_local1 = selectedItem;
if (((!(_editable)) && (!((_local1.data == null))))){
return (_local1.data);
};
return (itemToLabel(_local1));
}
public function get prompt():String{
return (_prompt);
}
public function set dataProvider(_arg1:DataProvider):void{
_arg1.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true);
list.dataProvider = _arg1;
invalidate(InvalidationType.DATA);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
if (!_editable){
return;
};
inputField.restrict = _arg1;
}
protected function onTextInput(_arg1:Event):void{
_arg1.stopPropagation();
if (!_editable){
return;
};
editableValue = inputField.text;
selectedIndex = -1;
dispatchEvent(new Event(Event.CHANGE));
}
protected function onInputFieldFocus(_arg1:FocusEvent):void{
inputField.addEventListener(ComponentEvent.ENTER, onEnter, false, 0, true);
close();
}
public function getItemAt(_arg1:uint):Object{
return (list.getItemAt(_arg1));
}
override protected function initializeAccessibility():void{
if (ComboBox.createAccessibilityImplementation != null){
ComboBox.createAccessibilityImplementation(this);
};
}
protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
_local1 = (getStyleValue("buttonWidth") as Number);
_local2 = (getStyleValue("textPadding") as Number);
background.setSize(width, height);
inputField.x = (inputField.y = _local2);
inputField.setSize(((width - _local1) - _local2), (height - _local2));
list.width = (isNaN(_dropdownWidth)) ? width : _dropdownWidth;
background.enabled = enabled;
background.drawNow();
}
public function removeItem(_arg1:Object):Object{
return (list.removeItem(_arg1));
}
private function addCloseListener(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, addCloseListener);
if (!isOpen){
return;
};
stage.addEventListener(MouseEvent.MOUSE_DOWN, onStageClick, false, 0, true);
}
public function get dataProvider():DataProvider{
return (list.dataProvider);
}
public function get textField():TextInput{
return (inputField);
}
protected function setStyles():void{
copyStylesToChild(background, BACKGROUND_STYLES);
copyStylesToChild(list, LIST_STYLES);
}
public function set labelFunction(_arg1:Function):void{
list.labelFunction = _arg1;
invalidate(InvalidationType.DATA);
}
protected function drawTextFormat():void{
var _local1:TextFormat;
_local1 = (getStyleValue((_enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local1 == null){
_local1 = new TextFormat();
};
inputField.textField.defaultTextFormat = _local1;
inputField.textField.setTextFormat(_local1);
setEmbedFonts();
}
public function set selectedIndex(_arg1:int):void{
list.selectedIndex = _arg1;
highlightCell();
invalidate(InvalidationType.SELECTED);
}
public function close():void{
highlightCell();
highlightedCell = -1;
if (!isOpen){
return;
};
dispatchEvent(new Event(Event.CLOSE));
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onStageClick);
isOpen = false;
stage.removeChild(list);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, List.getStyleDefinition()));
}
}
}//package fl.controls
Section 23
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 24
//List (fl.controls.List)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
import fl.managers.*;
import flash.ui.*;
public class List extends SelectableList implements IFocusManagerComponent {
protected var _labelField:String;// = "label"
protected var _rowHeight:Number;// = 20
protected var _cellRenderer:Object;
protected var _iconField:String;// = "icon"
protected var _labelFunction:Function;
protected var _iconFunction:Function;
private static var defaultStyles:Object = {focusRectSkin:null, focusRectPadding:null};
public static var createAccessibilityImplementation:Function;
public function List(){
_rowHeight = 20;
_labelField = "label";
_iconField = "icon";
super();
}
public function get iconField():String{
return (_iconField);
}
protected function doKeySelection(_arg1:int, _arg2:Boolean, _arg3:Boolean):void{
var _local4:Boolean;
var _local5:int;
var _local6:Array;
var _local7:int;
var _local8:int;
_local4 = false;
if (_arg2){
_local6 = [];
_local7 = lastCaretIndex;
_local8 = _arg1;
if (_local7 == -1){
_local7 = ((caretIndex)!=-1) ? caretIndex : _arg1;
};
if (_local7 > _local8){
_local8 = _local7;
_local7 = _arg1;
};
_local5 = _local7;
while (_local5 <= _local8) {
_local6.push(_local5);
_local5++;
};
selectedIndices = _local6;
caretIndex = _arg1;
_local4 = true;
} else {
selectedIndex = _arg1;
caretIndex = (lastCaretIndex = _arg1);
_local4 = true;
};
if (_local4){
dispatchEvent(new Event(Event.CHANGE));
};
invalidate(InvalidationType.DATA);
}
override protected function drawList():void{
var _local1:Rectangle;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:ICellRenderer;
var _local7:Dictionary;
var _local8:Dictionary;
var _local9:Boolean;
var _local10:String;
var _local11:Object;
var _local12:Sprite;
var _local13:String;
listHolder.x = (listHolder.y = contentPadding);
_local1 = listHolder.scrollRect;
_local1.x = _horizontalScrollPosition;
_local1.y = (Math.floor(_verticalScrollPosition) % rowHeight);
listHolder.scrollRect = _local1;
listHolder.cacheAsBitmap = useBitmapScrolling;
_local2 = Math.floor((_verticalScrollPosition / rowHeight));
_local3 = Math.min(length, ((_local2 + rowCount) + 1));
_local7 = (renderedItems = new Dictionary(true));
_local4 = _local2;
while (_local4 < _local3) {
_local7[_dataProvider.getItemAt(_local4)] = true;
_local4++;
};
_local8 = new Dictionary(true);
while (activeCellRenderers.length > 0) {
_local6 = (activeCellRenderers.pop() as ICellRenderer);
_local5 = _local6.data;
if ((((_local7[_local5] == null)) || ((invalidItems[_local5] == true)))){
availableCellRenderers.push(_local6);
} else {
_local8[_local5] = _local6;
invalidItems[_local5] = true;
};
list.removeChild((_local6 as DisplayObject));
};
invalidItems = new Dictionary(true);
_local4 = _local2;
while (_local4 < _local3) {
_local9 = false;
_local5 = _dataProvider.getItemAt(_local4);
if (_local8[_local5] != null){
_local9 = true;
_local6 = _local8[_local5];
delete _local8[_local5];
} else {
if (availableCellRenderers.length > 0){
_local6 = (availableCellRenderers.pop() as ICellRenderer);
} else {
_local6 = (getDisplayObjectInstance(getStyleValue("cellRenderer")) as ICellRenderer);
_local12 = (_local6 as Sprite);
if (_local12 != null){
_local12.addEventListener(MouseEvent.CLICK, handleCellRendererClick, false, 0, true);
_local12.addEventListener(MouseEvent.ROLL_OVER, handleCellRendererMouseEvent, false, 0, true);
_local12.addEventListener(MouseEvent.ROLL_OUT, handleCellRendererMouseEvent, false, 0, true);
_local12.addEventListener(Event.CHANGE, handleCellRendererChange, false, 0, true);
_local12.doubleClickEnabled = true;
_local12.addEventListener(MouseEvent.DOUBLE_CLICK, handleCellRendererDoubleClick, false, 0, true);
if (_local12["setStyle"] != null){
for (_local13 in rendererStyles) {
var _local16 = _local12;
_local16["setStyle"](_local13, rendererStyles[_local13]);
};
};
};
};
};
list.addChild((_local6 as Sprite));
activeCellRenderers.push(_local6);
_local6.y = (rowHeight * (_local4 - _local2));
_local6.setSize((availableWidth + _maxHorizontalScrollPosition), rowHeight);
_local10 = itemToLabel(_local5);
_local11 = null;
if (_iconFunction != null){
_local11 = _iconFunction(_local5);
} else {
if (_iconField != null){
_local11 = _local5[_iconField];
};
};
if (!_local9){
_local6.data = _local5;
};
_local6.listData = new ListData(_local10, _local11, this, _local4, _local4, 0);
_local6.selected = !((_selectedIndices.indexOf(_local4) == -1));
if ((_local6 is UIComponent)){
(_local6 as UIComponent).drawNow();
};
_local4++;
};
}
public function get iconFunction():Function{
return (_iconFunction);
}
public function set iconField(_arg1:String):void{
if (_arg1 == _iconField){
return;
};
_iconField = _arg1;
invalidate(InvalidationType.DATA);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
if (!selectable){
return;
};
switch (_arg1.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
case Keyboard.END:
case Keyboard.HOME:
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
break;
case Keyboard.SPACE:
if (caretIndex == -1){
caretIndex = 0;
};
doKeySelection(caretIndex, _arg1.shiftKey, _arg1.ctrlKey);
scrollToSelected();
break;
default:
_local2 = getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), selectedIndex);
if (_local2 > -1){
selectedIndex = _local2;
scrollToSelected();
};
break;
};
_arg1.stopPropagation();
}
override public function itemToLabel(_arg1:Object):String{
if (_labelFunction != null){
return (String(_labelFunction(_arg1)));
};
return (((_arg1[_labelField])!=null) ? String(_arg1[_labelField]) : "");
}
public function get labelField():String{
return (_labelField);
}
override protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
var _local4:int;
var _local5:int;
var _local6:int;
_local4 = Math.max(Math.floor((calculateAvailableHeight() / rowHeight)), 1);
_local5 = -1;
_local6 = 0;
switch (_arg1){
case Keyboard.UP:
if (caretIndex > 0){
_local5 = (caretIndex - 1);
};
break;
case Keyboard.DOWN:
if (caretIndex < (length - 1)){
_local5 = (caretIndex + 1);
};
break;
case Keyboard.PAGE_UP:
if (caretIndex > 0){
_local5 = Math.max((caretIndex - _local4), 0);
};
break;
case Keyboard.PAGE_DOWN:
if (caretIndex < (length - 1)){
_local5 = Math.min((caretIndex + _local4), (length - 1));
};
break;
case Keyboard.HOME:
if (caretIndex > 0){
_local5 = 0;
};
break;
case Keyboard.END:
if (caretIndex < (length - 1)){
_local5 = (length - 1);
};
break;
};
if (_local5 >= 0){
doKeySelection(_local5, _arg2, _arg3);
scrollToSelected();
};
}
public function set labelField(_arg1:String):void{
if (_arg1 == _labelField){
return;
};
_labelField = _arg1;
invalidate(InvalidationType.DATA);
}
public function set rowCount(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
_local2 = Number(getStyleValue("contentPadding"));
_local3 = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0;
height = (((rowHeight * _arg1) + (2 * _local2)) + _local3);
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
list.x = -(_arg1);
super.setHorizontalScrollPosition(_arg1, true);
}
public function set iconFunction(_arg1:Function):void{
if (_iconFunction == _arg1){
return;
};
_iconFunction = _arg1;
invalidate(InvalidationType.DATA);
}
public function get labelFunction():Function{
return (_labelFunction);
}
override protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
invalidate(InvalidationType.SCROLL);
super.setVerticalScrollPosition(_arg1, true);
}
protected function calculateAvailableHeight():Number{
var _local1:Number;
_local1 = Number(getStyleValue("contentPadding"));
return (((height - (_local1 * 2)) - ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0));
}
override protected function draw():void{
var _local1:Boolean;
_local1 = !((contentHeight == (rowHeight * length)));
contentHeight = (rowHeight * length);
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
if (_cellRenderer != getStyleValue("cellRenderer")){
_invalidateList();
_cellRenderer = getStyleValue("cellRenderer");
};
};
if (((isInvalid(InvalidationType.SIZE, InvalidationType.STATE)) || (_local1))){
drawLayout();
};
if (isInvalid(InvalidationType.RENDERER_STYLES)){
updateRendererStyles();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.SCROLL, InvalidationType.SELECTED)){
drawList();
};
updateChildren();
validate();
}
override protected function configUI():void{
useFixedHorizontalScrolling = true;
_horizontalScrollPolicy = ScrollPolicy.AUTO;
_verticalScrollPolicy = ScrollPolicy.AUTO;
super.configUI();
}
override public function get rowCount():uint{
return (Math.ceil((calculateAvailableHeight() / rowHeight)));
}
override protected function initializeAccessibility():void{
if (List.createAccessibilityImplementation != null){
List.createAccessibilityImplementation(this);
};
}
override public function scrollToIndex(_arg1:int):void{
var _local2:uint;
var _local3:uint;
drawNow();
_local2 = (Math.floor(((_verticalScrollPosition + availableHeight) / rowHeight)) - 1);
_local3 = Math.ceil((_verticalScrollPosition / rowHeight));
if (_arg1 < _local3){
verticalScrollPosition = (_arg1 * rowHeight);
} else {
if (_arg1 > _local2){
verticalScrollPosition = (((_arg1 + 1) * rowHeight) - availableHeight);
};
};
}
public function get rowHeight():Number{
return (_rowHeight);
}
public function set labelFunction(_arg1:Function):void{
if (_labelFunction == _arg1){
return;
};
_labelFunction = _arg1;
invalidate(InvalidationType.DATA);
}
public function set rowHeight(_arg1:Number):void{
_rowHeight = _arg1;
invalidate(InvalidationType.SIZE);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, SelectableList.getStyleDefinition()));
}
}
}//package fl.controls
Section 25
//ScrollBar (fl.controls.ScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import fl.events.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
protected var inDrag:Boolean;// = false
protected var upArrow:BaseButton;
private var _pageScrollSize:Number;// = 0
protected var downArrow:BaseButton;
private var _pageSize:Number;// = 10
private var thumbScrollOffset:Number;
private var _maxScrollPosition:Number;// = 0
private var _scrollPosition:Number;// = 0
protected var track:BaseButton;
private var _minScrollPosition:Number;// = 0
private var _lineScrollSize:Number;// = 1
protected var thumb:LabelButton;
protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0};
public static const WIDTH:Number = 15;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35};
public function ScrollBar(){
_pageSize = 10;
_pageScrollSize = 0;
_lineScrollSize = 1;
_minScrollPosition = 0;
_maxScrollPosition = 0;
_scrollPosition = 0;
_direction = ScrollBarDirection.VERTICAL;
inDrag = false;
super();
setStyles();
focusEnabled = false;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
public function set minScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _arg1, _maxScrollPosition);
}
public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
_local3 = scrollPosition;
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1));
if (_local3 == _scrollPosition){
return;
};
if (_arg2){
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition));
};
updateThumb();
}
public function set scrollPosition(_arg1:Number):void{
setScrollPosition(_arg1, true);
}
public function get pageScrollSize():Number{
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize);
}
public function set pageSize(_arg1:Number):void{
if (_arg1 > 0){
_pageSize = _arg1;
};
}
public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
this.pageSize = _arg1;
_minScrollPosition = _arg2;
_maxScrollPosition = _arg3;
if (_arg4 >= 0){
_pageScrollSize = _arg4;
};
enabled = (_maxScrollPosition > _minScrollPosition);
setScrollPosition(_scrollPosition, false);
updateThumb();
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition))))));
updateThumb();
}
protected function updateThumb():void{
var _local1:Number;
_local1 = ((_maxScrollPosition - _minScrollPosition) + _pageSize);
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = Math.max(13, ((_pageSize / _local1) * track.height));
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition))));
thumb.visible = enabled;
};
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
inDrag = true;
thumbScrollOffset = (mouseY - thumb.y);
thumb.mouseStateLocked = true;
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
inDrag = false;
mouseChildren = true;
thumb.mouseStateLocked = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
}
public function set pageScrollSize(_arg1:Number):void{
if (_arg1 >= 0){
_pageScrollSize = _arg1;
};
}
protected function handleThumbDrag(_arg1:MouseEvent):void{
var _local2:Number;
_local2 = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset)));
setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition));
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
if (_direction == _arg1){
return;
};
_direction = _arg1;
if (isLivePreview){
return;
};
setScaleY(1);
_local2 = (_direction == ScrollBarDirection.HORIZONTAL);
if (((_local2) && (componentInspectorSetting))){
if (rotation == 90){
return;
};
setScaleX(-1);
rotation = -90;
};
if (!componentInspectorSetting){
if (((_local2) && ((rotation == 0)))){
rotation = -90;
setScaleX(-1);
} else {
if (((!(_local2)) && ((rotation == -90)))){
rotation = 0;
setScaleX(1);
};
};
};
invalidate(InvalidationType.SIZE);
}
public function set lineScrollSize(_arg1:Number):void{
if (_arg1 > 0){
_lineScrollSize = _arg1;
};
}
override public function get height():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height);
}
protected function scrollPressHandler(_arg1:ComponentEvent):void{
var _local2:Number;
var _local3:Number;
_arg1.stopImmediatePropagation();
if (_arg1.currentTarget == upArrow){
setScrollPosition((_scrollPosition - _lineScrollSize));
} else {
if (_arg1.currentTarget == downArrow){
setScrollPosition((_scrollPosition + _lineScrollSize));
} else {
_local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition);
_local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize;
if (_scrollPosition < _local2){
setScrollPosition(Math.min(_local2, (_scrollPosition + _local3)));
} else {
if (_scrollPosition > _local2){
setScrollPosition(Math.max(_local2, (_scrollPosition - _local3)));
};
};
};
};
}
public function get pageSize():Number{
return (_pageSize);
}
public function set maxScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _minScrollPosition, _arg1);
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
var _local1:Number;
if (isInvalid(InvalidationType.SIZE)){
_local1 = super.height;
downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height)));
track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height))));
updateThumb();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
};
downArrow.drawNow();
upArrow.drawNow();
track.drawNow();
thumb.drawNow();
validate();
}
override protected function configUI():void{
super.configUI();
track = new BaseButton();
track.move(0, 14);
track.useHandCursor = false;
track.autoRepeat = true;
track.focusEnabled = false;
addChild(track);
thumb = new LabelButton();
thumb.label = "";
thumb.setSize(WIDTH, 15);
thumb.move(0, 15);
thumb.focusEnabled = false;
addChild(thumb);
downArrow = new BaseButton();
downArrow.setSize(WIDTH, 14);
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
addChild(downArrow);
upArrow = new BaseButton();
upArrow.setSize(WIDTH, 14);
upArrow.move(0, 0);
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
addChild(upArrow);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
enabled = false;
}
public function get direction():String{
return (_direction);
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if (_direction == ScrollBarDirection.HORIZONTAL){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
override public function get width():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 26
//ScrollBarDirection (fl.controls.ScrollBarDirection)
package fl.controls {
public class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
}
}//package fl.controls
Section 27
//ScrollPolicy (fl.controls.ScrollPolicy)
package fl.controls {
public class ScrollPolicy {
public static const OFF:String = "off";
public static const ON:String = "on";
public static const AUTO:String = "auto";
}
}//package fl.controls
Section 28
//SelectableList (fl.controls.SelectableList)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import fl.data.*;
import fl.managers.*;
import fl.events.*;
import fl.containers.*;
import flash.ui.*;
public class SelectableList extends BaseScrollPane implements IFocusManagerComponent {
protected var invalidItems:Dictionary;
protected var renderedItems:Dictionary;
protected var listHolder:Sprite;
protected var _allowMultipleSelection:Boolean;// = false
protected var lastCaretIndex:int;// = -1
protected var _selectedIndices:Array;
protected var availableCellRenderers:Array;
protected var list:Sprite;
protected var caretIndex:int;// = -1
protected var updatedRendererStyles:Object;
protected var preChangeItems:Array;
protected var activeCellRenderers:Array;
protected var rendererStyles:Object;
protected var _verticalScrollPosition:Number;
protected var _dataProvider:DataProvider;
protected var _horizontalScrollPosition:Number;
private var collectionItemImport:SimpleCollectionItem;
protected var _selectable:Boolean;// = true
private static var defaultStyles:Object = {skin:"List_skin", cellRenderer:CellRenderer, contentPadding:null, disabledAlpha:null};
public static var createAccessibilityImplementation:Function;
public function SelectableList(){
_allowMultipleSelection = false;
_selectable = true;
caretIndex = -1;
lastCaretIndex = -1;
super();
activeCellRenderers = [];
availableCellRenderers = [];
invalidItems = new Dictionary(true);
renderedItems = new Dictionary(true);
_selectedIndices = [];
if (dataProvider == null){
dataProvider = new DataProvider();
};
verticalScrollPolicy = ScrollPolicy.AUTO;
rendererStyles = {};
updatedRendererStyles = {};
}
protected function drawList():void{
}
public function set allowMultipleSelection(_arg1:Boolean):void{
if (_arg1 == _allowMultipleSelection){
return;
};
_allowMultipleSelection = _arg1;
if (((!(_arg1)) && ((_selectedIndices.length > 1)))){
_selectedIndices = [_selectedIndices.pop()];
invalidate(InvalidationType.DATA);
};
}
public function sortItemsOn(_arg1:String, _arg2:Object=null){
return (_dataProvider.sortOn(_arg1, _arg2));
}
public function removeItemAt(_arg1:uint):Object{
return (_dataProvider.removeItemAt(_arg1));
}
public function get selectedItem():Object{
return (((_selectedIndices.length)==0) ? null : _dataProvider.getItemAt(selectedIndex));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!selectable){
return;
};
switch (_arg1.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
case Keyboard.END:
case Keyboard.HOME:
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
_arg1.stopPropagation();
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
_arg1.stopPropagation();
break;
};
}
public function get selectable():Boolean{
return (_selectable);
}
public function itemToCellRenderer(_arg1:Object):ICellRenderer{
var _local2:*;
var _local3:ICellRenderer;
if (_arg1 != null){
for (_local2 in activeCellRenderers) {
_local3 = (activeCellRenderers[_local2] as ICellRenderer);
if (_local3.data == _arg1){
return (_local3);
};
};
};
return (null);
}
public function getNextIndexAtLetter(_arg1:String, _arg2:int=-1):int{
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Object;
var _local7:String;
if (length == 0){
return (-1);
};
_arg1 = _arg1.toUpperCase();
_local3 = (length - 1);
_local4 = 0;
while (_local4 < _local3) {
_local5 = ((_arg2 + 1) + _local4);
if (_local5 > (length - 1)){
_local5 = (_local5 - length);
};
_local6 = getItemAt(_local5);
if (_local6 == null){
break;
};
_local7 = itemToLabel(_local6);
if (_local7 == null){
} else {
if (_local7.charAt(0).toUpperCase() == _arg1){
return (_local5);
};
};
_local4++;
};
return (-1);
}
public function invalidateList():void{
_invalidateList();
invalidate(InvalidationType.DATA);
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
list.mouseChildren = _enabled;
}
public function get selectedIndices():Array{
return (_selectedIndices.concat());
}
public function set selectable(_arg1:Boolean):void{
if (_arg1 == _selectable){
return;
};
if (!_arg1){
selectedIndices = [];
};
_selectable = _arg1;
}
public function itemToLabel(_arg1:Object):String{
return (_arg1["label"]);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
_dataProvider.addItemAt(_arg1, _arg2);
invalidateList();
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
return (_dataProvider.replaceItemAt(_arg1, _arg2));
}
protected function handleDataChange(_arg1:DataChangeEvent):void{
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:uint;
_local2 = _arg1.startIndex;
_local3 = _arg1.endIndex;
_local4 = _arg1.changeType;
if (_local4 == DataChangeType.INVALIDATE_ALL){
clearSelection();
invalidateList();
} else {
if (_local4 == DataChangeType.INVALIDATE){
_local5 = 0;
while (_local5 < _arg1.items.length) {
invalidateItem(_arg1.items[_local5]);
_local5++;
};
} else {
if (_local4 == DataChangeType.ADD){
_local5 = 0;
while (_local5 < _selectedIndices.length) {
if (_selectedIndices[_local5] >= _local2){
_selectedIndices[_local5] = (_selectedIndices[_local5] + (_local2 - _local3));
};
_local5++;
};
} else {
if (_local4 == DataChangeType.REMOVE){
_local5 = 0;
while (_local5 < _selectedIndices.length) {
if (_selectedIndices[_local5] >= _local2){
if (_selectedIndices[_local5] <= _local3){
delete _selectedIndices[_local5];
} else {
_selectedIndices[_local5] = (_selectedIndices[_local5] - ((_local2 - _local3) + 1));
};
};
_local5++;
};
} else {
if (_local4 == DataChangeType.REMOVE_ALL){
clearSelection();
} else {
if (_local4 == DataChangeType.REPLACE){
} else {
selectedItems = preChangeItems;
preChangeItems = null;
};
};
};
};
};
};
invalidate(InvalidationType.DATA);
}
protected function _invalidateList():void{
availableCellRenderers = [];
while (activeCellRenderers.length > 0) {
list.removeChild((activeCellRenderers.pop() as DisplayObject));
};
}
protected function updateRendererStyles():void{
var _local1:Array;
var _local2:uint;
var _local3:uint;
var _local4:String;
_local1 = availableCellRenderers.concat(activeCellRenderers);
_local2 = _local1.length;
_local3 = 0;
while (_local3 < _local2) {
if (_local1[_local3].setStyle == null){
} else {
for (_local4 in updatedRendererStyles) {
_local1[_local3].setStyle(_local4, updatedRendererStyles[_local4]);
};
_local1[_local3].drawNow();
};
_local3++;
};
updatedRendererStyles = {};
}
public function set selectedItem(_arg1:Object):void{
var _local2:int;
_local2 = _dataProvider.getItemIndex(_arg1);
selectedIndex = _local2;
}
public function sortItems(... _args){
return (_dataProvider.sort.apply(_dataProvider, _args));
}
public function removeAll():void{
_dataProvider.removeAll();
}
protected function handleCellRendererChange(_arg1:Event):void{
var _local2:ICellRenderer;
var _local3:uint;
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
_dataProvider.invalidateItemAt(_local3);
}
protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
if (_arg1 == _horizontalScrollPosition){
return;
};
_local3 = (_arg1 - _horizontalScrollPosition);
_horizontalScrollPosition = _arg1;
if (_arg2){
dispatchEvent(new ScrollEvent(ScrollBarDirection.HORIZONTAL, _local3, _arg1));
};
}
public function scrollToSelected():void{
scrollToIndex(selectedIndex);
}
public function invalidateItem(_arg1:Object):void{
if (renderedItems[_arg1] == null){
return;
};
invalidItems[_arg1] = true;
invalidate(InvalidationType.DATA);
}
protected function handleCellRendererClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
var _local4:int;
var _local5:int;
var _local6:uint;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
if (((!(dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data)))) || (!(_selectable)))){
return;
};
_local4 = selectedIndices.indexOf(_local3);
if (!_allowMultipleSelection){
if (_local4 != -1){
return;
};
_local2.selected = true;
_selectedIndices = [_local3];
lastCaretIndex = (caretIndex = _local3);
} else {
if (_arg1.shiftKey){
_local6 = ((_selectedIndices.length)>0) ? _selectedIndices[0] : _local3;
_selectedIndices = [];
if (_local6 > _local3){
_local5 = _local6;
while (_local5 >= _local3) {
_selectedIndices.push(_local5);
_local5--;
};
} else {
_local5 = _local6;
while (_local5 <= _local3) {
_selectedIndices.push(_local5);
_local5++;
};
};
caretIndex = _local3;
} else {
if (_arg1.ctrlKey){
if (_local4 != -1){
_local2.selected = false;
_selectedIndices.splice(_local4, 1);
} else {
_local2.selected = true;
_selectedIndices.push(_local3);
};
caretIndex = _local3;
} else {
_selectedIndices = [_local3];
lastCaretIndex = (caretIndex = _local3);
};
};
};
dispatchEvent(new Event(Event.CHANGE));
invalidate(InvalidationType.DATA);
}
public function get length():uint{
return (_dataProvider.length);
}
public function get allowMultipleSelection():Boolean{
return (_allowMultipleSelection);
}
protected function onPreChange(_arg1:DataChangeEvent):void{
switch (_arg1.changeType){
case DataChangeType.REMOVE:
case DataChangeType.ADD:
case DataChangeType.INVALIDATE:
case DataChangeType.REMOVE_ALL:
case DataChangeType.REPLACE:
case DataChangeType.INVALIDATE_ALL:
break;
default:
preChangeItems = selectedItems;
break;
};
}
public function getRendererStyle(_arg1:String, _arg2:int=-1):Object{
return (rendererStyles[_arg1]);
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
if (_arg1 == _verticalScrollPosition){
return;
};
_local3 = (_arg1 - _verticalScrollPosition);
_verticalScrollPosition = _arg1;
if (_arg2){
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _local3, _arg1));
};
}
protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
public function set selectedIndices(_arg1:Array):void{
if (!_selectable){
return;
};
_selectedIndices = ((_arg1)==null) ? [] : _arg1.concat();
invalidate(InvalidationType.SELECTED);
}
public function get selectedIndex():int{
return (((_selectedIndices.length)==0) ? -1 : _selectedIndices[(_selectedIndices.length - 1)]);
}
override protected function draw():void{
super.draw();
}
override protected function configUI():void{
super.configUI();
listHolder = new Sprite();
addChild(listHolder);
listHolder.scrollRect = contentScrollRect;
list = new Sprite();
listHolder.addChild(list);
}
public function addItem(_arg1:Object):void{
_dataProvider.addItem(_arg1);
invalidateList();
}
protected function handleCellRendererMouseEvent(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:String;
_local2 = (_arg1.target as ICellRenderer);
_local3 = ((_arg1.type)==MouseEvent.ROLL_OVER) ? ListEvent.ITEM_ROLL_OVER : ListEvent.ITEM_ROLL_OUT;
dispatchEvent(new ListEvent(_local3, false, false, _local2.listData.column, _local2.listData.row, _local2.listData.index, _local2.data));
}
public function clearRendererStyle(_arg1:String, _arg2:int=-1):void{
delete rendererStyles[_arg1];
updatedRendererStyles[_arg1] = null;
invalidate(InvalidationType.RENDERER_STYLES);
}
protected function handleCellRendererDoubleClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
dispatchEvent(new ListEvent(ListEvent.ITEM_DOUBLE_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data));
}
public function get rowCount():uint{
return (0);
}
public function isItemSelected(_arg1:Object):Boolean{
return ((selectedItems.indexOf(_arg1) > -1));
}
public function set dataProvider(_arg1:DataProvider):void{
if (_dataProvider != null){
_dataProvider.removeEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange);
_dataProvider.removeEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange);
};
_dataProvider = _arg1;
_dataProvider.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true);
_dataProvider.addEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange, false, 0, true);
clearSelection();
invalidateList();
}
override protected function drawLayout():void{
super.drawLayout();
contentScrollRect = listHolder.scrollRect;
contentScrollRect.width = availableWidth;
contentScrollRect.height = availableHeight;
listHolder.scrollRect = contentScrollRect;
}
public function getItemAt(_arg1:uint):Object{
return (_dataProvider.getItemAt(_arg1));
}
override protected function initializeAccessibility():void{
if (SelectableList.createAccessibilityImplementation != null){
SelectableList.createAccessibilityImplementation(this);
};
}
public function scrollToIndex(_arg1:int):void{
}
public function removeItem(_arg1:Object):Object{
return (_dataProvider.removeItem(_arg1));
}
public function get dataProvider():DataProvider{
return (_dataProvider);
}
public function set maxHorizontalScrollPosition(_arg1:Number):void{
_maxHorizontalScrollPosition = _arg1;
invalidate(InvalidationType.SIZE);
}
public function setRendererStyle(_arg1:String, _arg2:Object, _arg3:uint=0):void{
if (rendererStyles[_arg1] == _arg2){
return;
};
updatedRendererStyles[_arg1] = _arg2;
rendererStyles[_arg1] = _arg2;
invalidate(InvalidationType.RENDERER_STYLES);
}
public function invalidateItemAt(_arg1:uint):void{
var _local2:Object;
_local2 = _dataProvider.getItemAt(_arg1);
if (_local2 != null){
invalidateItem(_local2);
};
}
public function set selectedItems(_arg1:Array):void{
var _local2:Array;
var _local3:uint;
var _local4:int;
if (_arg1 == null){
selectedIndices = null;
return;
};
_local2 = [];
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _dataProvider.getItemIndex(_arg1[_local3]);
if (_local4 != -1){
_local2.push(_local4);
};
_local3++;
};
selectedIndices = _local2;
}
public function clearSelection():void{
selectedIndex = -1;
}
override public function get maxHorizontalScrollPosition():Number{
return (_maxHorizontalScrollPosition);
}
public function get selectedItems():Array{
var _local1:Array;
var _local2:uint;
_local1 = [];
_local2 = 0;
while (_local2 < _selectedIndices.length) {
_local1.push(_dataProvider.getItemAt(_selectedIndices[_local2]));
_local2++;
};
return (_local1);
}
public function set selectedIndex(_arg1:int):void{
selectedIndices = ((_arg1)==-1) ? null : [_arg1];
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseScrollPane.getStyleDefinition()));
}
}
}//package fl.controls
Section 29
//Slider (fl.controls.Slider)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class Slider extends UIComponent implements IFocusManagerComponent {
protected var _direction:String;
protected var _liveDragging:Boolean;// = false
protected var _value:Number;// = 0
protected var _snapInterval:Number;// = 0
protected var _minimum:Number;// = 0
protected var _maximum:Number;// = 10
protected var track:BaseButton;
protected var _tickInterval:Number;// = 0
protected var tickContainer:Sprite;
protected var thumb:BaseButton;
protected static const TICK_STYLES:Object = {upSkin:"tickSkin"};
protected static const TRACK_STYLES:Object = {upSkin:"sliderTrackSkin", overSkin:"sliderTrackSkin", downSkin:"sliderTrackSkin", disabledSkin:"sliderTrackDisabledSkin"};
protected static const THUMB_STYLES:Object = {upSkin:"thumbUpSkin", overSkin:"thumbOverSkin", downSkin:"thumbDownSkin", disabledSkin:"thumbDisabledSkin"};
protected static var defaultStyles:Object = {thumbUpSkin:"SliderThumb_upSkin", thumbOverSkin:"SliderThumb_overSkin", thumbDownSkin:"SliderThumb_downSkin", thumbDisabledSkin:"SliderThumb_disabledSkin", sliderTrackSkin:"SliderTrack_skin", sliderTrackDisabledSkin:"SliderTrack_disabledSkin", tickSkin:"SliderTick_skin", focusRectSkin:null, focusRectPadding:null};
public function Slider(){
_direction = SliderDirection.HORIZONTAL;
_minimum = 0;
_maximum = 10;
_value = 0;
_tickInterval = 0;
_snapInterval = 0;
_liveDragging = false;
super();
setStyles();
}
public function get minimum():Number{
return (_minimum);
}
public function set minimum(_arg1:Number):void{
_minimum = _arg1;
this.value = Math.max(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get maximum():Number{
return (_maximum);
}
protected function positionThumb():void{
thumb.x = ((((_direction)==SliderDirection.VERTICAL) ? ((maximum - minimum) - value) : (value - minimum) / (maximum - minimum)) * _width);
}
protected function clearTicks():void{
if (((!(tickContainer)) || (!(tickContainer.parent)))){
return;
};
removeChild(tickContainer);
}
protected function onTrackClick(_arg1:MouseEvent):void{
calculateValue(track.mouseX, InteractionInputType.MOUSE, SliderEventClickTarget.TRACK);
if (!liveDragging){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.TRACK, InteractionInputType.MOUSE));
};
}
public function set maximum(_arg1:Number):void{
_maximum = _arg1;
this.value = Math.min(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get liveDragging():Boolean{
return (_liveDragging);
}
protected function doDrag(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
_local2 = (_width / snapInterval);
_local3 = track.mouseX;
calculateValue(_local3, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_DRAG, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:Number;
var _local4:Boolean;
if (!enabled){
return;
};
_local2 = ((snapInterval)>0) ? snapInterval : 1;
_local4 = (direction == SliderDirection.HORIZONTAL);
if ((((((_arg1.keyCode == Keyboard.DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.LEFT)) && (_local4))))){
_local3 = (value - _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.RIGHT)) && (_local4))))){
_local3 = (value + _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.HOME)) && (_local4))))){
_local3 = minimum;
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.END)) && (_local4))))){
_local3 = maximum;
};
};
};
};
if (!isNaN(_local3)){
_arg1.stopPropagation();
doSetValue(_local3, InteractionInputType.KEYBOARD, null, _arg1.keyCode);
};
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
super.enabled = _arg1;
track.enabled = (thumb.enabled = _arg1);
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, doDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_PRESS, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
}
public function get snapInterval():Number{
return (_snapInterval);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_RELEASE, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
public function set liveDragging(_arg1:Boolean):void{
_liveDragging = _arg1;
}
public function set value(_arg1:Number):void{
doSetValue(_arg1);
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
_direction = _arg1;
_local2 = (_direction == SliderDirection.VERTICAL);
if (isLivePreview){
if (_local2){
setScaleY(-1);
y = track.height;
} else {
setScaleY(1);
y = 0;
};
positionThumb();
return;
};
if (((_local2) && (componentInspectorSetting))){
if ((rotation % 90) == 0){
setScaleY(-1);
};
};
if (!componentInspectorSetting){
rotation = (_local2) ? 90 : 0;
};
}
public function set tickInterval(_arg1:Number):void{
_tickInterval = _arg1;
invalidate(InvalidationType.SIZE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
track.setSize(_width, track.height);
track.drawNow();
thumb.drawNow();
};
if (tickInterval > 0){
drawTicks();
} else {
clearTicks();
};
positionThumb();
super.draw();
}
override protected function configUI():void{
super.configUI();
thumb = new BaseButton();
thumb.setSize(13, 13);
thumb.autoRepeat = false;
addChild(thumb);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
track = new BaseButton();
track.move(0, 0);
track.setSize(80, 4);
track.autoRepeat = false;
track.useHandCursor = false;
track.addEventListener(MouseEvent.CLICK, onTrackClick, false, 0, true);
addChildAt(track, 0);
}
public function set snapInterval(_arg1:Number):void{
_snapInterval = _arg1;
}
public function get value():Number{
return (_value);
}
public function get direction():String{
return (_direction);
}
public function get tickInterval():Number{
return (_tickInterval);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if ((((_direction == SliderDirection.VERTICAL)) && (!(isLivePreview)))){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
invalidate(InvalidationType.SIZE);
}
protected function drawTicks():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:DisplayObject;
clearTicks();
tickContainer = new Sprite();
_local1 = ((maximum)<1) ? (tickInterval / 100) : tickInterval;
_local2 = ((maximum - minimum) / _local1);
_local3 = (_width / _local2);
_local4 = 0;
while (_local4 <= _local2) {
_local5 = getDisplayObjectInstance(getStyleValue("tickSkin"));
_local5.x = (_local3 * _local4);
_local5.y = ((track.y - _local5.height) - 2);
tickContainer.addChild(_local5);
_local4++;
};
addChild(tickContainer);
}
protected function calculateValue(_arg1:Number, _arg2:String, _arg3:String, _arg4:int=undefined):void{
var _local5:Number;
_local5 = ((_arg1 / _width) * (maximum - minimum));
if (_direction == SliderDirection.VERTICAL){
_local5 = (maximum - _local5);
} else {
_local5 = (minimum + _local5);
};
doSetValue(_local5, _arg2, _arg3, _arg4);
}
protected function getPrecision(_arg1:Number):Number{
var _local2:String;
_local2 = _arg1.toString();
if (_local2.indexOf(".") == -1){
return (0);
};
return (_local2.split(".").pop().length);
}
protected function doSetValue(_arg1:Number, _arg2:String=null, _arg3:String=null, _arg4:int=undefined):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local5 = _value;
if (((!((_snapInterval == 0))) && (!((_snapInterval == 1))))){
_local6 = Math.pow(10, getPrecision(snapInterval));
_local7 = (_snapInterval * _local6);
_local8 = Math.round((_arg1 * _local6));
_local9 = (Math.round((_local8 / _local7)) * _local7);
_arg1 = (_local9 / _local6);
_value = Math.max(minimum, Math.min(maximum, _arg1));
} else {
_value = Math.max(minimum, Math.min(maximum, Math.round(_arg1)));
};
if (((!((_local5 == _value))) && (((((liveDragging) && (!((_arg3 == null))))) || ((_arg2 == InteractionInputType.KEYBOARD)))))){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, _arg3, _arg2, _arg4));
};
positionThumb();
}
protected function setStyles():void{
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 30
//SliderDirection (fl.controls.SliderDirection)
package fl.controls {
public class SliderDirection {
public static var HORIZONTAL:String = "horizontal";
public static var VERTICAL:String = "vertical";
}
}//package fl.controls
Section 31
//TextInput (fl.controls.TextInput)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class TextInput extends UIComponent implements IFocusManagerComponent {
protected var _html:Boolean;// = false
protected var _savedHTML:String;
protected var background:DisplayObject;
protected var _editable:Boolean;// = true
public var textField:TextField;
private static var defaultStyles:Object = {upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:0, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function TextInput(){
_editable = true;
_html = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
if (focusTarget != null){
focusTarget.drawFocus(_arg1);
return;
};
super.drawFocus(_arg1);
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == textField)) || (super.isOurFocus(_arg1))));
}
protected function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
};
}
public function set text(_arg1:String):void{
textField.text = _arg1;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
}
public function get selectionEndIndex():int{
return (textField.selectionEndIndex);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (_arg1.target == this){
stage.focus = textField;
};
_local2 = focusManager;
if (((editable) && (_local2))){
_local2.showFocusIndicator = true;
if (((textField.selectable) && ((textField.selectionBeginIndex == textField.selectionBeginIndex)))){
setSelection(0, textField.length);
};
};
super.focusInHandler(_arg1);
if (editable){
setIMEMode(true);
};
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
public function set alwaysShowSelection(_arg1:Boolean):void{
textField.alwaysShowSelection = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
updateTextFieldType();
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
public function get horizontalScrollPosition():int{
return (textField.scrollH);
}
public function set condenseWhite(_arg1:Boolean):void{
textField.condenseWhite = _arg1;
}
public function set displayAsPassword(_arg1:Boolean):void{
textField.displayAsPassword = _arg1;
}
public function set horizontalScrollPosition(_arg1:int):void{
textField.scrollH = _arg1;
}
public function get restrict():String{
return (textField.restrict);
}
public function get textWidth():Number{
return (textField.textWidth);
}
public function get textHeight():Number{
return (textField.textHeight);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
updateTextFieldType();
}
public function get maxChars():int{
return (textField.maxChars);
}
public function get length():int{
return (textField.length);
}
public function getLineMetrics(_arg1:int):TextLineMetrics{
return (textField.getLineMetrics(_arg1));
}
public function get imeMode():String{
return (_imeMode);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
super.focusOutHandler(_arg1);
if (editable){
setIMEMode(false);
};
}
public function set htmlText(_arg1:String):void{
if (_arg1 == ""){
text = "";
return;
};
_html = true;
_savedHTML = _arg1;
textField.htmlText = _arg1;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
public function get text():String{
return (textField.text);
}
override public function get enabled():Boolean{
return (super.enabled);
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
override protected function draw():void{
var _local1:Object;
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function handleTextInput(_arg1:TextEvent):void{
_arg1.stopPropagation();
dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text));
}
override protected function configUI():void{
super.configUI();
tabChildren = true;
textField = new TextField();
addChild(textField);
updateTextFieldType();
textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
textField.addEventListener(Event.CHANGE, handleChange, false, 0, true);
textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);
}
public function setSelection(_arg1:int, _arg2:int):void{
textField.setSelection(_arg1, _arg2);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
public function appendText(_arg1:String):void{
textField.appendText(_arg1);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
textField.restrict = _arg1;
}
public function get htmlText():String{
return (textField.htmlText);
}
protected function drawBackground():void{
var _local1:DisplayObject;
var _local2:String;
_local1 = background;
_local2 = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(_local2));
if (background == null){
return;
};
addChildAt(background, 0);
if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){
removeChild(_local1);
};
}
override public function setFocus():void{
stage.focus = textField;
}
protected function drawLayout():void{
var _local1:Number;
_local1 = Number(getStyleValue("textPadding"));
if (background != null){
background.width = width;
background.height = height;
};
textField.width = (width - (2 * _local1));
textField.height = (height - (2 * _local1));
textField.x = (textField.y = _local1);
}
public function set maxChars(_arg1:int):void{
textField.maxChars = _arg1;
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
if (_html){
textField.htmlText = _savedHTML;
};
}
protected function handleChange(_arg1:Event):void{
_arg1.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 32
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 33
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 34
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 35
//DataProvider (fl.data.DataProvider)
package fl.data {
import flash.events.*;
import fl.events.*;
public class DataProvider extends EventDispatcher {
protected var data:Array;
public function DataProvider(_arg1:Object=null){
if (_arg1 == null){
data = [];
} else {
data = getDataFromObject(_arg1);
};
}
protected function dispatchPreChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.PRE_DATA_CHANGE, _arg1, _arg2, _arg3, _arg4));
}
public function invalidateItemAt(_arg1:int):void{
checkIndex(_arg1, (data.length - 1));
dispatchChangeEvent(DataChangeType.INVALIDATE, [data[_arg1]], _arg1, _arg1);
}
public function getItemIndex(_arg1:Object):int{
return (data.indexOf(_arg1));
}
protected function getDataFromObject(_arg1:Object):Array{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local6:XML;
var _local7:XMLList;
var _local8:XML;
var _local9:XMLList;
var _local10:XML;
var _local11:XMLList;
var _local12:XML;
if ((_arg1 is Array)){
_local3 = (_arg1 as Array);
if (_local3.length > 0){
if ((((_local3[0] is String)) || ((_local3[0] is Number)))){
_local2 = [];
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = {label:String(_local3[_local4]), data:_local3[_local4]};
_local2.push(_local5);
_local4++;
};
return (_local2);
};
};
return (_arg1.concat());
//unresolved jump
};
if ((_arg1 is DataProvider)){
return (_arg1.toArray());
};
if ((_arg1 is XML)){
_local6 = (_arg1 as XML);
_local2 = [];
_local7 = _local6.*;
for each (_local8 in _local7) {
_arg1 = {};
_local9 = _local8.attributes();
for each (_local10 in _local9) {
_arg1[_local10.localName()] = _local10.toString();
};
_local11 = _local8.*;
for each (_local12 in _local11) {
if (_local12.hasSimpleContent()){
_arg1[_local12.localName()] = _local12.toString();
};
};
_local2.push(_arg1);
};
return (_local2);
//unresolved jump
};
throw (new TypeError((("Error: Type Coercion failed: cannot convert " + _arg1) + " to Array or DataProvider.")));
}
public function removeItemAt(_arg1:uint):Object{
var _local2:Array;
checkIndex(_arg1, (data.length - 1));
dispatchPreChangeEvent(DataChangeType.REMOVE, data.slice(_arg1, (_arg1 + 1)), _arg1, _arg1);
_local2 = data.splice(_arg1, 1);
dispatchChangeEvent(DataChangeType.REMOVE, _local2, _arg1, _arg1);
return (_local2[0]);
}
public function addItem(_arg1:Object):void{
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1));
data.push(_arg1);
dispatchChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1));
}
public function sortOn(_arg1:Object, _arg2:Object=null){
var _local3:Array;
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
_local3 = data.sortOn(_arg1, _arg2);
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
return (_local3);
}
public function sort(... _args){
var _local2:Array;
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
_local2 = data.sort.apply(data, _args);
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
return (_local2);
}
public function addItems(_arg1:Object):void{
addItemsAt(_arg1, data.length);
}
public function concat(_arg1:Object):void{
addItems(_arg1);
}
public function clone():DataProvider{
return (new DataProvider(data));
}
public function toArray():Array{
return (data.concat());
}
public function get length():uint{
return (data.length);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
checkIndex(_arg2, data.length);
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2);
data.splice(_arg2, 0, _arg1);
dispatchChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2);
}
public function getItemAt(_arg1:uint):Object{
checkIndex(_arg1, (data.length - 1));
return (data[_arg1]);
}
override public function toString():String{
return ((("DataProvider [" + data.join(" , ")) + "]"));
}
public function invalidateItem(_arg1:Object):void{
var _local2:uint;
_local2 = getItemIndex(_arg1);
if (_local2 == -1){
return;
};
invalidateItemAt(_local2);
}
protected function dispatchChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, _arg1, _arg2, _arg3, _arg4));
}
protected function checkIndex(_arg1:int, _arg2:int):void{
if ((((_arg1 > _arg2)) || ((_arg1 < 0)))){
throw (new RangeError((((("DataProvider index (" + _arg1) + ") is not in acceptable range (0 - ") + _arg2) + ")")));
};
}
public function addItemsAt(_arg1:Object, _arg2:uint):void{
var _local3:Array;
checkIndex(_arg2, data.length);
_local3 = getDataFromObject(_arg1);
dispatchPreChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1));
data.splice.apply(data, [_arg2, 0].concat(_local3));
dispatchChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1));
}
public function replaceItem(_arg1:Object, _arg2:Object):Object{
var _local3:int;
_local3 = getItemIndex(_arg2);
if (_local3 != -1){
return (replaceItemAt(_arg1, _local3));
};
return (null);
}
public function removeItem(_arg1:Object):Object{
var _local2:int;
_local2 = getItemIndex(_arg1);
if (_local2 != -1){
return (removeItemAt(_local2));
};
return (null);
}
public function merge(_arg1:Object):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Object;
_local2 = getDataFromObject(_arg1);
_local3 = _local2.length;
_local4 = data.length;
dispatchPreChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1));
_local5 = 0;
while (_local5 < _local3) {
_local6 = _local2[_local5];
if (getItemIndex(_local6) == -1){
data.push(_local6);
};
_local5++;
};
if (data.length > _local4){
dispatchChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1));
} else {
dispatchChangeEvent(DataChangeType.ADD, [], -1, -1);
};
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
var _local3:Array;
checkIndex(_arg2, (data.length - 1));
_local3 = [data[_arg2]];
dispatchPreChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2);
data[_arg2] = _arg1;
dispatchChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2);
return (_local3[0]);
}
public function invalidate():void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, DataChangeType.INVALIDATE_ALL, data.concat(), 0, data.length));
}
public function removeAll():void{
var _local1:Array;
_local1 = data.concat();
dispatchPreChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length);
data = [];
dispatchChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length);
}
}
}//package fl.data
Section 36
//SimpleCollectionItem (fl.data.SimpleCollectionItem)
package fl.data {
public dynamic class SimpleCollectionItem {
public var label:String;
public var data:String;
public function toString():String{
return ((((("[SimpleCollectionItem: " + label) + ",") + data) + "]"));
}
}
}//package fl.data
Section 37
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 38
//DataChangeEvent (fl.events.DataChangeEvent)
package fl.events {
import flash.events.*;
public class DataChangeEvent extends Event {
protected var _items:Array;
protected var _endIndex:uint;
protected var _changeType:String;
protected var _startIndex:uint;
public static const PRE_DATA_CHANGE:String = "preDataChange";
public static const DATA_CHANGE:String = "dataChange";
public function DataChangeEvent(_arg1:String, _arg2:String, _arg3:Array, _arg4:int=-1, _arg5:int=-1):void{
super(_arg1);
_changeType = _arg2;
_startIndex = _arg4;
_items = _arg3;
_endIndex = ((_arg5)==-1) ? _startIndex : _arg5;
}
public function get changeType():String{
return (_changeType);
}
public function get startIndex():uint{
return (_startIndex);
}
public function get items():Array{
return (_items);
}
override public function clone():Event{
return (new DataChangeEvent(type, _changeType, _items, _startIndex, _endIndex));
}
override public function toString():String{
return (formatToString("DataChangeEvent", "type", "changeType", "startIndex", "endIndex", "bubbles", "cancelable"));
}
public function get endIndex():uint{
return (_endIndex);
}
}
}//package fl.events
Section 39
//DataChangeType (fl.events.DataChangeType)
package fl.events {
public class DataChangeType {
public static const ADD:String = "add";
public static const REMOVE:String = "remove";
public static const REMOVE_ALL:String = "removeAll";
public static const CHANGE:String = "change";
public static const REPLACE:String = "replace";
public static const INVALIDATE:String = "invalidate";
public static const INVALIDATE_ALL:String = "invalidateAll";
public static const SORT:String = "sort";
}
}//package fl.events
Section 40
//InteractionInputType (fl.events.InteractionInputType)
package fl.events {
public class InteractionInputType {
public static const MOUSE:String = "mouse";
public static const KEYBOARD:String = "keyboard";
}
}//package fl.events
Section 41
//ListEvent (fl.events.ListEvent)
package fl.events {
import flash.events.*;
public class ListEvent extends Event {
protected var _index:int;
protected var _item:Object;
protected var _columnIndex:int;
protected var _rowIndex:int;
public static const ITEM_DOUBLE_CLICK:String = "itemDoubleClick";
public static const ITEM_ROLL_OUT:String = "itemRollOut";
public static const ITEM_ROLL_OVER:String = "itemRollOver";
public static const ITEM_CLICK:String = "itemClick";
public function ListEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:int=-1, _arg5:int=-1, _arg6:int=-1, _arg7:Object=null){
super(_arg1, _arg2, _arg3);
_rowIndex = _arg5;
_columnIndex = _arg4;
_index = _arg6;
_item = _arg7;
}
public function get rowIndex():Object{
return (_rowIndex);
}
public function get index():int{
return (_index);
}
public function get item():Object{
return (_item);
}
public function get columnIndex():int{
return (_columnIndex);
}
override public function clone():Event{
return (new ListEvent(type, bubbles, cancelable, _columnIndex, _rowIndex));
}
override public function toString():String{
return (formatToString("ListEvent", "type", "bubbles", "cancelable", "columnIndex", "rowIndex", "index", "item"));
}
}
}//package fl.events
Section 42
//ScrollEvent (fl.events.ScrollEvent)
package fl.events {
import flash.events.*;
public class ScrollEvent extends Event {
private var _position:Number;
private var _direction:String;
private var _delta:Number;
public static const SCROLL:String = "scroll";
public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){
super(ScrollEvent.SCROLL, false, false);
_direction = _arg1;
_delta = _arg2;
_position = _arg3;
}
override public function clone():Event{
return (new ScrollEvent(_direction, _delta, _position));
}
public function get position():Number{
return (_position);
}
override public function toString():String{
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position"));
}
public function get delta():Number{
return (_delta);
}
public function get direction():String{
return (_direction);
}
}
}//package fl.events
Section 43
//SliderEvent (fl.events.SliderEvent)
package fl.events {
import flash.events.*;
public class SliderEvent extends Event {
protected var _triggerEvent:String;
protected var _keyCode:Number;
protected var _value:Number;
protected var _clickTarget:String;
public static const CHANGE:String = "change";
public static const THUMB_PRESS:String = "thumbPress";
public static const THUMB_DRAG:String = "thumbDrag";
public static const THUMB_RELEASE:String = "thumbRelease";
public function SliderEvent(_arg1:String, _arg2:Number, _arg3:String, _arg4:String, _arg5:int=0){
_value = _arg2;
_keyCode = _arg5;
_triggerEvent = _arg4;
_clickTarget = _arg3;
super(_arg1);
}
public function get clickTarget():String{
return (_clickTarget);
}
override public function clone():Event{
return (new SliderEvent(type, _value, _clickTarget, _triggerEvent, _keyCode));
}
override public function toString():String{
return (formatToString("SliderEvent", "type", "value", "bubbles", "cancelable", "keyCode", "triggerEvent", "clickTarget"));
}
public function get triggerEvent():String{
return (_triggerEvent);
}
public function get value():Number{
return (_value);
}
public function get keyCode():Number{
return (_keyCode);
}
}
}//package fl.events
Section 44
//SliderEventClickTarget (fl.events.SliderEventClickTarget)
package fl.events {
public class SliderEventClickTarget {
public static const TRACK:String = "track";
public static const THUMB:String = "thumb";
}
}//package fl.events
Section 45
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.core.*;
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 46
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 47
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 48
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 49
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.utils.*;
import flash.text.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 50
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 51
//movEntryScreen_2 (HiScores_fla.movEntryScreen_2)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movEntryScreen_2 extends MovieClip {
public var txtName:TextField;
public var movCode:MovieClip;
public var txtMsg2:TextField;
public var btnRefreshCode:SimpleButton;
public var txtCode:TextField;
public var txtMsg1:TextField;
public var btnSubmit:SimpleButton;
}
}//package HiScores_fla
Section 52
//movInfoScreen_6 (HiScores_fla.movInfoScreen_6)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movInfoScreen_6 extends MovieClip {
public var btnView:SimpleButton;
public var txtInfo:TextField;
public var btnBack:SimpleButton;
}
}//package HiScores_fla
Section 53
//EditorOverlay (levelEditor.EditorOverlay)
package levelEditor {
import flash.display.*;
import flash.events.*;
import com.evilfree.solarola.tiles.*;
import flash.net.*;
import com.evilfree.solarola.walls.*;
public class EditorOverlay {
private var overlay_mc:MovieClip;
private var wazStart:MovieClip;
private var levelXML:XML;
private var wizStart:MovieClip;
private var rotatorReference:Rotator;
public function EditorOverlay(_arg1:Rotator, _arg2:MovieClip){
rotatorReference = _arg1;
overlay_mc = _arg2;
drawGrid();
drawOverlayTiles();
overlay_mc.visible = false;
levelXML = rotatorReference.getLevelXML();
trace(("level xml:" + Number(levelXML.wizStartTile.@x)));
wizStart = new WizStart();
wazStart = new WazStart();
overlay_mc.addChild(wizStart);
trace(("wiz start x:" + levelXML.level.wizStartTile.@x));
wizStart.x = (((Number(levelXML.wizStartTile.@x) * 40) - 200) + 20);
wizStart.y = (((Number(levelXML.wizStartTile.@y) * 40) - 200) + 20);
overlay_mc.addChild(wazStart);
wazStart.x = (((Number(levelXML.wazStartTile.@x) * 40) - 200) + 20);
wazStart.y = (((Number(levelXML.wazStartTile.@y) * 40) - 200) + 20);
wizStart.buttonMode = true;
wazStart.buttonMode = true;
wizStart.addEventListener(MouseEvent.MOUSE_DOWN, startWizDrag);
wazStart.addEventListener(MouseEvent.MOUSE_DOWN, startWazDrag);
wizStart.addEventListener(MouseEvent.MOUSE_UP, stopWizDrag);
wazStart.addEventListener(MouseEvent.MOUSE_UP, stopWazDrag);
wizStart.addEventListener(MouseEvent.MOUSE_OUT, stopWizDrag);
wazStart.addEventListener(MouseEvent.MOUSE_OUT, stopWazDrag);
}
public function stopWizDrag(_arg1:Event){
wizStart.stopDrag();
levelXML.wizStartTile.@x = ((wizStart.x + 180) / 40);
levelXML.wizStartTile.@y = ((wizStart.y + 180) / 40);
}
public function drawOverlayTiles(){
var _local1:BaseTile;
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:TraceTile;
var _local7:*;
_local7 = 0;
while (_local7 < 100) {
_local2 = (_local7 % 10);
_local3 = Math.floor((_local7 / 10));
_local4 = (((_local2 * Rotator.gridSize) + (Rotator.gridSize / 2)) - (Rotator.levelSize / 2));
_local5 = (((_local3 * Rotator.gridSize) + (Rotator.gridSize / 2)) - (Rotator.levelSize / 2));
_local6 = new TraceTile(_local7);
overlay_mc.addChild(_local6);
_local6.x = _local4;
_local6.y = _local5;
_local6.setRotator(rotatorReference);
_local7++;
};
}
public function startWizDrag(_arg1:Event){
wizStart.startDrag();
}
public function startWazDrag(_arg1:Event){
wazStart.startDrag();
}
private function drawGridLines(_arg1:String){
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:MovieClip;
var _local9:TraceLine;
var _local10:*;
_local10 = 0;
while (_local10 < 110) {
if (_arg1 == "horizontal"){
_local4 = (_local10 % 10);
_local5 = Math.floor((_local10 / 10));
_local6 = (((_local4 * Rotator.gridSize) + (Rotator.gridSize / 2)) - (Rotator.levelSize / 2));
_local7 = ((_local5 * Rotator.gridSize) - (Rotator.levelSize / 2));
_local2 = (Rotator.gridSize - 8);
_local3 = 0;
} else {
_local4 = (_local10 % 11);
_local5 = Math.floor((_local10 / 11));
_local6 = ((_local4 * Rotator.gridSize) - (Rotator.levelSize / 2));
_local7 = (((_local5 * Rotator.gridSize) + (Rotator.gridSize / 2)) - (Rotator.levelSize / 2));
_local2 = 0;
_local3 = Rotator.gridSize;
};
_local9 = new TraceLine(_local10, _arg1);
overlay_mc.addChild(_local9);
_local9.x = _local6;
_local9.y = _local7;
_local9.setRotator(rotatorReference);
_local10++;
};
}
private function drawGrid(){
drawGridLines("horizontal");
drawGridLines("vertical");
}
public function stopWazDrag(_arg1:Event){
wazStart.stopDrag();
levelXML.wazStartTile.@x = ((wazStart.x + 180) / 40);
levelXML.wazStartTile.@y = ((wazStart.y + 180) / 40);
}
}
}//package levelEditor
Section 54
//SolaRolaLevelEditor (levelEditor.SolaRolaLevelEditor)
package levelEditor {
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import com.adobe.images.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
public class SolaRolaLevelEditor {
private var levelList:Array;
private var selectedWall:uint;
private var levelComboRef:ComboBox;
private var xmlLoader:URLLoader;
private var timelineRef;
private var fullURL:String;
private var selectedTile:uint;
private var jpegMode:Boolean;
private var levelName:String;
private var levelCount:Number;
private var solaRolaRef:SolaRola;
private var xmlRequest:URLRequest;
private var currentLevelNum:Number;
public static var cServerLocation:String = "http://www.evilfree.com/work/solarola";
public function SolaRolaLevelEditor(_arg1:MovieClip, _arg2){
var _local3:*;
super();
timelineRef = _arg2;
levelComboRef = _arg2.levelChooser;
jpegMode = false;
_local3 = Math.random();
fullURL = (SolaRolaLevelEditor.cServerLocation + "/scripts/levelList2.xml");
xmlRequest = new URLRequest(fullURL);
xmlLoader = new URLLoader();
xmlLoader.load(xmlRequest);
xmlLoader.addEventListener(Event.COMPLETE, levelsReturned);
currentLevelNum = 0;
levelCount = 0;
timelineRef.saveJpegButton.addEventListener(MouseEvent.CLICK, exportScreens);
}
private function levelsReturnedAfterUpload(_arg1:Event){
var _local2:XML;
var _local3:*;
xmlLoader.removeEventListener(Event.COMPLETE, levelsReturnedAfterUpload);
_local2 = XML(_arg1.currentTarget.data);
levelComboRef.removeAll();
levelComboRef.addItem({label:"Choose a Level..."});
_local3 = 0;
while (_local3 < _local2.children().length()) {
levelComboRef.addItem({label:_local2.children()[_local3].attribute("label"), data:_local2.children()[_local3].attribute("filePath")});
if (_local2.children()[_local3].attribute("label") == (timelineRef.txtNewFilename.text + ".xml")){
levelComboRef.selectedIndex = (_local3 + 1);
};
_local3++;
};
timelineRef.txtNewFilename.text = "";
levelComboRef.addEventListener(Event.CHANGE, buttonClick);
timelineRef.buttonCreate.addEventListener(MouseEvent.CLICK, buttonClick);
timelineRef.buttonSave.addEventListener(MouseEvent.CLICK, buttonClick);
timelineRef.txtNewFilename.type = TextFieldType.INPUT;
loadLevel();
}
private function newLevelReturned(_arg1:Event){
var _local2:XML;
var _local3:URLVariables;
var _local4:URLRequest;
xmlLoader.removeEventListener(Event.COMPLETE, newLevelReturned);
_local2 = XML(_arg1.currentTarget.data);
trace(_local2);
_local3 = new URLVariables();
_local3.levelData = _local2.toString();
_local3.file = (("../levels/" + timelineRef.txtNewFilename.text) + ".xml");
_local4 = new URLRequest((SolaRolaLevelEditor.cServerLocation + "/scripts/saveLevel.php"));
_local4.method = URLRequestMethod.POST;
_local4.data = _local3;
xmlLoader.load(_local4);
xmlLoader.addEventListener(Event.COMPLETE, newLevelCreated);
}
private function saveLevel(){
var _local1:XML;
var _local2:URLVariables;
var _local3:URLRequest;
if (((!((levelComboRef.selectedIndex == -1))) && (!((levelComboRef.selectedIndex == 0))))){
timelineRef.txtSaving.text = "Saving your new level...";
_local1 = solaRolaRef.rotator.getLevelXML();
_local2 = new URLVariables();
_local2.levelData = _local1.toString();
_local2.file = ("../levels/" + levelComboRef.getItemAt(levelComboRef.selectedIndex).data);
_local3 = new URLRequest((SolaRolaLevelEditor.cServerLocation + "/scripts/saveLevel.php"));
_local3.method = URLRequestMethod.POST;
_local3.data = _local2;
xmlLoader.load(_local3);
xmlLoader.addEventListener(Event.COMPLETE, newLevelSaved);
};
}
private function newLevelCreated(_arg1:Event){
var _local2:XML;
xmlLoader.removeEventListener(Event.COMPLETE, newLevelCreated);
trace(_arg1.currentTarget.data);
_local2 = XML(_arg1.currentTarget.data);
fullURL = (SolaRolaLevelEditor.cServerLocation + "/scripts/getLevelList.php");
xmlRequest = new URLRequest(fullURL);
xmlLoader = new URLLoader();
xmlLoader.load(xmlRequest);
xmlLoader.addEventListener(Event.COMPLETE, levelsReturnedAfterUpload);
}
public function exportScreen(){
var _local1:JPGEncoder;
var _local2:BitmapData;
_local1 = new JPGEncoder(75);
_local2 = new BitmapData(400, 400);
solaRolaRef.rotate_mc.visible = false;
solaRolaRef.overlay_mc.x = 200;
solaRolaRef.overlay_mc.y = 200;
_local2.draw(solaRolaRef);
solaRolaRef.overlay_mc.x = 0;
solaRolaRef.overlay_mc.y = 0;
solaRolaRef.rotate_mc.visible = true;
sendJPG(_local2);
}
function uploadCompleted(_arg1:Event){
trace(("Upload Completed:" + _arg1.target.data));
if (levelComboRef.selectedIndex < (levelCount + 1)){
};
}
private function newLevelSaved(_arg1:Event){
trace(_arg1.currentTarget.data);
timelineRef.txtSaving.text = "Your level has been saved.";
}
private function levelsReturned(_arg1:Event){
var _local2:XML;
var _local3:*;
xmlLoader.removeEventListener(Event.COMPLETE, levelsReturned);
_local2 = XML(_arg1.currentTarget.data);
solaRolaRef.receiveLevelXML(_local2);
levelComboRef.addItem({label:"Choose a Level..."});
levelCount = _local2.children().length();
_local3 = 0;
while (_local3 < _local2.children().length()) {
levelComboRef.addItem({label:_local2.children()[_local3].attribute("label"), data:_local2.children()[_local3].attribute("filePath")});
_local3++;
};
continueSetup();
}
private function createLevel(){
if (timelineRef.txtNewFilename.text != ""){
levelComboRef.removeEventListener(Event.CHANGE, buttonClick);
timelineRef.buttonCreate.removeEventListener(MouseEvent.CLICK, buttonClick);
timelineRef.buttonSave.removeEventListener(MouseEvent.CLICK, buttonClick);
timelineRef.txtNewFilename.type = TextFieldType.DYNAMIC;
fullURL = "newLevel.xml";
xmlRequest = new URLRequest(fullURL);
xmlLoader = new URLLoader();
xmlLoader.load(xmlRequest);
xmlLoader.addEventListener(Event.COMPLETE, newLevelReturned);
};
}
private function continueSetup(){
var _local1:*;
var _local2:Transform;
levelComboRef.addEventListener(Event.CHANGE, buttonClick);
timelineRef.buttonCreate.addEventListener(MouseEvent.CLICK, buttonClick);
timelineRef.buttonSave.addEventListener(MouseEvent.CLICK, buttonClick);
_local1 = 0;
while (_local1 < 9) {
if (_local1 < 6){
timelineRef[("wall" + _local1)].buttonMode = true;
timelineRef[("walltype" + _local1)].mouseEnabled = false;
timelineRef[("wall" + _local1)].addEventListener(MouseEvent.CLICK, buttonClick);
timelineRef[("wall" + _local1)].addEventListener(MouseEvent.ROLL_OVER, buttonRoll);
timelineRef[("wall" + _local1)].addEventListener(MouseEvent.ROLL_OUT, buttonRoll);
timelineRef[("wall" + _local1)].gotoAndStop(1);
};
timelineRef[("tile" + _local1)].buttonMode = true;
timelineRef[("tiletype" + _local1)].mouseEnabled = false;
timelineRef[("tile" + _local1)].addEventListener(MouseEvent.CLICK, buttonClick);
timelineRef[("tile" + _local1)].addEventListener(MouseEvent.ROLL_OVER, buttonRoll);
timelineRef[("tile" + _local1)].addEventListener(MouseEvent.ROLL_OUT, buttonRoll);
timelineRef[("tile" + _local1)].gotoAndStop(1);
if (_local1 >= 6){
timelineRef[("tile" + _local1)].visible = false;
timelineRef[("tiletype" + _local1)].visible = false;
};
_local1++;
};
_local2 = timelineRef.tile3.inner.transform;
_local2.colorTransform = new ColorTransform(0, 0, 0, 1, 0, 0, 0x0100, 0);
timelineRef.tile3.inner.transform = _local2;
_local2 = timelineRef.tile4.inner.transform;
_local2.colorTransform = new ColorTransform(0, 0, 0, 1, 0x0100, 0, 0, 0);
timelineRef.tile4.inner.transform = _local2;
_local2 = timelineRef.tile5.inner.transform;
_local2.colorTransform = new ColorTransform(0, 0, 0, 1, 0, 102, 0, 0);
timelineRef.tile5.inner.transform = _local2;
selectedTile = 0;
selectedWall = 0;
timelineRef.wall0.gotoAndStop(2);
timelineRef.tile0.gotoAndStop(2);
timelineRef.txtSaving.text = "";
}
private function buttonRoll(_arg1:Event){
if (_arg1.type == MouseEvent.ROLL_OVER){
if (_arg1.currentTarget.currentFrame != 2){
_arg1.currentTarget.gotoAndStop(3);
};
} else {
if (_arg1.currentTarget.currentFrame != 2){
_arg1.currentTarget.gotoAndStop(1);
};
};
}
function sendJPG(_arg1:BitmapData):void{
var jpgObj:JPGEncoder;
var imageBytes:ByteArray;
var boundary:String;
var header1:String;
var header2:String;
var headerBytes1:ByteArray;
var headerBytes2:ByteArray;
var sendBytes:ByteArray;
var request:URLRequest;
var loader:URLLoader;
var bmpData = _arg1;
jpgObj = new JPGEncoder(90);
imageBytes = jpgObj.encode(bmpData);
imageBytes.position = 0;
boundary = "---------------------------7d76d1b56035e";
header1 = (((((((((((("--" + boundary) + "\r\n") + "Content-Disposition: form-data; name=\"Filename\"\r\n\r\n") + levelName) + ".jpg\r\n") + "--") + boundary) + "\r\n") + "Content-Disposition: form-data; name=\"Filedata\"; filename=\"") + levelName) + ".jpg\"\r\n") + "Content-Type: application/octet-stream\r\n\r\n");
header2 = ((((((("--" + boundary) + "\r\n") + "Content-Disposition: form-data; name=\"Upload\"\r\n\r\n") + "Submit Query\r\n") + "--") + boundary) + "--");
headerBytes1 = new ByteArray();
headerBytes1.writeMultiByte(header1, "ascii");
headerBytes2 = new ByteArray();
headerBytes2.writeMultiByte(header2, "ascii");
sendBytes = new ByteArray();
sendBytes.writeBytes(headerBytes1, 0, headerBytes1.length);
sendBytes.writeBytes(imageBytes, 0, imageBytes.length);
sendBytes.writeBytes(headerBytes2, 0, headerBytes2.length);
request = new URLRequest("http://www.evilfree.com/work/solarola/upload2.php?relativePath=levelimages");
request.data = sendBytes;
request.method = URLRequestMethod.POST;
request.contentType = ("multipart/form-data; boundary=" + boundary);
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, uploadCompleted);
try {
loader.load(request);
} catch(error:Error) {
trace("Unable to load requested document.");
};
}
public function exportScreens(_arg1:Event){
jpegMode = true;
exportScreen();
}
private function buttonClick(_arg1:Event){
var _local2:uint;
var _local3:int;
timelineRef.txtSaving.text = "Click 'Save' to save this level!";
if (_arg1.currentTarget.name.substr(0, 4) == "wall"){
_local2 = _arg1.currentTarget.name.charAt(4);
_local3 = 0;
while (_local3 < 6) {
timelineRef[("wall" + _local3)].gotoAndStop(1);
_local3++;
};
selectedWall = _local2;
timelineRef[("wall" + selectedWall)].gotoAndStop(2);
if (solaRolaRef != null){
solaRolaRef.rotator.currentWallType = selectedWall;
};
} else {
if (_arg1.currentTarget.name.substr(0, 4) == "tile"){
_local2 = _arg1.currentTarget.name.charAt(4);
_local3 = 0;
while (_local3 < 6) {
timelineRef[("tile" + _local3)].gotoAndStop(1);
_local3++;
};
selectedTile = _local2;
timelineRef[("tile" + selectedTile)].gotoAndStop(2);
if (solaRolaRef != null){
solaRolaRef.rotator.currentTileType = selectedTile;
};
} else {
switch (_arg1.currentTarget.name){
case "levelChooser":
loadLevel();
break;
case "buttonCreate":
createLevel();
break;
case "buttonSave":
saveLevel();
break;
};
};
};
}
private function loadLevel(){
var _local1:String;
var _local2:Number;
if (((!((levelComboRef.selectedIndex == -1))) && (!((levelComboRef.selectedIndex == 0))))){
_local1 = levelComboRef.getItemAt(levelComboRef.selectedIndex).data;
if (((!((solaRolaRef == null))) && (timelineRef.contains(solaRolaRef)))){
solaRolaRef.clear();
};
levelName = _local1.substr(2).split(".")[0];
_local2 = (levelComboRef.selectedIndex - 2);
solaRolaRef.loadLevel(SolaRolaLevelEditor.cServerLocation, ((_local1.substr(2) + "?") + Math.random()), selectedWall, selectedTile, _local2);
timelineRef.stage.focus = null;
};
}
public function levelReady(){
trace("The level has loaded.");
if (jpegMode){
exportScreen();
};
}
}
}//package levelEditor
Section 55
//AbstractCollection (org.cove.ape.AbstractCollection)
package org.cove.ape {
import flash.display.*;
import flash.utils.*;
public class AbstractCollection {
private var _sprite:Sprite;
private var _isParented:Boolean;
private var _particles:Array;
private var _constraints:Array;
public function AbstractCollection(){
if (getQualifiedClassName(this) == "org.cove.ape::AbstractCollection"){
throw (new ArgumentError("AbstractCollection can't be instantiated directly"));
};
_isParented = false;
_particles = new Array();
_constraints = new Array();
}
public function getAll():Array{
return (particles.concat(constraints));
}
function checkCollisionsVsCollection(_arg1:AbstractCollection):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:AbstractParticle;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:AbstractParticle;
var _local10:SpringConstraint;
var _local11:SpringConstraint;
var _local12:int;
_local2 = _particles.length;
_local3 = 0;
while (_local3 < _local2) {
_local5 = _particles[_local3];
if ((((_local5 == null)) || (!(_local5.collidable)))){
} else {
_local6 = _arg1.particles.length;
_local7 = 0;
while (_local7 < _local6) {
_local9 = _arg1.particles[_local7];
if (((!((_local9 == null))) && (_local9.collidable))){
CollisionDetector.test(_local5, _local9);
};
_local7++;
};
_local8 = _arg1.constraints.length;
_local7 = 0;
while (_local7 < _local8) {
_local10 = _arg1.constraints[_local7];
if (((((!((_local10 == null))) && (_local10.collidable))) && (!(_local10.isConnectedTo(_local5))))){
_local10.scp.updatePosition();
CollisionDetector.test(_local5, _local10.scp);
};
_local7++;
};
};
_local3++;
};
_local4 = _constraints.length;
_local3 = 0;
while (_local3 < _local4) {
_local11 = _constraints[_local3];
if ((((_local11 == null)) || (!(_local11.collidable)))){
} else {
_local6 = _arg1.particles.length;
_local12 = 0;
while (_local12 < _local6) {
_local9 = _arg1.particles[_local12];
if (((((!((_local9 == null))) && (_local9.collidable))) && (!(_local11.isConnectedTo(_local9))))){
_local11.scp.updatePosition();
CollisionDetector.test(_local9, _local11.scp);
};
_local12++;
};
};
_local3++;
};
}
public function get sprite():Sprite{
if (_sprite != null){
return (_sprite);
};
if (APEngine.container == null){
throw (new Error("The container property of the APEngine class has not been set"));
};
_sprite = new Sprite();
APEngine.container.addChild(_sprite);
return (_sprite);
}
function checkInternalCollisions():void{
var _local1:int;
var _local2:int;
var _local3:AbstractParticle;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:AbstractParticle;
var _local8:SpringConstraint;
_local1 = _particles.length;
_local2 = 0;
while (_local2 < _local1) {
_local3 = _particles[_local2];
if ((((_local3 == null)) || (!(_local3.collidable)))){
} else {
_local4 = (_local2 + 1);
while (_local4 < _local1) {
_local7 = _particles[_local4];
if (((!((_local7 == null))) && (_local7.collidable))){
CollisionDetector.test(_local3, _local7);
};
_local4++;
};
_local5 = _constraints.length;
_local6 = 0;
while (_local6 < _local5) {
_local8 = _constraints[_local6];
if (((((!((_local8 == null))) && (_local8.collidable))) && (!(_local8.isConnectedTo(_local3))))){
_local8.scp.updatePosition();
CollisionDetector.test(_local3, _local8.scp);
};
_local6++;
};
};
_local2++;
};
}
public function addParticle(_arg1:AbstractParticle):void{
particles.push(_arg1);
if (isParented){
_arg1.init();
};
}
public function removeConstraint(_arg1:AbstractConstraint):void{
var _local2:int;
_local2 = constraints.indexOf(_arg1);
if (_local2 == -1){
return;
};
constraints.splice(_local2, 1);
_arg1.cleanup();
}
function get isParented():Boolean{
return (_isParented);
}
public function init():void{
var _local1:int;
_local1 = 0;
while (_local1 < particles.length) {
particles[_local1].init();
_local1++;
};
_local1 = 0;
while (_local1 < constraints.length) {
constraints[_local1].init();
_local1++;
};
}
function satisfyConstraints():void{
var _local1:int;
var _local2:int;
var _local3:AbstractConstraint;
_local1 = _constraints.length;
_local2 = 0;
while (_local2 < _local1) {
_local3 = _constraints[_local2];
_local3.resolve();
_local2++;
};
}
public function paint():void{
var _local1:AbstractParticle;
var _local2:int;
var _local3:int;
var _local4:SpringConstraint;
_local2 = _particles.length;
_local3 = 0;
while (_local3 < _local2) {
_local1 = _particles[_local3];
if (((!(_local1.fixed)) || (_local1.alwaysRepaint))){
_local1.paint();
};
_local3++;
};
_local2 = _constraints.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = _constraints[_local3];
if (((!(_local4.fixed)) || (_local4.alwaysRepaint))){
_local4.paint();
};
_local3++;
};
}
public function addConstraint(_arg1:AbstractConstraint):void{
constraints.push(_arg1);
if (isParented){
_arg1.init();
};
}
function set isParented(_arg1:Boolean):void{
_isParented = _arg1;
}
public function removeParticle(_arg1:AbstractParticle):void{
var _local2:int;
_local2 = particles.indexOf(_arg1);
if (_local2 == -1){
return;
};
particles.splice(_local2, 1);
_arg1.cleanup();
}
public function cleanup():void{
var _local1:int;
_local1 = 0;
while (_local1 < particles.length) {
particles[_local1].cleanup();
_local1++;
};
_local1 = 0;
while (_local1 < constraints.length) {
constraints[_local1].cleanup();
_local1++;
};
}
public function get particles():Array{
return (_particles);
}
function integrate(_arg1:Number):void{
var _local2:int;
var _local3:int;
var _local4:AbstractParticle;
_local2 = _particles.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = _particles[_local3];
_local4.update(_arg1);
_local3++;
};
}
public function get constraints():Array{
return (_constraints);
}
}
}//package org.cove.ape
Section 56
//AbstractConstraint (org.cove.ape.AbstractConstraint)
package org.cove.ape {
import flash.utils.*;
public class AbstractConstraint extends AbstractItem {
private var _stiffness:Number;
public function AbstractConstraint(_arg1:Number){
if (getQualifiedClassName(this) == "org.cove.ape::AbstractConstraint"){
throw (new ArgumentError("AbstractConstraint can't be instantiated directly"));
};
this.stiffness = _arg1;
setStyle();
}
public function get stiffness():Number{
return (_stiffness);
}
public function resolve():void{
}
public function set stiffness(_arg1:Number):void{
_stiffness = _arg1;
}
}
}//package org.cove.ape
Section 57
//AbstractItem (org.cove.ape.AbstractItem)
package org.cove.ape {
import flash.display.*;
import flash.events.*;
public class AbstractItem extends EventDispatcher {
var displayObjectOffset:Vector;
var fillColor:uint;
var displayObject:DisplayObject;
var fillAlpha:Number;
private var _solid:Boolean;
private var _visible:Boolean;
var displayObjectRotation:Number;
var lineColor:uint;
var lineAlpha:Number;
var lineThickness:Number;
private var _sprite:Sprite;
private var _alwaysRepaint:Boolean;
public function AbstractItem(){
_solid = true;
_visible = true;
_alwaysRepaint = false;
}
public function setFill(_arg1:uint=0xFFFFFF, _arg2:Number=1):void{
fillColor = _arg1;
fillAlpha = _arg2;
}
public function init():void{
}
public function cleanup():void{
var _local1:int;
sprite.graphics.clear();
_local1 = 0;
while (_local1 < sprite.numChildren) {
sprite.removeChildAt(_local1);
_local1++;
};
}
public function get solid():Boolean{
return (_solid);
}
public function get sprite():Sprite{
if (_sprite != null){
return (_sprite);
};
if (APEngine.container == null){
throw (new Error("The container property of the APEngine class has not been set"));
};
_sprite = new Sprite();
APEngine.container.addChild(_sprite);
return (_sprite);
}
public function set solid(_arg1:Boolean):void{
_solid = _arg1;
}
public function paint():void{
}
public function set visible(_arg1:Boolean):void{
_visible = _arg1;
sprite.visible = _arg1;
}
public function setStyle(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1, _arg4:uint=0xFFFFFF, _arg5:Number=1):void{
setLine(_arg1, _arg2, _arg3);
setFill(_arg4, _arg5);
}
public function get visible():Boolean{
return (_visible);
}
public function setLine(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1):void{
lineThickness = _arg1;
lineColor = _arg2;
lineAlpha = _arg3;
}
final public function set alwaysRepaint(_arg1:Boolean):void{
_alwaysRepaint = _arg1;
}
final public function get alwaysRepaint():Boolean{
return (_alwaysRepaint);
}
}
}//package org.cove.ape
Section 58
//AbstractParticle (org.cove.ape.AbstractParticle)
package org.cove.ape {
import flash.display.*;
import flash.utils.*;
public class AbstractParticle extends AbstractItem {
private var forceList:Array;
var curr:Vector;
var prev:Vector;
private var collision:Collision;
private var _invMass:Number;
private var _friction:Number;
private var firstCollision:Boolean;
private var _multisample:int;
var samp:Vector;
private var _center:Vector;
private var _fixed:Boolean;
private var _collidable:Boolean;
private var _kfr:Number;
var interval:Interval;
private var _mass:Number;
private var temp:Vector;
private var forces:Vector;
public function AbstractParticle(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number, _arg5:Number, _arg6:Number){
if (getQualifiedClassName(this) == "org.cove.ape::AbstractParticle"){
throw (new ArgumentError("AbstractParticle can't be instantiated directly"));
};
interval = new Interval(0, 0);
curr = new Vector(_arg1, _arg2);
prev = new Vector(_arg1, _arg2);
samp = new Vector();
temp = new Vector();
fixed = _arg3;
forces = new Vector();
forceList = new Array();
collision = new Collision(new Vector(), new Vector());
collidable = true;
firstCollision = false;
this.mass = _arg4;
this.elasticity = _arg5;
this.friction = _arg6;
setStyle();
_center = new Vector();
_multisample = 0;
}
public function get px():Number{
return (curr.x);
}
public function get py():Number{
return (curr.y);
}
public function set py(_arg1:Number):void{
curr.y = _arg1;
prev.y = _arg1;
}
function getComponents(_arg1:Vector):Collision{
var _local2:Vector;
var _local3:Number;
_local2 = velocity;
_local3 = _arg1.dot(_local2);
collision.vn = _arg1.mult(_local3);
collision.vt = _local2.minus(collision.vn);
return (collision);
}
public function set px(_arg1:Number):void{
curr.x = _arg1;
prev.x = _arg1;
}
public function setDisplay(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{
displayObject = _arg1;
displayObjectRotation = _arg4;
displayObjectOffset = new Vector(_arg2, _arg3);
}
public function get multisample():int{
return (_multisample);
}
public function get position():Vector{
return (new Vector(curr.x, curr.y));
}
public function set multisample(_arg1:int):void{
_multisample = _arg1;
}
public function get center():Vector{
_center.setTo(px, py);
return (_center);
}
public function set position(_arg1:Vector):void{
curr.copy(_arg1);
prev.copy(_arg1);
}
function testParticleEvents(_arg1:AbstractParticle):void{
if (hasEventListener(CollisionEvent.COLLIDE)){
dispatchEvent(new CollisionEvent(CollisionEvent.COLLIDE, false, false, _arg1));
};
if (((hasEventListener(CollisionEvent.FIRST_COLLIDE)) && (!(firstCollision)))){
firstCollision = true;
dispatchEvent(new CollisionEvent(CollisionEvent.FIRST_COLLIDE, false, false, _arg1));
};
}
public function set elasticity(_arg1:Number):void{
_kfr = _arg1;
}
public function get fixed():Boolean{
return (_fixed);
}
function get invMass():Number{
return ((fixed) ? 0 : _invMass);
}
public function resetFirstCollision():void{
firstCollision = false;
}
function initDisplay():void{
displayObject.x = displayObjectOffset.x;
displayObject.y = displayObjectOffset.y;
displayObject.rotation = displayObjectRotation;
sprite.addChild(displayObject);
}
private function clearForces():void{
forceList.length = 0;
forces.setTo(0, 0);
}
function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{
testParticleEvents(_arg6);
if (((((fixed) || (!(solid)))) || (!(_arg6.solid)))){
return;
};
curr.copy(samp);
curr.plusEquals(_arg1);
velocity = _arg2;
}
public function get elasticity():Number{
return (_kfr);
}
public function set velocity(_arg1:Vector):void{
prev = curr.minus(_arg1);
}
public function set collidable(_arg1:Boolean):void{
_collidable = _arg1;
}
public function update(_arg1:Number):void{
var _local2:Vector;
if (fixed){
return;
};
accumulateForces();
temp.copy(curr);
_local2 = velocity.plus(forces.multEquals(_arg1));
curr.plusEquals(_local2.multEquals(APEngine.damping));
prev.copy(temp);
clearForces();
}
public function addForce(_arg1:IForce):void{
forceList.push(_arg1);
}
public function get velocity():Vector{
return (curr.minus(prev));
}
public function get collidable():Boolean{
return (_collidable);
}
public function set mass(_arg1:Number):void{
if (_arg1 <= 0){
throw (new ArgumentError("mass may not be set <= 0"));
};
_mass = _arg1;
_invMass = (1 / _mass);
}
public function set fixed(_arg1:Boolean):void{
_fixed = _arg1;
}
private function accumulateForces():void{
var _local1:IForce;
var _local2:int;
var _local3:int;
var _local4:Array;
_local2 = forceList.length;
_local3 = 0;
while (_local3 < _local2) {
_local1 = forceList[_local3];
forces.plusEquals(_local1.getValue(_invMass));
_local3++;
};
_local4 = APEngine.forces;
_local2 = _local4.length;
_local3 = 0;
while (_local3 < _local2) {
_local1 = _local4[_local3];
forces.plusEquals(_local1.getValue(_invMass));
_local3++;
};
}
public function get mass():Number{
return (_mass);
}
public function get friction():Number{
return (_friction);
}
public function set friction(_arg1:Number):void{
if ((((_arg1 < 0)) || ((_arg1 > 1)))){
throw (new ArgumentError("Legal friction must be >= 0 and <=1"));
};
_friction = _arg1;
}
}
}//package org.cove.ape
Section 59
//APEngine (org.cove.ape.APEngine)
package org.cove.ape {
import flash.display.*;
public final class APEngine {
private static var _damping:Number;
private static var _container:DisplayObjectContainer;
private static var _constraintCollisionCycles:int;
private static var groups:Array;
static var forces:Array;
private static var _constraintCycles:int;
private static var timeStep:Number;
private static var numGroups:int;
public static function get container():DisplayObjectContainer{
return (_container);
}
public static function get constraintCollisionCycles():int{
return (_constraintCollisionCycles);
}
public static function removeForce(_arg1:IForce):void{
var _local2:int;
_local2 = forces.indexOf(_arg1);
if (_local2 == -1){
return;
};
forces.splice(_local2, 1);
}
public static function set damping(_arg1:Number):void{
_damping = _arg1;
}
public static function step():void{
var _local1:int;
var _local2:int;
integrate();
_local1 = 0;
while (_local1 < _constraintCycles) {
satisfyConstraints();
_local1++;
};
_local2 = 0;
while (_local2 < _constraintCollisionCycles) {
satisfyConstraints();
checkCollisions();
_local2++;
};
}
public static function get constraintCycles():int{
return (_constraintCycles);
}
public static function set constraintCollisionCycles(_arg1:int):void{
_constraintCollisionCycles = _arg1;
}
public static function init(_arg1:Number=0.25):void{
timeStep = (_arg1 * _arg1);
numGroups = 0;
groups = new Array();
forces = new Array();
_damping = 1;
_constraintCycles = 0;
_constraintCollisionCycles = 1;
}
public static function addForce(_arg1:IForce):void{
forces.push(_arg1);
}
public static function get damping():Number{
return (_damping);
}
public static function set constraintCycles(_arg1:int):void{
_constraintCycles = _arg1;
}
public static function addGroup(_arg1:Group):void{
groups.push(_arg1);
_arg1.isParented = true;
numGroups++;
_arg1.init();
}
public static function set container(_arg1:DisplayObjectContainer):void{
_container = _arg1;
}
public static function paint():void{
var _local1:int;
var _local2:Group;
_local1 = 0;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.paint();
_local1++;
};
}
public static function removeGroup(_arg1:Group):void{
var _local2:int;
_local2 = groups.indexOf(_arg1);
if (_local2 == -1){
return;
};
groups.splice(_local2, 1);
_arg1.isParented = false;
numGroups--;
_arg1.cleanup();
}
private static function satisfyConstraints():void{
var _local1:int;
var _local2:Group;
_local1 = 0;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.satisfyConstraints();
_local1++;
};
}
public static function removeAllForce():void{
forces = new Array();
}
private static function checkCollisions():void{
var _local1:int;
var _local2:Group;
_local1 = 0;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.checkCollisions();
_local1++;
};
}
private static function integrate():void{
var _local1:int;
var _local2:Group;
_local1 = 0;
while (_local1 < numGroups) {
_local2 = groups[_local1];
_local2.integrate(timeStep);
_local1++;
};
}
}
}//package org.cove.ape
Section 60
//CircleParticle (org.cove.ape.CircleParticle)
package org.cove.ape {
public class CircleParticle extends AbstractParticle {
private var _radius:Number;
public function CircleParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0.3, _arg7:Number=0){
super(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7);
_radius = _arg3;
}
function getProjection(_arg1:Vector):Interval{
var _local2:Number;
_local2 = samp.dot(_arg1);
interval.min = (_local2 - _radius);
interval.max = (_local2 + _radius);
return (interval);
}
override public function init():void{
cleanup();
if (displayObject != null){
initDisplay();
} else {
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.beginFill(fillColor, fillAlpha);
sprite.graphics.drawCircle(0, 0, radius);
sprite.graphics.endFill();
};
paint();
}
public function get radius():Number{
return (_radius);
}
function getIntervalY():Interval{
interval.min = (samp.y - _radius);
interval.max = (samp.y + _radius);
return (interval);
}
public function set radius(_arg1:Number):void{
_radius = _arg1;
}
override public function paint():void{
sprite.x = curr.x;
sprite.y = curr.y;
}
function getIntervalX():Interval{
interval.min = (samp.x - _radius);
interval.max = (samp.x + _radius);
return (interval);
}
}
}//package org.cove.ape
Section 61
//Collision (org.cove.ape.Collision)
package org.cove.ape {
import org.cove.ape.*;
final class Collision {
var vn:Vector;
var vt:Vector;
function Collision(_arg1:Vector, _arg2:Vector){
this.vn = _arg1;
this.vt = _arg2;
}
}
}//package org.cove.ape
Section 62
//CollisionDetector (org.cove.ape.CollisionDetector)
package org.cove.ape {
import org.cove.ape.*;
final class CollisionDetector {
private static var collNormal:Vector;
private static var cpa:AbstractParticle;
private static var cpb:AbstractParticle;
private static var collDepth:Number;
private static function testIntervals(_arg1:Interval, _arg2:Interval):Number{
var _local3:Number;
var _local4:Number;
if (_arg1.max < _arg2.min){
return (0);
};
if (_arg2.max < _arg1.min){
return (0);
};
_local3 = (_arg2.max - _arg1.min);
_local4 = (_arg2.min - _arg1.max);
return (((Math.abs(_local3))<Math.abs(_local4)) ? _local3 : _local4);
}
private static function testOBBvsOBB(_arg1:RectangleParticle, _arg2:RectangleParticle):Boolean{
var _local3:int;
var _local4:Vector;
var _local5:Number;
var _local6:Vector;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Boolean;
collDepth = Number.POSITIVE_INFINITY;
_local3 = 0;
while (_local3 < 2) {
_local4 = _arg1.axes[_local3];
_local5 = testIntervals(_arg1.getProjection(_local4), _arg2.getProjection(_local4));
if (_local5 == 0){
return (false);
};
_local6 = _arg2.axes[_local3];
_local7 = testIntervals(_arg1.getProjection(_local6), _arg2.getProjection(_local6));
if (_local7 == 0){
return (false);
};
_local8 = Math.abs(_local5);
_local9 = Math.abs(_local7);
if ((((_local8 < Math.abs(collDepth))) || ((_local9 < Math.abs(collDepth))))){
_local10 = (_local8 < _local9);
collNormal = (_local10) ? _local4 : _local6;
collDepth = (_local10) ? _local5 : _local7;
};
_local3++;
};
cpa = _arg1;
cpb = _arg2;
return (true);
}
private static function testTypes(_arg1:AbstractParticle, _arg2:AbstractParticle):Boolean{
if ((((_arg1 is RectangleParticle)) && ((_arg2 is RectangleParticle)))){
return (testOBBvsOBB((_arg1 as RectangleParticle), (_arg2 as RectangleParticle)));
};
if ((((_arg1 is CircleParticle)) && ((_arg2 is CircleParticle)))){
return (testCirclevsCircle((_arg1 as CircleParticle), (_arg2 as CircleParticle)));
};
if ((((_arg1 is RectangleParticle)) && ((_arg2 is CircleParticle)))){
return (testOBBvsCircle((_arg1 as RectangleParticle), (_arg2 as CircleParticle)));
};
if ((((_arg1 is CircleParticle)) && ((_arg2 is RectangleParticle)))){
return (testOBBvsCircle((_arg2 as RectangleParticle), (_arg1 as CircleParticle)));
};
return (false);
}
private static function sampVsNorm(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
var _local3:Number;
var _local4:Number;
var _local5:int;
if (normVsNorm(_arg1, _arg2)){
return;
};
_local3 = (1 / (_arg1.multisample + 1));
_local4 = _local3;
_local5 = 0;
while (_local5 <= _arg1.multisample) {
_arg1.samp.setTo((_arg1.prev.x + (_local4 * (_arg1.curr.x - _arg1.prev.x))), (_arg1.prev.y + (_local4 * (_arg1.curr.y - _arg1.prev.y))));
if (testTypes(_arg1, _arg2)){
CollisionResolver.resolve(cpa, cpb, collNormal, collDepth);
return;
};
_local4 = (_local4 + _local3);
_local5++;
};
}
private static function testCirclevsCircle(_arg1:CircleParticle, _arg2:CircleParticle):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = testIntervals(_arg1.getIntervalX(), _arg2.getIntervalX());
if (_local3 == 0){
return (false);
};
_local4 = testIntervals(_arg1.getIntervalY(), _arg2.getIntervalY());
if (_local4 == 0){
return (false);
};
collNormal = _arg1.samp.minus(_arg2.samp);
_local5 = collNormal.magnitude();
collDepth = ((_arg1.radius + _arg2.radius) - _local5);
if (collDepth > 0){
collNormal.divEquals(_local5);
cpa = _arg1;
cpb = _arg2;
return (true);
};
return (false);
}
static function test(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
if (((_arg1.fixed) && (_arg2.fixed))){
return;
};
if ((((_arg1.multisample == 0)) && ((_arg2.multisample == 0)))){
normVsNorm(_arg1, _arg2);
} else {
if ((((_arg1.multisample > 0)) && ((_arg2.multisample == 0)))){
sampVsNorm(_arg1, _arg2);
} else {
if ((((_arg2.multisample > 0)) && ((_arg1.multisample == 0)))){
sampVsNorm(_arg2, _arg1);
} else {
if (_arg1.multisample == _arg2.multisample){
sampVsSamp(_arg1, _arg2);
} else {
normVsNorm(_arg1, _arg2);
};
};
};
};
}
private static function testOBBvsCircle(_arg1:RectangleParticle, _arg2:CircleParticle):Boolean{
var _local3:Array;
var _local4:int;
var _local5:Number;
var _local6:Vector;
var _local7:Number;
var _local8:Vector;
var _local9:Number;
collDepth = Number.POSITIVE_INFINITY;
_local3 = new Array(2);
_local4 = 0;
while (_local4 < 2) {
_local6 = _arg1.axes[_local4];
_local7 = testIntervals(_arg1.getProjection(_local6), _arg2.getProjection(_local6));
if (_local7 == 0){
return (false);
};
if (Math.abs(_local7) < Math.abs(collDepth)){
collNormal = _local6;
collDepth = _local7;
};
_local3[_local4] = _local7;
_local4++;
};
_local5 = _arg2.radius;
if ((((Math.abs(_local3[0]) < _local5)) && ((Math.abs(_local3[1]) < _local5)))){
_local8 = closestVertexOnOBB(_arg2.samp, _arg1);
collNormal = _local8.minus(_arg2.samp);
_local9 = collNormal.magnitude();
collDepth = (_local5 - _local9);
if (collDepth > 0){
collNormal.divEquals(_local9);
} else {
return (false);
};
};
cpa = _arg1;
cpb = _arg2;
return (true);
}
private static function closestVertexOnOBB(_arg1:Vector, _arg2:RectangleParticle):Vector{
var _local3:Vector;
var _local4:Vector;
var _local5:int;
var _local6:Number;
_local3 = _arg1.minus(_arg2.samp);
_local4 = new Vector(_arg2.samp.x, _arg2.samp.y);
_local5 = 0;
while (_local5 < 2) {
_local6 = _local3.dot(_arg2.axes[_local5]);
if (_local6 >= 0){
_local6 = _arg2.extents[_local5];
} else {
if (_local6 < 0){
_local6 = -(_arg2.extents[_local5]);
};
};
_local4.plusEquals(_arg2.axes[_local5].mult(_local6));
_local5++;
};
return (_local4);
}
private static function normVsNorm(_arg1:AbstractParticle, _arg2:AbstractParticle):Boolean{
_arg1.samp.copy(_arg1.curr);
_arg2.samp.copy(_arg2.curr);
if (testTypes(_arg1, _arg2)){
CollisionResolver.resolve(cpa, cpb, collNormal, collDepth);
return (true);
};
return (false);
}
private static function sampVsSamp(_arg1:AbstractParticle, _arg2:AbstractParticle):void{
var _local3:Number;
var _local4:Number;
var _local5:int;
if (normVsNorm(_arg1, _arg2)){
return;
};
_local3 = (1 / (_arg1.multisample + 1));
_local4 = _local3;
_local5 = 0;
while (_local5 <= _arg1.multisample) {
_arg1.samp.setTo((_arg1.prev.x + (_local4 * (_arg1.curr.x - _arg1.prev.x))), (_arg1.prev.y + (_local4 * (_arg1.curr.y - _arg1.prev.y))));
_arg2.samp.setTo((_arg2.prev.x + (_local4 * (_arg2.curr.x - _arg2.prev.x))), (_arg2.prev.y + (_local4 * (_arg2.curr.y - _arg2.prev.y))));
if (testTypes(_arg1, _arg2)){
CollisionResolver.resolve(cpa, cpb, collNormal, collDepth);
return;
};
_local4 = (_local4 + _local3);
_local5++;
};
}
}
}//package org.cove.ape
Section 63
//CollisionEvent (org.cove.ape.CollisionEvent)
package org.cove.ape {
import flash.events.*;
public class CollisionEvent extends Event {
private var _collidingItem:AbstractItem;
public static const COLLIDE:String = "collide";
public static const FIRST_COLLIDE:String = "firstCollide";
public function CollisionEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:AbstractItem=null){
super(_arg1, _arg2, _arg3);
_collidingItem = _arg4;
}
public function get collidingItem():AbstractItem{
var _local1:SpringConstraintParticle;
if ((_collidingItem is SpringConstraintParticle)){
_local1 = (_collidingItem as SpringConstraintParticle);
return (_local1.parent);
};
return (_collidingItem);
}
}
}//package org.cove.ape
Section 64
//CollisionResolver (org.cove.ape.CollisionResolver)
package org.cove.ape {
import org.cove.ape.*;
final class CollisionResolver {
static function resolve(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:Vector, _arg4:Number):void{
var _local5:Vector;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Collision;
var _local10:Collision;
var _local11:Vector;
var _local12:Vector;
var _local13:Vector;
var _local14:Vector;
_local5 = _arg3.mult(_arg4);
_local6 = (_arg1.elasticity + _arg2.elasticity);
_local7 = (_arg1.invMass + _arg2.invMass);
_local8 = MathUtil.clamp((1 - (_arg1.friction + _arg2.friction)), 0, 1);
_local9 = _arg1.getComponents(_arg3);
_local10 = _arg2.getComponents(_arg3);
_local11 = _local10.vn.mult(((_local6 + 1) * _arg1.invMass)).plus(_local9.vn.mult((_arg2.invMass - (_local6 * _arg1.invMass)))).divEquals(_local7);
_local12 = _local9.vn.mult(((_local6 + 1) * _arg2.invMass)).plus(_local10.vn.mult((_arg1.invMass - (_local6 * _arg2.invMass)))).divEquals(_local7);
_local9.vt.multEquals(_local8);
_local10.vt.multEquals(_local8);
_local13 = _local5.mult((_arg1.invMass / _local7));
_local14 = _local5.mult((-(_arg2.invMass) / _local7));
_local11.plusEquals(_local9.vt);
_local12.plusEquals(_local10.vt);
_arg1.resolveCollision(_local13, _local11, _arg3, _arg4, -1, _arg2);
_arg2.resolveCollision(_local14, _local12, _arg3, _arg4, 1, _arg1);
}
}
}//package org.cove.ape
Section 65
//Composite (org.cove.ape.Composite)
package org.cove.ape {
public class Composite extends AbstractCollection {
private var delta:Vector;
public function Composite(){
delta = new Vector();
}
private function getRelativeAngle(_arg1:Vector, _arg2:Vector):Number{
delta.setTo((_arg2.x - _arg1.x), (_arg2.y - _arg1.y));
return (Math.atan2(delta.y, delta.x));
}
public function rotateByRadian(_arg1:Number, _arg2:Vector):void{
var _local3:AbstractParticle;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
_local4 = particles;
_local5 = _local4.length;
_local6 = 0;
while (_local6 < _local5) {
_local3 = _local4[_local6];
_local7 = _local3.center.distance(_arg2);
_local8 = (getRelativeAngle(_arg2, _local3.center) + _arg1);
_local3.px = ((Math.cos(_local8) * _local7) + _arg2.x);
_local3.py = ((Math.sin(_local8) * _local7) + _arg2.y);
_local6++;
};
}
public function rotateByAngle(_arg1:Number, _arg2:Vector):void{
var _local3:Number;
_local3 = (_arg1 * MathUtil.PI_OVER_ONE_EIGHTY);
rotateByRadian(_local3, _arg2);
}
public function set fixed(_arg1:Boolean):void{
var _local2:int;
_local2 = 0;
while (_local2 < particles.length) {
particles[_local2].fixed = _arg1;
_local2++;
};
}
public function get fixed():Boolean{
var _local1:int;
_local1 = 0;
while (_local1 < particles.length) {
if (!particles[_local1].fixed){
return (false);
};
_local1++;
};
return (true);
}
}
}//package org.cove.ape
Section 66
//Group (org.cove.ape.Group)
package org.cove.ape {
public class Group extends AbstractCollection {
private var _collideInternal:Boolean;
private var _composites:Array;
private var _collisionList:Array;
public function Group(_arg1:Boolean=false){
_composites = new Array();
_collisionList = new Array();
this.collideInternal = _arg1;
}
function checkCollisions():void{
var _local1:int;
var _local2:int;
var _local3:Group;
if (collideInternal){
checkCollisionGroupInternal();
};
_local1 = collisionList.length;
_local2 = 0;
while (_local2 < _local1) {
_local3 = collisionList[_local2];
if (_local3 == null){
} else {
checkCollisionVsGroup(_local3);
};
_local2++;
};
}
public function get composites():Array{
return (_composites);
}
override public function init():void{
var _local1:int;
super.init();
_local1 = 0;
while (_local1 < composites.length) {
composites[_local1].init();
_local1++;
};
}
public function removeCollidable(_arg1:Group):void{
var _local2:int;
_local2 = collisionList.indexOf(_arg1);
if (_local2 == -1){
return;
};
collisionList.splice(_local2, 1);
}
private function checkCollisionVsGroup(_arg1:Group):void{
var _local2:Composite;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Composite;
var _local7:int;
checkCollisionsVsCollection(_arg1);
_local3 = _composites.length;
_local4 = _arg1.composites.length;
_local5 = 0;
while (_local5 < _local3) {
_local6 = _composites[_local5];
if (_local6 == null){
} else {
_local6.checkCollisionsVsCollection(_arg1);
_local7 = 0;
while (_local7 < _local4) {
_local2 = _arg1.composites[_local7];
if (_local2 == null){
} else {
_local6.checkCollisionsVsCollection(_local2);
};
_local7++;
};
};
_local5++;
};
_local7 = 0;
while (_local7 < _local4) {
_local2 = _arg1.composites[_local7];
if (_local2 == null){
} else {
checkCollisionsVsCollection(_local2);
};
_local7++;
};
}
override function satisfyConstraints():void{
var _local1:int;
var _local2:int;
var _local3:Composite;
super.satisfyConstraints();
_local1 = _composites.length;
_local2 = 0;
while (_local2 < _local1) {
_local3 = _composites[_local2];
_local3.satisfyConstraints();
_local2++;
};
}
public function get collideInternal():Boolean{
return (_collideInternal);
}
public function addCollidableList(_arg1:Array):void{
var _local2:int;
var _local3:Group;
_local2 = 0;
while (_local2 < _arg1.length) {
_local3 = _arg1[_local2];
collisionList.push(_local3);
_local2++;
};
}
public function removeComposite(_arg1:Composite):void{
var _local2:int;
_local2 = composites.indexOf(_arg1);
if (_local2 == -1){
return;
};
composites.splice(_local2, 1);
_arg1.isParented = false;
_arg1.cleanup();
}
override public function cleanup():void{
var _local1:int;
super.cleanup();
_local1 = 0;
while (_local1 < composites.length) {
composites[_local1].cleanup();
_local1++;
};
}
override public function paint():void{
var _local1:int;
var _local2:int;
var _local3:Composite;
super.paint();
_local1 = _composites.length;
_local2 = 0;
while (_local2 < _local1) {
_local3 = _composites[_local2];
_local3.paint();
_local2++;
};
}
public function addCollidable(_arg1:Group):void{
collisionList.push(_arg1);
}
override public function getAll():Array{
return (particles.concat(constraints).concat(composites));
}
public function get collisionList():Array{
return (_collisionList);
}
override function integrate(_arg1:Number):void{
var _local2:int;
var _local3:int;
var _local4:Composite;
super.integrate(_arg1);
_local2 = _composites.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = _composites[_local3];
_local4.integrate(_arg1);
_local3++;
};
}
public function addComposite(_arg1:Composite):void{
composites.push(_arg1);
_arg1.isParented = true;
if (isParented){
_arg1.init();
};
}
private function checkCollisionGroupInternal():void{
var _local1:int;
var _local2:int;
var _local3:Composite;
var _local4:int;
var _local5:Composite;
checkInternalCollisions();
_local1 = _composites.length;
_local2 = 0;
while (_local2 < _local1) {
_local3 = _composites[_local2];
if (_local3 == null){
} else {
_local3.checkCollisionsVsCollection(this);
_local4 = (_local2 + 1);
while (_local4 < _local1) {
_local5 = _composites[_local4];
if (_local5 != null){
_local3.checkCollisionsVsCollection(_local5);
};
_local4++;
};
};
_local2++;
};
}
public function set collideInternal(_arg1:Boolean):void{
_collideInternal = _arg1;
}
}
}//package org.cove.ape
Section 67
//IForce (org.cove.ape.IForce)
package org.cove.ape {
public interface IForce {
function getValue(_arg1:Number):Vector;
}
}//package org.cove.ape
Section 68
//Interval (org.cove.ape.Interval)
package org.cove.ape {
final class Interval {
var min:Number;
var max:Number;
function Interval(_arg1:Number, _arg2:Number){
this.min = _arg1;
this.max = _arg2;
}
function toString():String{
return (((min + " : ") + max));
}
}
}//package org.cove.ape
Section 69
//MathUtil (org.cove.ape.MathUtil)
package org.cove.ape {
final class MathUtil {
static var ONE_EIGHTY_OVER_PI:Number = 57.2957795130823;
static var PI_OVER_ONE_EIGHTY:Number = 0.0174532925199433;
static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg1 < _arg2){
return (_arg2);
};
if (_arg1 > _arg3){
return (_arg3);
};
return (_arg1);
}
static function sign(_arg1:Number):int{
if (_arg1 < 0){
return (-1);
};
return (1);
}
}
}//package org.cove.ape
Section 70
//RectangleParticle (org.cove.ape.RectangleParticle)
package org.cove.ape {
public class RectangleParticle extends AbstractParticle {
private var _axes:Array;
private var _extents:Array;
private var _radian:Number;
public function RectangleParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Boolean=false, _arg7:Number=1, _arg8:Number=0.3, _arg9:Number=0){
super(_arg1, _arg2, _arg6, _arg7, _arg8, _arg9);
_extents = new Array((_arg3 / 2), (_arg4 / 2));
_axes = new Array(new Vector(0, 0), new Vector(0, 0));
radian = _arg5;
}
function getProjection(_arg1:Vector):Interval{
var _local2:Number;
var _local3:Number;
_local2 = ((extents[0] * Math.abs(_arg1.dot(axes[0]))) + (extents[1] * Math.abs(_arg1.dot(axes[1]))));
_local3 = samp.dot(_arg1);
interval.min = (_local3 - _local2);
interval.max = (_local3 + _local2);
return (interval);
}
override public function init():void{
var _local1:Number;
var _local2:Number;
cleanup();
if (displayObject != null){
initDisplay();
} else {
_local1 = (extents[0] * 2);
_local2 = (extents[1] * 2);
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.beginFill(fillColor, fillAlpha);
sprite.graphics.drawRect((-(_local1) / 2), (-(_local2) / 2), _local1, _local2);
sprite.graphics.endFill();
};
paint();
}
public function set width(_arg1:Number):void{
_extents[0] = (_arg1 / 2);
}
function get extents():Array{
return (_extents);
}
function get axes():Array{
return (_axes);
}
public function get height():Number{
return ((_extents[1] * 2));
}
private function setAxes(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.sin(_arg1);
_local3 = Math.cos(_arg1);
axes[0].x = _local3;
axes[0].y = _local2;
axes[1].x = -(_local2);
axes[1].y = _local3;
}
public function get radian():Number{
return (_radian);
}
public function set angle(_arg1:Number):void{
radian = (_arg1 * MathUtil.PI_OVER_ONE_EIGHTY);
}
public function set height(_arg1:Number):void{
_extents[1] = (_arg1 / 2);
}
public function get angle():Number{
return ((radian * MathUtil.ONE_EIGHTY_OVER_PI));
}
public function set radian(_arg1:Number):void{
_radian = _arg1;
setAxes(_arg1);
}
override public function paint():void{
sprite.x = curr.x;
sprite.y = curr.y;
sprite.rotation = angle;
}
public function get width():Number{
return ((_extents[0] * 2));
}
}
}//package org.cove.ape
Section 71
//RimParticle (org.cove.ape.RimParticle)
package org.cove.ape {
import org.cove.ape.*;
class RimParticle {
private var maxTorque:Number;
var curr:Vector;
var prev:Vector;
private var av:Number;
private var wr:Number;
private var sp:Number;
function RimParticle(_arg1:Number, _arg2:Number){
curr = new Vector(_arg1, 0);
prev = new Vector(0, 0);
sp = 0;
av = 0;
maxTorque = _arg2;
wr = _arg1;
}
function update(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
sp = Math.max(-(maxTorque), Math.min(maxTorque, (sp + av)));
_local2 = -(curr.y);
_local3 = curr.x;
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local2 = (_local2 / _local4);
_local3 = (_local3 / _local4);
curr.x = (curr.x + (sp * _local2));
curr.y = (curr.y + (sp * _local3));
_local5 = prev.x;
_local6 = prev.y;
_local7 = (prev.x = curr.x);
_local8 = (prev.y = curr.y);
curr.x = (curr.x + (APEngine.damping * (_local7 - _local5)));
curr.y = (curr.y + (APEngine.damping * (_local8 - _local6)));
_local9 = Math.sqrt(((curr.x * curr.x) + (curr.y * curr.y)));
_local10 = ((_local9 - wr) / _local9);
curr.x = (curr.x - (curr.x * _local10));
curr.y = (curr.y - (curr.y * _local10));
}
function set speed(_arg1:Number):void{
sp = _arg1;
}
function get angularVelocity():Number{
return (av);
}
function set angularVelocity(_arg1:Number):void{
av = _arg1;
}
function get speed():Number{
return (sp);
}
}
}//package org.cove.ape
Section 72
//SpringConstraint (org.cove.ape.SpringConstraint)
package org.cove.ape {
import flash.display.*;
public class SpringConstraint extends AbstractConstraint {
private var _collidable:Boolean;
private var p1:AbstractParticle;
private var p2:AbstractParticle;
private var _scp:SpringConstraintParticle;
private var _restLength:Number;
public function SpringConstraint(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:Number=0.5, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=1, _arg7:Boolean=false){
super(_arg3);
this.p1 = _arg1;
this.p2 = _arg2;
checkParticlesLocation();
_restLength = currLength;
setCollidable(_arg4, _arg5, _arg6, _arg7);
}
public function get fixed():Boolean{
return (((p1.fixed) && (p2.fixed)));
}
public function set rectScale(_arg1:Number):void{
if (scp == null){
return;
};
scp.rectScale = _arg1;
}
override public function init():void{
cleanup();
if (collidable){
scp.init();
} else {
if (displayObject != null){
initDisplay();
};
};
paint();
}
function initDisplay():void{
if (collidable){
scp.initDisplay();
} else {
displayObject.x = displayObjectOffset.x;
displayObject.y = displayObjectOffset.y;
displayObject.rotation = displayObjectRotation;
sprite.addChild(displayObject);
};
}
public function isConnectedTo(_arg1:AbstractParticle):Boolean{
return ((((_arg1 == p1)) || ((_arg1 == p2))));
}
public function setDisplay(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{
if (collidable){
scp.setDisplay(_arg1, _arg2, _arg3, _arg4);
} else {
displayObject = _arg1;
displayObjectRotation = _arg4;
displayObjectOffset = new Vector(_arg2, _arg3);
};
}
function get scp():SpringConstraintParticle{
return (_scp);
}
private function checkParticlesLocation():void{
if ((((p1.curr.x == p2.curr.x)) && ((p1.curr.y == p2.curr.y)))){
p2.curr.x = (p2.curr.x + 0.0001);
};
}
public function get radian():Number{
var _local1:Vector;
_local1 = delta;
return (Math.atan2(_local1.y, _local1.x));
}
public function get rectHeight():Number{
return (scp.rectHeight);
}
public function set restLength(_arg1:Number):void{
if (_arg1 <= 0){
throw (new ArgumentError("restLength must be greater than 0"));
};
_restLength = _arg1;
}
public function get currLength():Number{
return (p1.curr.distance(p2.curr));
}
public function get fixedEndLimit():Number{
return (scp.fixedEndLimit);
}
function get delta():Vector{
return (p1.curr.minus(p2.curr));
}
public function get angle():Number{
return ((radian * MathUtil.ONE_EIGHTY_OVER_PI));
}
public function get center():Vector{
return (p1.curr.plus(p2.curr).divEquals(2));
}
public function set rectHeight(_arg1:Number):void{
if (scp == null){
return;
};
scp.rectHeight = _arg1;
}
public function setCollidable(_arg1:Boolean, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
_collidable = _arg1;
_scp = null;
if (_collidable){
_scp = new SpringConstraintParticle(p1, p2, this, _arg2, _arg3, _arg4);
};
}
override public function paint():void{
var _local1:Vector;
if (collidable){
scp.paint();
} else {
if (displayObject != null){
_local1 = center;
sprite.x = _local1.x;
sprite.y = _local1.y;
sprite.rotation = angle;
} else {
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.moveTo(p1.px, p1.py);
sprite.graphics.lineTo(p2.px, p2.py);
};
};
}
public function get rectScale():Number{
return (scp.rectScale);
}
public function get restLength():Number{
return (_restLength);
}
override public function resolve():void{
var _local1:Number;
var _local2:Number;
var _local3:Vector;
if (((p1.fixed) && (p2.fixed))){
return;
};
_local1 = currLength;
_local2 = ((_local1 - restLength) / (_local1 * (p1.invMass + p2.invMass)));
_local3 = delta.mult((_local2 * stiffness));
p1.curr.minusEquals(_local3.mult(p1.invMass));
p2.curr.plusEquals(_local3.mult(p2.invMass));
}
public function get collidable():Boolean{
return (_collidable);
}
public function set fixedEndLimit(_arg1:Number):void{
if (scp == null){
return;
};
scp.fixedEndLimit = _arg1;
}
}
}//package org.cove.ape
Section 73
//SpringConstraintParticle (org.cove.ape.SpringConstraintParticle)
package org.cove.ape {
import flash.display.*;
import org.cove.ape.*;
class SpringConstraintParticle extends RectangleParticle {
private var _fixedEndLimit:Number;
private var rca:Vector;
private var rcb:Vector;
private var _rectScale:Number;
private var s:Number;
var parent:SpringConstraint;
private var scaleToLength:Boolean;
private var p1:AbstractParticle;
private var p2:AbstractParticle;
private var lambda:Vector;
private var avgVelocity:Vector;
private var _rectHeight:Number;
function SpringConstraintParticle(_arg1:AbstractParticle, _arg2:AbstractParticle, _arg3:SpringConstraint, _arg4:Number, _arg5:Number, _arg6:Boolean){
super(0, 0, 0, 0, 0, false);
this.p1 = _arg1;
this.p2 = _arg2;
lambda = new Vector(0, 0);
avgVelocity = new Vector(0, 0);
parent = _arg3;
this.rectScale = _arg5;
this.rectHeight = _arg4;
this.scaleToLength = _arg6;
fixedEndLimit = 0;
rca = new Vector();
rcb = new Vector();
}
private function setCorners(_arg1:RectangleParticle, _arg2:int):void{
var _local3:Number;
var _local4:Number;
var _local5:Array;
var _local6:Array;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local3 = _arg1.curr.x;
_local4 = _arg1.curr.y;
_local5 = _arg1.axes;
_local6 = _arg1.extents;
_local7 = (_local5[0].x * _local6[0]);
_local8 = (_local5[0].y * _local6[0]);
_local9 = (_local5[1].x * _local6[1]);
_local10 = (_local5[1].y * _local6[1]);
_local11 = (_local7 - _local9);
_local12 = (_local8 - _local10);
_local13 = (_local7 + _local9);
_local14 = (_local8 + _local10);
if (_arg2 == 0){
rca.x = (_local3 - _local13);
rca.y = (_local4 - _local14);
rcb.x = (_local3 + _local11);
rcb.y = (_local4 + _local12);
} else {
if (_arg2 == 1){
rca.x = (_local3 + _local11);
rca.y = (_local4 + _local12);
rcb.x = (_local3 + _local13);
rcb.y = (_local4 + _local14);
} else {
if (_arg2 == 2){
rca.x = (_local3 + _local13);
rca.y = (_local4 + _local14);
rcb.x = (_local3 - _local11);
rcb.y = (_local4 - _local12);
} else {
if (_arg2 == 3){
rca.x = (_local3 - _local11);
rca.y = (_local4 - _local12);
rcb.x = (_local3 - _local13);
rcb.y = (_local4 - _local14);
};
};
};
};
}
override public function init():void{
var _local1:Sprite;
var _local2:Number;
var _local3:Number;
if (displayObject != null){
initDisplay();
} else {
_local1 = new Sprite();
parent.sprite.addChild(_local1);
_local1.name = "inner";
_local2 = (parent.currLength * rectScale);
_local3 = rectHeight;
_local1.graphics.clear();
_local1.graphics.lineStyle(parent.lineThickness, parent.lineColor, parent.lineAlpha);
_local1.graphics.beginFill(parent.fillColor, parent.fillAlpha);
_local1.graphics.drawRect((-(_local2) / 2), (-(_local3) / 2), _local2, _local3);
_local1.graphics.endFill();
};
paint();
}
function updatePosition():void{
var _local1:Vector;
_local1 = parent.center;
curr.setTo(_local1.x, _local1.y);
width = (scaleToLength) ? (parent.currLength * rectScale) : (parent.restLength * rectScale);
height = rectHeight;
radian = parent.radian;
}
private function closestPtSegmentSegment():Number{
var _local1:Vector;
var _local2:Vector;
var _local3:Vector;
var _local4:Vector;
var _local5:Vector;
var _local6:Vector;
var _local7:Vector;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Vector;
var _local16:Vector;
var _local17:Vector;
_local1 = p1.curr;
_local2 = p2.curr;
_local3 = rca;
_local4 = rcb;
_local5 = _local2.minus(_local1);
_local6 = _local4.minus(_local3);
_local7 = _local1.minus(_local3);
_local9 = _local5.dot(_local5);
_local10 = _local6.dot(_local6);
_local11 = _local6.dot(_local7);
_local12 = _local5.dot(_local7);
_local13 = _local5.dot(_local6);
_local14 = ((_local9 * _local10) - (_local13 * _local13));
if (_local14 != 0){
s = MathUtil.clamp((((_local13 * _local11) - (_local12 * _local10)) / _local14), 0, 1);
} else {
s = 0.5;
};
_local8 = (((_local13 * s) + _local11) / _local10);
if (_local8 < 0){
_local8 = 0;
s = MathUtil.clamp((-(_local12) / _local9), 0, 1);
} else {
if (_local8 > 0){
_local8 = 1;
s = MathUtil.clamp(((_local13 - _local12) / _local9), 0, 1);
};
};
_local15 = _local1.plus(_local5.mult(s));
_local16 = _local3.plus(_local6.mult(_local8));
_local17 = _local15.minus(_local16);
return (_local15.minus(_local16).dot(_local17));
}
function get rectHeight():Number{
return (_rectHeight);
}
function get fixedEndLimit():Number{
return (_fixedEndLimit);
}
private function closestParamPoint(_arg1:Vector):Number{
var _local2:Vector;
var _local3:Number;
_local2 = p2.curr.minus(p1.curr);
_local3 = (_local2.dot(_arg1.minus(p1.curr)) / _local2.dot(_local2));
return (MathUtil.clamp(_local3, 0, 1));
}
override public function paint():void{
var _local1:Vector;
var _local2:Sprite;
_local1 = parent.center;
_local2 = parent.sprite;
if (scaleToLength){
_local2.getChildByName("inner").width = (parent.currLength * rectScale);
} else {
if (displayObject != null){
_local2.getChildByName("inner").width = (parent.restLength * rectScale);
};
};
_local2.x = _local1.x;
_local2.y = _local1.y;
_local2.rotation = parent.angle;
}
function set rectHeight(_arg1:Number):void{
_rectHeight = _arg1;
}
private function getContactPointParam(_arg1:AbstractParticle):Number{
var _local2:Number;
var _local3:Number;
var _local4:Array;
var _local5:Number;
var _local6:int;
var _local7:Number;
if ((_arg1 is CircleParticle)){
_local2 = closestParamPoint(_arg1.curr);
} else {
if ((_arg1 is RectangleParticle)){
_local4 = new Array(4);
_local5 = Number.POSITIVE_INFINITY;
_local6 = 0;
while (_local6 < 4) {
setCorners((_arg1 as RectangleParticle), _local6);
_local7 = closestPtSegmentSegment();
if (_local7 < _local5){
_local5 = _local7;
_local3 = _local6;
_local4[_local6] = s;
};
_local6++;
};
_local2 = _local4[_local3];
};
};
return (_local2);
}
function set fixedEndLimit(_arg1:Number):void{
_fixedEndLimit = _arg1;
}
override public function get fixed():Boolean{
return (parent.fixed);
}
override function get invMass():Number{
if (((p1.fixed) && (p2.fixed))){
return (0);
};
return ((1 / ((p1.mass + p2.mass) / 2)));
}
override function initDisplay():void{
var _local1:Sprite;
displayObject.x = displayObjectOffset.x;
displayObject.y = displayObjectOffset.y;
displayObject.rotation = displayObjectRotation;
_local1 = new Sprite();
_local1.name = "inner";
_local1.addChild(displayObject);
parent.sprite.addChild(_local1);
}
function set rectScale(_arg1:Number):void{
_rectScale = _arg1;
}
override function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:AbstractParticle;
testParticleEvents(_arg6);
if (((fixed) || (!(_arg6.solid)))){
return;
};
_local7 = getContactPointParam(_arg6);
_local8 = (1 - _local7);
_local9 = _local7;
if (p1.fixed){
if (_local9 <= fixedEndLimit){
return;
};
lambda.setTo((_arg1.x / _local9), (_arg1.y / _local9));
p2.curr.plusEquals(lambda);
p2.velocity = _arg2;
} else {
if (p2.fixed){
if (_local8 <= fixedEndLimit){
return;
};
lambda.setTo((_arg1.x / _local8), (_arg1.y / _local8));
p1.curr.plusEquals(lambda);
p1.velocity = _arg2;
} else {
_local10 = ((_local8 * _local8) + (_local9 * _local9));
if (_local10 == 0){
return;
};
lambda.setTo((_arg1.x / _local10), (_arg1.y / _local10));
p1.curr.plusEquals(lambda.mult(_local8));
p2.curr.plusEquals(lambda.mult(_local9));
if (_local7 == 0.5){
p1.velocity = _arg2;
p2.velocity = _arg2;
} else {
_local11 = ((_local7)<0.5) ? p1 : p2;
_local11.velocity = _arg2;
};
};
};
}
override public function get elasticity():Number{
return (((p1.elasticity + p2.elasticity) / 2));
}
function get rectScale():Number{
return (_rectScale);
}
override public function get velocity():Vector{
var _local1:Vector;
var _local2:Vector;
_local1 = p1.velocity;
_local2 = p2.velocity;
avgVelocity.setTo(((_local1.x + _local2.x) / 2), ((_local1.y + _local2.y) / 2));
return (avgVelocity);
}
override public function get mass():Number{
return (((p1.mass + p2.mass) / 2));
}
override public function get friction():Number{
return (((p1.friction + p2.friction) / 2));
}
}
}//package org.cove.ape
Section 74
//Vector (org.cove.ape.Vector)
package org.cove.ape {
public class Vector {
public var x:Number;
public var y:Number;
public function Vector(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
}
public function cross(_arg1:Vector):Number{
return (((x * _arg1.y) - (y * _arg1.x)));
}
public function magnitude():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function divEquals(_arg1:Number):Vector{
if (_arg1 == 0){
_arg1 = 0.0001;
};
x = (x / _arg1);
y = (y / _arg1);
return (this);
}
public function times(_arg1:Vector):Vector{
return (new Vector((x * _arg1.x), (y * _arg1.y)));
}
public function plusEquals(_arg1:Vector):Vector{
x = (x + _arg1.x);
y = (y + _arg1.y);
return (this);
}
public function dot(_arg1:Vector):Number{
return (((x * _arg1.x) + (y * _arg1.y)));
}
public function normalizeEquals():Vector{
var _local1:Number;
_local1 = magnitude();
if (_local1 == 0){
_local1 = 0.0001;
};
return (multEquals((1 / _local1)));
}
public function normalize():Vector{
var _local1:Number;
_local1 = magnitude();
if (_local1 == 0){
_local1 = 0.0001;
};
return (mult((1 / _local1)));
}
public function copy(_arg1:Vector):void{
x = _arg1.x;
y = _arg1.y;
}
public function minusEquals(_arg1:Vector):Vector{
x = (x - _arg1.x);
y = (y - _arg1.y);
return (this);
}
public function minus(_arg1:Vector):Vector{
return (new Vector((x - _arg1.x), (y - _arg1.y)));
}
public function plus(_arg1:Vector):Vector{
return (new Vector((x + _arg1.x), (y + _arg1.y)));
}
public function toString():String{
return (((x + " : ") + y));
}
public function distance(_arg1:Vector):Number{
var _local2:Vector;
_local2 = this.minus(_arg1);
return (_local2.magnitude());
}
public function setTo(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
}
public function multEquals(_arg1:Number):Vector{
x = (x * _arg1);
y = (y * _arg1);
return (this);
}
public function mult(_arg1:Number):Vector{
return (new Vector((x * _arg1), (y * _arg1)));
}
}
}//package org.cove.ape
Section 75
//VectorForce (org.cove.ape.VectorForce)
package org.cove.ape {
public class VectorForce implements IForce {
private var fvx:Number;
private var fvy:Number;
private var value:Vector;
private var scaleMass:Boolean;
public function VectorForce(_arg1:Boolean, _arg2:Number, _arg3:Number){
fvx = _arg2;
fvy = _arg3;
scaleMass = _arg1;
value = new Vector(_arg2, _arg3);
}
public function set vx(_arg1:Number):void{
fvx = _arg1;
value.x = _arg1;
}
public function set vy(_arg1:Number):void{
fvy = _arg1;
value.y = _arg1;
}
public function set useMass(_arg1:Boolean):void{
scaleMass = _arg1;
}
public function getValue(_arg1:Number):Vector{
if (scaleMass){
value.setTo((fvx * _arg1), (fvy * _arg1));
};
return (value);
}
}
}//package org.cove.ape
Section 76
//WheelParticle (org.cove.ape.WheelParticle)
package org.cove.ape {
public class WheelParticle extends CircleParticle {
private var normSlip:Vector;
private var rp:RimParticle;
private var _traction:Number;
private var tan:Vector;
private var orientation:Vector;
public function WheelParticle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0.3, _arg7:Number=0, _arg8:Number=1){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
tan = new Vector(0, 0);
normSlip = new Vector(0, 0);
rp = new RimParticle(_arg3, 2);
this.traction = _arg8;
orientation = new Vector();
}
override public function init():void{
cleanup();
if (displayObject != null){
initDisplay();
} else {
sprite.graphics.clear();
sprite.graphics.lineStyle(lineThickness, lineColor, lineAlpha);
sprite.graphics.beginFill(fillColor, fillAlpha);
sprite.graphics.drawCircle(0, 0, radius);
sprite.graphics.endFill();
sprite.graphics.moveTo(-(radius), 0);
sprite.graphics.lineTo(radius, 0);
sprite.graphics.moveTo(0, -(radius));
sprite.graphics.lineTo(0, radius);
};
paint();
}
public function get radian():Number{
orientation.setTo(rp.curr.x, rp.curr.y);
return ((Math.atan2(orientation.y, orientation.x) + Math.PI));
}
public function get traction():Number{
return ((1 - _traction));
}
public function get speed():Number{
return (rp.speed);
}
override public function paint():void{
sprite.x = curr.x;
sprite.y = curr.y;
sprite.rotation = angle;
}
public function set traction(_arg1:Number):void{
_traction = (1 - _arg1);
}
public function set speed(_arg1:Number):void{
rp.speed = _arg1;
}
override function resolveCollision(_arg1:Vector, _arg2:Vector, _arg3:Vector, _arg4:Number, _arg5:int, _arg6:AbstractParticle):void{
super.resolveCollision(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
resolve(_arg3.mult(MathUtil.sign((_arg4 * _arg5))));
}
public function set angularVelocity(_arg1:Number):void{
rp.angularVelocity = _arg1;
}
override public function update(_arg1:Number):void{
super.update(_arg1);
rp.update(_arg1);
}
public function get angle():Number{
return ((radian * MathUtil.ONE_EIGHTY_OVER_PI));
}
public function get angularVelocity():Number{
return (rp.angularVelocity);
}
private function resolve(_arg1:Vector):void{
var _local2:Vector;
var _local3:Vector;
var _local4:Number;
var _local5:Number;
tan.setTo(-(rp.curr.y), rp.curr.x);
tan = tan.normalize();
_local2 = tan.mult(rp.speed);
_local3 = velocity.plusEquals(_local2);
_local4 = _local3.cross(_arg1);
tan.multEquals(_local4);
rp.prev.copy(rp.curr.minus(tan));
_local5 = ((1 - _traction) * rp.speed);
normSlip.setTo((_local5 * _arg1.y), (_local5 * _arg1.x));
curr.plusEquals(normSlip);
rp.speed = (rp.speed * _traction);
}
}
}//package org.cove.ape
Section 77
//_Introzz_22 (solaRolaGravityMaze_fla._Introzz_22)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class _Introzz_22 extends MovieClip {
public var storyText:MovieClip;
}
}//package solaRolaGravityMaze_fla
Section 78
//audioControl2_20 (solaRolaGravityMaze_fla.audioControl2_20)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class audioControl2_20 extends MovieClip {
public function audioControl2_20(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package solaRolaGravityMaze_fla
Section 79
//BackToMainMenu_129 (solaRolaGravityMaze_fla.BackToMainMenu_129)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class BackToMainMenu_129 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 80
//BlooArow_69 (solaRolaGravityMaze_fla.BlooArow_69)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class BlooArow_69 extends MovieClip {
public function BlooArow_69(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package solaRolaGravityMaze_fla
Section 81
//bubbleBottomLeft_76 (solaRolaGravityMaze_fla.bubbleBottomLeft_76)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class bubbleBottomLeft_76 extends MovieClip {
public var dialog_mc:MovieClip;
}
}//package solaRolaGravityMaze_fla
Section 82
//bubbleBottomRight_75 (solaRolaGravityMaze_fla.bubbleBottomRight_75)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class bubbleBottomRight_75 extends MovieClip {
public var dialog_mc:MovieClip;
}
}//package solaRolaGravityMaze_fla
Section 83
//bubbleTopLeft_72 (solaRolaGravityMaze_fla.bubbleTopLeft_72)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class bubbleTopLeft_72 extends MovieClip {
public var dialog_mc:MovieClip;
}
}//package solaRolaGravityMaze_fla
Section 84
//bubbleTopRight_74 (solaRolaGravityMaze_fla.bubbleTopRight_74)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class bubbleTopRight_74 extends MovieClip {
public var dialog_mc:MovieClip;
}
}//package solaRolaGravityMaze_fla
Section 85
//dialogText_73 (solaRolaGravityMaze_fla.dialogText_73)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class dialogText_73 extends MovieClip {
public var message:TextField;
}
}//package solaRolaGravityMaze_fla
Section 86
//dutchButton_3 (solaRolaGravityMaze_fla.dutchButton_3)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class dutchButton_3 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 87
//englishButton_1 (solaRolaGravityMaze_fla.englishButton_1)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class englishButton_1 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 88
//Exit_77 (solaRolaGravityMaze_fla.Exit_77)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class Exit_77 extends MovieClip {
public var storyText:MovieClip;
public function Exit_77(){
addFrameScript(1454, frame1455);
}
function frame1455(){
stop();
}
}
}//package solaRolaGravityMaze_fla
Section 89
//frenchButton_5 (solaRolaGravityMaze_fla.frenchButton_5)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class frenchButton_5 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 90
//glows_124 (solaRolaGravityMaze_fla.glows_124)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class glows_124 extends MovieClip {
public function glows_124(){
addFrameScript(34, frame35);
}
function frame35(){
stop();
}
}
}//package solaRolaGravityMaze_fla
Section 91
//graphic_232 (solaRolaGravityMaze_fla.graphic_232)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class graphic_232 extends MovieClip {
public function graphic_232(){
addFrameScript(199, frame200);
}
function frame200(){
stop();
}
}
}//package solaRolaGravityMaze_fla
Section 92
//italianButton_4 (solaRolaGravityMaze_fla.italianButton_4)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class italianButton_4 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 93
//LevelSelectButton_109 (solaRolaGravityMaze_fla.LevelSelectButton_109)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LevelSelectButton_109 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 94
//MainTimeline (solaRolaGravityMaze_fla.MainTimeline)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
import com.evilfree.solarola.*;
import flash.text.*;
import flash.net.*;
import flash.media.*;
import flash.filters.*;
import flash.system.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var translateCallMade:Boolean;
public var serverPath:String;
public var mainMenuButton:SimpleButton;
public var poButton:MovieClip;
public var translationLoaded:Boolean;
public var introMovie:MovieClip;
public var mute:Boolean;
public var itButton:MovieClip;
public var timeLine:MovieClip;
public var bubbleTopRight:MovieClip;
public var exitStory:MovieClip;
public var bubbleBottomLeft:MovieClip;
public var bubbleBottomRight:MovieClip;
public var translatePath:String;
public var sendToFriend:MovieClip;
public var musicStarted:Boolean;
public var skipButton2:MovieClip;
public var unselectedFilter:GlowFilter;
public var pauseButton:MovieClip;
public var bubbleTopLeft:MovieClip;
public var timer_mc:TextField;
public var buttonName:TextField;
public var volumeControl:MovieClip;
public var playMoreGamesButton:MovieClip;
public var gimme5Splash:movSplash;
public var game_mc:MovieClip;
public var vControl2:MovieClip;
public var sChannel:SoundChannel;
public var deButton:MovieClip;
public var frButton:MovieClip;
public var localText:LocalText;
public var enButton:MovieClip;
public var rightIndicator:MovieClip;
public var resetButton:SimpleButton;
public var blogButton:MovieClip;
public var esButton:MovieClip;
public var levelListPath:String;
public var skipButton:MovieClip;
public var leftIndicator:MovieClip;
public var levelPath:String;
public var selectedFilter:GlowFilter;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 19, frame20);
}
public function skipIntro(_arg1:Event){
trace("skip button");
gotoAndStop(6);
}
function frame2(){
MochiAd.showPreGameAd({clip:root, id:"10b45db17a419a20", res:"590x692"});
}
public function hostThis(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.gimme5games.com/index.jsp?id=codes&ref=flash_solarola");
navigateToURL(_local2, "_blank");
}
function frame1(){
serverPath = "http://www.gimme5games.com/solarola/";
levelPath = (serverPath + "levels/");
translatePath = "translate.xml";
levelListPath = "levels/levelList.xml";
timeLine = this;
unselectedFilter = new GlowFilter(11520480, 1, 4, 4, 75, 1, false, false);
selectedFilter = new GlowFilter(5208997, 1, 4, 4, 75, 1, false, false);
mute = false;
translationLoaded = false;
musicStarted = false;
this.stage.showDefaultContextMenu = false;
timeLine.addEventListener("enterFrame", newFrame);
enButton.addEventListener(MouseEvent.CLICK, selectLang);
enButton.addEventListener(MouseEvent.ROLL_OVER, buttonRoll);
enButton.addEventListener(MouseEvent.ROLL_OUT, buttonRoll);
enButton.local.filters = [unselectedFilter];
enButton.buttonMode = true;
enButton.local.mouseEnabled = false;
esButton.addEventListener(MouseEvent.CLICK, selectLang);
esButton.addEventListener(MouseEvent.ROLL_OVER, buttonRoll);
esButton.addEventListener(MouseEvent.ROLL_OUT, buttonRoll);
esButton.local.filters = [unselectedFilter];
esButton.buttonMode = true;
esButton.local.mouseEnabled = false;
deButton.addEventListener(MouseEvent.CLICK, selectLang);
deButton.addEventListener(MouseEvent.ROLL_OVER, buttonRoll);
deButton.addEventListener(MouseEvent.ROLL_OUT, buttonRoll);
deButton.local.filters = [unselectedFilter];
deButton.buttonMode = true;
deButton.local.mouseEnabled = false;
itButton.addEventListener(MouseEvent.CLICK, selectLang);
itButton.addEventListener(MouseEvent.ROLL_OVER, buttonRoll);
itButton.addEventListener(MouseEvent.ROLL_OUT, buttonRoll);
itButton.local.filters = [unselectedFilter];
itButton.buttonMode = true;
itButton.local.mouseEnabled = false;
frButton.addEventListener(MouseEvent.CLICK, selectLang);
frButton.addEventListener(MouseEvent.ROLL_OVER, buttonRoll);
frButton.addEventListener(MouseEvent.ROLL_OUT, buttonRoll);
frButton.local.filters = [unselectedFilter];
frButton.buttonMode = true;
frButton.local.mouseEnabled = false;
poButton.addEventListener(MouseEvent.CLICK, selectLang);
poButton.addEventListener(MouseEvent.ROLL_OVER, buttonRoll);
poButton.addEventListener(MouseEvent.ROLL_OUT, buttonRoll);
poButton.local.filters = [unselectedFilter];
poButton.buttonMode = true;
poButton.local.mouseEnabled = false;
trace("A OK");
vControl2.addEventListener("click", toggleMusic);
vControl2.buttonMode = true;
blogButton.addEventListener("click", hostThis);
blogButton.buttonMode = true;
sendToFriend.addEventListener("click", sendToFriendEvent);
sendToFriend.buttonMode = true;
playMoreGamesButton.addEventListener("click", gotoGimme5);
playMoreGamesButton.buttonMode = true;
stop();
}
public function sendToFriendEvent(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("mailto:?subject=Play Sola Rola, The Gravity Maze!&body=Hi, I found this great game, and thought you might like to play it: http://www.gimme5games.com/index.jsp?id=solarola");
navigateToURL(_local2, "_blank");
}
function frame20(){
volumeControl.x = 0;
volumeControl.y = 598;
}
public function buttonRoll(_arg1:MouseEvent){
if (_arg1.type == MouseEvent.ROLL_OVER){
_arg1.currentTarget.local.filters = [selectedFilter];
} else {
_arg1.currentTarget.local.filters = [unselectedFilter];
};
}
public function selectLang(_arg1:Event){
var _local2:String;
if (_arg1.target == enButton){
_local2 = "en";
};
if (_arg1.target == esButton){
_local2 = "es";
};
if (_arg1.target == deButton){
_local2 = "de";
};
if (_arg1.target == itButton){
_local2 = "it";
};
if (_arg1.target == frButton){
_local2 = "fr";
};
if (_arg1.target == poButton){
_local2 = "po";
};
localText.setLanguage(_local2);
gotoAndPlay(5);
}
public function toggleMusic(_arg1:Event){
var _local2:SoundTransform;
if (musicStarted == false){
return;
};
if (mute){
mute = false;
volumeControl.gotoAndStop(1);
vControl2.gotoAndStop(1);
_local2 = sChannel.soundTransform;
_local2.volume = 1;
sChannel.soundTransform = _local2;
} else {
mute = true;
volumeControl.gotoAndStop(2);
vControl2.gotoAndStop(2);
_local2 = sChannel.soundTransform;
_local2.volume = 0;
sChannel.soundTransform = _local2;
};
}
public function gotoGimme5(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.gimme5games.com?ref=flash_solarola");
navigateToURL(_local2, "_blank");
}
public function textComplete(_arg1:Event){
var _local2:XML;
trace("text complete");
_local2 = XML(_arg1.currentTarget.data);
localText = new LocalText(_local2);
translationLoaded = true;
}
public function watchEnd(_arg1:Event){
trace("skip button");
gotoAndPlay(20);
}
public function newFrame(_arg1:Event){
var _local2:MovieClip;
var _local3:URLRequest;
var _local4:URLLoader;
var _local5:Number;
var _local6:MovieClip;
var _local7:Sound;
var _local8:URLRequest;
var _local9:URLLoader;
if (timeLine.currentFrame == 1){
_local2 = this.gimme5Splash;
if (_local2 != null){
if (_local2.currentFrame >= 100){
gotoAndPlay(2);
};
};
stop();
};
if (timeLine.currentFrame == 2){
if (translateCallMade == false){
trace("Loading Translation Data");
_local3 = new URLRequest((((serverPath + translatePath) + "?") + Math.random()));
_local4 = new URLLoader();
_local4.addEventListener(Event.COMPLETE, textComplete);
_local4.load(_local3);
translateCallMade = true;
};
};
if (timeLine.currentFrame == 3){
if (translationLoaded){
gotoAndStop(4);
};
stop();
};
if (timeLine.currentFrame == 4){
_local5 = 250;
enButton.x = _local5;
esButton.x = _local5;
deButton.x = _local5;
itButton.x = _local5;
frButton.x = _local5;
poButton.x = _local5;
stop();
return;
};
if (timeLine.currentFrame == 5){
stop();
_local6 = this.introMovie;
if (_local6 != null){
if (_local6.currentFrame == 2){
trace("adding skip button");
this.skipButton.addEventListener(MouseEvent.CLICK, skipIntro);
this.skipButton.addEventListener(MouseEvent.ROLL_OVER, buttonRoll);
this.skipButton.addEventListener(MouseEvent.ROLL_OUT, buttonRoll);
this.skipButton.buttonMode = true;
this.skipButton.local.mouseEnabled = false;
this.skipButton.local.filters = [unselectedFilter];
this.skipButton.local.text = localText.getText("intro25");
trace("starting to play music");
_local7 = new Music();
sChannel = _local7.play(0, 10000);
musicStarted = true;
trace("doing volume control");
volumeControl.addEventListener("click", toggleMusic);
volumeControl.buttonMode = true;
};
if (_local6.currentFrame == 16){
_local6.storyText.local.text = localText.getText("intro1");
};
if (_local6.currentFrame == 144){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 175){
_local6.storyText.local.text = localText.getText("intro2");
};
if (_local6.currentFrame == 300){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 315){
_local6.storyText.local.text = localText.getText("intro3");
};
if (_local6.currentFrame == 440){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 450){
_local6.storyText.local.text = localText.getText("intro4");
};
if (_local6.currentFrame == 505){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 520){
_local6.storyText.local.text = localText.getText("intro5");
};
if (_local6.currentFrame == 600){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 615){
_local6.storyText.local.text = localText.getText("intro6");
};
if (_local6.currentFrame == 730){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 740){
_local6.storyText.local.text = localText.getText("intro7");
};
if (_local6.currentFrame == 860){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 875){
_local6.storyText.local.text = localText.getText("intro8");
};
if (_local6.currentFrame == 990){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1000){
_local6.storyText.local.text = localText.getText("intro9");
};
if (_local6.currentFrame == 1140){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1150){
_local6.storyText.local.text = localText.getText("intro10");
};
if (_local6.currentFrame == 1265){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 0x0500){
_local6.storyText.local.text = localText.getText("intro11");
};
if (_local6.currentFrame == 1400){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1415){
_local6.storyText.local.text = localText.getText("intro12");
};
if (_local6.currentFrame == 1525){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1540){
_local6.storyText.local.text = localText.getText("intro13");
};
if (_local6.currentFrame == 1590){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1605){
_local6.storyText.local.text = localText.getText("intro14");
};
if (_local6.currentFrame == 1705){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1720){
_local6.storyText.local.text = localText.getText("intro15");
};
if (_local6.currentFrame == 1840){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1855){
_local6.storyText.local.text = localText.getText("intro16");
};
if (_local6.currentFrame == 1975){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1990){
_local6.storyText.local.text = localText.getText("intro17");
};
if (_local6.currentFrame == 2075){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 2090){
_local6.storyText.local.text = localText.getText("intro18");
};
if (_local6.currentFrame == 2145){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 2160){
_local6.storyText.local.text = localText.getText("intro19");
};
if (_local6.currentFrame == 2240){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 2255){
_local6.storyText.local.text = localText.getText("intro20");
};
if (_local6.currentFrame == 2370){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 2385){
_local6.storyText.local.text = localText.getText("intro21");
};
if (_local6.currentFrame == 2505){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 2520){
_local6.storyText.local.text = localText.getText("intro22");
};
if (_local6.currentFrame == 2640){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 2655){
_local6.storyText.local.text = localText.getText("intro23");
};
if (_local6.currentFrame == 2770){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 2786){
_local6.storyText.local.text = localText.getText("intro24");
};
if (_local6.currentFrame == 2910){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 2920){
gotoAndPlay(6);
};
};
return;
};
if (timeLine.currentFrame == 6){
trace("Loading Level Data");
_local8 = new URLRequest((serverPath + levelListPath));
_local9 = new URLLoader();
_local9.addEventListener(Event.COMPLETE, levelsComplete);
_local9.load(_local8);
gotoAndStop(7);
};
if (timeLine.currentFrame == 7){
};
if (timeLine.currentFrame == 8){
stop();
};
if (timeLine.currentFrame == 20){
stop();
_local6 = this.exitStory;
if (_local6 != null){
if (_local6.currentFrame == 2){
trace("adding skip button");
this.skipButton2.addEventListener(MouseEvent.CLICK, skipIntro);
this.skipButton2.addEventListener(MouseEvent.ROLL_OVER, buttonRoll);
this.skipButton2.addEventListener(MouseEvent.ROLL_OUT, buttonRoll);
this.skipButton2.buttonMode = true;
this.skipButton2.local.mouseEnabled = false;
this.skipButton2.local.filters = [unselectedFilter];
this.skipButton2.local.text = localText.getText("intro25");
};
if (_local6.currentFrame == 16){
_local6.storyText.local.text = localText.getText("end1");
};
if (_local6.currentFrame == 135){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 151){
_local6.storyText.local.text = localText.getText("end2");
};
if (_local6.currentFrame == 430){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 445){
_local6.storyText.local.text = localText.getText("end3");
};
if (_local6.currentFrame == 565){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 580){
_local6.storyText.local.text = localText.getText("end4");
};
if (_local6.currentFrame == 860){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 875){
_local6.storyText.local.text = localText.getText("end5");
};
if (_local6.currentFrame == 995){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1010){
_local6.storyText.local.text = localText.getText("end6");
};
if (_local6.currentFrame == 1290){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1303){
_local6.storyText.local.text = localText.getText("end7");
};
if (_local6.currentFrame == 1425){
_local6.storyText.local.text = "";
};
if (_local6.currentFrame == 1450){
gotoAndStop(6);
};
};
};
}
public function levelsComplete(_arg1:Event){
var _local2:XML;
var _local3:SolaRola;
trace("levels complete");
gotoAndStop(8);
_local2 = XML(_arg1.currentTarget.data);
_local3 = new SolaRola(this, _local2, false);
game_mc.addChild(_local3);
volumeControl.x = 96;
volumeControl.y = 55;
_local3.ini();
}
}
}//package solaRolaGravityMaze_fla
Section 95
//MobileGameLink_229 (solaRolaGravityMaze_fla.MobileGameLink_229)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class MobileGameLink_229 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 96
//musicEmbed_21 (solaRolaGravityMaze_fla.musicEmbed_21)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class musicEmbed_21 extends MovieClip {
public function musicEmbed_21(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package solaRolaGravityMaze_fla
Section 97
//nextLevelButton_110 (solaRolaGravityMaze_fla.nextLevelButton_110)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class nextLevelButton_110 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 98
//nextLevelsButton_127 (solaRolaGravityMaze_fla.nextLevelsButton_127)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class nextLevelsButton_127 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 99
//portButton_6 (solaRolaGravityMaze_fla.portButton_6)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class portButton_6 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 100
//previousLevelsButton_128 (solaRolaGravityMaze_fla.previousLevelsButton_128)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class previousLevelsButton_128 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 101
//RedArroww_70 (solaRolaGravityMaze_fla.RedArroww_70)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class RedArroww_70 extends MovieClip {
public function RedArroww_70(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package solaRolaGravityMaze_fla
Section 102
//replayLevelButton_111 (solaRolaGravityMaze_fla.replayLevelButton_111)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class replayLevelButton_111 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 103
//skipButton_64 (solaRolaGravityMaze_fla.skipButton_64)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class skipButton_64 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 104
//SoundBtn_65 (solaRolaGravityMaze_fla.SoundBtn_65)
package solaRolaGravityMaze_fla {
import flash.display.*;
public dynamic class SoundBtn_65 extends MovieClip {
public function SoundBtn_65(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package solaRolaGravityMaze_fla
Section 105
//spanishButton_2 (solaRolaGravityMaze_fla.spanishButton_2)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class spanishButton_2 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 106
//storyText_29 (solaRolaGravityMaze_fla.storyText_29)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class storyText_29 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 107
//SubmitSymbol_114 (solaRolaGravityMaze_fla.SubmitSymbol_114)
package solaRolaGravityMaze_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SubmitSymbol_114 extends MovieClip {
public var local:TextField;
}
}//package solaRolaGravityMaze_fla
Section 108
//AboutMenuSymbol (AboutMenuSymbol)
package {
import com.evilfree.solarola.*;
public dynamic class AboutMenuSymbol extends AboutMenu {
}
}//package
Section 109
//Button_disabledSkin (Button_disabledSkin)
package {
import flash.display.*;
public dynamic class Button_disabledSkin extends MovieClip {
}
}//package
Section 110
//Button_downSkin (Button_downSkin)
package {
import flash.display.*;
public dynamic class Button_downSkin extends MovieClip {
}
}//package
Section 111
//Button_emphasizedSkin (Button_emphasizedSkin)
package {
import flash.display.*;
public dynamic class Button_emphasizedSkin extends MovieClip {
}
}//package
Section 112
//Button_overSkin (Button_overSkin)
package {
import flash.display.*;
public dynamic class Button_overSkin extends MovieClip {
}
}//package
Section 113
//Button_selectedDisabledSkin (Button_selectedDisabledSkin)
package {
import flash.display.*;
public dynamic class Button_selectedDisabledSkin extends MovieClip {
}
}//package
Section 114
//Button_selectedDownSkin (Button_selectedDownSkin)
package {
import flash.display.*;
public dynamic class Button_selectedDownSkin extends MovieClip {
}
}//package
Section 115
//Button_selectedOverSkin (Button_selectedOverSkin)
package {
import flash.display.*;
public dynamic class Button_selectedOverSkin extends MovieClip {
}
}//package
Section 116
//Button_selectedUpSkin (Button_selectedUpSkin)
package {
import flash.display.*;
public dynamic class Button_selectedUpSkin extends MovieClip {
}
}//package
Section 117
//Button_upSkin (Button_upSkin)
package {
import flash.display.*;
public dynamic class Button_upSkin extends MovieClip {
}
}//package
Section 118
//Car (Car)
package {
import org.cove.ape.*;
public class Car extends Group {
private var wheelParticleB:WheelParticle;
private var wheelParticleA:WheelParticle;
public function Car(_arg1:uint, _arg2:uint){
var _local3:SpringConstraint;
super();
wheelParticleA = new WheelParticle(140, 10, 14, false, 2);
wheelParticleA.setStyle(0, _arg1, 1, _arg2);
addParticle(wheelParticleA);
wheelParticleA.sprite.cacheAsBitmap = true;
wheelParticleB = new WheelParticle(200, 10, 14, false, 2);
wheelParticleB.setStyle(0, _arg1, 1, _arg2);
addParticle(wheelParticleB);
wheelParticleB.sprite.cacheAsBitmap = true;
_local3 = new SpringConstraint(wheelParticleA, wheelParticleB, 0.5, true, 8);
_local3.setStyle(0, _arg1, 1, _arg2);
addConstraint(_local3);
}
public function set speed(_arg1:Number):void{
wheelParticleA.angularVelocity = _arg1;
wheelParticleB.angularVelocity = _arg1;
}
}
}//package
Section 119
//CellRenderer_disabledSkin (CellRenderer_disabledSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_disabledSkin extends MovieClip {
}
}//package
Section 120
//CellRenderer_downSkin (CellRenderer_downSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_downSkin extends MovieClip {
}
}//package
Section 121
//CellRenderer_overSkin (CellRenderer_overSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_overSkin extends MovieClip {
}
}//package
Section 122
//CellRenderer_selectedDisabledSkin (CellRenderer_selectedDisabledSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedDisabledSkin extends MovieClip {
}
}//package
Section 123
//CellRenderer_selectedDownSkin (CellRenderer_selectedDownSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedDownSkin extends MovieClip {
}
}//package
Section 124
//CellRenderer_selectedOverSkin (CellRenderer_selectedOverSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedOverSkin extends MovieClip {
}
}//package
Section 125
//CellRenderer_selectedUpSkin (CellRenderer_selectedUpSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedUpSkin extends MovieClip {
}
}//package
Section 126
//CellRenderer_upSkin (CellRenderer_upSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_upSkin extends MovieClip {
}
}//package
Section 127
//CheckBox_disabledIcon (CheckBox_disabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_disabledIcon extends MovieClip {
}
}//package
Section 128
//CheckBox_downIcon (CheckBox_downIcon)
package {
import flash.display.*;
public dynamic class CheckBox_downIcon extends MovieClip {
}
}//package
Section 129
//CheckBox_overIcon (CheckBox_overIcon)
package {
import flash.display.*;
public dynamic class CheckBox_overIcon extends MovieClip {
}
}//package
Section 130
//CheckBox_selectedDisabledIcon (CheckBox_selectedDisabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDisabledIcon extends MovieClip {
}
}//package
Section 131
//CheckBox_selectedDownIcon (CheckBox_selectedDownIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDownIcon extends MovieClip {
}
}//package
Section 132
//CheckBox_selectedOverIcon (CheckBox_selectedOverIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedOverIcon extends MovieClip {
}
}//package
Section 133
//CheckBox_selectedUpIcon (CheckBox_selectedUpIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedUpIcon extends MovieClip {
}
}//package
Section 134
//CheckBox_upIcon (CheckBox_upIcon)
package {
import flash.display.*;
public dynamic class CheckBox_upIcon extends MovieClip {
}
}//package
Section 135
//CircleLevelSelector (CircleLevelSelector)
package {
import com.evilfree.solarola.*;
public dynamic class CircleLevelSelector extends LevelSelectButton {
public function CircleLevelSelector(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 136
//CircleMenuButton (CircleMenuButton)
package {
import flash.display.*;
import flash.text.*;
public dynamic class CircleMenuButton extends MovieClip {
public var buttonName:TextField;
public function CircleMenuButton(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 137
//ComboBox_disabledSkin (ComboBox_disabledSkin)
package {
import flash.display.*;
public dynamic class ComboBox_disabledSkin extends MovieClip {
}
}//package
Section 138
//ComboBox_downSkin (ComboBox_downSkin)
package {
import flash.display.*;
public dynamic class ComboBox_downSkin extends MovieClip {
}
}//package
Section 139
//ComboBox_overSkin (ComboBox_overSkin)
package {
import flash.display.*;
public dynamic class ComboBox_overSkin extends MovieClip {
}
}//package
Section 140
//ComboBox_upSkin (ComboBox_upSkin)
package {
import flash.display.*;
public dynamic class ComboBox_upSkin extends MovieClip {
}
}//package
Section 141
//CreditsMenuSymbol (CreditsMenuSymbol)
package {
import com.evilfree.solarola.*;
public dynamic class CreditsMenuSymbol extends CreditsMenu {
}
}//package
Section 142
//DragButton (DragButton)
package {
import flash.display.*;
public dynamic class DragButton extends MovieClip {
}
}//package
Section 143
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 144
//Gate (Gate)
package {
import com.evilfree.solarola.tiles.*;
public dynamic class Gate extends BaseTile {
}
}//package
Section 145
//GateBlue (GateBlue)
package {
import com.evilfree.solarola.tiles.*;
public dynamic class GateBlue extends BaseTile {
}
}//package
Section 146
//GateGreen (GateGreen)
package {
import com.evilfree.solarola.tiles.*;
public dynamic class GateGreen extends BaseTile {
}
}//package
Section 147
//GateRed (GateRed)
package {
import com.evilfree.solarola.tiles.*;
public dynamic class GateRed extends BaseTile {
}
}//package
Section 148
//GateSwitchSound (GateSwitchSound)
package {
import flash.media.*;
public dynamic class GateSwitchSound extends Sound {
}
}//package
Section 149
//GravBeam (GravBeam)
package {
import flash.display.*;
public dynamic class GravBeam extends MovieClip {
public var line:MovieClip;
public var beam:MovieClip;
}
}//package
Section 150
//HDragButton (HDragButton)
package {
import flash.display.*;
public dynamic class HDragButton extends MovieClip {
}
}//package
Section 151
//HiScores (HiScores)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class HiScores extends MovieClip {
private var KEY:String;// = "rocket"
private var score:Number;
private var lowIsBest:Boolean;
private var gameId:Number;
private var infoScreen:MovieClip;// = null
public var movEntryScreen:MovieClip;
private var levelId:Number;
private var entryScreen:MovieClip;// = null
public var movInfoScreen:MovieClip;
private var gameCode:String;
public static var HS_SERVLET_URL:String = (SERVER_URL + "/servlet/hiServlet");
public static var SERVER_URL:String = "http://www.gimme5games.com";
public static var INDEX_URL:String = (SERVER_URL + "/index.jsp?id=");
public function HiScores(){
KEY = "rocket";
infoScreen = null;
entryScreen = null;
super();
this.visible = false;
}
public function secCodeLoad():void{
var _local1:Loader;
var _local2:String;
_local1 = new Loader();
_local1.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, secCodeLoadError);
_local2 = ((HS_SERVLET_URL + "?type=genCode&cachebuster=") + new Date().getTime());
_local1.load(new URLRequest(_local2));
entryScreen["movCode"].addChild(_local1);
}
public function submitDetails():void{
var _local1:Boolean;
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:URLVariables;
var _local7:URLRequest;
var _local8:URLLoader;
entryScreen.visible = false;
infoScreen.visible = true;
_local1 = true;
if (entryScreen["txtName"].text.length == 0){
showInfoMessage("Please enter your name.", true);
} else {
if (entryScreen["txtCode"].text.length != 5){
showInfoMessage("Please enter all 5 letters of the security code.", true);
} else {
showInfoMessage("Submitting hi-score details to the server, please wait.", true);
infoScreen["btnBack"].visible = false;
_local1 = false;
};
};
if (!_local1){
_local2 = ((((((((("save|" + entryScreen["txtName"].text) + "|") + entryScreen["txtCode"].text) + "|") + score) + "|") + gameId) + "|") + levelId);
_local3 = "";
_local4 = 0;
_local5 = 0;
while (_local4 < _local2.length) {
if (_local5 >= KEY.length){
_local5 = 0;
};
_local3 = (_local3 + String.fromCharCode(((_local2.charCodeAt(_local4) ^ KEY.charCodeAt(_local5)) + 1)));
_local4++;
_local5++;
};
_local6 = new URLVariables();
_local6.ffdata = _local3;
_local6.lowIsBest = lowIsBest;
_local7 = new URLRequest(HS_SERVLET_URL);
_local8 = new URLLoader();
_local8.dataFormat = URLLoaderDataFormat.VARIABLES;
_local7.data = _local6;
_local7.method = URLRequestMethod.POST;
_local8.addEventListener(Event.COMPLETE, submitHiScoreHandler);
_local8.addEventListener(IOErrorEvent.IO_ERROR, submitHiScoreError);
_local8.load(_local7);
};
}
public function back():void{
entryScreen.visible = true;
infoScreen.visible = false;
}
public function submitHiScoreHandler(_arg1:Event):void{
var _local2:URLLoader;
var _local3:Number;
_local2 = URLLoader(_arg1.target);
_local3 = _local2.data.res;
if (_local3 == -1){
showInfoMessage("Could not store hi-score details. Click on back, generate a new security code and re-submit.", true);
} else {
if (_local3 == 0){
showInfoMessage("Sorry, a better score already exists with that name.", false);
} else {
if (_local3 == 1){
showInfoMessage("Congratulations! You made it into the\nhi-score table.", false);
};
};
};
}
public function showInfoMessage(_arg1:String, _arg2:Boolean):void{
infoScreen["txtInfo"].text = _arg1;
infoScreen["btnBack"].visible = _arg2;
infoScreen["btnView"].visible = !(_arg2);
}
public function secCodeLoadError(_arg1:IOErrorEvent):void{
entryScreen.visible = false;
infoScreen.visible = true;
showInfoMessage("Could not generate a security code. Click on back and try to refresh the code window.", true);
}
public function setDetails(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Boolean, _arg5:Number, _arg6:String, _arg7:String):void{
this.gameId = _arg1;
this.levelId = _arg2;
this.gameCode = _arg3;
this.lowIsBest = _arg4;
this.score = _arg5;
this.entryScreen = this["movEntryScreen"];
this.infoScreen = this["movInfoScreen"];
entryScreen["txtMsg1"].text = _arg6;
entryScreen["txtMsg2"].text = _arg7;
entryScreen["txtName"].text = "";
entryScreen["txtCode"].text = "";
entryScreen.visible = true;
infoScreen.visible = false;
secCodeLoad();
entryScreen["btnRefreshCode"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
entryScreen["btnSubmit"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnView"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnBack"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
this.visible = true;
}
public function submitHiScoreError(_arg1:IOErrorEvent):void{
showInfoMessage("A serious problem was encountered with the server, please try again in a few minutes.", true);
}
public function onButtonPress(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "btnRefreshCode":
secCodeLoad();
break;
case "btnSubmit":
submitDetails();
break;
case "btnView":
viewScore();
break;
case "btnBack":
back();
break;
};
}
public function viewScore():void{
var _local1:URLRequest;
_local1 = new URLRequest(((((((((INDEX_URL + gameCode) + "_hs") + "&name=") + entryScreen["txtName"].text) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime()));
navigateToURL(_local1, "_blank");
}
}
}//package
Section 152
//hTraceLine (hTraceLine)
package {
import flash.display.*;
public dynamic class hTraceLine extends MovieClip {
}
}//package
Section 153
//HWallBrick (HWallBrick)
package {
import flash.display.*;
public dynamic class HWallBrick extends MovieClip {
}
}//package
Section 154
//LevelDone (LevelDone)
package {
import flash.display.*;
public dynamic class LevelDone extends MovieClip {
}
}//package
Section 155
//LevelEndSound (LevelEndSound)
package {
import flash.media.*;
public dynamic class LevelEndSound extends Sound {
}
}//package
Section 156
//LevelLocked (LevelLocked)
package {
import flash.display.*;
public dynamic class LevelLocked extends MovieClip {
}
}//package
Section 157
//LevelSelectControls (LevelSelectControls)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LevelSelectControls extends MovieClip {
public var nextButton:MovieClip;
public var previousButton:MovieClip;
public var mainButton:MovieClip;
public var selectLevel:TextField;
}
}//package
Section 158
//LevelSelector (LevelSelector)
package {
import flash.display.*;
public dynamic class LevelSelector extends MovieClip {
}
}//package
Section 159
//LevelStartSound (LevelStartSound)
package {
import flash.media.*;
public dynamic class LevelStartSound extends Sound {
}
}//package
Section 160
//Line (Line)
package {
import flash.display.*;
public dynamic class Line extends MovieClip {
}
}//package
Section 161
//List_skin (List_skin)
package {
import flash.display.*;
public dynamic class List_skin extends MovieClip {
}
}//package
Section 162
//Logo (Logo)
package {
import flash.display.*;
public dynamic class Logo extends MovieClip {
}
}//package
Section 163
//Maze (Maze)
package {
import flash.display.*;
public dynamic class Maze extends MovieClip {
}
}//package
Section 164
//MenuButton (MenuButton)
package {
import flash.display.*;
public dynamic class MenuButton extends MovieClip {
}
}//package
Section 165
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.1");
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
_arg1.removeChild(_arg1._mochiad);
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (!this.parent.parent){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 166
//movSplash (movSplash)
package {
import flash.display.*;
public dynamic class movSplash extends MovieClip {
public var hand:MovieClip;
public function movSplash(){
addFrameScript(100, frame101);
}
function frame101(){
stop();
}
}
}//package
Section 167
//Music (Music)
package {
import flash.media.*;
public dynamic class Music extends Sound {
}
}//package
Section 168
//PauseSymbol (PauseSymbol)
package {
import com.evilfree.solarola.*;
public dynamic class PauseSymbol extends PauseMenu {
}
}//package
Section 169
//pieceHolder (pieceHolder)
package {
import flash.display.*;
public dynamic class pieceHolder extends MovieClip {
public var inner:MovieClip;
public function pieceHolder(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 170
//RectComposite (RectComposite)
package {
import org.cove.ape.*;
public class RectComposite extends Composite {
private var wall:CircleParticle;
private var cpA:CircleParticle;
private var cpB:CircleParticle;
private var cpD:CircleParticle;
private var cpC:CircleParticle;
private static var colA:uint = 3359795;
private static var colC:uint = 11189179;
private static var colE:uint = 7833719;
private static var colB:uint = 3368618;
private static var colD:uint = 6724010;
public function RectComposite(_arg1:Vector, _arg2:uint, _arg3:uint){
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:CircleParticle;
var _local8:CircleParticle;
var _local9:SpringConstraint;
var _local10:SpringConstraint;
var _local11:SpringConstraint;
var _local12:SpringConstraint;
var _local13:SpringConstraint;
super();
_local4 = 400;
_local5 = 400;
_local6 = 2;
cpA = new CircleParticle((_arg1.x - (_local4 / 2)), (_arg1.y - (_local5 / 2)), _local6, true);
cpB = new CircleParticle((_arg1.x + (_local4 / 2)), (_arg1.y - (_local5 / 2)), _local6, true);
cpC = new CircleParticle((_arg1.x + (_local4 / 2)), (_arg1.y + (_local5 / 2)), _local6, true);
cpD = new CircleParticle((_arg1.x - (_local4 / 2)), (_arg1.y + (_local5 / 2)), _local6, true);
_local7 = new CircleParticle(_arg1.x, _arg1.y, _local6, true);
_local8 = new CircleParticle((_arg1.x - (_local4 / 2)), _arg1.y, _local6, true);
cpA.setStyle(0, 0, 0, _arg2);
cpB.setStyle(0, 0, 0, _arg2);
cpC.setStyle(0, 0, 0, _arg2);
cpD.setStyle(0, 0, 0, _arg2);
_local7.setStyle(0, 0, 0, _arg2);
_local8.setStyle(0, 0, 0, _arg2);
cpA.alwaysRepaint = true;
cpB.alwaysRepaint = true;
cpC.alwaysRepaint = true;
cpD.alwaysRepaint = true;
_local7.alwaysRepaint = true;
_local8.alwaysRepaint = true;
_local9 = new SpringConstraint(cpA, cpB, 0.5, true, (_local6 * 2));
_local10 = new SpringConstraint(cpB, cpC, 0.5, true, (_local6 * 2));
_local11 = new SpringConstraint(cpC, cpD, 0.5, true, (_local6 * 2));
_local12 = new SpringConstraint(cpD, cpA, 0.5, true, (_local6 * 2));
_local13 = new SpringConstraint(_local7, _local8, 0.5, true, (_local6 * 2));
_local9.setStyle(0, 0, 0, _arg2);
_local10.setStyle(0, 0, 0, _arg2);
_local11.setStyle(0, 0, 0, _arg2);
_local12.setStyle(0, 0, 0, _arg2);
_local13.setStyle(0, 0, 0, _arg2);
_local9.alwaysRepaint = true;
_local10.alwaysRepaint = true;
_local11.alwaysRepaint = true;
_local12.alwaysRepaint = true;
_local13.alwaysRepaint = true;
addParticle(cpA);
addParticle(cpB);
addParticle(cpC);
addParticle(cpD);
addParticle(_local7);
addParticle(_local8);
addConstraint(_local9);
addConstraint(_local10);
addConstraint(_local11);
addConstraint(_local12);
addConstraint(_local13);
}
public function get pa():CircleParticle{
return (cpA);
}
public function get pc():CircleParticle{
return (cpC);
}
}
}//package
Section 171
//RopeGraphic (RopeGraphic)
package {
import flash.display.*;
public dynamic class RopeGraphic extends MovieClip {
}
}//package
Section 172
//Rotator (Rotator)
package {
import flash.display.*;
import flash.events.*;
import org.cove.ape.*;
import flash.utils.*;
import flash.geom.*;
import com.evilfree.solarola.tiles.*;
import levelEditor.*;
import com.evilfree.solarola.*;
import flash.net.*;
import com.evilfree.solarola.walls.*;
import flash.media.*;
import flash.filters.*;
public class Rotator extends Group {
private var greenGateStatus:Boolean;
private var tileCirclePieces:Array;
private var previousGreenGateStatus:Boolean;
private var redGateStatus:Boolean;
private var ctr:Vector;
private var editorOverlay:EditorOverlay;
private var wazGoal:Boolean;
private var gravBeam:MovieClip;
private var allWallPieces:Array;
private var solaMain:SolaRola;
private var wazWheel:WheelParticle;
public var substate:String;
private var wizWheel:WheelParticle;
private var previousRedGateStatus:Boolean;
private var gFriction:Number;
private var currentDialogStep:Number;
public var state:String;
private var winCount:Number;
private var blueGateStatus:Boolean;
public var ropeActive:Boolean;
private var menuList:Array;
private var showDialog:Boolean;
private var levelSelectButtonList:Array;
public var currentWallType:uint;
private var editMode:Boolean;
private var currentRopeLength:Number;
private var step:Number;
private var dialogTimer:Timer;
private var localTime:String;
private var currentDialogText:String;
private var rope:SpringConstraint;
private var rectComposite:RectComposite;
private var fixedRopeLength:Boolean;
private var currentDialogTarget:String;
private var wizGoal:Boolean;
private var levelGroup:Number;
public var dragButton1:MovieClip;
public var dragButton2:MovieClip;
public var dragButton3:MovieClip;
public var dragButton4:MovieClip;
private var currentDialogData:Array;
private var wallCount:Number;
private var previousBlueGateStatus:Boolean;
private var tilePieces:Array;
private var menuConstrainList:Array;
private var levelSelect:MovieClip;
public var currentTileType:uint;
public var frameCount:Number;
private var menuButtonList:Array;
private var menuItemSelected:int;
public var currentMenuType:uint;
public var bTestMode:Boolean;
private var overlay_mc:MovieClip;
private var levelXML:XML;
public var currentLevelNum:Number;
public static var wallThickness:int = 4;
public static var levelSize:int = 400;
public static var gridSize:int = 40;
public function Rotator(_arg1:MovieClip, _arg2:Boolean, _arg3:SolaRola){
var _local4:Number;
var _local5:LevelSelectButton;
super();
bTestMode = _arg2;
collideInternal = true;
overlay_mc = _arg1;
solaMain = _arg3;
editMode = _arg2;
gFriction = 0.9;
tilePieces = [];
allWallPieces = [];
tileCirclePieces = [];
levelGroup = 0;
levelSelectButtonList = [];
winCount = 0;
frameCount = 0;
showDialog = false;
currentDialogTarget = "wiz";
currentDialogText = "test";
currentLevelNum = 0;
wallCount = 0;
_local4 = 0;
while (_local4 < 6) {
_local5 = new CircleLevelSelector();
_local5.buttonMode = true;
_local5.mouseChildren = false;
_local5.addEventListener(MouseEvent.CLICK, loadLevelNumber);
_local5.setLevel((_local4 + 1));
_local5.myNum = _local4;
_local5.addEventListener(MouseEvent.ROLL_OVER, selectButton);
_local5.addEventListener(MouseEvent.ROLL_OUT, deselectButton);
levelSelectButtonList.push(_local5);
_local4++;
};
previousBlueGateStatus = false;
previousGreenGateStatus = false;
previousRedGateStatus = false;
ropeActive = false;
fixedRopeLength = true;
currentRopeLength = 80;
createWaz();
createWiz();
createRope();
state = "menu";
menuButtonList = [];
menuConstrainList = [];
gravBeam = new GravBeam();
localTime = solaMain.timeLineRef.localText.getText("Time");
addDragButtons();
showMainMenu();
}
public function loadNextLevel(){
if (currentLevelNum == 48){
trace("THE PLAYER HAS WON!");
solaMain.unListen();
solaMain.timeLineRef.gotoAndStop(20);
} else {
solaMain.loadLevelNumber(currentLevelNum);
};
}
public function createRope(){
rope = new SpringConstraint(wizWheel, wazWheel, 0.02, false, 5, 0.9, false);
rope.setDisplay(gravBeam);
if (fixedRopeLength){
rope.restLength = currentRopeLength;
};
rope.setLine(2, 0xFF0000, 0.5);
}
private function getTileIndex(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:*;
var _local5:Number;
_arg1 = (_arg1 + (levelSize / 2));
_local3 = Math.floor((_arg1 / gridSize));
_arg2 = (_arg2 + (levelSize / 2));
_local4 = Math.floor((_arg2 / gridSize));
_local5 = ((_local4 * 10) + _local3);
return (_local5);
}
public function messageDone(_arg1:Event){
currentDialogStep++;
if (currentDialogStep < currentDialogData.length){
setMessage();
} else {
showDialog = false;
hideBubbles();
};
}
public function startDialogSequence(){
currentDialogData = [];
currentDialogStep = 0;
showDialog = false;
if (currentLevelNum == 0){
currentDialogData.push({textKey:"t1a", target:"wiz", length:3000});
currentDialogData.push({textKey:"t1b", target:"waz", length:2000});
currentDialogData.push({textKey:"t1c", target:"wiz", length:3000});
currentDialogData.push({textKey:"t1d", target:"waz", length:4000});
currentDialogData.push({textKey:"t1e", target:"wiz", length:5000});
currentDialogData.push({textKey:"t1f", target:"waz", length:2000});
currentDialogData.push({textKey:"t1g", target:"wiz", length:5000});
currentDialogData.push({textKey:"t1h", target:"waz", length:3000});
showDialog = true;
};
if (currentLevelNum == 2){
currentDialogData.push({textKey:"t2a", target:"wiz", length:2000});
currentDialogData.push({textKey:"t2b", target:"waz", length:2000});
currentDialogData.push({textKey:"t2c", target:"wiz", length:5000});
currentDialogData.push({textKey:"t2d", target:"waz", length:5000});
currentDialogData.push({textKey:"t2e", target:"wiz", length:4000});
currentDialogData.push({textKey:"t2f", target:"waz", length:5000});
currentDialogData.push({textKey:"t2g", target:"wiz", length:3000});
showDialog = true;
};
if (currentLevelNum == 4){
currentDialogData.push({textKey:"t3a", target:"wiz", length:3000});
currentDialogData.push({textKey:"t3b", target:"waz", length:1000});
currentDialogData.push({textKey:"t3c", target:"wiz", length:1000});
currentDialogData.push({textKey:"t3d", target:"waz", length:5000});
currentDialogData.push({textKey:"t3e", target:"wiz", length:4000});
currentDialogData.push({textKey:"t3f", target:"waz", length:5000});
currentDialogData.push({textKey:"t3g", target:"wiz", length:3000});
currentDialogData.push({textKey:"t3h", target:"waz", length:5000});
currentDialogData.push({textKey:"t3i", target:"wiz", length:3000});
showDialog = true;
};
if (currentLevelNum == 7){
currentDialogData.push({textKey:"t4a", target:"waz", length:4000});
currentDialogData.push({textKey:"t4b", target:"wiz", length:4000});
currentDialogData.push({textKey:"t4c", target:"waz", length:5000});
currentDialogData.push({textKey:"t4d", target:"wiz", length:5000});
currentDialogData.push({textKey:"t4e", target:"waz", length:6000});
currentDialogData.push({textKey:"t4f", target:"wiz", length:6000});
showDialog = true;
};
if (currentLevelNum == 13){
currentDialogData.push({textKey:"t5a", target:"wiz", length:4000});
currentDialogData.push({textKey:"t5b", target:"waz", length:2000});
currentDialogData.push({textKey:"t5c", target:"wiz", length:5000});
currentDialogData.push({textKey:"t5d", target:"waz", length:3000});
currentDialogData.push({textKey:"t5e", target:"wiz", length:5000});
currentDialogData.push({textKey:"t5f", target:"waz", length:5000});
currentDialogData.push({textKey:"t5g", target:"wiz", length:5000});
currentDialogData.push({textKey:"t5h", target:"waz", length:5000});
currentDialogData.push({textKey:"t5i", target:"wiz", length:3000});
showDialog = true;
};
if (showDialog){
setMessage();
};
}
private function openGateColor(_arg1:Number){
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < allWallPieces.length) {
_local3 = allWallPieces[_local2];
if (_local3 != null){
_local3.openGate(_arg1);
};
_local2++;
};
}
private function showLevelsClick(_arg1:Event){
showLevels();
}
private function playSound(_arg1:String){
var _local2:Sound;
trace(("Play sound:" + _arg1));
if (solaMain.timeLineRef.mute == true){
return;
};
if (_arg1 == "gate"){
_local2 = new GateSwitchSound();
};
if (_arg1 == "levelStart"){
_local2 = new LevelStartSound();
};
if (_arg1 == "levelEnd"){
_local2 = new LevelEndSound();
};
_local2.play();
}
public function loadLevel(_arg1:XML, _arg2:Number, _arg3:Boolean){
var _local4:int;
levelSelect = null;
if (dialogTimer != undefined){
dialogTimer.removeEventListener("timer", messageDone);
};
levelXML = _arg1;
winCount = 0;
solaMain.timeLineRef.stage.focus = null;
levelGroup = Math.floor(((_arg2 + 1) / 6));
ropeActive = _arg3;
trace(("Gravity Beam:" + ropeActive));
trace(("level group:" + levelGroup));
solaMain.resetRotation();
removeMenuItems();
currentLevelNum = _arg2;
step = 1;
wizGoal = false;
wazGoal = false;
removeConstraint(rope);
removeParticle(wizWheel);
removeParticle(wazWheel);
_local4 = 0;
_local4 = 0;
while (_local4 < 11) {
removeRow(_local4);
_local4++;
};
_local4 = 0;
while (_local4 < 11) {
removeColumn(_local4);
_local4++;
};
drawRows();
drawColumns();
state = "build";
playSound("levelStart");
spreadWallRandom();
drawTiles();
hideTiles();
}
private function activateTile(_arg1:BaseTile){
if (_arg1 != null){
switch (_arg1.type){
case "gate":
if (_arg1.color == 0xFF){
blueGateStatus = true;
};
if (_arg1.color == 0xFF0000){
redGateStatus = true;
};
if (_arg1.color == 0x8800){
greenGateStatus = true;
};
openGateColor(_arg1.color);
break;
};
};
}
public function setWazFriction(_arg1:Number){
trace(("waz friction:" + _arg1));
wazWheel.friction = _arg1;
}
public function setFixedRopeLength(_arg1:Boolean){
trace(("fixed rope length:" + _arg1));
fixedRopeLength = _arg1;
if (fixedRopeLength){
rope.restLength = currentRopeLength;
};
}
public function addDragButtons(){
dragButton1 = new DragButton();
dragButton1.y = -250;
dragButton1.visible = false;
overlay_mc.addChild(dragButton1);
}
public function deselectButton(_arg1:Event){
if (((!((_arg1.currentTarget.currentFrame == 3))) && (!((_arg1.currentTarget.currentFrame == 4))))){
_arg1.currentTarget.gotoAndStop(1);
};
}
private function createWaz(){
var _local1:*;
wazWheel = new WheelParticle(0, 0, 15);
_local1 = new Waz();
wazWheel.setDisplay(_local1);
}
public function toggleRope(){
var _local1:Number;
trace("toggle rope");
if (ropeActive){
ropeActive = false;
removeConstraint(rope);
} else {
ropeActive = true;
_local1 = rope.stiffness;
rope = new SpringConstraint(wizWheel, wazWheel, _local1, false, 5, 0.9, false);
rope.setLine(2, 0xFF0000, 0.5);
rope.setDisplay(gravBeam);
if (fixedRopeLength){
rope.restLength = currentRopeLength;
};
addConstraint(rope);
};
}
public function start(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
frameCount = 0;
solaMain.gravStrength = 1.5;
state = "run";
_local1 = indexToPosition(Number(levelXML.wizStartTile.@x));
_local2 = indexToPosition(Number(levelXML.wizStartTile.@y));
_local3 = indexToPosition(Number(levelXML.wazStartTile.@x));
_local4 = indexToPosition(Number(levelXML.wazStartTile.@y));
placeWizWaz(_local1, _local2, _local3, _local4);
if (ropeActive){
toggleRope();
toggleRope();
};
showTiles();
if (editMode == true){
};
startDialogSequence();
}
public function setRopeLength(_arg1:Number){
currentRopeLength = _arg1;
if (fixedRopeLength){
rope.restLength = _arg1;
};
}
private function getTileType(_arg1:Number):String{
var _local2:BaseTile;
_local2 = tilePieces[_arg1];
if (_local2 == null){
return ("none");
};
return (_local2.type);
}
public function setWellDoneMenuAnchor(_arg1:MovieClip){
var _local2:CircleParticle;
_local2 = new CircleParticle(0, 0, 100, true);
_local2.collidable = false;
_local2.setDisplay(_arg1);
addParticle(_local2);
menuButtonList.push(_local2);
}
public function showTiles(){
var _local1:*;
var _local2:CircleParticle;
_local1 = 0;
while (_local1 < tileCirclePieces.length) {
trace("circle paricle");
_local2 = tileCirclePieces[_local1];
addParticle(_local2);
_local1++;
};
}
public function setWinState(){
solaMain.bDeconstructing = true;
wallCount = 0;
state = "freeWalls";
solaMain.gravStrength = (-(solaMain.gravStrength) * 2);
freeWalls();
hideBubbles();
playSound("levelEnd");
}
public function drawTiles(){
var _local1:XMLList;
var _local2:*;
var _local3:int;
var _local4:int;
var _local5:XML;
var _local6:BaseTile;
var _local7:Number;
var _local8:Number;
var _local9:CircleParticle;
_local1 = levelXML.tiles.tPiece;
hideTiles();
tileCirclePieces = [];
tilePieces = [];
_local2 = 0;
while (_local2 < 100) {
_local3 = (_local2 % 10);
_local4 = Math.floor((_local2 / 10));
_local5 = _local1[_local2];
_local7 = (((_local3 * gridSize) + (gridSize / 2)) - (levelSize / 2));
_local8 = (((_local4 * gridSize) + (gridSize / 2)) - (levelSize / 2));
if (_local5.@type == "gate"){
if (_local5.@color == "0xFF0000"){
_local6 = new GateRed();
};
if (_local5.@color == "0x008800"){
_local6 = new GateGreen();
};
if (_local5.@color == "0x0000FF"){
_local6 = new GateBlue();
};
_local9 = new CircleParticle(_local7, _local8, 15, true);
_local9.collidable = false;
addParticle(_local9);
tileCirclePieces.push(_local9);
_local9.setDisplay(_local6);
_local6.setData(_local5);
tilePieces[_local2] = _local6;
};
if (_local5.@type == "wizGoal"){
_local6 = new WizGoal();
_local6.setData(_local5);
_local9 = new CircleParticle(_local7, _local8, 15, true);
_local9.collidable = false;
addParticle(_local9);
tileCirclePieces.push(_local9);
_local9.setDisplay(_local6);
tilePieces[_local2] = _local6;
};
if (_local5.@type == "wazGoal"){
_local6 = new WazGoal();
_local6.setData(_local5);
_local9 = new CircleParticle(_local7, _local8, 15, true);
_local9.collidable = false;
addParticle(_local9);
tileCirclePieces.push(_local9);
_local9.setDisplay(_local6);
tilePieces[_local2] = _local6;
};
_local2++;
};
}
public function setLevelGrid(_arg1:Boolean){
overlay_mc.visible = _arg1;
}
public function nextLevelGroup(_arg1:Event){
showNextLevelGroup();
}
public function setGlobalFriction(_arg1:Number){
gFriction = (1 - _arg1);
}
public function updateLevelButtons(){
var _local1:uint;
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:LevelSelectButton;
_local1 = 6;
_local2 = new Array();
solaMain.timeLineRef.stage.focus = null;
if (levelGroup > 7){
levelGroup = 7;
};
_local5 = 0;
while (_local5 < 6) {
_local4 = -1;
_local3 = ((levelGroup * 6) + _local5);
_local6 = levelSelectButtonList[_local5];
_local6.setLevel((_local3 + 1));
_local2.push(_local6);
if (_local5 == 0){
_local6.gotoAndStop(3);
};
trace(((((("Button ID: " + _local3) + " Completed? ") + solaMain.userStatsSO.data[("level" + _local3)]) + " PRevious completed? ") + solaMain.userStatsSO.data[("level" + (_local3 - 1))]));
if ((((_local3 == 0)) || (!((solaMain.userStatsSO.data[("level" + (_local3 - 1))] == null))))){
_local4 = 0;
_local6.setState(0);
_local6.mouseEnabled = true;
};
if (solaMain.userStatsSO.data[("level" + _local3)] != null){
_local4 = 2;
_local6.setState(2);
_local6.mouseEnabled = true;
} else {
if (_local4 != 0){
_local4 = 1;
_local6.setState(1);
_local6.mouseEnabled = false;
};
};
_local5++;
};
solaMain.setMenu(_local1, _local2);
solaMain.clearSelectedMenu();
}
private function interceptMenuClick(_arg1:Event){
menuButtonPressed(_arg1.currentTarget.myButtonIndex);
}
public function removeRow(_arg1:Number){
var _local2:int;
var _local3:*;
_local2 = 0;
while (_local2 < allWallPieces.length) {
_local3 = allWallPieces[_local2];
if (_local3.rowNum == _arg1){
allWallPieces.splice(_local2, 1);
_local2--;
_local3.remove();
};
_local2++;
};
}
public function setRopeStrength(_arg1:Number){
rope.stiffness = _arg1;
}
public function showLevels(){
showLevelSelector();
updateLevelButtons();
}
public function freeWalls(){
var _local1:int;
var _local2:BaseWall;
var _local3:CircleParticle;
_local1 = 0;
while (_local1 < allWallPieces.length) {
_local2 = allWallPieces[_local1];
_local2.freeWall();
_local1++;
};
_local1 = 0;
while (_local1 < tileCirclePieces.length) {
trace("circle paricle");
_local3 = tileCirclePieces[_local1];
_local3.fixed = false;
_local3.velocity = new Vector(((Math.random() * 16) - 8), ((Math.random() * 20) - 10));
_local3.collidable = true;
_local1++;
};
}
public function showMainMenu(){
var _local1:*;
var _local2:uint;
var _local3:Array;
var _local4:int;
var _local5:*;
var _local6:Array;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:CircleParticle;
var _local11:CircleParticle;
var _local12:SpringConstraint;
var _local13:MovieClip;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:MovieClip;
var _local19:MovieClip;
trace("showMainMenu");
levelSelect = null;
state = "menu";
substate = "mainmenu";
solaMain.timeLineRef.stage.quality = StageQuality.HIGH;
menuList = new Array();
_local1 = new Array();
_local3 = [];
removeMenuItems();
solaMain.resetRotation();
_local5 = (Math.sqrt(((400 * 400) + (400 * 400))) / 2);
currentMenuType = 0;
solaMain.resetMenuSelect();
_local6 = ["play", "more games", "credits", "about"];
_local7 = _local6.length;
_local2 = _local7;
_local4 = 0;
while (_local4 < _local7) {
trace(("button num:" + _local4));
_local15 = (((_local4 / _local7) * 360) + 180);
_local16 = (180 / Math.PI);
_local17 = (_local15 / _local16);
_local8 = (Math.sin(_local17) * _local5);
_local9 = (Math.cos(_local17) * _local5);
_local10 = new CircleParticle(_local8, _local9, 5, true);
_local10.visible = false;
_local10.collidable = false;
addParticle(_local10);
_local8 = ((Math.sin(_local17) * _local5) * 0.65);
_local9 = ((Math.cos(_local17) * _local5) * 0.65);
_local11 = new CircleParticle(_local8, _local9, 62, false);
_local18 = new CircleMenuButton();
_local18.addEventListener(MouseEvent.ROLL_OVER, selectButton);
_local18.addEventListener(MouseEvent.ROLL_OUT, deselectButton);
_local18.buttonMode = true;
_local18.mouseChildren = false;
_local18.buttonName.text = solaMain.timeLineRef.localText.getText(_local6[_local4]);
_local18.buttonName.y = (-(_local18.buttonName.textHeight) / 2);
_local18.myButtonIndex = _local4;
_local18.addEventListener(MouseEvent.CLICK, interceptMenuClick);
if (_local4 == 0){
_local18.gotoAndStop(3);
};
_local11.collidable = true;
_local11.setDisplay(_local18);
addParticle(_local11);
_local12 = new SpringConstraint(_local10, _local11, 1, false, 0, 1);
_local19 = new Line();
_local12.setDisplay(_local19);
trace(_local12.sprite);
addConstraint(_local12);
menuList.push(_local10, _local11);
_local3.push(_local12);
_local1.push(_local18);
_local4++;
};
solaMain.setMenu(_local2, _local1);
_local10 = new CircleParticle(0, 0, 110, true);
_local10.elasticity = 1;
_local13 = new Logo();
_local10.setDisplay(_local13);
addParticle(_local10);
menuList.push(_local10);
_local14 = 60;
_local4 = 0;
while (_local4 < _local14) {
_local15 = ((_local4 / _local14) * 360);
_local16 = (180 / Math.PI);
_local17 = (_local15 / _local16);
_local8 = (Math.sin(_local17) * _local5);
_local9 = (Math.cos(_local17) * _local5);
_local10 = new CircleParticle(_local8, _local9, 5, true);
_local10.collidable = true;
_local10.visible = false;
addParticle(_local10);
menuList.push(_local10);
_local4++;
};
menuConstrainList = _local3;
menuButtonList = menuList;
placeWizWaz(-100, 0, 100, 0);
}
private function createWall(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:XML){
var _local6:String;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:BaseWall;
var _local12:String;
_local6 = _arg5.@type;
_local7 = ((_arg3 + _arg1) / 2);
_local8 = ((_arg4 + _arg2) / 2);
_local9 = (_arg3 - _arg1);
_local10 = (_arg4 - _arg2);
_local11 = new BaseWall(this, _local6);
_local12 = "horizontal";
if (_local10 > _local9){
_local12 = "vertical";
};
switch (_local6){
case "none":
break;
case "standard":
_local11.createWallRect(_local7, _local8, _local9, _local10, 0, true);
_local11.color = 0;
_local11.setStyle(1, _local11.color, 1, _local11.color);
_local11.addToDisplay();
break;
case "gate":
_local11.createWallRect(_local7, _local8, _local9, _local10, 0, true);
_local11.color = Number(_arg5.@color);
_local11.setStyle(1, _local11.color, 1, _local11.color);
_local11.addToDisplay();
break;
case "bridge":
if (_local10 == wallThickness){
_local11.createBridge((_local7 - (_local9 / 2)), _local8, (_local7 + (_local9 / 2)), _local8, (_local9 / gridSize));
};
if (_local9 == wallThickness){
_local11.createBridge(_local7, (_local8 - (_local10 / 2)), _local7, (_local8 + (_local10 / 2)), (_local10 / gridSize));
};
_local11.addToDisplay();
};
return (_local11);
}
public function removeColumn(_arg1:Number){
var _local2:int;
var _local3:*;
_local2 = 0;
while (_local2 < allWallPieces.length) {
_local3 = allWallPieces[_local2];
if (_local3.columnNum == _arg1){
allWallPieces.splice(_local2, 1);
_local2--;
_local3.remove();
};
_local2++;
};
}
public function spreadWallRandom(){
var _local1:*;
var _local2:BaseWall;
_local1 = 0;
while (_local1 < allWallPieces.length) {
_local2 = allWallPieces[_local1];
_local2.setRandomPosition();
_local1++;
};
}
public function clearInnerMenu(){
var _local1:GlowFilter;
menuItemSelected = -1;
if (levelSelect != null){
_local1 = new GlowFilter(11520480, 1, 4, 4, 75, 1, false, false);
levelSelect.nextButton.local.filters = [_local1];
levelSelect.previousButton.local.filters = [_local1];
_local1 = new GlowFilter(9961988, 1, 4, 4, 75, 1, false, false);
levelSelect.mainButton.local.filters = [_local1];
};
}
private function showNextLevelGroup(){
levelGroup++;
if (levelGroup > 7){
levelGroup = 7;
};
updateLevelButtons();
}
private function getTile(_arg1:Number):BaseTile{
return (tilePieces[_arg1]);
}
public function loadLevelNumber(_arg1:Event){
var _local2:Number;
_local2 = _arg1.target.myNum;
trace(("load level clicked:" + _local2));
solaMain.loadLevelNumber(((levelGroup * 6) + _local2));
}
private function indexToPosition(_arg1:Number):Number{
return ((((_arg1 * gridSize) - (levelSize / 2)) + (gridSize / 2)));
}
public function clearLevel(){
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < 11) {
removeRow(_local1);
removeColumn(_local1);
_local1++;
};
removeParticle(wizWheel);
removeParticle(wazWheel);
hideTiles();
}
private function drawRows(){
var _local1:int;
_local1 = 0;
while (_local1 < 11) {
drawRow(_local1);
_local1++;
};
}
public function setMessage(){
var _local1:String;
var _local2:Number;
currentDialogTarget = currentDialogData[currentDialogStep].target;
_local1 = currentDialogData[currentDialogStep].textKey;
currentDialogText = solaMain.timeLineRef.localText.getText(_local1);
_local2 = currentDialogData[currentDialogStep].length;
dialogTimer = new Timer(_local2, 1);
dialogTimer.addEventListener("timer", messageDone);
dialogTimer.start();
}
public function setWizFriction(_arg1:Number){
trace(("wiz friction:" + _arg1));
wizWheel.friction = _arg1;
}
private function createWiz(){
var _local1:*;
wizWheel = new WheelParticle(0, 0, 18);
wizWheel.friction = 0.01;
_local1 = new Wiz();
wizWheel.setDisplay(_local1);
}
public function selectButton(_arg1:Event){
if (solaMain.playMode != "popupScreen"){
if (((!((_arg1.currentTarget.currentFrame == 3))) && (!((_arg1.currentTarget.currentFrame == 4))))){
_arg1.currentTarget.gotoAndStop(2);
};
};
}
public function reset(){
var _local1:Number;
var _local2:Number;
trace(("Current state is:" + state));
if (state != "run"){
return;
};
frameCount = 0;
_local1 = indexToPosition(Number(levelXML.wizStartTile.@x));
_local2 = indexToPosition(Number(levelXML.wizStartTile.@y));
wizWheel.px = _local1;
wizWheel.py = _local2;
_local1 = indexToPosition(Number(levelXML.wazStartTile.@x));
_local2 = indexToPosition(Number(levelXML.wazStartTile.@y));
wazWheel.px = _local1;
wazWheel.py = _local2;
}
public function removeTiles(){
var _local1:*;
var _local2:CircleParticle;
_local1 = 0;
while (_local1 < tileCirclePieces.length) {
trace("circle paricle");
_local2 = tileCirclePieces[_local1];
removeParticle(_local2);
_local1++;
};
}
public function hideTiles(){
var _local1:*;
var _local2:CircleParticle;
_local1 = 0;
while (_local1 < tileCirclePieces.length) {
trace("circle paricle");
_local2 = tileCirclePieces[_local1];
removeParticle(_local2);
_local1++;
};
}
public function getLevelXML():XML{
return (levelXML);
}
public function menuButtonPressed(_arg1:Number){
var _local2:URLRequest;
if (levelSelect == null){
if (solaMain.playMode != "popupScreen"){
switch (_arg1){
case 0:
showLevels();
solaMain.resetMenuSelect();
break;
case 1:
_local2 = new URLRequest(SolaRola.cMoreGamesLink);
navigateToURL(_local2, "_blank");
break;
case 2:
solaMain.showPopupScreen(1);
break;
case 3:
solaMain.showPopupScreen(0);
break;
};
};
} else {
if (((!((solaMain.userStatsSO.data[("level" + (((levelGroup * 6) + _arg1) - 1))] == null))) || ((((levelGroup * 6) + _arg1) == 0)))){
solaMain.loadLevelNumber(((levelGroup * 6) + _arg1));
};
};
}
public function removeMenuItems(){
var _local1:int;
var _local2:AbstractParticle;
var _local3:SpringConstraint;
if (showDialog){
hideBubbles();
};
_local1 = 0;
while (_local1 < menuButtonList.length) {
_local2 = menuButtonList[_local1];
removeParticle(_local2);
_local1++;
};
_local1 = 0;
while (_local1 < menuConstrainList.length) {
_local3 = menuConstrainList[_local1];
removeConstraint(_local3);
_local1++;
};
}
public function interceptMenuPress(_arg1:Boolean, _arg2:Boolean, _arg3:Boolean, _arg4:Number){
var _local5:GlowFilter;
var _local6:GlowFilter;
var _local7:GlowFilter;
var _local8:GlowFilter;
_local5 = new GlowFilter(11520480, 1, 4, 4, 75, 1, false, false);
_local6 = new GlowFilter(5208997, 1, 4, 4, 75, 1, false, false);
_local7 = new GlowFilter(9961988, 1, 4, 4, 75, 1, false, false);
_local8 = new GlowFilter(0xFF0000, 1, 4, 4, 75, 1, false, false);
if (state == "menu"){
if (((!((_arg4 == -1))) && ((_arg3 == true)))){
menuButtonPressed(_arg4);
} else {
if (levelSelect != null){
levelSelect.nextButton.local.filters = [_local5];
levelSelect.previousButton.local.filters = [_local5];
levelSelect.mainButton.local.filters = [_local7];
if (_arg3 == false){
if (_arg1 == true){
menuItemSelected--;
if (menuItemSelected < 0){
menuItemSelected = 2;
};
} else {
if (_arg2 == true){
menuItemSelected++;
if (menuItemSelected > 2){
menuItemSelected = 0;
};
};
};
} else {
switch (menuItemSelected){
case 0:
showPreviousLevelGroup();
break;
case 1:
showNextLevelGroup();
break;
case 2:
showMainMenu();
break;
};
};
if (levelSelect != null){
switch (menuItemSelected){
case 0:
levelSelect.previousButton.local.filters = [_local6];
break;
case 1:
levelSelect.nextButton.local.filters = [_local6];
break;
case 2:
levelSelect.mainButton.local.filters = [_local8];
break;
};
};
};
};
};
}
private function groupSame(_arg1:XMLList):Array{
var _local2:Array;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:int;
var _local7:XML;
var _local8:*;
var _local9:*;
_local2 = [];
_local3 = 0;
_local2[_local3] = [];
_local2[_local3].push(_arg1[0]);
_local4 = _arg1[0].@type;
_local5 = 0;
if (_arg1[0].@color != undefined){
_local5 = Number(_arg1[0].@color);
};
_local6 = 1;
while (_local6 < _arg1.length()) {
_local7 = _arg1[_local6];
_local8 = _local7.@type;
_local9 = 0;
if (_local7.@color != undefined){
_local9 = Number(_local7.@color);
};
if ((((_local8 == _local4)) && ((_local5 == _local9)))){
_local2[_local3].push(_local7);
} else {
_local3++;
_local2[_local3] = [];
_local2[_local3].push(_local7);
_local4 = _local8;
_local5 = _local9;
};
_local6++;
};
return (_local2);
}
public function showLevelSelector(){
var _local1:Array;
var _local2:Array;
var _local3:int;
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:CircleParticle;
var _local9:CircleParticle;
var _local10:SpringConstraint;
var _local11:Number;
var _local12:GlowFilter;
var _local13:GlowFilter;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:MovieClip;
solaMain.timeLineRef.stage.quality = StageQuality.HIGH;
solaMain.timeLineRef.stage.focus = null;
solaMain.gravStrength = 1.5;
clearLevel();
state = "menu";
substate = "levelselect";
_local1 = [];
_local2 = [];
currentMenuType = 1;
removeMenuItems();
solaMain.resetRotation();
_local4 = (Math.sqrt(((400 * 400) + (400 * 400))) / 2);
_local5 = 6;
_local3 = 0;
while (_local3 < _local5) {
_local11 = (((((5 - _local3) / _local5) * 360) + 180) + 60);
_local15 = (180 / Math.PI);
_local16 = (_local11 / _local15);
_local6 = (Math.sin(_local16) * _local4);
_local7 = (Math.cos(_local16) * _local4);
_local8 = new CircleParticle(_local6, _local7, 5, true);
_local8.collidable = false;
addParticle(_local8);
_local6 = ((Math.sin(_local16) * _local4) * 0.65);
_local7 = ((Math.cos(_local16) * _local4) * 0.65);
_local9 = new CircleParticle(_local6, _local7, 60, false);
_local9.collidable = true;
_local9.setDisplay(levelSelectButtonList[_local3]);
addParticle(_local9);
_local10 = new SpringConstraint(_local8, _local9, 1, false, 5, 0.9);
_local17 = new Line();
_local10.setDisplay(_local17);
trace(_local10.sprite);
addConstraint(_local10);
_local1.push(_local8, _local9);
_local2.push(_local10);
_local3++;
};
_local8 = new CircleParticle(0, 0, 50, true);
levelSelect = new LevelSelectControls();
levelSelect.selectLevel.text = solaMain.timeLineRef.localText.getText("level select2");
levelSelect.mainButton.addEventListener(MouseEvent.CLICK, showMenu);
levelSelect.nextButton.addEventListener(MouseEvent.CLICK, nextLevelGroup);
levelSelect.previousButton.addEventListener(MouseEvent.CLICK, previousLevelGroup);
levelSelect.nextButton.local.text = solaMain.timeLineRef.localText.getText("next");
levelSelect.previousButton.local.text = solaMain.timeLineRef.localText.getText("previous");
levelSelect.mainButton.local.text = solaMain.timeLineRef.localText.getText("main menu");
menuItemSelected = -1;
_local12 = new GlowFilter(11520480, 1, 4, 4, 75, 1, false, false);
_local13 = new GlowFilter(5208997, 1, 4, 4, 75, 1, false, false);
levelSelect.nextButton.local.filters = [_local12];
levelSelect.previousButton.local.filters = [_local12];
_local12 = new GlowFilter(9961988, 1, 4, 4, 75, 1, false, false);
_local13 = new GlowFilter(0xFF0000, 1, 4, 4, 75, 1, false, false);
levelSelect.mainButton.local.filters = [_local12];
levelSelect.nextButton.addEventListener(MouseEvent.ROLL_OVER, buttonRollFunction);
levelSelect.mainButton.addEventListener(MouseEvent.ROLL_OVER, buttonRollFunction);
levelSelect.previousButton.addEventListener(MouseEvent.ROLL_OVER, buttonRollFunction);
levelSelect.nextButton.buttonMode = true;
levelSelect.previousButton.buttonMode = true;
levelSelect.mainButton.buttonMode = true;
levelSelect.nextButton.local.mouseEnabled = false;
levelSelect.previousButton.local.mouseEnabled = false;
levelSelect.mainButton.local.mouseEnabled = false;
_local8.setDisplay(levelSelect);
addParticle(_local8);
_local1.push(_local8);
_local14 = 60;
_local3 = 0;
while (_local3 < _local14) {
_local11 = ((_local3 / _local14) * 360);
_local15 = (180 / Math.PI);
_local16 = (_local11 / _local15);
_local6 = (Math.sin(_local16) * _local4);
_local7 = (Math.cos(_local16) * _local4);
_local8 = new CircleParticle(_local6, _local7, 5, true);
_local8.collidable = true;
_local8.visible = false;
addParticle(_local8);
_local1.push(_local8);
_local3++;
};
menuConstrainList = _local2;
menuButtonList = _local1;
}
private function showPreviousLevelGroup(){
levelGroup--;
if (levelGroup < 0){
levelGroup = 0;
};
updateLevelButtons();
}
private function convertTimeToSecondsText(_arg1:Number):String{
var _local2:Number;
var _local3:String;
_local2 = (_arg1 / 30);
_local2 = (Math.round((_local2 * 10)) / 10);
_local3 = _local2.toString();
if (_local3.indexOf(".") == -1){
_local3 = (_local3 + ".0");
};
return (_local3);
}
public function newFrame(_arg1:Number){
var _local2:int;
var _local3:AbstractParticle;
var _local4:BaseWall;
var _local5:Number;
var _local6:Number;
var _local7:BaseTile;
var _local8:BaseTile;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:*;
var _local13:Point;
_local2 = 0;
while (_local2 < menuButtonList.length) {
_local3 = menuButtonList[_local2];
_local3.velocity = _local3.velocity.mult(0.9);
_local3.sprite.rotation = -(_arg1);
_local2++;
};
if (state == "freeWalls"){
wallCount++;
if (wallCount == 50){
clearLevel();
solaMain.gravStrength = (-(solaMain.gravStrength) / 2);
solaMain.bDeconstructing = false;
};
};
if (state == "build"){
step++;
_local2 = 0;
while (_local2 < allWallPieces.length) {
_local4 = allWallPieces[_local2];
_local4.moveIn(step);
_local2++;
};
if (step == 31){
start();
};
};
if (state == "run"){
solaMain.timeLineRef.timer_mc.visible = true;
if (showDialog){
showBubble();
};
frameCount++;
solaMain.timeLineRef.timer_mc.text = ((localTime + ": ") + convertTimeToSecondsText(frameCount));
wizWheel.velocity = wizWheel.velocity.mult(gFriction);
wazWheel.velocity = wazWheel.velocity.mult(gFriction);
_local5 = getTileIndex(wizWheel.px, wizWheel.py);
_local6 = getTileIndex(wazWheel.px, wazWheel.py);
closeAllGates();
redGateStatus = false;
blueGateStatus = false;
greenGateStatus = false;
_local7 = getTile(_local5);
activateTile(_local7);
_local8 = getTile(_local6);
activateTile(_local8);
if (redGateStatus != previousRedGateStatus){
playSound("gate");
};
if (blueGateStatus != previousBlueGateStatus){
playSound("gate");
};
if (greenGateStatus != previousGreenGateStatus){
playSound("gate");
};
previousBlueGateStatus = blueGateStatus;
previousRedGateStatus = redGateStatus;
previousGreenGateStatus = greenGateStatus;
_local9 = (wizWheel.px - wazWheel.px);
_local10 = (wizWheel.py - wazWheel.py);
_local11 = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_local11 = (_local11 - 34);
gravBeam.scaleX = (_local11 / 170);
gravBeam.x = -2;
_local12 = false;
if (((!((_local7 == undefined))) && (!((_local8 == undefined))))){
if ((((_local7.type == "wizGoal")) && ((_local8.type == "wazGoal")))){
_local12 = true;
};
};
if (_local12){
winCount++;
} else {
winCount = 0;
};
_local13 = new Point(0, 0);
if (winCount == 3){
solaMain.showWin();
};
} else {
solaMain.timeLineRef.timer_mc.visible = false;
};
}
public function previousLevelGroup(_arg1:Event){
showPreviousLevelGroup();
}
public function drawColumn(_arg1:Number){
var columnData:XMLList;
var groupedNodeArray:Array;
var startY:Number;
var endY:Number;
var xPos:Number;
var gIndex:Number;
var currentGroup:Array;
var currentWallData:XML;
var tileLength:Number;
var wallType:String;
var wallPiece:*;
var num = _arg1;
columnData = levelXML.vWalls.wPiece.(@x == num);
groupedNodeArray = groupSame(columnData);
startY = -200;
xPos = ((-(levelSize) / 2) + (num * gridSize));
gIndex = 0;
while (gIndex < groupedNodeArray.length) {
currentGroup = groupedNodeArray[gIndex];
currentWallData = currentGroup[0];
tileLength = currentGroup.length;
wallType = currentWallData.@type;
endY = (startY + (tileLength * gridSize));
wallPiece = createWall((xPos - (wallThickness / 2)), startY, (xPos + (wallThickness / 2)), endY, currentWallData);
wallPiece.rowNum = -1;
wallPiece.columnNum = num;
allWallPieces.push(wallPiece);
startY = endY;
gIndex = (gIndex + 1);
};
}
private function hideBubbles(){
solaMain.timeLineRef.bubbleTopLeft.x = -1000;
solaMain.timeLineRef.bubbleTopRight.x = -1000;
solaMain.timeLineRef.bubbleBottomLeft.x = -1000;
solaMain.timeLineRef.bubbleBottomRight.x = -1000;
}
private function buttonRollFunction(_arg1:MouseEvent){
var _local2:GlowFilter;
var _local3:GlowFilter;
var _local4:GlowFilter;
var _local5:GlowFilter;
_local2 = new GlowFilter(11520480, 1, 4, 4, 75, 1, false, false);
_local3 = new GlowFilter(5208997, 1, 4, 4, 75, 1, false, false);
_local4 = new GlowFilter(9961988, 1, 4, 4, 75, 1, false, false);
_local5 = new GlowFilter(0xFF0000, 1, 4, 4, 75, 1, false, false);
levelSelect.mainButton.local.filters = [_local4];
levelSelect.nextButton.local.filters = [_local2];
levelSelect.previousButton.local.filters = [_local2];
switch (_arg1.currentTarget.name){
case "mainButton":
menuItemSelected = 2;
_arg1.currentTarget.local.filters = [_local5];
break;
case "nextButton":
menuItemSelected = 1;
_arg1.currentTarget.local.filters = [_local3];
break;
case "previousButton":
menuItemSelected = 0;
_arg1.currentTarget.local.filters = [_local3];
break;
};
}
public function placeWizWaz(_arg1, _arg2, _arg3, _arg4){
removeParticle(wizWheel);
removeParticle(wazWheel);
createWaz();
createWiz();
wizWheel.px = _arg1;
wizWheel.py = _arg2;
wizWheel.velocity = new Vector(0, 0);
wazWheel.px = _arg3;
wazWheel.py = _arg4;
wazWheel.velocity = new Vector(0, 0);
addParticle(wizWheel);
addParticle(wazWheel);
}
public function rotateByRadian(_arg1:Number):void{
rectComposite.rotateByRadian(_arg1, ctr);
}
public function showBubble(){
var _local1:Point;
var _local2:CircleParticle;
var _local3:Point;
var _local4:MovieClip;
_local1 = new Point(0, 0);
if (currentDialogTarget == "wiz"){
_local2 = wizWheel;
};
if (currentDialogTarget == "waz"){
_local2 = wazWheel;
};
_local3 = _local2.sprite.localToGlobal(_local1);
hideBubbles();
if (_local3.x > 450){
if (_local3.y > 140){
_local4 = solaMain.timeLineRef.bubbleTopLeft;
} else {
_local4 = solaMain.timeLineRef.bubbleBottomLeft;
};
} else {
if (_local3.y > 140){
_local4 = solaMain.timeLineRef.bubbleTopRight;
} else {
_local4 = solaMain.timeLineRef.bubbleBottomRight;
};
};
_local4.dialog_mc.message.text = currentDialogText;
_local4.x = _local3.x;
_local4.y = _local3.y;
}
private function drawColumns(){
var _local1:int;
_local1 = 0;
while (_local1 < 11) {
drawColumn(_local1);
_local1++;
};
}
public function showMenu(_arg1:Event){
trace("showing menu");
levelSelect = null;
showMainMenu();
}
public function drawRow(_arg1:Number){
var rowData:XMLList;
var groupedNodeArray:Array;
var startX:Number;
var endX:Number;
var yPos:Number;
var gIndex:Number;
var currentGroup:Array;
var currentWallData:XML;
var tileLength:Number;
var wallType:String;
var wallPiece:BaseWall;
var num = _arg1;
rowData = levelXML.hWalls.wPiece.(@y == num);
groupedNodeArray = groupSame(rowData);
startX = -200;
yPos = ((-(levelSize) / 2) + (num * gridSize));
gIndex = 0;
while (gIndex < groupedNodeArray.length) {
currentGroup = groupedNodeArray[gIndex];
currentWallData = currentGroup[0];
tileLength = currentGroup.length;
wallType = currentWallData.@type;
endX = (startX + (tileLength * gridSize));
wallPiece = createWall(startX, (yPos - (wallThickness / 2)), endX, (yPos + (wallThickness / 2)), currentWallData);
allWallPieces.push(wallPiece);
wallPiece.rowNum = num;
wallPiece.columnNum = -1;
startX = endX;
gIndex = (gIndex + 1);
};
}
private function closeAllGates(){
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < allWallPieces.length) {
_local2 = allWallPieces[_local1];
if (_local2 != null){
_local2.closeGate();
};
_local1++;
};
}
}
}//package
Section 173
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 174
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 175
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 176
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 177
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 178
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 179
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 180
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 181
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 182
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 183
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 184
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 185
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 186
//SliderThumb_disabledSkin (SliderThumb_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_disabledSkin extends MovieClip {
}
}//package
Section 187
//SliderThumb_downSkin (SliderThumb_downSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_downSkin extends MovieClip {
}
}//package
Section 188
//SliderThumb_overSkin (SliderThumb_overSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_overSkin extends MovieClip {
}
}//package
Section 189
//SliderThumb_upSkin (SliderThumb_upSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_upSkin extends MovieClip {
}
}//package
Section 190
//SliderTick_skin (SliderTick_skin)
package {
import flash.display.*;
public dynamic class SliderTick_skin extends MovieClip {
}
}//package
Section 191
//SliderTrack_disabledSkin (SliderTrack_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderTrack_disabledSkin extends MovieClip {
}
}//package
Section 192
//SliderTrack_skin (SliderTrack_skin)
package {
import flash.display.*;
public dynamic class SliderTrack_skin extends MovieClip {
}
}//package
Section 193
//sndSlap (sndSlap)
package {
import flash.media.*;
public dynamic class sndSlap extends Sound {
}
}//package
Section 194
//SolaRola (SolaRola)
package {
import flash.display.*;
import flash.events.*;
import org.cove.ape.*;
import levelEditor.*;
import com.evilfree.solarola.*;
import flash.net.*;
public class SolaRola extends Sprite {
private var flipKeys:Boolean;
private var pauseMC:PauseMenu;
private var targetRotation:Number;
private var levelName:String;
private var rotationMode:String;
private var levelListXML:XML;
private var bOKToStop:Boolean;
public var timeLineRef:MovieClip;
private var currentMenuSize:uint;
private var bMenuSelected:Boolean;
public var bDeconstructing:Boolean;
private var currentWallType:uint;
public var gravStrength:Number;
private var currentMenuArray:Array;
private var selectedMenuItem:Number;
private var dragRotation:Number;
public var userStatsSO:SharedObject;
private var lEditor:SolaRolaLevelEditor;
public var rotate_mc:MovieClip;
public var playMode:String;
private var bMoveMenuDown:Boolean;
private var gravityForce:VectorForce;
private var popupMC:MovieClip;
private var dragging:Boolean;
public var bInPauseMode:Boolean;
private var keyReceived:Boolean;
private var rotationSpeed:Number;
private var rotationStep:Number;
private var solaWellDone:MovieClip;
public var currentGameQuality:String;
private var lockedAtDegrees:uint;
public var bDisableKeyPresses:Boolean;
private var bMoveMenuUp:Boolean;
private var currentTileType:uint;
private var frameCount:Number;
private var bMenuLock:Boolean;
public var rotator:Rotator;
private var previousMenuSelected:Number;
private var clickX:Number;
private var car:Car;
private var bTestMode:Boolean;
public var overlay_mc:MovieClip;
private var easeAmount:Number;
private var levelXML:XML;
private var currentLevelNum:Number;
private var dragAngle:Number;
private static var colA:uint = 3359795;
public static var cMoreGamesLink:String = "http://www.gimme5games.com?ref=flash_solarola";
private static var colE:uint = 7833719;
private static var colC:uint = 11189179;
private static var colD:uint = 6724010;
public static var cMaxNumberOfLevels:int = 48;
private static var colB:uint = 3368618;
public function SolaRola(_arg1:MovieClip, _arg2:XML, _arg3:Boolean){
rotationSpeed = 0;
rotationStep = 0;
dragging = false;
bDeconstructing = false;
bInPauseMode = false;
bDisableKeyPresses = false;
dragAngle = 0;
dragRotation = 0;
bMenuLock = false;
lockedAtDegrees = 0;
bOKToStop = false;
selectedMenuItem = 0;
previousMenuSelected = 0;
timeLineRef = _arg1;
currentGameQuality = StageQuality.MEDIUM;
timeLineRef.stage.quality = StageQuality.HIGH;
bTestMode = _arg3;
playMode = "play";
levelListXML = _arg2;
overlay_mc = new MovieClip();
rotate_mc = new MovieClip();
addChild(overlay_mc);
addChild(rotate_mc);
easeAmount = 0.2;
gravStrength = 1.5;
flipKeys = false;
keyReceived = false;
targetRotation = 0;
rotationMode = "Key Free Medium";
setBindings();
userStatsSO = SharedObject.getLocal("userStats");
}
public function setRotation(_arg1:Number){
}
public function getCurrentLevel():Number{
return (rotator.currentLevelNum);
}
function controlSchemeSelected(_arg1:Event){
var _local2:String;
_local2 = _arg1.target.selectedItem.label;
setRotationMode(_local2);
}
public function releaseWalls(_arg1:Event){
gravStrength = (-(gravStrength) * 2);
rotator.freeWalls();
}
public function doPause(){
trace(("Pause Engine: " + playMode));
if (playMode == "pause"){
bInPauseMode = false;
setPlayMode("play");
pauseMC.showPauseMenu(false);
} else {
if (((!((rotator.state == "menu"))) && (!((playMode == "winstate"))))){
bInPauseMode = true;
setPlayMode("pause");
pauseMC.showPauseMenu(true);
};
};
}
function globalFrictionChanged(_arg1:Event){
rotator.setGlobalFriction(_arg1.target.value);
}
public function setGravStrength(_arg1:Number){
gravStrength = _arg1;
}
public function loadLevel(_arg1:String, _arg2:String, _arg3:uint, _arg4:uint, _arg5:Number){
var _local6:URLRequest;
var _local7:URLLoader;
currentLevelNum = _arg5;
currentWallType = _arg3;
currentTileType = _arg4;
gravStrength = 1.5;
levelName = _arg2.split(".")[0];
_local6 = new URLRequest((_arg1 + _arg2));
_local7 = new URLLoader();
_local7.load(_local6);
_local7.addEventListener(Event.COMPLETE, levelXMLComplete);
}
function levelXMLComplete(_arg1:Event){
var _local2:Boolean;
levelXML = XML(_arg1.currentTarget.data);
_local2 = false;
if (levelListXML.item[currentLevelNum].@grav == "true"){
_local2 = true;
};
rotator.loadLevel(levelXML, currentLevelNum, _local2);
resetRotation();
}
function wazSurfaceChanged(_arg1:Event){
rotator.setWazFriction(_arg1.target.value);
}
public function doMainMenu(){
bDisableKeyPresses = false;
if (rotator.ropeActive == true){
rotator.toggleRope();
};
rotator.clearLevel();
rotator.showMainMenu();
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:*;
var _local3:*;
if (keyReceived){
return;
};
if (bDisableKeyPresses == true){
return;
};
if (_arg1.keyCode == 88){
keyReceived = true;
};
if (bMenuLock == false){
_local2 = 0.01;
if ((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))){
rotationStep = 0.5;
bMenuSelected = false;
bMoveMenuDown = false;
bMoveMenuUp = false;
rotator.interceptMenuPress(bMoveMenuUp, bMoveMenuDown, bMenuSelected, selectedMenuItem);
} else {
if ((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))){
keyReceived = true;
rotationStep = -0.5;
bMenuSelected = false;
bMoveMenuDown = false;
bMoveMenuUp = false;
rotator.interceptMenuPress(bMoveMenuUp, bMoveMenuDown, bMenuSelected, selectedMenuItem);
};
};
if (flipKeys){
rotationStep = -(rotationStep);
};
};
if (_arg1.keyCode == 38){
if (rotator.currentMenuType != 0){
bMoveMenuUp = true;
selectedMenuItem = -1;
_local3 = 0;
while (_local3 < currentMenuArray.length) {
MovieClip(currentMenuArray[_local3]).gotoAndStop(1);
_local3++;
};
};
} else {
if (_arg1.keyCode == 40){
if (rotator.currentMenuType != 0){
bMoveMenuDown = true;
selectedMenuItem = -1;
_local3 = 0;
while (_local3 < currentMenuArray.length) {
MovieClip(currentMenuArray[_local3]).gotoAndStop(1);
_local3++;
};
};
} else {
if ((((_arg1.keyCode == 13)) || ((_arg1.keyCode == 32)))){
bMenuSelected = true;
};
};
};
}
public function setEditor(_arg1:SolaRolaLevelEditor){
lEditor = _arg1;
}
function resetEngine(_arg1:Event){
if (rotator.state != "run"){
return;
};
reset();
}
public function setFlipKeys(_arg1:Boolean){
flipKeys = _arg1;
}
public function clear(){
gravStrength = 1.5;
}
private function keyUpHandler(_arg1:KeyboardEvent):void{
rotationStep = 0;
bMenuLock = false;
}
function playEngine(_arg1:Event){
setPlayMode("play");
}
private function run(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Boolean;
var _local10:*;
var _local11:*;
keyReceived = false;
timeLineRef.leftIndicator.gotoAndStop(1);
timeLineRef.rightIndicator.gotoAndStop(1);
if ((((playMode == "play")) || ((playMode == "winstate")))){
if ((((bMenuLock == false)) && ((playMode == "play")))){
switch (rotationMode){
case "Mouse Horizontal Drag":
_local2 = this.parent.mouseX;
_local6 = (clickX - _local2);
targetRotation = (dragRotation + (_local6 / 2));
break;
case "Horizontal Mouse Slow":
_local2 = this.parent.mouseX;
if (_local2 < 0){
_local2 = 0;
};
if (_local2 > 580){
_local2 = 580;
};
_local5 = ((_local2 / 580) - 0.5);
targetRotation = (targetRotation + (_local5 * 4));
break;
case "Horizontal Mouse Fast":
_local2 = this.parent.mouseX;
if (_local2 < 0){
_local2 = 0;
};
if (_local2 > 580){
_local2 = 580;
};
_local5 = ((_local2 / 580) - 0.5);
targetRotation = (targetRotation + (_local5 * 10));
break;
case "Mouse Angle":
_local2 = (this.parent.mouseX - (580 / 2));
_local3 = (this.parent.mouseY - (580 / 2));
_local4 = Math.atan2(_local3, _local2);
targetRotation = ((_local4 * 180) / Math.PI);
break;
case "Key Snap Small":
targetRotation = (targetRotation + (rotationStep * 30));
rotationStep = 0;
break;
case "Key Snap Big":
targetRotation = (targetRotation + (rotationStep * 60));
rotationStep = 0;
break;
case "Key Free Slow":
rotationSpeed = (rotationSpeed + rotationStep);
targetRotation = (targetRotation + (rotationSpeed * 3));
rotationSpeed = 0;
break;
case "Key Free Medium":
rotationSpeed = (rotationSpeed + rotationStep);
targetRotation = (targetRotation + (rotationSpeed * 6));
rotationSpeed = 0;
if (rotationStep == -0.5){
timeLineRef.leftIndicator.gotoAndStop(2);
};
if (rotationStep == 0.5){
timeLineRef.rightIndicator.gotoAndStop(2);
};
break;
case "Mouse Angle Drag":
if (dragging){
_local2 = (this.parent.mouseX - (580 / 2));
_local3 = (this.parent.mouseY - (580 / 2));
_local4 = Math.atan2(_local3, _local2);
_local6 = (_local4 - dragAngle);
targetRotation = (dragRotation + ((_local6 * 180) / Math.PI));
if (targetRotation > 180){
targetRotation = (targetRotation - 360);
};
if (targetRotation < -180){
targetRotation = (targetRotation + 360);
};
};
break;
case "Key Free Fast":
rotationSpeed = (rotationSpeed + rotationStep);
targetRotation = (targetRotation + (rotationSpeed * 8));
rotationSpeed = 0;
break;
default:
trace("Control not defined");
break;
};
if (targetRotation > 180){
targetRotation = (targetRotation - 360);
};
if (targetRotation < -180){
targetRotation = (targetRotation + 360);
};
_local6 = (this.rotation - targetRotation);
if (_local6 > 180){
_local6 = (_local6 - 360);
};
if (_local6 < -180){
_local6 = (_local6 + 360);
};
this.rotation = (this.rotation - (_local6 * easeAmount));
} else {
targetRotation = this.rotation;
};
if (rotator.state == "menu"){
_local8 = this.rotation;
if (_local8 < 0){
_local8 = (_local8 + 360);
};
if ((((_local8 < 10)) && ((((lockedAtDegrees < (350 + _local8))) && ((lockedAtDegrees > (_local8 + 10))))))){
bOKToStop = true;
} else {
if ((((_local8 > 350)) && ((((lockedAtDegrees < (_local8 - 10))) && ((lockedAtDegrees > (360 - _local8))))))){
bOKToStop = true;
} else {
if ((((Math.abs((_local8 - lockedAtDegrees)) > 10)) && ((((_local8 >= 10)) && ((_local8 <= 350)))))){
bOKToStop = true;
};
};
};
_local10 = 0;
while (_local10 < currentMenuSize) {
if (rotator.substate == "mainmenu"){
_local7 = ((_local10 / currentMenuSize) * 360);
} else {
_local7 = ((((5 - _local10) / currentMenuSize) * 360) + 60);
};
_local9 = false;
if ((((((_local7 == 0)) && ((((_local8 > 358)) || ((_local8 < 2)))))) && ((bOKToStop == true)))){
_local9 = true;
} else {
if ((((((_local8 > (_local7 - 2))) && ((_local8 < (_local7 + 2))))) && ((bOKToStop == true)))){
_local9 = true;
};
};
if ((((_local9 == true)) && (!((MovieClip(currentMenuArray[_local10]).currentState == 1))))){
bMenuLock = true;
bOKToStop = false;
lockedAtDegrees = _local8;
if (selectedMenuItem != _local10){
selectedMenuItem = _local10;
previousMenuSelected = _local10;
_local11 = 0;
while (_local11 < currentMenuArray.length) {
MovieClip(currentMenuArray[_local11]).gotoAndStop(1);
_local11++;
};
if (MovieClip(currentMenuArray[selectedMenuItem]).currentState == 1){
MovieClip(currentMenuArray[selectedMenuItem]).gotoAndStop(4);
} else {
MovieClip(currentMenuArray[selectedMenuItem]).gotoAndStop(3);
};
rotator.clearInnerMenu();
};
};
_local10++;
};
};
_local4 = (this.rotation / (180 / Math.PI));
gravityForce.vx = (Math.sin(_local4) * gravStrength);
gravityForce.vy = (Math.cos(_local4) * gravStrength);
rotator.newFrame(this.rotation);
APEngine.step();
APEngine.step();
APEngine.paint();
if ((((((bMenuSelected == true)) || ((bMoveMenuDown == true)))) || ((bMoveMenuUp == true)))){
if (playMode != "winstate"){
if (rotator.state == "menu"){
trace(((("Selected: " + bMenuSelected) + " Item: ") + selectedMenuItem));
rotator.interceptMenuPress(bMoveMenuUp, bMoveMenuDown, bMenuSelected, selectedMenuItem);
bMenuSelected = false;
bMoveMenuDown = false;
bMoveMenuUp = false;
} else {
if ((((bMenuSelected == true)) && (!((playMode == "pause"))))){
trace("in pause click");
doPause();
bMenuSelected = false;
};
};
} else {
if (bDisableKeyPresses == false){
solaWellDone.interceptMenuPress(bMoveMenuUp, bMoveMenuDown, bMenuSelected);
bMenuSelected = false;
bMoveMenuDown = false;
bMoveMenuUp = false;
};
};
};
} else {
if (playMode == "pause"){
if ((((((bMenuSelected == true)) || ((bMoveMenuDown == true)))) || ((bMoveMenuUp == true)))){
trace("in pause mode click");
pauseMC.interceptMenuPress(bMoveMenuUp, bMoveMenuDown, bMenuSelected);
bMenuSelected = false;
bMoveMenuDown = false;
bMoveMenuUp = false;
};
} else {
if (playMode == "popupScreen"){
if ((((((bMenuSelected == true)) || ((bMoveMenuDown == true)))) || ((bMoveMenuUp == true)))){
if (bMenuSelected){
if (((!((popupMC == null))) && (timeLineRef.contains(popupMC)))){
timeLineRef.removeChild(popupMC);
};
timeLineRef.stage.focus = null;
if (bInPauseMode == true){
playMode = "pause";
} else {
playMode = "play";
};
};
bMenuSelected = false;
bMoveMenuDown = false;
bMoveMenuUp = false;
};
};
};
};
}
function setLevelGrid(_arg1:Event){
rotator.setLevelGrid(_arg1.target.selected);
}
public function setMenu(_arg1:uint, _arg2:Array){
currentMenuSize = _arg1;
currentMenuArray = _arg2;
}
function gravitySliderChanged(_arg1:Event){
setGravStrength(_arg1.target.value);
}
public function setEasingAmount(_arg1:Number){
easeAmount = _arg1;
}
public function showPopupScreen(_arg1:uint){
playMode = "popupScreen";
if (((!((popupMC == null))) && (timeLineRef.contains(popupMC)))){
timeLineRef.removeChild(popupMC);
};
switch (_arg1){
case 0:
popupMC = new AboutMenuSymbol();
popupMC.receiveLocalText(timeLineRef.localText);
break;
case 1:
popupMC = new CreditsMenuSymbol();
popupMC.receiveLocalText(timeLineRef.localText);
break;
};
popupMC.x = 186;
popupMC.y = 320;
popupMC.closeButton.addEventListener(MouseEvent.CLICK, removePopupScreen);
timeLineRef.addChild(popupMC);
}
public function setBindings(){
timeLineRef.mainMenuButton.addEventListener(MouseEvent.CLICK, loadMainMenu);
timeLineRef.resetButton.addEventListener(MouseEvent.CLICK, resetEngine);
timeLineRef.pauseButton.addEventListener(MouseEvent.CLICK, pauseEngine);
timeLineRef.pauseButton.buttonMode = true;
}
function ropeLengthChanged(_arg1:Event){
rotator.setRopeLength(_arg1.target.value);
}
private function removePopupScreen(_arg1:Event){
if (((!((popupMC == null))) && (timeLineRef.contains(popupMC)))){
timeLineRef.removeChild(popupMC);
};
timeLineRef.stage.focus = null;
if (bInPauseMode == true){
playMode = "pause";
} else {
playMode = "play";
};
}
public function testStats(){
var _local1:Number;
_local1 = 0;
while (_local1 < 48) {
userStatsSO.data[("level" + _local1)] = 1;
_local1++;
};
}
public function loadLevelNumber(_arg1:Number){
var _local2:String;
var _local3:String;
timeLineRef.stage.quality = currentGameQuality;
_local2 = levelListXML.item[_arg1].@label;
_local3 = timeLineRef.levelPath;
loadLevel(_local3, _local2, 0, 0, _arg1);
}
function easingSliderChanged(_arg1:Event){
setEasingAmount(_arg1.target.value);
}
function wizSurfaceChanged(_arg1:Event){
rotator.setWizFriction(_arg1.target.value);
}
public function resetRotator(){
rotator.reset();
}
public function dragHorizontalMouseDown(_arg1:Event){
rotationMode = "Mouse Horizontal Drag";
dragging = true;
clickX = this.parent.mouseX;
dragRotation = this.rotation;
trace("drag house mouse down");
}
function flipKeysChanged(_arg1:Event){
setFlipKeys(_arg1.target.selected);
}
public function setPlayMode(_arg1:String){
trace(("New Play Mode: " + _arg1));
playMode = _arg1;
}
public function reset(){
resetRotation();
rotator.reset();
}
public function clearSelectedMenu(){
var _local1:*;
selectedMenuItem = -1;
_local1 = 0;
while (_local1 < currentMenuArray.length) {
MovieClip(currentMenuArray[_local1]).gotoAndStop(1);
_local1++;
};
}
function toggleFixedRope(_arg1:Event){
rotator.setFixedRopeLength(_arg1.target.selected);
}
public function showWin(){
playMode = "winstate";
solaWellDone.updateWellDoneText();
rotator.setWinState();
rotator.setWellDoneMenuAnchor(solaWellDone);
}
public function getFrameCount():Number{
return (rotator.frameCount);
}
public function rotatorMouseUp(_arg1:Event){
dragging = false;
rotationMode = "Key Free Medium";
trace("rotate mouse up");
}
public function rotatorMouseDown(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:Number;
rotationMode = "Mouse Angle Drag";
dragging = true;
_local2 = (this.parent.mouseX - (580 / 2));
_local3 = (this.parent.mouseY - (580 / 2));
_local4 = Math.atan2(_local3, _local2);
dragAngle = _local4;
dragRotation = this.rotation;
trace("rotate mouse down");
}
public function loadMainMenu(_arg1:Event){
if (bDeconstructing == false){
bDisableKeyPresses = false;
if (playMode == "winstate"){
rotator.clearLevel();
} else {
if (((!((popupMC == null))) && (timeLineRef.contains(popupMC)))){
timeLineRef.removeChild(popupMC);
};
};
if (pauseMC.visible == true){
pauseMC.visible = false;
};
timeLineRef.stage.focus = null;
playMode = "play";
if (rotator.ropeActive == true){
rotator.toggleRope();
};
doMainMenu();
} else {
trace("STILL DECONSTRUCTING");
};
}
public function unListen(){
removeEventListener(Event.ENTER_FRAME, run);
}
public function setRotationMode(_arg1:String){
rotationMode = _arg1;
}
function ropeStrengthChanged(_arg1:Event){
rotator.setRopeStrength(_arg1.target.value);
}
public function ini(){
var _local1:MovieClip;
trace("ini called");
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler, true);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, false);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler, false);
trace("keys bindings complete");
addEventListener(Event.ENTER_FRAME, run);
APEngine.init((1 / 2));
APEngine.container = overlay_mc;
this.x = 294;
this.y = 293;
trace("engine created");
gravityForce = new VectorForce(false, 0, 3);
APEngine.addForce(gravityForce);
trace("creating rotator");
rotator = new Rotator(rotate_mc, bTestMode, this);
trace("rotator done");
rotator.currentTileType = currentTileType;
rotator.currentWallType = currentWallType;
rotator.dragButton1.addEventListener(MouseEvent.MOUSE_DOWN, rotatorMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, rotatorMouseUp);
_local1 = new HDragButton();
_local1.y = 576;
_local1.x = 295;
_local1.visible = false;
this.parent.addChild(_local1);
_local1.addEventListener(MouseEvent.MOUSE_DOWN, dragHorizontalMouseDown);
APEngine.addGroup(rotator);
if (bTestMode){
};
pauseMC = new PauseSymbol();
pauseMC.setSolaRef(this);
pauseMC.receiveLocalText(timeLineRef.localText);
pauseMC.x = 185;
pauseMC.y = 320;
pauseMC.visible = false;
timeLineRef.addChild(pauseMC);
solaWellDone = new WellDone();
solaWellDone.setSolaRef(this);
solaWellDone.receiveLocalText(timeLineRef.localText);
trace("ini complete");
}
public function pauseEngine(_arg1:Event){
doPause();
}
public function resetMenuSelect(){
var _local1:*;
selectedMenuItem = 0;
if (currentMenuArray != null){
_local1 = 0;
while (_local1 < currentMenuArray.length) {
MovieClip(currentMenuArray[_local1]).gotoAndStop(1);
_local1++;
};
MovieClip(currentMenuArray[0]).gotoAndStop(3);
};
}
public function receiveLevelXML(_arg1:XML){
levelListXML = _arg1;
}
public function resetRotation(){
rotation = 0;
targetRotation = 0;
}
}
}//package
Section 195
//StandardWall (StandardWall)
package {
import flash.display.*;
public dynamic class StandardWall extends MovieClip {
public var wl:MovieClip;
public var wm:MovieClip;
public var wr:MovieClip;
}
}//package
Section 196
//TextInput_disabledSkin (TextInput_disabledSkin)
package {
import flash.display.*;
public dynamic class TextInput_disabledSkin extends MovieClip {
}
}//package
Section 197
//TextInput_upSkin (TextInput_upSkin)
package {
import flash.display.*;
public dynamic class TextInput_upSkin extends MovieClip {
}
}//package
Section 198
//TileTrace (TileTrace)
package {
import flash.display.*;
public dynamic class TileTrace extends MovieClip {
public function TileTrace(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 199
//Waz (Waz)
package {
import flash.display.*;
public dynamic class Waz extends MovieClip {
}
}//package
Section 200
//WazGoal (WazGoal)
package {
import com.evilfree.solarola.tiles.*;
public dynamic class WazGoal extends BaseTile {
}
}//package
Section 201
//WazStart (WazStart)
package {
import flash.display.*;
public dynamic class WazStart extends MovieClip {
}
}//package
Section 202
//WellDone (WellDone)
package {
import com.evilfree.solarola.*;
public dynamic class WellDone extends WellDoneMenu {
}
}//package
Section 203
//Wiz (Wiz)
package {
import flash.display.*;
public dynamic class Wiz extends MovieClip {
}
}//package
Section 204
//WizGoal (WizGoal)
package {
import com.evilfree.solarola.tiles.*;
public dynamic class WizGoal extends BaseTile {
}
}//package
Section 205
//WizStart (WizStart)
package {
import flash.display.*;
public dynamic class WizStart extends MovieClip {
}
}//package
Section 206
//vTraceLine (vTraceLine)
package {
import flash.display.*;
public dynamic class vTraceLine extends MovieClip {
}
}//package
Section 207
//VWallBrick (VWallBrick)
package {
import flash.display.*;
public dynamic class VWallBrick extends MovieClip {
}
}//package