Section 1
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import flash.utils.*;
import com.adobe.utils.*;
public class MD5 {
public static var digest:ByteArray;
public static function hash(s:String):String{
var ba:ByteArray = new ByteArray();
ba.writeUTFBytes(s);
return (hashBinary(ba));
}
public static function hashBytes(s:ByteArray):String{
return (hashBinary(s));
}
public static function hashBinary(s:ByteArray):String{
var aa:int;
var bb:int;
var cc:int;
var dd:int;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
var x:Array = createBlocks(s);
var len:int = x.length;
var i:int;
while (i < len) {
aa = a;
bb = b;
cc = c;
dd = d;
a = ff(a, b, c, d, x[int((i + 0))], 7, -680876936);
d = ff(d, a, b, c, x[int((i + 1))], 12, -389564586);
c = ff(c, d, a, b, x[int((i + 2))], 17, 606105819);
b = ff(b, c, d, a, x[int((i + 3))], 22, -1044525330);
a = ff(a, b, c, d, x[int((i + 4))], 7, -176418897);
d = ff(d, a, b, c, x[int((i + 5))], 12, 1200080426);
c = ff(c, d, a, b, x[int((i + 6))], 17, -1473231341);
b = ff(b, c, d, a, x[int((i + 7))], 22, -45705983);
a = ff(a, b, c, d, x[int((i + 8))], 7, 1770035416);
d = ff(d, a, b, c, x[int((i + 9))], 12, -1958414417);
c = ff(c, d, a, b, x[int((i + 10))], 17, -42063);
b = ff(b, c, d, a, x[int((i + 11))], 22, -1990404162);
a = ff(a, b, c, d, x[int((i + 12))], 7, 1804603682);
d = ff(d, a, b, c, x[int((i + 13))], 12, -40341101);
c = ff(c, d, a, b, x[int((i + 14))], 17, -1502002290);
b = ff(b, c, d, a, x[int((i + 15))], 22, 1236535329);
a = gg(a, b, c, d, x[int((i + 1))], 5, -165796510);
d = gg(d, a, b, c, x[int((i + 6))], 9, -1069501632);
c = gg(c, d, a, b, x[int((i + 11))], 14, 643717713);
b = gg(b, c, d, a, x[int((i + 0))], 20, -373897302);
a = gg(a, b, c, d, x[int((i + 5))], 5, -701558691);
d = gg(d, a, b, c, x[int((i + 10))], 9, 38016083);
c = gg(c, d, a, b, x[int((i + 15))], 14, -660478335);
b = gg(b, c, d, a, x[int((i + 4))], 20, -405537848);
a = gg(a, b, c, d, x[int((i + 9))], 5, 568446438);
d = gg(d, a, b, c, x[int((i + 14))], 9, -1019803690);
c = gg(c, d, a, b, x[int((i + 3))], 14, -187363961);
b = gg(b, c, d, a, x[int((i + 8))], 20, 1163531501);
a = gg(a, b, c, d, x[int((i + 13))], 5, -1444681467);
d = gg(d, a, b, c, x[int((i + 2))], 9, -51403784);
c = gg(c, d, a, b, x[int((i + 7))], 14, 1735328473);
b = gg(b, c, d, a, x[int((i + 12))], 20, -1926607734);
a = hh(a, b, c, d, x[int((i + 5))], 4, -378558);
d = hh(d, a, b, c, x[int((i + 8))], 11, -2022574463);
c = hh(c, d, a, b, x[int((i + 11))], 16, 1839030562);
b = hh(b, c, d, a, x[int((i + 14))], 23, -35309556);
a = hh(a, b, c, d, x[int((i + 1))], 4, -1530992060);
d = hh(d, a, b, c, x[int((i + 4))], 11, 1272893353);
c = hh(c, d, a, b, x[int((i + 7))], 16, -155497632);
b = hh(b, c, d, a, x[int((i + 10))], 23, -1094730640);
a = hh(a, b, c, d, x[int((i + 13))], 4, 681279174);
d = hh(d, a, b, c, x[int((i + 0))], 11, -358537222);
c = hh(c, d, a, b, x[int((i + 3))], 16, -722521979);
b = hh(b, c, d, a, x[int((i + 6))], 23, 76029189);
a = hh(a, b, c, d, x[int((i + 9))], 4, -640364487);
d = hh(d, a, b, c, x[int((i + 12))], 11, -421815835);
c = hh(c, d, a, b, x[int((i + 15))], 16, 530742520);
b = hh(b, c, d, a, x[int((i + 2))], 23, -995338651);
a = ii(a, b, c, d, x[int((i + 0))], 6, -198630844);
d = ii(d, a, b, c, x[int((i + 7))], 10, 1126891415);
c = ii(c, d, a, b, x[int((i + 14))], 15, -1416354905);
b = ii(b, c, d, a, x[int((i + 5))], 21, -57434055);
a = ii(a, b, c, d, x[int((i + 12))], 6, 1700485571);
d = ii(d, a, b, c, x[int((i + 3))], 10, -1894986606);
c = ii(c, d, a, b, x[int((i + 10))], 15, -1051523);
b = ii(b, c, d, a, x[int((i + 1))], 21, -2054922799);
a = ii(a, b, c, d, x[int((i + 8))], 6, 1873313359);
d = ii(d, a, b, c, x[int((i + 15))], 10, -30611744);
c = ii(c, d, a, b, x[int((i + 6))], 15, -1560198380);
b = ii(b, c, d, a, x[int((i + 13))], 21, 1309151649);
a = ii(a, b, c, d, x[int((i + 4))], 6, -145523070);
d = ii(d, a, b, c, x[int((i + 11))], 10, -1120210379);
c = ii(c, d, a, b, x[int((i + 2))], 15, 718787259);
b = ii(b, c, d, a, x[int((i + 9))], 21, -343485551);
a = (a + aa);
b = (b + bb);
c = (c + cc);
d = (d + dd);
i = (i + 16);
};
digest = new ByteArray();
digest.writeInt(a);
digest.writeInt(b);
digest.writeInt(c);
digest.writeInt(d);
digest.position = 0;
return ((((IntUtil.toHex(a) + IntUtil.toHex(b)) + IntUtil.toHex(c)) + IntUtil.toHex(d)));
}
private static function f(x:int, y:int, z:int):int{
return (((x & y) | (~(x) & z)));
}
private static function g(x:int, y:int, z:int):int{
return (((x & z) | (y & ~(z))));
}
private static function h(x:int, y:int, z:int):int{
return (((x ^ y) ^ z));
}
private static function i(x:int, y:int, z:int):int{
return ((y ^ (x | ~(z))));
}
private static function transform(func:Function, a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{
var tmp:int = (((a + int(func(b, c, d))) + x) + t);
return ((IntUtil.rol(tmp, s) + b));
}
private static function ff(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{
return (transform(f, a, b, c, d, x, s, t));
}
private static function gg(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{
return (transform(g, a, b, c, d, x, s, t));
}
private static function hh(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{
return (transform(h, a, b, c, d, x, s, t));
}
private static function ii(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{
return (transform(i, a, b, c, d, x, s, t));
}
private static function createBlocks(s:ByteArray):Array{
var blocks:Array = new Array();
var len:int = (s.length * 8);
var mask = 0xFF;
var i:int;
while (i < len) {
blocks[int((i >> 5))] = (blocks[int((i >> 5))] | ((s[(i / 8)] & mask) << (i % 32)));
i = (i + 8);
};
blocks[int((len >> 5))] = (blocks[int((len >> 5))] | (128 << (len % 32)));
blocks[int(((((len + 64) >>> 9) << 4) + 14))] = len;
return (blocks);
}
}
}//package com.adobe.crypto
Section 2
//PNGEncoder (com.adobe.images.PNGEncoder)
package com.adobe.images {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class PNGEncoder {
private static var crcTable:Array;
private static var crcTableComputed:Boolean = false;
public static function encode(img:BitmapData):ByteArray{
var p:uint;
var j:int;
var png:ByteArray = new ByteArray();
png.writeUnsignedInt(2303741511);
png.writeUnsignedInt(218765834);
var IHDR:ByteArray = new ByteArray();
IHDR.writeInt(img.width);
IHDR.writeInt(img.height);
IHDR.writeUnsignedInt(134610944);
IHDR.writeByte(0);
writeChunk(png, 1229472850, IHDR);
var IDAT:ByteArray = new ByteArray();
var i:int;
while (i < img.height) {
IDAT.writeByte(0);
if (!img.transparent){
j = 0;
while (j < img.width) {
p = img.getPixel(j, i);
IDAT.writeUnsignedInt(uint((((p & 0xFFFFFF) << 8) | 0xFF)));
j++;
};
} else {
j = 0;
while (j < img.width) {
p = img.getPixel32(j, i);
IDAT.writeUnsignedInt(uint((((p & 0xFFFFFF) << 8) | (p >>> 24))));
j++;
};
};
i++;
};
IDAT.compress();
writeChunk(png, 1229209940, IDAT);
writeChunk(png, 1229278788, null);
return (png);
}
private static function writeChunk(png:ByteArray, type:uint, data:ByteArray):void{
var c:uint;
var n:uint;
var k:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
n = 0;
while (n < 0x0100) {
c = n;
k = 0;
while (k < 8) {
if ((c & 1)){
c = uint((uint(3988292384) ^ uint((c >>> 1))));
} else {
c = uint((c >>> 1));
};
k++;
};
crcTable[n] = c;
n++;
};
};
var len:uint;
if (data != null){
len = data.length;
};
png.writeUnsignedInt(len);
var p:uint = png.position;
png.writeUnsignedInt(type);
if (data != null){
png.writeBytes(data);
};
var e:uint = png.position;
png.position = p;
c = 4294967295;
var i:int;
while (i < (e - p)) {
c = uint((crcTable[((c ^ png.readUnsignedByte()) & uint(0xFF))] ^ uint((c >>> 8))));
i++;
};
c = uint((c ^ uint(4294967295)));
png.position = e;
png.writeUnsignedInt(c);
}
}
}//package com.adobe.images
Section 3
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public static function encode(o:Object):String{
var encoder:JSONEncoder = new JSONEncoder(o);
return (encoder.getString());
}
public static function decode(s:String){
var decoder:JSONDecoder = new JSONDecoder(s);
return (decoder.getValue());
}
}
}//package com.adobe.serialization.json
Section 4
//JSONDecoder (com.adobe.serialization.json.JSONDecoder)
package com.adobe.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(s:String){
super();
this.tokenizer = new JSONTokenizer(s);
this.nextToken();
this.value = this.parseValue();
}
public function getValue(){
return (this.value);
}
private function nextToken():JSONToken{
return ((this.token = this.tokenizer.getNextToken()));
}
private function parseArray():Array{
var a:Array = new Array();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACKET){
return (a);
};
while (true) {
a.push(this.parseValue());
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACKET){
return (a);
};
if (this.token.type == JSONTokenType.COMMA){
this.nextToken();
} else {
this.tokenizer.parseError(("Expecting ] or , but found " + this.token.value));
};
};
return (null);
}
private function parseObject():Object{
var key:String;
var o:Object = new Object();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACE){
return (o);
};
while (true) {
if (this.token.type == JSONTokenType.STRING){
key = String(this.token.value);
this.nextToken();
if (this.token.type == JSONTokenType.COLON){
this.nextToken();
o[key] = this.parseValue();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACE){
return (o);
};
if (this.token.type == JSONTokenType.COMMA){
this.nextToken();
} else {
this.tokenizer.parseError(("Expecting } or , but found " + this.token.value));
};
} else {
this.tokenizer.parseError(("Expecting : but found " + this.token.value));
};
} else {
this.tokenizer.parseError(("Expecting string but found " + this.token.value));
};
};
return (null);
}
private function parseValue():Object{
if (this.token == null){
this.tokenizer.parseError("Unexpected end of input");
};
switch (this.token.type){
case JSONTokenType.LEFT_BRACE:
return (this.parseObject());
case JSONTokenType.LEFT_BRACKET:
return (this.parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (this.token.value);
default:
this.tokenizer.parseError(("Unexpected " + this.token.value));
};
return (null);
}
}
}//package com.adobe.serialization.json
Section 5
//JSONEncoder (com.adobe.serialization.json.JSONEncoder)
package com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(value){
super();
this.jsonString = this.convertToString(value);
}
public function getString():String{
return (this.jsonString);
}
private function convertToString(value):String{
if ((value is String)){
return (this.escapeString((value as String)));
};
if ((value is Number)){
return ((isFinite((value as Number))) ? value.toString() : "null");
} else {
if ((value is Boolean)){
return ((value) ? "true" : "false");
} else {
if ((value is Array)){
return (this.arrayToString((value as Array)));
};
if ((((value is Object)) && (!((value == null))))){
return (this.objectToString(value));
};
};
};
return ("null");
}
private function escapeString(str:String):String{
var ch:String;
var hexCode:String;
var zeroPad:String;
var s:String = "";
var len:Number = str.length;
var i:int;
while (i < len) {
ch = str.charAt(i);
switch (ch){
case "\"":
s = (s + "\\\"");
break;
case "\\":
s = (s + "\\\\");
break;
case "\b":
s = (s + "\\b");
break;
case "\f":
s = (s + "\\f");
break;
case "\n":
s = (s + "\\n");
break;
case "\r":
s = (s + "\\r");
break;
case "\t":
s = (s + "\\t");
break;
default:
if (ch < " "){
hexCode = ch.charCodeAt(0).toString(16);
zeroPad = ((hexCode.length == 2)) ? "00" : "000";
s = (s + (("\\u" + zeroPad) + hexCode));
} else {
s = (s + ch);
};
};
i++;
};
return ((("\"" + s) + "\""));
}
private function arrayToString(a:Array):String{
var s:String = "";
var i:int;
while (i < a.length) {
if (s.length > 0){
s = (s + ",");
};
s = (s + this.convertToString(a[i]));
i++;
};
return ((("[" + s) + "]"));
}
private function objectToString(o:Object):String{
var value:Object;
var key:String;
var v:XML;
var o = o;
var s = "";
var classInfo:XML = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((this.escapeString(key) + ":") + this.convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((this.escapeString(v.@name.toString()) + ":") + this.convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
}
}//package com.adobe.serialization.json
Section 6
//JSONParseError (com.adobe.serialization.json.JSONParseError)
package com.adobe.serialization.json {
public class JSONParseError extends Error {
private var _location:int;
private var _text:String;
public function JSONParseError(message:String="", location:int=0, text:String=""){
super(message);
name = "JSONParseError";
this._location = location;
this._text = text;
}
public function get location():int{
return (this._location);
}
public function get text():String{
return (this._text);
}
}
}//package com.adobe.serialization.json
Section 7
//JSONToken (com.adobe.serialization.json.JSONToken)
package com.adobe.serialization.json {
public class JSONToken {
private var _type:int;
private var _value:Object;
public function JSONToken(type:int=-1, value:Object=null){
super();
this._type = type;
this._value = value;
}
public function get type():int{
return (this._type);
}
public function set type(value:int):void{
this._type = value;
}
public function get value():Object{
return (this._value);
}
public function set value(v:Object):void{
this._value = v;
}
}
}//package com.adobe.serialization.json
Section 8
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer)
package com.adobe.serialization.json {
public class JSONTokenizer {
private var obj:Object;
private var jsonString:String;
private var loc:int;
private var ch:String;
public function JSONTokenizer(s:String){
super();
this.jsonString = s;
this.loc = 0;
this.nextChar();
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var token:JSONToken = new JSONToken();
this.skipIgnored();
switch (this.ch){
case "{":
token.type = JSONTokenType.LEFT_BRACE;
token.value = "{";
this.nextChar();
break;
case "}":
token.type = JSONTokenType.RIGHT_BRACE;
token.value = "}";
this.nextChar();
break;
case "[":
token.type = JSONTokenType.LEFT_BRACKET;
token.value = "[";
this.nextChar();
break;
case "]":
token.type = JSONTokenType.RIGHT_BRACKET;
token.value = "]";
this.nextChar();
break;
case ",":
token.type = JSONTokenType.COMMA;
token.value = ",";
this.nextChar();
break;
case ":":
token.type = JSONTokenType.COLON;
token.value = ":";
this.nextChar();
break;
case "t":
_local2 = ((("t" + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local2 == "true"){
token.type = JSONTokenType.TRUE;
token.value = true;
this.nextChar();
} else {
this.parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + this.nextChar()) + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local3 == "false"){
token.type = JSONTokenType.FALSE;
token.value = false;
this.nextChar();
} else {
this.parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local4 == "null"){
token.type = JSONTokenType.NULL;
token.value = null;
this.nextChar();
} else {
this.parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
token = this.readString();
break;
default:
if (((this.isDigit(this.ch)) || ((this.ch == "-")))){
token = this.readNumber();
} else {
if (this.ch == ""){
return (null);
};
this.parseError((("Unexpected " + this.ch) + " encountered"));
};
};
return (token);
}
private function readString():JSONToken{
var _local5:String;
var i:int;
var token:JSONToken = new JSONToken();
token.type = JSONTokenType.STRING;
var string:String = "";
this.nextChar();
while (((!((this.ch == "\""))) && (!((this.ch == ""))))) {
if (this.ch == "\\"){
this.nextChar();
switch (this.ch){
case "\"":
string = (string + "\"");
break;
case "/":
string = (string + "/");
break;
case "\\":
string = (string + "\\");
break;
case "b":
string = (string + "\b");
break;
case "f":
string = (string + "\f");
break;
case "n":
string = (string + "\n");
break;
case "r":
string = (string + "\r");
break;
case "t":
string = (string + "\t");
break;
case "u":
_local5 = "";
i = 0;
while (i < 4) {
if (!this.isHexDigit(this.nextChar())){
this.parseError((" Excepted a hex digit, but found: " + this.ch));
};
_local5 = (_local5 + this.ch);
i++;
};
string = (string + String.fromCharCode(parseInt(_local5, 16)));
break;
default:
string = (string + ("\\" + this.ch));
};
} else {
string = (string + this.ch);
};
this.nextChar();
};
if (this.ch == ""){
this.parseError("Unterminated string literal");
};
this.nextChar();
token.value = string;
return (token);
}
private function readNumber():JSONToken{
var token:JSONToken = new JSONToken();
token.type = JSONTokenType.NUMBER;
var input:String = "";
if (this.ch == "-"){
input = (input + "-");
this.nextChar();
};
if (!this.isDigit(this.ch)){
this.parseError("Expecting a digit");
};
if (this.ch == "0"){
input = (input + this.ch);
this.nextChar();
if (this.isDigit(this.ch)){
this.parseError("A digit cannot immediately follow 0");
};
} else {
while (this.isDigit(this.ch)) {
input = (input + this.ch);
this.nextChar();
};
};
if (this.ch == "."){
input = (input + ".");
this.nextChar();
if (!this.isDigit(this.ch)){
this.parseError("Expecting a digit");
};
while (this.isDigit(this.ch)) {
input = (input + this.ch);
this.nextChar();
};
};
if ((((this.ch == "e")) || ((this.ch == "E")))){
input = (input + "e");
this.nextChar();
if ((((this.ch == "+")) || ((this.ch == "-")))){
input = (input + this.ch);
this.nextChar();
};
if (!this.isDigit(this.ch)){
this.parseError("Scientific notation number needs exponent value");
};
while (this.isDigit(this.ch)) {
input = (input + this.ch);
this.nextChar();
};
};
var num:Number = Number(input);
if (((isFinite(num)) && (!(isNaN(num))))){
token.value = num;
return (token);
};
this.parseError((("Number " + num) + " is not valid!"));
return (null);
}
private function nextChar():String{
return ((this.ch = this.jsonString.charAt(this.loc++)));
}
private function skipIgnored():void{
var originalLoc:int;
do {
originalLoc = this.loc;
this.skipWhite();
this.skipComments();
} while (originalLoc != this.loc);
}
private function skipComments():void{
if (this.ch == "/"){
this.nextChar();
switch (this.ch){
case "/":
do {
this.nextChar();
} while (((!((this.ch == "\n"))) && (!((this.ch == "")))));
this.nextChar();
break;
case "*":
this.nextChar();
while (true) {
if (this.ch == "*"){
this.nextChar();
if (this.ch == "/"){
this.nextChar();
break;
};
} else {
this.nextChar();
};
if (this.ch == ""){
this.parseError("Multi-line comment not closed");
};
};
break;
default:
this.parseError((("Unexpected " + this.ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function skipWhite():void{
while (this.isWhiteSpace(this.ch)) {
this.nextChar();
};
}
private function isWhiteSpace(ch:String):Boolean{
return ((((((((ch == " ")) || ((ch == "\t")))) || ((ch == "\n")))) || ((ch == "\r"))));
}
private function isDigit(ch:String):Boolean{
return ((((ch >= "0")) && ((ch <= "9"))));
}
private function isHexDigit(ch:String):Boolean{
var uc:String = ch.toUpperCase();
return (((this.isDigit(ch)) || ((((uc >= "A")) && ((uc <= "F"))))));
}
public function parseError(message:String):void{
throw (new JSONParseError(message, this.loc, this.jsonString));
}
}
}//package com.adobe.serialization.json
Section 9
//JSONTokenType (com.adobe.serialization.json.JSONTokenType)
package com.adobe.serialization.json {
public class JSONTokenType {
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACE:int = 1;
public static const RIGHT_BRACE:int = 2;
public static const LEFT_BRACKET:int = 3;
public static const RIGHT_BRACKET:int = 4;
public static const COLON:int = 6;
public static const TRUE:int = 7;
public static const FALSE:int = 8;
public static const NULL:int = 9;
public static const STRING:int = 10;
public static const NUMBER:int = 11;
}
}//package com.adobe.serialization.json
Section 10
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function rol(x:int, n:int):int{
return (((x << n) | (x >>> (32 - n))));
}
public static function ror(x:int, n:int):uint{
var nn:int = (32 - n);
return (((x << nn) | (x >>> (32 - nn))));
}
public static function toHex(n:int, bigEndian:Boolean=false):String{
var i:int;
var x:int;
var s:String = "";
if (bigEndian){
i = 0;
while (i < 4) {
s = (s + (hexChars.charAt(((n >> (((3 - i) * 8) + 4)) & 15)) + hexChars.charAt(((n >> ((3 - i) * 8)) & 15))));
i++;
};
} else {
x = 0;
while (x < 4) {
s = (s + (hexChars.charAt(((n >> ((x * 8) + 4)) & 15)) + hexChars.charAt(((n >> (x * 8)) & 15))));
x++;
};
};
return (s);
}
}
}//package com.adobe.utils
Section 11
//FlashAd (com.newgrounds.components.FlashAd)
package com.newgrounds.components {
import flash.events.*;
import com.newgrounds.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class FlashAd extends Sprite {
public var background:MovieClip;
private var _showBackground:Boolean;
private var _adURLLoader:URLLoader;
private var _adRect:Sprite;
private var _mask:Shape;
private var _ad:Loader;
private static const DEBUG_AD_URL:String = "http://www.ngads.com/adtest.php";
private static const REMOVED_FROM_STAGE:String = "removedFromStage";
private static var _adResetTime:uint = 0;
private static var _adURL:URLRequest;
public function FlashAd(showBackground:Boolean=true){
super();
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
Security.allowDomain("server.cpmstar.com");
this._adRect = new Sprite();
this._adRect.graphics.beginFill(0);
this._adRect.graphics.moveTo(0, 0);
this._adRect.graphics.lineTo(300, 0);
this._adRect.graphics.lineTo(300, 250);
this._adRect.graphics.lineTo(0, 250);
this._adRect.graphics.lineTo(0, 0);
this._adRect.graphics.endFill();
this._mask = new Shape();
this._mask.graphics.beginFill(0);
this._mask.graphics.moveTo(0, 0);
this._mask.graphics.lineTo(300, 0);
this._mask.graphics.lineTo(300, 250);
this._mask.graphics.lineTo(0, 250);
this._mask.graphics.lineTo(0, 0);
this._mask.graphics.endFill();
addChild(this._adRect);
this._adRect.addChild(this._mask);
this._adRect.visible = false;
x = Math.round(x);
y = Math.round(y);
scaleX = 1;
scaleY = 1;
if (this.background){
if (this.background.ngLinkButton){
this.background.ngLinkButton.addEventListener(MouseEvent.CLICK, this.linkClickHandler);
};
if (this.background.loadingClip){
this.background.loadingClip.visible = false;
};
};
if (API.isFlashVersion(9, 0, 28)){
addEventListener(REMOVED_FROM_STAGE, this.onRemovedFromStage);
};
if (API.adsApproved){
this.loadAdFeed(API.adFeedURL);
} else {
API.addEventListener(APIEvent.ADS_APPROVED, this.onAdsApproved, false, 0, true);
};
this.showBackground = showBackground;
}
public function get showBackground():Boolean{
return (this._showBackground);
}
public function set showBackground(value:Boolean):void{
this._showBackground = value;
if (this.background){
this.background.visible = value;
this._adRect.mask = (value) ? this.background.adMask : null;
};
}
public function removeAd():void{
removeEventListener(REMOVED_FROM_STAGE, this.onRemovedFromStage);
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
if (this._adURLLoader){
this._adURLLoader.close();
//unresolved jump
var _slot1 = e;
};
if (this._adRect){
this._adRect.visible = false;
};
if (this._ad){
trace("[NewgroundsAPI] :: Ad removed");
this._ad.close();
//unresolved jump
var _slot1 = e;
Object(this._ad).unloadAndStop(true);
//unresolved jump
var _slot1 = e;
_ad.unload();
if (this._ad.parent){
this._ad.parent.removeChild(this._ad);
};
};
this._ad = null;
}
private function onAdsApproved(e:APIEvent):void{
API.removeEventListener(APIEvent.ADS_APPROVED, this.onAdsApproved, false);
if (e.success){
this.loadAdFeed(API.adFeedURL);
} else {
trace("[NewgroundsAPI] :: No ad feed URL supplied to Newgrounds API ad!");
};
}
private function loadAdFeed(adFeedURL:String):void{
var adFeedURL = adFeedURL;
this._adURLLoader = new URLLoader();
this._adURLLoader.addEventListener(Event.COMPLETE, this.onAdFeedLoaded);
this._adURLLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
this._adURLLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onAdError);
if (!adFeedURL){
trace("[Newgrounds API] :: Invalid feed URL!");
return;
};
if (this.hasAdElapsed){
if (adFeedURL.indexOf("?") > -1){
_adURL = new URLRequest(((adFeedURL + "&random=") + Math.random()));
} else {
_adURL = new URLRequest(((adFeedURL + "?random=") + Math.random()));
};
};
this._adURLLoader.load(_adURL);
//unresolved jump
var _slot1 = e;
onAdError(null);
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = true;
};
}
private function loadAd(url:String):void{
var url = url;
if (this._ad){
this.removeAd();
};
this._ad = new Loader();
this._ad.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onAdLoaded);
this._ad.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
Object(this._ad.contentLoaderInfo).uncaughtErrorEvents.addEventListener("uncaughtError", function (event:Event):void{
});
//unresolved jump
var _slot1 = error;
this._ad.load(new URLRequest(url), new LoaderContext(false, new ApplicationDomain(null)));
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = true;
};
}
private function onAdFeedLoaded(e:Event):void{
var loader:URLLoader = URLLoader(e.target);
if (((loader.data) && (!((loader.data == ""))))){
this.loadAd((loader.data as String));
} else {
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, false, new APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
};
}
private function onAdFeedError(e:Event):void{
trace("[NewgroundsAPI] :: Unable to load ad feed!");
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
}
private function onAdError(e:Event):void{
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, false, new APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
this.removeAd();
}
private function onAdLoaded(e:Event):void{
this._adRect.addChild(this._ad);
this._ad.mask = this._mask;
this._adRect.visible = true;
if (this.background){
if (this._showBackground){
this._adRect.mask = this.background.adMask;
};
if (this.background.loadingClip){
this.background.loadingClip.visible = false;
};
};
trace("[NewgroundsAPI] :: Ad loaded!");
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, true));
}
private function onRemovedFromStage(e:Event):void{
this.removeAd();
}
private function get hasAdElapsed():Boolean{
if (getTimer() >= _adResetTime){
_adResetTime = (getTimer() + ((1000 * 60) * 5));
return (true);
};
return (false);
}
private function linkClickHandler(event:MouseEvent):void{
API.loadNewgrounds();
}
}
}//package com.newgrounds.components
Section 12
//FlxNGPreloader (com.newgrounds.components.FlxNGPreloader)
package com.newgrounds.components {
import flash.events.*;
import com.newgrounds.*;
import flash.display.*;
import flash.utils.*;
public class FlxNGPreloader extends MovieClip {
public var NewgroundsAPIId:String;
public var NewgroundsAPIEncryptionKey:String;
public var NewgroundsAPIShowAds:Boolean;// = true
public var autoPlay:Boolean;// = false
public var className:String;
protected var _initialized:Boolean;
protected var _preloader:Sprite;
protected var _ad:FlashAd;
protected var _adContainer:Sprite;
protected var _loadBarMask:Shape;
protected var _loadBar:Bitmap;
public function FlxNGPreloader():void{
this._preloader = new Sprite();
this._adContainer = new Sprite();
this._loadBarMask = new Shape();
super();
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
}
protected function create():void{
if (!this.NewgroundsAPIId){
trace("[NewgroundsAPI] :: No API ID set! Please set NewgroundsAPIId in your preloader.");
return;
};
if (this.NewgroundsAPIShowAds){
API.addEventListener(APIEvent.ADS_APPROVED, this.adsApprovedHandler, false, 0, true);
this._adContainer.graphics.beginFill(0);
this._adContainer.graphics.moveTo(-4, -4);
this._adContainer.graphics.lineTo(304, -4);
this._adContainer.graphics.lineTo(304, 254);
this._adContainer.graphics.lineTo(-4, 254);
this._adContainer.graphics.lineTo(-4, -4);
this._adContainer.graphics.endFill();
this._adContainer.scaleX = Math.min(1, (stage.stageWidth / 325));
this._adContainer.scaleY = this._adContainer.scaleX;
};
this._preloader.addChild(this._adContainer);
this._adContainer.visible = false;
var frame:Bitmap = new Bitmap(new FlxLoaderFrame(0, 0));
frame.y = 260;
this._preloader.addChild(frame);
this._loadBarMask.graphics.beginFill(0);
this._loadBarMask.graphics.lineTo(304, 0);
this._loadBarMask.graphics.lineTo(304, 70);
this._loadBarMask.graphics.lineTo(0, 70);
this._loadBarMask.graphics.lineTo(0, 0);
this._loadBarMask.graphics.endFill();
this._loadBarMask.scaleX = 0;
this._loadBarMask.y = frame.y;
this._preloader.addChild(this._loadBarMask);
this._loadBar = new Bitmap(new FlxLoaderBar(0, 0));
this._loadBar.y = frame.y;
this._preloader.addChild(this._loadBar);
this._loadBar.mask = this._loadBarMask;
addChild(this._preloader);
this._preloader.x = ((stage.stageWidth - this._preloader.width) / 2);
this._preloader.y = ((stage.stageHeight - this._preloader.height) / 2);
API.connect(loaderInfo, this.NewgroundsAPIId, this.NewgroundsAPIEncryptionKey);
this._initialized = true;
}
protected function createMedalPopup(x:Number, y:Number):void{
var popup:MedalPopup = new MedalPopup();
popup.x = x;
popup.y = y;
addChild(popup);
}
protected function enterFrameHandler(event:Event):void{
var button:Sprite;
if (!this._initialized){
if (stage){
this.create();
};
return;
};
var percent:Number = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
this._loadBarMask.scaleX = (uint((percent * 200)) / 200);
if (percent >= 1){
removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
if (this.autoPlay){
this.startGame();
} else {
button = new Sprite();
button.addChild(new Bitmap(new FlxLoaderPlay(0, 0)));
button.x = this._loadBarMask.x;
button.y = this._loadBarMask.y;
button.buttonMode = true;
this._loadBar.visible = false;
button.addEventListener(MouseEvent.CLICK, this.playButtonClickHandler);
this._preloader.addChild(button);
};
};
}
protected function startGame():void{
var app:Object;
nextFrame();
var mainClass:Class = Class(getDefinitionByName(this.className));
if (mainClass){
app = new (mainClass);
addChild((app as DisplayObject));
};
removeChild(this._preloader);
if (this._ad){
this._ad.removeAd();
};
this._ad = null;
this._adContainer = null;
this._loadBarMask = null;
this._preloader = null;
}
private function adsApprovedHandler(event:APIEvent):void{
API.removeEventListener(APIEvent.ADS_APPROVED, this.adsApprovedHandler);
if (this._adContainer){
this._ad = new FlashAd(false);
this._adContainer.addChild(this._ad);
this._preloader.addChild(this._adContainer);
this._adContainer.visible = true;
};
}
private function playButtonClickHandler(event:MouseEvent):void{
this.startGame();
}
}
}//package com.newgrounds.components
Section 13
//MedalPopup (com.newgrounds.components.MedalPopup)
package com.newgrounds.components {
import flash.events.*;
import com.newgrounds.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class MedalPopup extends MovieClip {
public var medalNameText:TextField;
public var medalValueText:TextField;
public var medalContainer:Sprite;
private var _initialized:Boolean;
private var _medal:Medal;
private var _medalIcon:Bitmap;
private var _medalQueue:Array;
private var _popDelay:Timer;
public function MedalPopup(){
this._medalQueue = [];
this._popDelay = new Timer(3000, 1);
super();
addFrameScript(0, this.frame1, 9, this.frame10, 18, this.frame19);
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
visible = false;
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
stop();
API.addEventListener(APIEvent.MEDAL_UNLOCKED, this.onMedalUnlocked, false, 0, true);
this._popDelay.addEventListener(TimerEvent.TIMER, this.timerHandler);
}
public function get popupTime():Number{
return ((this._popDelay.delay / 1000));
}
public function set popupTime(n:Number):void{
if (isNaN(n)){
n = 3;
};
this._popDelay.delay = (n * 1000);
}
private function enterFrameHandler(event:Event):void{
var myIndex:uint;
var topIndex:uint;
var event = event;
if (((this._medalQueue.length) && (!(visible)))){
this._medal = this._medalQueue.pop();
this._popDelay.start();
gotoAndPlay("medal_show");
visible = true;
};
if (((visible) && (parent))){
myIndex = parent.getChildIndex(this);
topIndex = (parent.numChildren - 1);
if (myIndex != topIndex){
parent.setChildIndex(this, topIndex);
};
//unresolved jump
var _slot1 = error;
};
}
private function onMedalUnlocked(e:APIEvent):void{
if (((((e.success) && (e.data))) && ((e.data.medal is Medal)))){
this._medalQueue.push(Medal(e.data.medal));
};
}
private function showMedalInfo():void{
if (!this._medal){
return;
};
if (this.medalContainer){
this._medalIcon = this._medal.createIconBitmap();
this.medalContainer.addChild(this._medalIcon);
};
if (this.medalNameText){
this.medalNameText.text = this._medal.name;
};
if (this.medalValueText){
this.medalValueText.text = (this._medal.value.toString() + "pts");
};
this._popDelay.start();
stop();
}
private function timerHandler(event:TimerEvent):void{
if (((this._medalIcon) && (this._medalIcon.parent))){
this._medalIcon.parent.removeChild(this._medalIcon);
this._medalIcon = null;
};
gotoAndPlay("medal_hide");
this._popDelay.stop();
}
function frame1(){
stop();
}
function frame10(){
this.showMedalInfo();
stop();
}
function frame19(){
stop();
visible = false;
}
}
}//package com.newgrounds.components
Section 14
//API (com.newgrounds.API)
package com.newgrounds {
import flash.events.*;
import flash.display.*;
import com.newgrounds.components.*;
import flash.utils.*;
import com.adobe.serialization.json.*;
import flash.net.*;
import com.adobe.crypto.*;
import com.adobe.images.*;
import flash.system.*;
public class API {
public static const VERSION:String = "2.4.18";
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway_v2.php";
private static const AD_TERMS_URL:String = "http://www.newgrounds.com/wiki/flashads/terms/";
private static const COMMANDS_WIKI_URL:String = "http://www.newgrounds.com/wiki/flashapi/commands/";
private static var do_echo:Boolean = false;
private static var _debug:Boolean = true;
private static var _connected:Boolean = false;
private static var _isMetadataLoaded:Boolean = false;
private static var _preloadComplete:Boolean = false;
private static var _adsApproved:Boolean = false;
private static var _saveGroupId:uint;
private static var _saveFileId:uint;
private static var _trackerId:uint;
private static var _movieId:String;
private static var _encryptionKey:String;
private static var _url:String;
private static var _host:String;
private static var connected:Boolean;
private static var version:String;
private static var ad_url:String;
private static var _fakeSession:Boolean = false;
private static var publisher_id:uint;
private static var session_id:String;
private static var user_email:String;
private static var user_name:String;
private static var user_id:uint;
private static var userpage_format:String;
private static var _medals:Array;
private static var timeoutTimer:Timer = new Timer(8000, 1);
private static var _userpageFormat:String;
private static var _scoreboards:Array = new Array();
private static var _bridge:Bridge;
private static var save_file:SaveFile;
private static var _imageFilePath:String;
private static var _saveFilePath:String;
private static var _saveGroups:Array = [];
private static var root:DisplayObject;
private static var _eventDispatcher:EventDispatcher = new EventDispatcher();
private static var score_page_counts:Object = new Object();
private static var compression_radix:String = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
private static var compressor:BaseN = new BaseN(compression_radix);
public static var errors:Dictionary = APIError.init_codes();
private static var sharedObjects:Dictionary = new Dictionary();
private static var _preloadAssets:Array = [];
public static var periods:Object = getPeriodAliases();
private static var period_aliases:Object = {t:{name:"Today", alias:"TODAY"}, p:{name:"Yesterday", alias:"YESTERDAY"}, w:{name:"This Week", alias:"THIS_WEEK"}, m:{name:"This Month", alias:"THIS_MONTH"}, y:{name:"This Year", alias:"THIS_YEAR"}, a:{name:"All-Time", alias:"ALL_TIME"}};
private static var secureCommand:String;
public static function get adFeedURL():String{
return (ad_url);
}
public static function get preloadComplete():Boolean{
return (_preloadComplete);
}
private static function assertConnected():Boolean{
if (!_connected){
return (false);
};
return (true);
}
public static function setVersion(v:String):void{
if (((v) && (!((v == ""))))){
version = v;
};
}
public static function setUserEmail(e:String):void{
user_email = e;
}
public static function setFakeSession(fake:Boolean):void{
_fakeSession = fake;
}
public static function getFakeSession():Boolean{
return (_fakeSession);
}
public static function get debugMode():Boolean{
return (_debug);
}
public static function set debugMode(value:Boolean):void{
_debug = value;
}
public static function getTrackerID():uint{
return (_trackerId);
}
public static function getUserID():uint{
return (user_id);
}
public static function getUserName():String{
return (user_name);
}
public static function isConnected():Boolean{
return (_connected);
}
public static function getID():uint{
return (_trackerId);
}
public static function getOfficialURL():String{
var o_url:String = ((((((GATEWAY_URL + "?tracker_id=") + _movieId) + "&command_id=") + getCommandID("loadOfficalVersion")) + "&seed=") + Math.random());
if (debugMode){
o_url = (o_url + "&debug=1");
};
return (o_url);
}
public static function get adsApproved():Boolean{
return (_adsApproved);
}
public static function hasUserSession():Boolean{
return (((((!((session_id == null))) && (!((session_id == ""))))) && (!((publisher_id == 0)))));
}
public static function isNewgrounds():Boolean{
return ((((publisher_id == 1)) || (((_host) && ((_host.toLowerCase().indexOf("ungrounded.net") > -1))))));
}
public static function hostIsCompatible():Boolean{
return (!((publisher_id == 0)));
}
public static function hasUserEmail():Boolean{
return (((!((user_email == null))) && (!((user_email == "")))));
}
public static function connectionTimeOut(e:Event=null):void{
dispatchEvent(new APIEvent(APIEvent.API_CONNECTED, false, new APIError("CONNECTION_FAILED", "Connection to NewgroundsAPI gateway timed out.")));
}
public static function connect(loaderInfo:LoaderInfo, m_id:String, encrypt_key:String=null):void{
var loaderInfo = loaderInfo;
var m_id = m_id;
var encrypt_key = encrypt_key;
if (!loaderInfo){
fatalError("Null loaderInfo paremeter passed in to connectMovie!", "");
return;
};
if (loaderInfo.loader){
loaderInfo = loaderInfo.loader.loaderInfo;
};
//unresolved jump
var _slot1 = error;
_url = loaderInfo.url;
_host = _url;
if ((((_host.indexOf("http://") > -1)) || ((_host.indexOf("https://") > -1)))){
_host = _host.split("/")[2].toLowerCase();
} else {
_host = "localhost";
};
var flashVars:Object = loaderInfo.parameters;
if (isPublishedHost()){
debugMode = false;
};
if (((!(debugMode)) && (flashVars))){
if (flashVars.NewgroundsAPI_UserName){
user_name = flashVars.NewgroundsAPI_UserName;
};
if (flashVars.NewgroundsAPI_UserID){
user_id = flashVars.NewgroundsAPI_UserID;
};
if (flashVars.NewgroundsAPI_PublisherID){
publisher_id = flashVars.NewgroundsAPI_PublisherID;
} else {
publisher_id = 0;
};
if (flashVars.NewgroundsAPI_UserpageFormat){
_userpageFormat = flashVars.NewgroundsAPI_UserpageFormat;
};
if (flashVars.NewgroundsAPI_SessionID){
session_id = flashVars.NewgroundsAPI_SessionID;
};
if (flashVars.NewgroundsAPI_SaveGroupID){
_saveGroupId = flashVars.NewgroundsAPI_SaveGroupID;
};
if (flashVars.NewgroundsAPI_SaveFileID){
_saveFileId = flashVars.NewgroundsAPI_SaveFileID;
};
if (flashVars.NewgroundsAPI_SandboxID){
_bridge = new Bridge(flashVars.NewgroundsAPI_SandboxID);
};
} else {
publisher_id = 1;
if (_fakeSession){
session_id = "D3bu64p1U53R";
user_id = 10;
user_name = "API-Debugger";
};
};
if (connected){
fatalError("NewgroundsAPI.connect() - connection already in progress", "connect");
return;
};
timeoutTimer.start();
if (!m_id){
fatalError("NewgroundsAPI.connectMovie() - missing required movieId parameter", "connectMovie");
};
_movieId = String(m_id);
_trackerId = uint(_movieId.substring(0, _movieId.indexOf(":")));
_encryptionKey = encrypt_key;
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
private static function getHost():String{
return (_host);
}
public static function isPublishedHost():Boolean{
return (((!((getHost() == "localhost"))) && ((getHost().indexOf("file://") == -1))));
}
public static function loadUserPage(userId:uint=0, userName:String=null):Boolean{
var userPage:String;
if ((((userId == 0)) && ((userName == null)))){
if (hasUserSession()){
userId = user_id;
userName = user_name;
} else {
return (false);
};
};
if (publisher_id == 1){
userPage = (("http://" + userName.toLowerCase()) + ".newgrounds.com");
navigateToURL(new URLRequest(userPage), "_blank");
return (true);
};
if (userpage_format){
userPage = userpage_format;
userPage = userPage.split(":user_id:").join(userId.toString());
userPage = userPage.split(":user_name:").join(escape(userName));
navigateToURL(new URLRequest(userPage), "_blank");
return (true);
};
return (false);
}
public static function loadNewgrounds():void{
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
public static function loadOfficialURL():void{
navigateToURL(new URLRequest(getOfficialURL()));
}
public static function loadMySite():void{
sendCommand("loadMySite", {host:getHost()}, true);
}
public static function loadCustomLink(link:String):void{
sendCommand("loadCustomLink", {host:getHost(), link:link}, true);
}
public static function logCustomEvent(event:String):void{
sendCommand("logCustomEvent", {host:getHost(), event:event});
}
public static function getScoreBoard(name:String):ScoreBoard{
var board:ScoreBoard;
for each (board in _scoreboards) {
if (board.name == name){
return (board);
};
};
return (null);
}
public static function getScoreBoardById(id:uint):ScoreBoard{
var board:ScoreBoard;
for each (board in _scoreboards) {
if (board.id == id){
return (board);
};
};
return (null);
}
public static function postScore(boardName:String, value:uint, tag:String=""):void{
if (((!(boardName)) || ((boardName == "")))){
sendError({command_id:getCommandID("postScore")}, new APIError("MISSING_PARAM", "missing required parameter(s)"));
return;
};
if (tag == null){
tag = "";
};
sendSecureCommand("postScore", {user_name:user_name, board:boardName, value:value, publisher_id:publisher_id, tag:tag});
}
public static function loadScores(boardName:String, period:String=null, tag:String=null):void{
var command_name:String = "loadScores";
var board:ScoreBoard = getScoreBoard(boardName);
if (((!(board)) || (!(board.id)))){
sendError({command_id:getCommandID(command_name)}, new APIError("MISSING_PARAM", "missing required ScoreBoard instance"));
return;
};
var params:Object = {};
params.publisher_id = publisher_id;
if (period){
params.period = period;
} else {
params.period = board.period;
};
params.board = board.id;
params.num_results = board.num_results;
params.page = board.page;
if (((!(tag)) || ((tag == "")))){
params.tag = board.tag;
} else {
params.tag = tag;
};
sendCommand(command_name, params);
}
public static function loadScoresInRange(boardName:String, period:String="All-Time", startRank:uint=1, endRank:uint=10):void{
if (((!(boardName)) || ((boardName == "")))){
sendError({command_id:getCommandID("postScore")}, new APIError("MISSING_PARAM", "missing required parameter(s)"));
return;
};
var scoreboard:ScoreBoard = getScoreBoard(boardName);
if (scoreboard){
scoreboard.loadScoresInRange(period, startRank, endRank);
} else {
sendWarning((("loadScoresInRange: Scoreboard " + boardName) + " could not be found."));
};
}
private static function populateMedals(medal_list:Array):void{
var i:uint;
var m:Object;
if (_medals === null){
_medals = new Array();
i = 0;
while (i < medal_list.length) {
m = medal_list[i];
_medals.push(Medal.createFromObject(m));
i++;
};
};
sendMessage("Medals loaded!");
}
private static function populateSaveGroups(saveGroupList:Array):void{
var saveGroup:SaveGroup;
_saveGroups = [];
var i:uint;
while (i < saveGroupList.length) {
saveGroup = SaveGroup.createFromObject(saveGroupList[i]);
_saveGroups.push(saveGroup);
i++;
};
}
private static function populateScoreBoards(scoreBoards:Array):void{
_scoreboards = [];
var i:uint;
while (i < scoreBoards.length) {
_scoreboards.push(new ScoreBoard(scoreBoards[i].id, scoreBoards[i].name, ""));
i++;
};
}
public static function getMedals():Array{
return (_medals);
}
public static function getMedalById(medalId:uint):Medal{
var medal:Medal;
for each (medal in _medals) {
if (medal.id == medalId){
return (medal);
};
};
return (null);
}
public static function getMedal(medalName:String):Medal{
var medal:Medal;
for each (medal in _medals) {
if (medal.name == medalName){
return (medal);
};
};
return (null);
}
public static function unlockMedal(medalName:String):void{
var params:Object;
var medalsUnlocked:Object;
if (((!(medalName)) || ((medalName == "")))){
sendError({command_id:getCommandID("unlockMedal")}, new APIError("MISSING_PARAM", "missing required medal name"));
return;
};
var medal:Medal = getMedal(medalName);
if (!medal){
sendMessage(("No medal with name: " + medalName));
return;
};
if (((hasUserSession()) || (debugMode))){
sendMessage((("Attempting to unlock '" + medal.name) + "'"));
if (medal.unlocked){
sendWarning((("Medal '" + medal.name) + "' is already unlocked!"));
return;
};
params = new Object();
params.medal_id = medal.id;
sendSecureCommand("unlockMedal", params);
} else {
sendMessage(("Locally unlocking " + medal.name));
if (medal.unlocked){
sendWarning((("Medal '" + medal.name) + "' is already unlocked!"));
return;
};
medal.unlocked = true;
medalsUnlocked = loadLocal("medals_unlocked");
if (!medalsUnlocked){
medalsUnlocked = new Object();
};
medalsUnlocked[medal.id.toString()] = true;
saveLocal("medals_unlocked", medalsUnlocked);
callListener(APIEvent.UNLOCK_MEDAL, true, {medal:medal});
};
}
public static function loadMedals():void{
if (_medals){
dispatchEvent(new APIEvent(APIEvent.MEDALS_LOADED, true, {medals:getMedals()}));
return;
};
var params:Object = new Object();
if (hasUserSession()){
params.publisher_id = publisher_id;
params.user_id = user_id;
};
sendCommand("getMedals", params);
}
public static function saveLocal(save_id:String, save_data:Object, size_allocation:uint=0):void{
var sharedObj:SharedObject;
var save_id = save_id;
var save_data = save_data;
var size_allocation = size_allocation;
if (!sharedObjects[save_id]){
sharedObjects[save_id] = SharedObject.getLocal(((("ng_ap_secure_" + _trackerId) + "_") + save_id));
};
sharedObj = sharedObjects[save_id];
sharedObj.data[save_id] = encodeData(save_data);
sharedObj.flush();
//unresolved jump
var _slot1 = e;
sendWarning(("saveLocal ERROR: " + _slot1));
}
public static function loadLocal(save_id:String):Object{
var sharedObj:SharedObject;
var save_id = save_id;
if (!sharedObjects[save_id]){
sharedObjects[save_id] = SharedObject.getLocal(((("ng_ap_secure_" + _trackerId) + "_") + save_id));
};
sharedObj = sharedObjects[save_id];
if (((((sharedObj) && (sharedObj.data))) && (sharedObj.data[save_id]))){
return (decodeData(sharedObj.data[save_id]));
} else {
return (null);
};
//unresolved jump
var _slot1 = e;
sendWarning(("loadLocal ERROR: " + _slot1));
return (null);
}
public static function encodeData(data:Object):String{
return (compressHex(RC4.encrypt(JSON.encode(data), _encryptionKey)));
}
public static function decodeData(base:String){
return (JSON.decode(RC4.decrypt(uncompressHex(base), _encryptionKey)));
}
private static function compressHex(hex_value:String):String{
var offset:uint = (hex_value.length % 6);
var basen_value:String = "";
var i:uint;
while (i < hex_value.length) {
basen_value = (basen_value + compressor.encode(uint(("0x" + hex_value.substr(i, 6))), 4));
i = (i + 6);
};
return ((offset.toString() + basen_value));
}
private static function uncompressHex(base_value:String):String{
var hl:uint;
var chunk:String;
var num:uint;
var hex:String;
var offset:uint = uint(base_value.charAt(0));
var hex_value:String = "";
var i:uint = 1;
while (i < base_value.length) {
chunk = base_value.substr(i, 4);
num = uint(compressor.decode(chunk));
hex = num.toString(16);
if ((i + 4) < base_value.length){
hl = 6;
} else {
hl = offset;
};
while (hex.length < hl) {
hex = ("0" + hex);
};
hex_value = (hex_value + hex);
i = (i + 4);
};
return (hex_value);
}
public static function getSaveGroupById(groupId:uint):SaveGroup{
if (((!(_saveGroups)) || ((_saveGroups.length < 1)))){
sendWarning("No save groups found");
return (null);
};
var i:uint;
while (i < _saveGroups.length) {
if (_saveGroups[i].id == groupId){
return (_saveGroups[i]);
};
i++;
};
return (null);
}
public static function getSaveGroup(groupName:String):SaveGroup{
if (((!(_saveGroups)) || ((_saveGroups.length < 1)))){
sendWarning("No save groups found");
return (null);
};
var i:uint;
while (i < _saveGroups.length) {
if (_saveGroups[i].name == groupName){
return (_saveGroups[i]);
};
i++;
};
return (null);
}
public static function getCurrentSaveFile(){
return (save_file);
}
public static function setCurrentSaveFile(current:SaveFile){
save_file = current;
}
public static function newSaveQuery(groupName:String):SaveGroupQuery{
var group:SaveGroup = getSaveGroup(groupName);
if (group){
return (group.newQuery());
};
return (null);
}
public static function executeSaveQuery(query:SaveGroupQuery):void{
sendCommand("lookupSaveFiles", {publisher_id:publisher_id, group_id:query.groupId, query:JSON.encode(query.toObject())}, false, null, query);
}
public static function lookupSaveFiles(saveGroup:SaveGroup):void{
var query:SaveGroupQuery = saveGroup.getQuery(false);
sendCommand("lookupSaveFiles", {publisher_id:publisher_id, group_id:saveGroup.id, query:query.toObject()}, false, null, query);
}
public static function checkFilePrivledges(file:SaveFile):void{
sendCommand("checkFilePrivs", {group:file.groupId, filename:file.name, user_id:(user_id) ? user_id : 0, publisher_id:publisher_id});
}
public static function newSaveFile(groupName:String):SaveFile{
var group:SaveGroup = getSaveGroup(groupName);
if (group){
return (new SaveFile(group));
};
sendError({command_id:"newSaveFile"}, new APIError("INVALID_SAVE_GROUP", (("'" + group) + "' is not a valid save group.")));
return (null);
}
public static function saveFile(file:SaveFile, overwrite:Boolean=false, draft:Boolean=false):void{
var params:Object = file.toObject();
params.user_name = user_name;
if (file.id){
params.save_id = file.id;
};
params.overwrite = (overwrite) ? 1 : 0;
if (draft){
params.draft = 1;
};
var byteArray:ByteArray = new ByteArray();
if ((file.contents is ByteArray)){
byteArray.writeByte(0);
byteArray.writeBytes(file.contents);
} else {
byteArray.writeByte(1);
byteArray.writeObject(file.contents);
};
byteArray.compress();
var files:Object = new Object();
files.file = byteArray;
if (file.thumbnail){
files.thumbnail = PNGEncoder.encode(file.thumbnail);
};
save_file = file;
sendSecureCommand("saveFile", params, null, files, file);
}
public static function rateSaveFile(file:SaveFile, rating:SaveRating, vote:Number):void{
sendSecureCommand("rateSaveFile", {group:file.groupId, save_id:file.id, rating_id:rating.id, vote:vote, user_id:user_id}, null, null, file);
}
public static function loadSaveFile(save_id:Number, get_contents:Boolean=true){
var packet:Object = {publisher_id:publisher_id, save_id:save_id, get_contents:get_contents};
save_file = null;
sendCommand("loadSaveFile", packet);
}
public static function loadFilesByDate(groupName:String, sortDescending:Boolean=true, keyName:String=null, keyValue=null):void{
var error:*;
var group:SaveGroup = getSaveGroup(groupName);
if (!group){
error = new APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByDate"}, error);
return;
};
var query:SaveGroupQuery = group.newQuery();
if (keyName){
query.addKeyCondition(keyName, "=", keyValue);
};
query.sortOn(SaveGroupQuery.CREATED_ON, sortDescending);
query.execute();
}
public static function loadFilesByViews(groupName:String, sortDescending:Boolean=true, keyName:String=null, keyValue=null):void{
var error:*;
var group:SaveGroup = getSaveGroup(groupName);
if (!group){
error = new APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByViews"}, error);
return;
};
var query:SaveGroupQuery = group.newQuery();
if (keyName){
query.addKeyCondition(keyName, "=", keyValue);
};
query.sortOn(SaveGroupQuery.TOTAL_VIEWS, sortDescending);
query.execute();
}
public static function loadFilesByRating(groupName:String, ratingName:String, sortDescending:Boolean=true, keyName:String=null, keyValue=null):void{
var error:*;
var group:SaveGroup = getSaveGroup(groupName);
if (!group){
error = new APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByDate"}, error);
return;
};
var query:SaveGroupQuery = group.newQuery();
if (keyName){
query.addKeyCondition(keyName, "=", keyValue);
};
query.sortOnRating(ratingName, sortDescending);
query.execute();
}
public static function onRemoteAuthentication(auth_result:String){
var auth_data:Object = JSON.decode(RC4.decrypt(auth_result, _encryptionKey));
user_id = auth_data.NewgroundsAPI_UserID;
user_name = auth_data.NewgroundsAPI_UserName;
session_id = auth_data.NewgroundsAPI_SessionID;
publisher_id = auth_data.NewgroundsAPI_PublisherID;
}
private static function doEvent(e:Object):void{
var msg:String;
var packet:Object;
var user:String;
var _local7:Boolean;
var _local8:ScoreBoard;
var _local9:Array;
var medalsUnlocked:*;
var medalId:String;
var medal:Medal;
var group:SaveGroup;
var bestScores:Object;
var bestRanks:Object;
var numScores:Object;
var file:SaveFile;
var i:uint;
var fileData:Object;
var j:uint;
var error:APIError;
var r:Object;
switch (getCommandName(e.command_id)){
case "connectMovie":
timeoutTimer.stop();
if (e.success){
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage((("Movie identified as \"" + e.movie_name) + "\""));
callListener(APIEvent.API_CONNECTED, e.success, {title:e.movie_name});
} else {
callListener(APIEvent.API_CONNECTED, e.success, {});
return;
};
_local7 = false;
if (e.ad_status === -1){
msg = "This movie was not approved to run Flash Ads.";
sendWarning(msg);
sendWarning((("visit " + AD_TERMS_URL) + " to view our approval guidelines"));
if (!e.ad_url){
callListener(APIEvent.ADS_APPROVED, false, new APIError("FLASH_ADS_NOT_APPROVED", msg));
} else {
_local7 = true;
};
} else {
if (e.ad_status === 0){
msg = "Flash Ads are currently awaiting approval.";
sendNotice(msg);
if (!e.ad_url){
callListener(APIEvent.ADS_APPROVED, false, new APIError("FLASH_ADS_NOT_APPROVED", msg));
} else {
_local7 = true;
};
};
};
if (e.ad_url){
ad_url = unescape(e.ad_url);
if (!_local7){
sendMessage("This movie has been approved to run Flash Ads!");
};
_adsApproved = true;
callListener(APIEvent.ADS_APPROVED, true);
};
if (e.deny_host){
msg = (getHost() + " does not have permission to run this movie!");
sendWarning(msg);
sendWarning(("\tUpdate your API configuration to unblock " + getHost()));
callListener(APIEvent.HOST_BLOCKED, true, {real_url:unescape(e.movie_url), url:getOfficialURL()});
};
if (e.movie_version){
sendWarning("According to your API Configuration, this version is out of date.");
if (version){
sendWarning(("\tThe this movie is version " + version));
};
sendWarning(("\tThe most current version is " + e.movie_version));
callListener(APIEvent.NEW_VERSION_AVAILABLE, true, {version:e.movie_version, real_url:unescape(e.movie_url), url:getOfficialURL()});
};
if (e.request_portal_url){
sendCommand("setPortalID", {portal_url:_url});
};
sendCommand("preloadSettings", {publisher_id:publisher_id, user_id:user_id});
break;
case "preloadSettings":
if (e.medals){
populateMedals(e.medals);
if (((!(hasUserSession())) && (!(debugMode)))){
echo("Checking for SharedObject Medals...");
medalsUnlocked = loadLocal("medals_unlocked");
if (medalsUnlocked){
for (medalId in medalsUnlocked) {
if (medalsUnlocked[medalId]){
medal = getMedalById(uint(medalId));
echo(("Now unlocking " + medal.name));
medal.unlocked = true;
};
};
};
};
};
if (e.save_groups){
populateSaveGroups(e.save_groups);
};
if (e.save_file_path){
_saveFilePath = (e.save_file_path + "/");
};
if (e.image_file_path){
_imageFilePath = (e.image_file_path + "/");
};
if (e.score_boards){
populateScoreBoards(e.score_boards);
};
sendMessage("Metadata loaded!");
callListener(APIEvent.METADATA_LOADED, e.success);
if (((_saveFileId) && (_saveGroupId))){
group = getSaveGroupById(_saveGroupId);
if (group){
callListener(APIEvent.FILE_REQUESTED, true, {save_id:_saveFileId, group:group});
};
};
_preloadComplete = true;
break;
case "logCustomEvent":
if (e.success){
sendMessage((("Event '" + e.event) + "' was logged."));
};
callListener(APIEvent.EVENT_LOGGED, e.success, {event:e.event});
break;
case "postScore":
if (e.success){
user = "User";
if (user_email){
user = user_email;
} else {
if (user_name){
user = user_name;
};
};
_local8 = getScoreBoardById(e.board);
if (_local8){
sendMessage((((((user + " posted ") + e.value) + " to '") + _local8.name) + "'"));
};
if (e.best_scores){
bestScores = {today:e.best_scores.D, yesterday:e.best_scores.P, week:e.best_scores.W, year:e.best_scores.Y, all_time:e.best_scores.A};
} else {
bestScores = {};
};
if (e.best_ranks){
bestRanks = {today:e.best_ranks.D, yesterday:e.best_ranks.P, week:e.best_ranks.W, year:e.best_ranks.Y, all_time:e.best_ranks.A};
} else {
bestRanks = {};
};
if (e.num_scores){
numScores = {today:e.num_scores.D, yesterday:e.num_scores.P, week:e.num_scores.W, year:e.num_scores.Y, all_time:e.num_scores.A};
} else {
numScores = {};
};
packet = {score:e.score, value:e.value, username:user, best_scores:bestScores, best_ranks:bestRanks, num_scores:numScores};
};
callListener(APIEvent.SCORE_POSTED, e.success, packet);
break;
case "loadScores":
packet = new Object();
_local8 = getScoreBoardById(e.board);
if (_local8){
_local8.setScores(e.scores, e.period, e.page, e.num_results, e.num_scores);
};
callListener(APIEvent.SCORES_LOADED, e.success, {board:_local8});
break;
case "unlockMedal":
if (_medals){
medal = getMedal(e.medal_name);
if (medal.unlocked){
return;
};
medal.unlocked = true;
callListener(APIEvent.MEDAL_UNLOCKED, e.success, {medal_id:medal.id, medal:medal});
};
break;
case "getMedals":
if (e.success){
populateMedals(e.medals);
};
callListener(APIEvent.MEDALS_LOADED, e.success, packet);
break;
case "loadSaveFile":
if (e.success){
group = getSaveGroupById(e.group_id);
file = new SaveFile(group);
file.id = e.file.save_id;
file.name = e.file.filename;
file.fileUrl = (_saveFilePath + e.file.file);
file.thumbnailUrl = (_imageFilePath + e.file.thumb);
file.authorName = e.file.user_name;
file.authorId = e.file.user_id;
file.setStatus(e.file.status);
file.description = e.file.description;
file.setFileSize(e.file.file_size);
if (((e.file.keys) && (e.file.keys.length))){
i = 0;
while (i < e.file.keys.length) {
file.setKey(e.file.keys[i].id, e.file.keys[i].value);
i++;
};
};
if (((e.file.ratings) && (e.file.ratings.length))){
i = 0;
while (i < e.file.ratings.length) {
file.setRating(e.file.ratings[i].id, e.file.ratings[i].votes, e.file.ratings[i].score);
i++;
};
};
if (e.get_contents){
file.loadContents();
};
};
save_file = file;
callListener(APIEvent.FILE_INITIALIZED, e.success, {save_id:file.id, file:file});
break;
case "lookupSaveFiles":
_local9 = [];
if (((e.success) && (e.files))){
i = 0;
while (i < e.files.length) {
fileData = e.files[i];
file = new SaveFile(getSaveGroupById(e.group_id));
file.name = fileData.filename;
file.id = fileData.save_id;
file.description = fileData.description;
file.thumbnailUrl = (_imageFilePath + fileData.thumb);
file.fileUrl = (_saveFilePath + fileData.file);
file.authorName = fileData.user_name;
file.authorId = fileData.user_id;
file.setStatus(fileData.status);
file.setFileSize(fileData.file_size);
if (((fileData.keys) && (fileData.keys.length))){
j = 0;
while (j < fileData.keys.length) {
file.setKey(fileData.keys[j].id, fileData.keys[j].value);
j++;
};
};
if (((fileData.ratings) && (fileData.ratings.length))){
j = 0;
while (j < fileData.ratings.length) {
file.setRating(fileData.ratings[j].id, fileData.ratings[j].votes, fileData.ratings[j].score);
j++;
};
};
_local9.push(file);
i++;
};
};
e.owner.setResults(_local9);
e.owner.dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, e.success, {query:e.owner}));
callListener(APIEvent.QUERY_COMPLETE, e.success, {query:e.owner});
break;
case "rateSaveFile":
file = e.owner;
e.success = ((e.success) && (!(e.already_voted)));
if (e.success){
file.setRating(e.rating_id, e.votes, e.score);
};
e.file = file;
if (e.already_voted){
error = new APIError("PERMISSION_DENIED", "You have already voted on this item today");
file.dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, e.success, {error:error, file:file, save_id:file.id}));
callListener(APIEvent.VOTE_COMPLETE, e.success, e);
} else {
r = file.getRating(e.rating_id);
file.dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, e.success, {rating:r, file:file, save_id:file.id}));
API.callListener(APIEvent.VOTE_COMPLETE, e.success, {rating:r, file:file, save_id:file.id});
};
break;
case "saveFile":
packet = {};
if (e.success){
packet = {save_id:e.save_id, filename:e.filename, file_url:e.file_url, thumbnail:e.thumbnail, icon:e.icon};
SaveFile(e.owner).fileSaved(packet);
};
e.owner.dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, e.success, {save_id:save_file.id, file:save_file}));
callListener(APIEvent.FILE_SAVED, e.success, {save_id:save_file.id, file:save_file});
save_file = null;
break;
case "checkFilePrivs":
packet = {filename:e.filename, folder:e.folder, can_read:e.can_read, can_write:e.can_write};
callListener(APIEvent.FILE_PRIVS_LOADED, e.success, packet);
break;
};
}
public static function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:uint=0, useWeakReference:Boolean=false):void{
_eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public static function hasEventListener(type:String):Boolean{
return (_eventDispatcher.hasEventListener(type));
}
public static function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
_eventDispatcher.removeEventListener(type, listener, useCapture);
}
private static function dispatchEvent(event:Event):void{
_eventDispatcher.dispatchEvent(event);
echo(("Fired Event: " + event.type));
}
static function callListener(type:String, success:Boolean=true, data=undefined):void{
dispatchEvent(new APIEvent(type, success, data));
if (_bridge){
_bridge.sendEvent(type, {success:success, data:data});
};
}
private static function getCommandName(id:String):String{
return (id);
}
private static function getCommandID(name:String):String{
return (name);
}
private static function getPeriodAliases():Object{
var i:String;
var aliases:Object = new Object();
for (i in period_aliases) {
aliases[period_aliases[i].alias] = i;
};
return (aliases);
}
public static function getPeriodName(p:String):String{
var i:String;
for (i in period_aliases) {
if (i == p){
return (period_aliases[i].name);
};
};
return (null);
}
public static function getPeriodAlias(p:String):String{
var i:String;
for (i in period_aliases) {
if (i == p){
return (period_aliases[i].alias);
};
};
return (null);
}
private static function sendError(c:Object, e:APIError):void{
var msg:String = ((((("[NewgroundsAPI ERROR] :: " + getCommandName(c.command_id)) + "() - ") + e.name) + ":\n\t\t\t\t") + e.message);
trace(msg);
if (_bridge){
_bridge.sendEvent("trace", {data:msg});
};
}
private static function sendWarning(m:String, c:String=null):void{
if (c){
m = (m + ((("\n[NewgroundsAPI WARNING] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information."));
};
trace(m);
if (_bridge){
_bridge.sendEvent("trace", {data:m});
};
}
private static function sendNotice(m:String, c:String=null):void{
var msg:String;
if (c){
m = (m + ((("\n[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information."));
};
trace(m);
if (_bridge){
_bridge.sendEvent("trace", {data:m});
};
}
private static function fatalError(m:String, c:String):void{
if (c){
m = (m + ((("\n\tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information."));
};
trace(("***ERROR*** class=API\n\n" + m));
}
public static function openLoginPage(){
if (hasUserSession()){
return;
};
}
public static function sendSecureCommand(command:String, secure_params:Object, unsecure_params:Object=null, files:Object=null, owner=null):void{
if (((((!(debugMode)) && (!(hasUserSession())))) && (!(hasUserEmail())))){
sendError({command_id:getCommandID(command)}, new APIError("IDENTIFICATION_REQUIRED", (("You must be logged in or provide an e-mail address ( using NewgroundsAPI.setUserEmail(\"name@domain.com\"); ) to use " + command) + "().")));
return;
};
if (!command){
fatalError("Missing command", "sendSecureCommand");
};
if (!secure_params){
fatalError("Missing secure_params", "sendSecureCommand");
};
if (!unsecure_params){
unsecure_params = new Object();
};
var seed:String = "";
var i:uint;
while (i < 16) {
seed = (seed + compression_radix.charAt(Math.floor((Math.random() * compression_radix.length))));
i++;
};
if (((debugMode) && (!(session_id)))){
secure_params.session_id = "";
} else {
secure_params.session_id = session_id;
};
secure_params.as_version = 3;
secure_params.user_email = user_email;
secure_params.publisher_id = publisher_id;
secure_params.seed = seed;
secure_params.command_id = getCommandID(command);
var hash:String = MD5.hash(seed);
var rc4enc:String = RC4.encrypt(JSON.encode(secure_params), _encryptionKey);
var hex_value:String = (hash + rc4enc);
unsecure_params.secure = compressHex(hex_value);
secureCommand = command;
sendCommand("securePacket", unsecure_params, false, files, owner);
}
public static function stopPendingCommands():void{
SmartURLLoader.closeAll();
}
private static function onCommandComplete(e:Event):void{
var response:Object;
var error:APIError;
var e = e;
var loader:SmartURLLoader = SmartURLLoader(e.target);
echo((("INPUT: \n" + loader.response) + "\n"));
var i:uint;
while (i < _preloadAssets.length) {
if (_preloadAssets[i] == loader){
_preloadAssets.splice(i, 1);
break;
};
i = (i + 1);
};
response = JSON.decode(loader.response);
//unresolved jump
var _slot1 = error;
if (!response){
response = {command_id:loader._command, success:false};
};
response.owner = loader.owner;
if (((!(response)) || (!(response.success)))){
if (response.command_id == "connectMovie"){
connected = false;
};
error = new APIError(response.error_code, response.error_msg);
sendError(response, error);
if (response.command_id){
doEvent(response);
};
} else {
doEvent(response);
};
}
private static function onCommandError(e:Event):void{
var response:Object = {success:false};
var loader:SmartURLLoader = SmartURLLoader(e.target);
response.owner = loader.owner;
var i:uint;
while (i < _preloadAssets.length) {
if (_preloadAssets[i] == loader){
_preloadAssets.splice(i, 1);
break;
};
i++;
};
if (loader._command){
response.command_id = loader._command;
if (response.command_id == "connectMovie"){
connected = false;
};
doEvent(response);
};
}
private static function sendCommand(command:String, params:Object, openBrowser:Boolean=false, files:Object=null, owner=null):void{
var msg:String;
var key:String;
var name:String;
if (((!(connected)) && (!((command == "connectMovie"))))){
msg = (("NewgroundsAPI." + command) + "() - NewgroundsAPI.connectMovie() must be called before this command can be called\n");
fatalError(msg, "connectMovie");
};
var loader:SmartURLLoader = new SmartURLLoader();
loader.addVariable("command_id", getCommandID(command));
loader.addVariable("tracker_id", _movieId);
if (debugMode){
loader.addVariable("debug", 1);
};
if (params){
for (key in params) {
loader.addVariable(key, params[key]);
};
};
if (files){
for (name in files) {
loader.addFile(name, files[name], name);
};
};
if (openBrowser){
loader.method = URLRequestMethod.GET;
} else {
loader.method = URLRequestMethod.POST;
};
loader.preventCache = true;
if (openBrowser){
loader.openBrowser = true;
loader.method = URLRequestMethod.GET;
} else {
loader.addEventListener(Event.COMPLETE, onCommandComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, onCommandError);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onCommandError);
loader.method = URLRequestMethod.POST;
};
if (params.secure){
loader._command = secureCommand;
} else {
loader._command = getCommandID(command);
};
loader.owner = owner;
loader.load(GATEWAY_URL);
}
public static function isFlashVersion(major:uint, minor:uint=0, buildNumber:uint=0, internalBuildNumber:uint=0):Boolean{
var version:Array = Capabilities.version.split(" ")[1].split(",");
var requiredVersion:Array = arguments;
var i:uint;
while (i < requiredVersion.length) {
version[i] = uint(version[i]);
i++;
};
i = 0;
while (i < requiredVersion.length) {
if (version[i] > requiredVersion[i]){
return (true);
};
if (version[i] < requiredVersion[i]){
return (false);
};
i++;
};
return (true);
}
public static function createAd():FlashAd{
sendMessage("You may see a security sandbox violation. This is normal!");
return (new FlashAd());
}
public static function sendMessage(m:String, r:Boolean=false):void{
var msg:String = ("[NewgroundsAPI] :: " + m);
trace(msg);
if (_bridge){
_bridge.sendEvent("trace", {data:msg});
};
}
private static function echo(m:String):void{
if (do_echo){
trace(m);
};
}
}
}//package com.newgrounds
Section 15
//APIError (com.newgrounds.APIError)
package com.newgrounds {
import flash.utils.*;
public class APIError {
public var code:Number;// = 0
public var message:String;
public var name:String;
public var alias:String;
public static const aliases:Array = new Array("UNKNOWN_ERROR", "INVALID_API_ID", "MISSING_PARAM", "INVALID_STAT_ID", "INVALID_COMMAND_ID", "FLASH_ADS_NOT_APPROVED", "PERMISSION_DENIED", "IDENTIFICATION_REQUIRED", "INVALID_EMAIL_ADDRESS", "BANNED_USER", "SESSION_EXPIRED", "INVALID_SCORE", "INVALID_MEDAL", "INVALID_FOLDER", "FILE_NOT_FOUND", "SITE_ID_REQUIRED", "UPLOAD_IN_PROGRESS", "USER_CANCELLED", "CONFIRM_REQUEST", "CONNECTION_FAILED");
private static const always_caps:Array = new Array("API", "URL", "ID");
public static const error_codes:Object = init_codes();
public static const error_names:Object = init_names();
public function APIError(error, msg:String){
super();
if ((error is String)){
error = error_codes[error];
} else {
if (!(error is uint)){
error = 0;
};
};
this.code = error;
this.message = msg;
this.name = error_names[error];
this.alias = aliases[error];
}
public function isError():Boolean{
return (true);
}
public static function init_codes():Dictionary{
var result:Dictionary = new Dictionary();
var i:uint;
while (i < aliases.length) {
result[aliases[i]] = i;
i++;
};
return (result);
}
private static function init_names():Array{
var alias_parts:Array;
var a:uint;
var c:String;
var result:Array = new Array();
var i:uint;
while (i < aliases.length) {
alias_parts = aliases[i].toLowerCase().split("_");
a = 0;
while (a < alias_parts.length) {
alias_parts[a] = (alias_parts[a].substr(0, 1).toUpperCase() + alias_parts[a].substr(1, alias_parts[a].length));
for each (c in always_caps) {
if (alias_parts[a].toUpperCase() == c){
alias_parts[a] = alias_parts[a].toUpperCase();
};
};
a++;
};
result[i] = alias_parts.join(" ");
i++;
};
return (result);
}
}
}//package com.newgrounds
Section 16
//APIEvent (com.newgrounds.APIEvent)
package com.newgrounds {
import flash.events.*;
public class APIEvent extends Event {
private var _data;
private var _success:Boolean;
private var _target;
private var _error:APIError;
public static const API_CONNECTED:String = "movieConnected";
public static const ADS_APPROVED:String = "adsApproved";
public static const AD_ATTACHED:String = "adAttached";
public static const HOST_BLOCKED:String = "hostBlocked";
public static const NEW_VERSION_AVAILABLE:String = "newVersionAvailable";
public static const EVENT_LOGGED:String = "eventLogged";
public static const SCORE_POSTED:String = "scorePosted";
public static const SCORES_LOADED:String = "scoresLoaded";
public static const UNLOCK_MEDAL:String = "unlockMedal";
public static const MEDAL_UNLOCKED:String = "medalUnlocked";
public static const MEDALS_LOADED:String = "medalsLoaded";
public static const METADATA_LOADED:String = "metadataLoaded";
public static const FILE_PRIVS_LOADED:String = "filePrivsLoaded";
public static const FILE_SAVED:String = "fileSaved";
public static const FILE_LOADED:String = "fileLoaded";
public static const FILE_INITIALIZED:String = "fileInitialized";
public static const FILE_REQUESTED:String = "fileRequested";
public static const QUERY_COMPLETE:String = "queryComplete";
public static const VOTE_COMPLETE:String = "voteComplete";
public function APIEvent(type:String, success:Boolean=true, data=undefined){
super(type);
this._data = data;
this._success = success;
}
public function get success():Boolean{
return (this._success);
}
public function get data(){
return (this._data);
}
}
}//package com.newgrounds
Section 17
//BaseN (com.newgrounds.BaseN)
package com.newgrounds {
import flash.utils.*;
public class BaseN {
private var _hashIndex:String;
private var _hashVal:Dictionary;
private var _base:Number;
public function BaseN(hash:String=null){
super();
if (hash){
this._hashIndex = hash;
} else {
this._hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
};
this._base = this._hashIndex.length;
this._hashVal = new Dictionary();
var i:uint;
while (i < this._base) {
this._hashVal[this._hashIndex.charAt(i)] = i;
i++;
};
}
public function encode(n:Number, minchars:uint=1):String{
var s:String = n.toString();
var str:String = "";
if (s.charAt(0) == "-"){
str = "-";
s = s.substring(1);
};
var halves:Array = s.split(".", 2);
str = (str + this.baseNEncoder(halves[0], minchars));
if (halves.length > 1){
str = (str + ("." + this.baseNEncoder(halves[1])));
};
return (str);
}
public function decode(s:String):Number{
var val:String = "";
if (s.charAt(0) == "-"){
val = "-";
s = s.substring(1);
};
var halves:Array = s.split(".", 2);
val = (val + this.baseNDecoder(halves[0]));
if (halves.length > 1){
val = (val + ".");
val = (val + this.baseNDecoder(halves[1]));
};
return (Number(val));
}
private function baseNEncoder(n:uint, minchars:uint=1):String{
var str:String = "";
var val:uint = n;
while (val != 0) {
str = (this._hashIndex.charAt((val % this._base)) + str);
val = (val / this._base);
};
if (minchars){
while (str.length < minchars) {
str = (this._hashIndex.charAt(0) + str);
};
};
return (str);
}
private function baseNDecoder(s:String):uint{
var val:uint;
var i:uint;
while (i < s.length) {
val = (val * this._base);
val = (val + this._hashVal[s.charAt(i)]);
i++;
};
return (val);
}
}
}//package com.newgrounds
Section 18
//Bridge (com.newgrounds.Bridge)
package com.newgrounds {
import flash.events.*;
import flash.net.*;
public class Bridge {
private var _inConnection:LocalConnection;
private var _outConnection:LocalConnection;
private var _widgetId:String;
public function Bridge(id:String){
super();
this._widgetId = id;
this._inConnection = new LocalConnection();
this._outConnection = new LocalConnection();
this._inConnection.client = this;
this._inConnection.connect(("rec_" + this._widgetId));
this._outConnection.addEventListener(StatusEvent.STATUS, this.onStatus);
}
public function sendCommand(command:String, parameters:Object):void{
if (this._outConnection){
this._outConnection.send(this._widgetId, "sendCommand", command, this.scrubParameters(parameters));
};
}
public function sendEvent(command:String, parameters:Object):void{
if (this._outConnection){
this._outConnection.send(this._widgetId, "sendEvent", command, this.scrubParameters(parameters));
};
}
public function receiveEvent(event:String, parameters:Object):void{
API.callListener(event, parameters.success, parameters.data);
}
public function scrubParameters(parameters:Object):Object{
var key:String;
var outParameters:Object = new Object();
for (key in parameters) {
if ((((((((((parameters[key] is String)) || ((parameters[key] is Number)))) || ((parameters[key] is uint)))) || ((parameters[key] is int)))) || ((parameters[key] is Boolean)))){
outParameters[key] = parameters[key];
};
};
return (outParameters);
}
private function onStatus(event:Event):void{
}
}
}//package com.newgrounds
Section 19
//Medal (com.newgrounds.Medal)
package com.newgrounds {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class Medal {
private var _id:uint;
private var _name:String;
private var _value:uint;
private var _difficultyId:uint;
private var _unlocked:Boolean;// = false
private var _iconUrl:URLRequest;
private var _iconLoader:Loader;
private var _icon:BitmapData;
private static const DEFAULT_ICON:BitmapData = new BitmapData(50, 50, false, 0);
private static const DIFFICULT_NAMES:Array = [null, "Easy", "Moderate", "Challenging", "Difficult", "Brutal"];
public function Medal(id:uint, name:String, value:uint, difficulty:uint, unlocked:Boolean, iconUrl:String){
var id = id;
var name = name;
var value = value;
var difficulty = difficulty;
var unlocked = unlocked;
var iconUrl = iconUrl;
this._icon = DEFAULT_ICON;
super();
this._id = id;
this._name = name;
this._value = value;
this._difficultyId = difficulty;
this._unlocked = unlocked;
if (iconUrl){
this._iconUrl = new URLRequest(iconUrl);
this._iconLoader = new Loader();
this._iconLoader.contentLoaderInfo.addEventListener(Event.INIT, this.onIconLoaderInit);
this._iconLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onIconLoaderError);
this._iconLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onIconLoaderError);
this._iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onIconLoaderComplete);
this._iconLoader.load(this._iconUrl, new LoaderContext(true));
//unresolved jump
var _slot1 = e;
onIconLoaderError(null);
};
}
public function get difficulty():String{
return (DIFFICULT_NAMES[this._difficultyId]);
}
public function get difficultyId():uint{
return (this._difficultyId);
}
public function get icon():BitmapData{
return (this._icon);
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get unlocked():Boolean{
return (this._unlocked);
}
public function isUnlocked():Boolean{
return (this._unlocked);
}
public function set unlocked(b:Boolean):void{
this._unlocked = b;
}
public function get value():uint{
return (this._value);
}
public function get bytesLoaded():uint{
return ((this._iconLoader) ? this._iconLoader.contentLoaderInfo.bytesLoaded : 0);
}
public function get bytesTotal():uint{
return ((this._iconLoader) ? this._iconLoader.contentLoaderInfo.bytesTotal : 0);
}
public function getID():uint{
return (this._id);
}
public function getName():String{
return (this._name);
}
public function getValue():uint{
return (this._value);
}
public function getDifficulty():String{
return (DIFFICULT_NAMES[this._difficultyId]);
}
private function onIconLoaderInit(e:Event):void{
}
private function onIconLoaderError(e:IOErrorEvent):void{
trace((((("[NewgroundsAPI WARNING] :: Failed to load medal icon for " + this.name) + " (") + this._iconUrl.url.split("/").pop()) + ")"));
this._iconLoader.unload();
this._iconLoader = null;
}
private function onIconLoaderComplete(e:Event):void{
var bitmap:Bitmap = (this._iconLoader.content as Bitmap);
this._icon = bitmap.bitmapData;
this._iconLoader.unload();
this._iconLoader = null;
}
public function unlock():void{
if (!this._unlocked){
API.unlockMedal(this._name);
};
}
public function createIconBitmap():Bitmap{
return (new Bitmap(this.icon));
}
public function toString():String{
return (this._name);
}
public static function createFromObject(medalData:Object):Medal{
return (new Medal(medalData.medal_id, medalData.medal_name, medalData.medal_value, medalData.medal_difficulty, medalData.medal_unlocked, medalData.medal_icon));
}
}
}//package com.newgrounds
Section 20
//RC4 (com.newgrounds.RC4)
package com.newgrounds {
public class RC4 {
private static var sbox:Array = new Array(0xFF);
private static var mykey:Array = new Array(0xFF);
public static function encrypt(src:String, key:String):String{
var mtxt:Array = strToChars(src);
var mkey:Array = strToChars(key);
var result:Array = calculate(mtxt, mkey);
return (charsToHex(result));
}
public static function encryptbin(src:String, key:String):Array{
var mtxt:Array = strToChars(src);
var mkey:Array = strToChars(key);
var result:Array = calculate(mtxt, mkey);
return (result);
}
public static function decrypt(src:String, key:String):String{
var mtxt:Array = hexToChars(src);
var mkey:Array = strToChars(key);
var result:Array = calculate(mtxt, mkey);
return (charsToStr(result));
}
private static function initialize(pwd:Array):void{
var tempSwap:uint;
var b:uint;
var intLength:uint = pwd.length;
var a:uint;
while (a <= 0xFF) {
mykey[a] = pwd[(a % intLength)];
sbox[a] = a;
a++;
};
a = 0;
while (a <= 0xFF) {
b = (((b + sbox[a]) + mykey[a]) % 0x0100);
tempSwap = sbox[a];
sbox[a] = sbox[b];
sbox[b] = tempSwap;
a++;
};
}
private static function calculate(plaintxt:Array, psw:Array):Array{
var k:uint;
var temp:uint;
var cipherby:uint;
var idx:uint;
initialize(psw);
var i:uint;
var j:uint;
var cipher:Array = new Array();
var a:uint;
while (a < plaintxt.length) {
i = ((i + 1) % 0x0100);
j = ((j + sbox[i]) % 0x0100);
temp = sbox[i];
sbox[i] = sbox[j];
sbox[j] = temp;
idx = ((sbox[i] + sbox[j]) % 0x0100);
k = sbox[idx];
cipherby = (plaintxt[a] ^ k);
cipher.push(cipherby);
a++;
};
return (cipher);
}
private static function charsToHex(chars:Array):String{
var result:String = new String("");
var hexes:Array = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var i:uint;
while (i < chars.length) {
result = (result + (hexes[(chars[i] >> 4)] + hexes[(chars[i] & 15)]));
i++;
};
return (result);
}
private static function hexToChars(hex:String):Array{
var codes:Array = new Array();
var i:uint = ((hex.substr(0, 2))=="0x") ? 2 : 0;
while (i < hex.length) {
codes.push(parseInt(hex.substr(i, 2), 16));
i = (i + 2);
};
return (codes);
}
private static function charsToStr(chars:Array):String{
var result:String = new String("");
var i:uint;
while (i < chars.length) {
result = (result + String.fromCharCode(chars[i]));
i++;
};
return (result);
}
private static function strToChars(str:String):Array{
var codes:Array = new Array();
var i:uint;
while (i < str.length) {
codes.push(str.charCodeAt(i));
i++;
};
return (codes);
}
}
}//package com.newgrounds
Section 21
//SaveFile (com.newgrounds.SaveFile)
package com.newgrounds {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class SaveFile extends EventDispatcher {
private var _filename:String;
private var _id:uint;
private var _description:String;
private var _contents;
private var _loader:SmartURLLoader;
private var _group:SaveGroup;
private var _keys:Dictionary;
private var _ratings:Dictionary;
private var _fileUrl:String;
private var _thumbnail:BitmapData;
private var _thumbnailUrl:String;
private var _authorId:uint;
private var _authorName:String;
private var _contentSize:uint;
private var _locked:Boolean;
private var _status:uint;
private var duplicate_id:uint;
private var _draft:Boolean;
public static const STATUS_PRIVATE = 1;
public static const STATUS_SHARED = 2;
public static const STATUS_UNAPPROVED = 3;
public static const STATUS_APPROVED = 4;
public function SaveFile(group:SaveGroup){
super();
this._keys = new Dictionary();
this._ratings = new Dictionary();
this._group = group;
this._description = "";
}
public function get name():String{
return (this._filename);
}
public function set name(s:String):void{
this._filename = s;
}
public function get id():uint{
return (this._id);
}
public function set id(i:uint):void{
this._id = i;
}
public function get description():String{
return (this._description);
}
public function set description(s:String):void{
this._description = s;
}
public function get contents(){
return (this._contents);
}
public function set contents(o):void{
this._contents = o;
this._contentSize = 0;
}
public function get thumbnailUrl():String{
return (this._thumbnailUrl);
}
public function set thumbnailUrl(s:String):void{
this._thumbnailUrl = s;
}
public function get fileUrl():String{
return (this._fileUrl);
}
public function set fileUrl(s:String):void{
this._fileUrl = s;
}
public function get thumbnail():BitmapData{
return (this._thumbnail);
}
public function set thumbnail(bData:BitmapData):void{
if (this._thumbnail){
this._thumbnail.dispose();
};
this._thumbnail = bData.clone();
}
public function loadThumbnail():Loader{
var thumb:Loader = new Loader();
if (this._thumbnailUrl){
thumb.load(new URLRequest(this._thumbnailUrl));
};
return (thumb);
}
public function get bytesLoaded():uint{
return ((this._loader) ? this._loader.bytesLoaded : this._contentSize);
}
public function get bytesTotal():uint{
return (this._contentSize);
}
public function get status():uint{
return (this._status);
}
function setStatus(value:uint):void{
this._status = value;
}
public function get groupId():uint{
return (this._group.id);
}
public function get groupName():String{
return (this._group.name);
}
public function get groupType():uint{
return (this._group.type);
}
public function get authorName():String{
return (this._authorName);
}
public function set authorName(value:String):void{
this._authorName = value;
}
public function get authorId():uint{
return (this._authorId);
}
public function set authorId(value:uint):void{
this._authorId = value;
}
public function get draft():Boolean{
return (this._draft);
}
public function set draft(val:Boolean):void{
this._draft = val;
}
public function get locked():Boolean{
return (this._locked);
}
public function get shared():Boolean{
return ((this._status == STATUS_SHARED));
}
public function get isPrivate():Boolean{
return ((this._status == STATUS_PRIVATE));
}
public function get isPublic():Boolean{
if (this.isPrivate){
return (false);
};
if (((this._group.isType("SYSTEM")) || (this._group.isType("PRIVATE")))){
return (false);
};
if (this._group.isType("PUBLIC")){
return (true);
};
if (this.approved){
return (true);
};
return (false);
}
public function get approved():Boolean{
return ((this._status > STATUS_UNAPPROVED));
}
public function get keys():Dictionary{
return (this._keys);
}
public function get ratings():Dictionary{
return (this._ratings);
}
function setPermissions(status:uint, locked:Boolean){
locked = this._locked;
this._status = status;
}
function setFileSize(value:uint):void{
this._contentSize = value;
}
public function isLocked():Boolean{
return (this._locked);
}
public function getDescription():String{
return (this._description);
}
public function getShared():Boolean{
return (this._draft);
}
public function getDuplicateID():uint{
return (this.duplicate_id);
}
public function getKeys():Dictionary{
return (this._keys);
}
public function getRatings():Dictionary{
return (this._ratings);
}
public function setKey(key, value):void{
var k:SaveKey;
if ((key is String)){
k = this._group.getKeyName(key);
} else {
k = this._group.getKeyID(key);
};
if (k){
switch (k.type){
case SaveKey.TYPE_BOOLEAN:
this._keys[k] = {id:k.id, value:Boolean(int(value))};
break;
case SaveKey.TYPE_FLOAT:
this._keys[k] = {id:k.id, value:Number(value)};
break;
case SaveKey.TYPE_INTEGER:
this._keys[k] = {id:k.id, value:int(value)};
break;
case SaveKey.TYPE_STRING:
default:
this._keys[k] = {id:k.id, value:value.toString()};
break;
};
};
}
public function getKey(key){
var k:SaveKey;
if ((key is String)){
k = this._group.getKeyName(key);
} else {
k = this._group.getKeyID(key);
};
if (k){
return (this._keys[k]);
};
return (null);
}
public function setRating(rating, votes:Number, score:Number):void{
var r:SaveRating;
if ((rating is String)){
r = this._group.getRatingName(rating);
} else {
r = this._group.getRatingID(rating);
};
if (r){
this._ratings[r] = {id:r.id, name:r.name, votes:votes, score:score};
};
}
public function getRating(rating):Object{
var r:SaveRating;
if ((rating is String)){
r = this._group.getRatingName(rating);
} else {
r = this._group.getRatingID(rating);
};
if (r){
return (this._ratings[r]);
};
return (null);
}
public function sendRating(rating:String, vote:Number):void{
var ratingObject:SaveRating = this._group.getRatingName(rating);
if (!ratingObject){
trace((("[NewgroundsAPISaveFile] " + rating) + " is not a recognized save file"));
return;
};
if ((((vote < ratingObject.minValue)) || ((vote > ratingObject.maxValue)))){
trace(((("[NewgroundsAPISaveFile] Vote must be between " + ratingObject.minValue) + " and ") + ratingObject.maxValue));
return;
};
ratingObject.voted = true;
API.rateSaveFile(this, ratingObject, vote);
}
override public function toString():String{
var key:Object;
var rating:Object;
var str = (((((("Save File " + this._filename) + " ID: ") + this._id) + "\n ") + this._description) + "\n");
for each (key in this._keys) {
str = (str + ((((" " + this._group.getKeyID(key.id).name) + ": ") + key.val) + "\n"));
};
for each (rating in this._ratings) {
str = (str + ((((((" " + this._group.getRatingID(rating.id).name) + "\n Score: ") + rating.score) + " Votes: ") + rating.votes) + "\n"));
};
return (str);
}
public function toObject():Object{
var key:Object;
var obj:Object = {group:this.groupId, filename:this.name, description:this.description, shared:true};
obj.keys = [];
for each (key in this._keys) {
obj.keys.push({id:key.id, value:key.val});
};
return (obj);
}
public function save(draft:Boolean=false, overwrite:Boolean=false):void{
API.saveFile(this, draft, overwrite);
}
public function loadContents():void{
if (this._fileUrl){
this._loader = new SmartURLLoader();
this._loader.responseFormat = URLLoaderDataFormat.BINARY;
this._loader.addEventListener(Event.COMPLETE, this.onContentsLoaded);
this._loader.addEventListener(IOErrorEvent.IO_ERROR, this.onContentsError);
this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onContentsError);
this._loader.load(this._fileUrl);
};
}
private function onContentsError(e:Event):void{
this._loader = null;
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, false));
API.callListener(APIEvent.FILE_LOADED, false);
}
private function onContentsLoaded(e:Event):void{
var byteArray:ByteArray = e.target.response;
this._contentSize = byteArray.length;
byteArray.uncompress();
var tag:uint = byteArray.readUnsignedByte();
if (tag == 0){
this._contents = new ByteArray();
this._contents.writeBytes(byteArray, 1);
} else {
this._contents = byteArray.readObject();
};
this._loader = null;
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, true, {file:this}));
API.callListener(APIEvent.FILE_LOADED, true, {file:this});
}
public function loadAuthorPage(){
API.loadUserPage(this._authorId, this._authorName);
}
function fileSaved(packet:Object):void{
this._id = packet.save_id;
this._thumbnailUrl = packet.thumbnail;
this._fileUrl = packet.file_url;
}
}
}//package com.newgrounds
Section 22
//SaveGroup (com.newgrounds.SaveGroup)
package com.newgrounds {
public class SaveGroup {
private var _name:String;
private var _id:uint;
private var _type:uint;
private var _keys:Array;
private var _ratings:Array;
private var _files:Array;
private var _query:SaveGroupQuery;
public static const TYPE_SYSTEM:uint = 0;
public static const TYPE_PRIVATE:uint = 1;
public static const TYPE_PUBLIC:uint = 2;
public static const TYPE_MODERATED:uint = 3;
public static const KEY_TYPES:Array = [null, "float", "integer", "string", "boolean"];
public static const TYPES:Object = {SYSTEM:0, PRIVATE:1, PUBLIC:2, MODERATED:3};
public function SaveGroup(groupId:uint, groupName:String, groupType:uint){
super();
this._name = groupName;
this._id = groupId;
this._type = groupType;
this._ratings = [];
this._keys = [];
this._files = [];
this._query = new SaveGroupQuery(this);
}
public function get name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get type():uint{
return (this._type);
}
public function get keys():Array{
return (this._keys);
}
public function get ratings():Array{
return (this._ratings);
}
public function get group_id():uint{
return (this._id);
}
public function get group_name():String{
return (this._name);
}
public function addRating(rating:SaveRating):void{
this._ratings.push(rating);
}
function getRating(rating_id):SaveRating{
var i:uint;
while (i < this._ratings.length) {
if ((((((((rating_id is uint)) || ((rating_id is int)))) || ((rating_id is Number)))) && ((this._ratings[i].rating_id == rating_id)))){
return (this._ratings[i]);
};
if (this._ratings[i].name == rating_id){
return (this._ratings[i]);
};
i++;
};
return (null);
}
public function getRatingID(ratingId:uint):SaveRating{
var i:uint;
while (i < this._ratings.length) {
if (this._ratings[i].id == ratingId){
return (this._ratings[i]);
};
i++;
};
return (null);
}
public function getRatingName(ratingName:String):SaveRating{
var i:uint;
while (i < this._ratings.length) {
if (this._ratings[i].name == ratingName){
return (this._ratings[i]);
};
i++;
};
return (null);
}
public function addKey(key:SaveKey):void{
this._keys.push(key);
}
public function getKey(key_id):SaveKey{
var i:uint;
while (i < this._keys.length) {
if ((((((((key_id is Number)) || ((key_id is uint)))) || ((key_id is int)))) && ((this._keys[i].key_id == key_id)))){
return (this._keys[i]);
};
if (this._keys[i].key_name == key_id){
return (this._keys[i]);
};
i++;
};
return (null);
}
public function getKeyID(keyId:uint):SaveKey{
var i:uint;
while (i < this._keys.length) {
if (this._keys[i].id == keyId){
return (this._keys[i]);
};
i++;
};
return (null);
}
public function getKeyType(key_name:String, as_string:Boolean=false){
var key:SaveKey = this.getKey(key_name);
if (key){
return ((as_string) ? KEY_TYPES[key.key_type] : key.key_type);
};
return (null);
}
public function getKeyName(keyName:String):SaveKey{
var i:uint;
while (i < this._keys.length) {
if (this._keys[i].name == keyName){
return (this._keys[i]);
};
i++;
};
return (null);
}
public function isType(type:String):Boolean{
return ((TYPES[this._type] == type));
}
public function getID():uint{
return (this._id);
}
public function getName():String{
return (this._name);
}
public function getQuery(asObject:Boolean=false){
return ((asObject) ? this._query.toObject() : this._query);
}
public function newQuery():SaveGroupQuery{
return (new SaveGroupQuery(this));
}
public function newFile():SaveFile{
return (new SaveFile(this));
}
public function toString():String{
return ((((((("SaveGroup { name: " + this._name) + ", id: ") + this._id) + ", keys: ") + this._keys) + "}"));
}
public static function createFromObject(groupData:Object):SaveGroup{
var keyData:Object;
var ratingData:Object;
var saveGroup:SaveGroup = new SaveGroup(groupData.group_id, groupData.group_name, groupData.group_type);
var i:uint;
while (i < groupData.keys.length) {
keyData = groupData.keys[i];
saveGroup.addKey(new SaveKey(keyData.id, keyData.name, keyData.type));
i++;
};
i = 0;
while (i < groupData.ratings.length) {
ratingData = groupData.ratings[i];
saveGroup.addRating(new SaveRating(ratingData.id, ratingData.name, ratingData.float, ratingData.min, ratingData.max));
i++;
};
return (saveGroup);
}
}
}//package com.newgrounds
Section 23
//SaveGroupQuery (com.newgrounds.SaveGroupQuery)
package com.newgrounds {
import flash.events.*;
public class SaveGroupQuery extends EventDispatcher {
private var _group:SaveGroup;
private var _groupBy:Array;
private var _lookupKeys:Array;
private var _lookupRatings:Array;
private var _fileConditions:Array;
private var _keyConditions:Array;
private var _ratingConditions:Array;
private var _sortConditions:Array;
private var _page:uint;
private var _resultsPerPage:uint;
private var _randomizeResults:Boolean;
private var _results:Array;
public static const TABLE_FILES:uint = 1;
public static const TABLE_KEYS:uint = 2;
public static const TABLE_RATINGS:uint = 3;
public static const FILE_ID:uint = 0;
public static const AUTHOR_ID:uint = 1;
public static const AUTHOR_NAME:uint = 2;
public static const FILE_NAME:uint = 3;
public static const CREATED_ON:uint = 4;
public static const UPDATED_ON:uint = 5;
public static const TOTAL_VIEWS:uint = 6;
public static const FILE_STATUS:uint = 7;
public static const SCORE:String = "score";
public static const TOTAL_VOTES:String = "votes";
public function SaveGroupQuery(group:SaveGroup){
this._results = [];
super();
this._group = group;
this.reset();
}
public function clearCache():void{
this._results = [];
}
public function get group():SaveGroup{
return (this._group);
}
public function get groupId():uint{
return (this._group.id);
}
public function get resultsPerPage():uint{
return (this._resultsPerPage);
}
public function set resultsPerPage(n:uint):void{
this._resultsPerPage = n;
}
public function get page():uint{
return (this._page);
}
public function set page(n:uint):void{
this._page = n;
}
public function get randomized():Boolean{
return (this._randomizeResults);
}
public function set randomized(b:Boolean):void{
this._randomizeResults = b;
}
public function get results():Array{
return (this._results);
}
public function reset():void{
this._fileConditions = [];
this._keyConditions = [];
this._ratingConditions = [];
this._sortConditions = [];
this._groupBy = [];
this._lookupKeys = [];
this._lookupRatings = [];
this._randomizeResults = false;
this._resultsPerPage = 20;
this._page = 1;
this.clearCache();
}
function getGroup():SaveGroup{
return (this._group);
}
function getGroupID():uint{
return (this._group.getID());
}
public function includeKey(keyName:String):void{
var key:SaveKey = this._group.getKeyName(keyName);
if (key){
this._lookupKeys.push(key.id);
};
}
public function isRandomized():Boolean{
return (this._randomizeResults);
}
public function includeRating(ratingName:String):void{
var rating:SaveRating = this._group.getRatingName(ratingName);
if (rating){
this._lookupRatings.push(rating.id);
};
}
public function excludeKey(keyName:String):void{
var key:SaveKey = this._group.getKeyName(keyName);
var i:uint;
while (i < this._lookupKeys.length) {
if (this._lookupKeys[i] == key.id){
this._lookupKeys.splice(i, 1);
return;
};
i++;
};
}
public function excludeRating(ratingName:String):void{
var rating:SaveRating = this._group.getRatingName(ratingName);
var i:uint;
while (i < this._lookupRatings.length) {
if (this._lookupRatings[i] == rating.id){
this._lookupRatings.splice(i, 1);
return;
};
i++;
};
}
public function groupBy(field:uint):void{
this._groupBy.push({table:TABLE_FILES, field:field});
}
public function groupByRating(ratingName:String):void{
var rating:SaveRating = this._group.getRatingName(ratingName);
if (!rating){
return;
};
this._groupBy.push({table:TABLE_RATINGS, field:rating.id});
}
public function groupByKey(keyName:String):void{
var key:SaveKey = this._group.getKeyName(keyName);
if (!key){
return;
};
this._groupBy.push({table:TABLE_KEYS, field:key.id});
}
public function addFileCondition(field:uint, operator:String, value):void{
this._fileConditions.push({field:field, operator:operator, value:value});
}
public function addKeyCondition(keyName:String, operator:String, value):void{
var key:SaveKey = this._group.getKeyName(keyName);
if (!key){
return;
};
if (!this.checkValue(value, key.type)){
return;
};
this._keyConditions.push({key_id:key.id, operator:operator, value:value});
}
public function addRatingCondition(ratingName:String, operator:String, value, column:String="score"):void{
var rating:SaveRating = this._group.getRatingName(ratingName);
if (!rating){
return;
};
this._ratingConditions.push({rating_id:rating.id, operator:operator, value:value, column:column});
}
private function addSortCondition(table:uint, field:uint, sortDescending:Boolean=false, extra=null):void{
var sortCondition:Object = {table:table, field:field, desc:sortDescending};
if (extra){
sortCondition.extra = extra;
};
this._sortConditions.push(sortCondition);
}
public function sortOn(field:uint, sortDescending:Boolean=false):void{
this.addSortCondition(TABLE_FILES, field, sortDescending);
}
public function sortOnKey(keyName:String, sortDescending:Boolean=false):void{
this.addSortCondition(TABLE_KEYS, this._group.getKeyName(keyName).id, sortDescending);
}
public function sortOnRating(ratingName:String, sortDescending:Boolean=false, column:String="score"):void{
this.addSortCondition(TABLE_RATINGS, this._group.getRatingName(ratingName).id, sortDescending, column);
}
public function sortOnRatingScore(rating:String, descending:Boolean){
this.sortOnRating(rating, descending, SCORE);
}
public function sortOnRatingVotes(rating:String, descending:Boolean){
this.sortOnRating(rating, descending, TOTAL_VOTES);
}
public function setResultsPerPage(r:uint){
this._resultsPerPage = r;
this.clearCache();
}
public function setPage(p:Number){
this._page = p;
this.clearCache();
}
public function setRandomize(bool:Boolean):void{
this._randomizeResults = bool;
}
public function execute():void{
API.executeSaveQuery(this);
}
private function checkValue(obj, type:uint):Boolean{
return (true);
}
function setResults(res:Array):void{
this._results = res;
}
override public function toString():String{
return ("");
}
public function toObject():Object{
var query:Object = {page:this._page, num_results:this._resultsPerPage};
if (this.isRandomized()){
query.randomize = 1;
};
if (((this._fileConditions) && ((this._fileConditions.length > 0)))){
query.file_conditions = this._fileConditions;
};
if (((this._keyConditions) && ((this._keyConditions.length > 0)))){
query.key_conditions = this._keyConditions;
};
if (((this._ratingConditions) && ((this._ratingConditions.length > 0)))){
query.rating_conditions = this._ratingConditions;
};
if (((this._sortConditions) && ((this._sortConditions.length > 0)))){
query.sort_conditions = this._sortConditions;
};
if (((this._lookupKeys) && ((this._lookupKeys.length > 0)))){
query.lookup_keys = this._lookupKeys;
};
if (((this._lookupRatings) && ((this._lookupRatings.length > 0)))){
query.lookup_ratings = this._lookupRatings;
};
if (((this._groupBy) && ((this._groupBy.length > 0)))){
query.group_by = this._groupBy;
};
return (query);
}
}
}//package com.newgrounds
Section 24
//SaveKey (com.newgrounds.SaveKey)
package com.newgrounds {
public class SaveKey {
private var _id:uint;
private var _name:String;
private var _type:uint;
public static const TYPE_FLOAT:uint = 1;
public static const TYPE_INTEGER:uint = 2;
public static const TYPE_STRING:uint = 3;
public static const TYPE_BOOLEAN:uint = 4;
public function SaveKey(id:uint, name:String, type:uint){
super();
this._id = id;
this._name = name;
this._type = type;
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get type():uint{
return (this._type);
}
public function get key_id():uint{
return (this._id);
}
public function get key_name():String{
return (this._name);
}
public function get key_type():uint{
return (this._type);
}
public function isValueValid(value):Boolean{
if (this._type == TYPE_INTEGER){
return ((((value is int)) || ((value is uint))));
};
if (this._type == TYPE_FLOAT){
return ((((((value is int)) || ((value is uint)))) || ((value is Number))));
};
if (this._type == TYPE_STRING){
return ((value is String));
};
if (this._type == TYPE_BOOLEAN){
return ((((((((value is Boolean)) || ((value === 0)))) || ((value === 1)))) || ((value == ""))));
};
return (false);
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 25
//SaveRating (com.newgrounds.SaveRating)
package com.newgrounds {
public class SaveRating {
private var _id:uint;
private var _name:String;
private var _minValue:Number;
private var _maxValue:Number;
private var _isFloat:Boolean;
private var _voted:Boolean;
public function SaveRating(id:uint, name:String, isFloat:Boolean, minValue:Number=-INF, maxValue:Number=INF){
super();
this._id = id;
this._name = name;
this._isFloat = isFloat;
this._minValue = minValue;
this._maxValue = maxValue;
}
public function get rating_id():uint{
return (this._id);
}
public function get rating_name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get minValue():Number{
return (this._minValue);
}
public function get maxValue():Number{
return (this._maxValue);
}
public function get isFloat():Boolean{
return (this._isFloat);
}
public function get voted():Boolean{
return (this._voted);
}
public function set voted(b:Boolean):void{
this._voted = b;
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 26
//Score (com.newgrounds.Score)
package com.newgrounds {
public class Score {
private var _board:ScoreBoard;
private var _position:uint;
private var _username:String;
private var _value:String;
private var _numeric_value:uint;
private var _tag:String;
public function Score(board:ScoreBoard, position:Number, username:String, value:String, numeric_value:uint, tag:String){
super();
this._board = board;
this._position = position;
this._username = username;
this._value = value;
this._numeric_value = numeric_value;
this._tag = tag;
}
public function get board():ScoreBoard{
return (this._board);
}
public function get position():uint{
return (this._position);
}
public function get username():String{
return (this._username);
}
public function get value():String{
return (this._value);
}
public function get numeric_value():uint{
return (this._numeric_value);
}
public function get tag():String{
return (this._tag);
}
}
}//package com.newgrounds
Section 27
//ScoreBoard (com.newgrounds.ScoreBoard)
package com.newgrounds {
import flash.events.*;
public class ScoreBoard extends EventDispatcher {
private var _name:String;
private var _id:uint;
private var _scores:Array;
private var _period:String;// = "Today"
private var _num_results:uint;// = 10
private var _numScores:uint;
private var _desiredNumResults:uint;
private var _startRank:uint;
private var _endRank:uint;
private var _page:uint;// = 1
private var _tag:String;
public function ScoreBoard(id:uint, name:String, tag:String){
super();
this._name = name;
this._id = id;
this._scores = [];
this._tag = tag;
}
public function exists():Boolean{
return ((this._id > 0));
}
public function get id():Number{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get period():String{
return (this._period);
}
public function get page():uint{
return (this._page);
}
public function get num_results():uint{
return (this._num_results);
}
public function get scores():Array{
return (this._scores);
}
public function get tag():String{
return (this._tag);
}
public function get num_scores():uint{
return (this._numScores);
}
public function postScore(value:uint, tag:String=null):void{
if (tag){
this._tag = tag;
};
API.postScore(this._name, value);
}
public function loadScores(period:String="Today", page:uint=1, num_results:uint=10):void{
this._period = period;
if (((!(this._period)) || ((this._period == "")))){
this._period = ScoreBoardPeriod.TODAY;
};
this._page = page;
this._num_results = num_results;
this._desiredNumResults = 0;
API.loadScores(this.name);
}
public function loadScoresInRange(period:String="Today", startRank:uint=1, endRank:uint=10):void{
if (startRank == 0){
startRank = 1;
};
if (endRank < startRank){
endRank = startRank;
};
this._period = period;
if (((!(this._period)) || ((this._period == "")))){
this._period = ScoreBoardPeriod.TODAY;
};
this._desiredNumResults = ((endRank - startRank) + 1);
this._num_results = this._desiredNumResults;
while (int(((startRank - 1) / this._num_results)) != int(((endRank - 1) / this._num_results))) {
this._num_results++;
};
this._page = ((startRank - 1) / this._num_results);
this._startRank = startRank;
this._endRank = endRank;
this._page++;
API.loadScores(this.name);
}
function setScores(scores:Array, period:String, page:Number, num_results:Number, numScores:uint):void{
var position:uint;
this._period = period;
this._page = page;
this._num_results = num_results;
this._numScores = numScores;
this._scores = [];
var i:uint;
while (i < scores.length) {
position = (((this._num_results * (this._page - 1)) + 1) + i);
if (((!(this._desiredNumResults)) || ((((position >= this._startRank)) && ((position <= this._endRank)))))){
this._scores.push(new Score(this, position, scores[i].username, scores[i].value, scores[i].numeric_value, scores[i].tag));
};
i++;
};
this._num_results = this._scores.length;
}
}
}//package com.newgrounds
Section 28
//ScoreBoardPeriod (com.newgrounds.ScoreBoardPeriod)
package com.newgrounds {
public class ScoreBoardPeriod {
public static const TODAY:String = "Today";
public static const WEEK:String = "This Week";
public static const MONTH:String = "This Month";
public static const YEAR:String = "This Year";
public static const ALL_TIME:String = "All-Time";
}
}//package com.newgrounds
Section 29
//SmartURLLoader (com.newgrounds.SmartURLLoader)
package com.newgrounds {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.errors.*;
public class SmartURLLoader extends EventDispatcher {
private var _variables:Dictionary;
private var _files:Dictionary;
private var _hasVariables:Boolean;
private var _method:String;// = "GET"
private var _urlRequest:URLRequest;
private var _urlLoader:URLLoader;
private var _dataFormat:String;// = "text"
private var _openBrowser:Boolean;// = false
private var _preventCache:Boolean;// = false
var _command:String;
public var owner;
private static const CRLF:String = "
";
private static var _loaders:Dictionary = new Dictionary();
public function SmartURLLoader(){
super();
this._urlRequest = new URLRequest();
this._variables = new Dictionary();
}
public function get responseFormat():String{
return (this._dataFormat);
}
public function set responseFormat(s:String):void{
this._dataFormat = s;
}
public function get response(){
return (this._urlLoader.data);
}
public function get hasFiles():Boolean{
return (Boolean(this._files));
}
public function get method():String{
return (this._method);
}
public function set method(m:String):void{
if (((this.hasFiles) && ((m == URLRequestMethod.GET)))){
throw (new IllegalOperationError("GET cannot be used to upload files."));
};
this._method = m;
}
public function get openBrowser():Boolean{
return (this._openBrowser);
}
public function set openBrowser(b:Boolean):void{
this._openBrowser = b;
}
public function get preventCache():Boolean{
return (this._preventCache);
}
public function set preventCache(b:Boolean):void{
this._preventCache = b;
}
public function get bytesLoaded():uint{
return ((this._urlLoader) ? this._urlLoader.bytesLoaded : 0);
}
public function get bytesTotal():uint{
return ((this._urlLoader) ? this._urlLoader.bytesTotal : 0);
}
public function addVariable(name:String, value=""):void{
this._variables[name] = value;
if (value){
this._hasVariables = true;
};
}
public function addFile(fileName:String, data:ByteArray, dataField:String, contentType:String="application/octet-stream"):void{
this.method = URLRequestMethod.POST;
if (!this._files){
this._files = new Dictionary();
};
this._files[fileName] = new File(fileName, data, dataField, contentType);
}
public function clearVariables():void{
this._variables = new Dictionary();
}
public function clearFiles():void{
this._files = null;
}
public function load(url:String):void{
var urlVariables:URLVariables;
var key:String;
var boundary:String;
var i:uint;
var event:SecurityErrorEvent;
var url = url;
this._urlRequest.url = url;
if (this._preventCache){
url = (url + ("?seed=" + Math.random()));
if (this._hasVariables){
url = (url + "&");
};
};
this._urlRequest.method = this._method;
if ((((this._urlRequest.method == URLRequestMethod.GET)) || (!(this.hasFiles)))){
this._urlRequest.contentType = "application/x-www-form-urlencoded";
if (this._hasVariables){
urlVariables = new URLVariables();
for (key in this._variables) {
urlVariables[key] = this._variables[key];
};
this._urlRequest.data = urlVariables;
};
} else {
boundary = "";
i = 0;
while (i < 32) {
boundary = (boundary + String.fromCharCode(uint((97 + (Math.random() * 25)))));
i = (i + 1);
};
this._urlRequest.contentType = (("multipart/form-data; boundary=\"" + boundary) + "\"");
this._urlRequest.data = this.buildMultipartData(boundary);
};
if (this.openBrowser){
navigateToURL(this._urlRequest, "_blank");
} else {
this._urlLoader = new URLLoader();
this._urlLoader.dataFormat = this._dataFormat;
this._urlLoader.addEventListener(Event.COMPLETE, this.onComplete);
this._urlLoader.addEventListener(ProgressEvent.PROGRESS, this.onProgress);
this._urlLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onIOError);
this._urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, this.onHTTPStatus);
this._urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onSecurityError);
_loaders[this._urlLoader] = this;
this._urlLoader.load(this._urlRequest);
//unresolved jump
var _slot1 = error;
event = new SecurityErrorEvent(SecurityErrorEvent.SECURITY_ERROR, false, false, _slot1.message);
onSecurityError(event);
};
}
public function close():void{
this._urlLoader.close();
//unresolved jump
var _slot1 = e;
}
public function dispose():void{
this.close();
this._files = null;
this._variables = null;
if (this._urlLoader){
this._urlLoader.removeEventListener(Event.COMPLETE, this.onComplete);
this._urlLoader.removeEventListener(ProgressEvent.PROGRESS, this.onProgress);
this._urlLoader.removeEventListener(IOErrorEvent.IO_ERROR, this.onIOError);
this._urlLoader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, this.onHTTPStatus);
this._urlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onSecurityError);
this._urlLoader = null;
};
this._urlRequest = null;
delete _loaders[this];
}
private function buildMultipartData(boundary:String):ByteArray{
var key:String;
var file:File;
var postData:ByteArray = new ByteArray();
postData.endian = Endian.BIG_ENDIAN;
boundary = ("--" + boundary);
for (key in this._variables) {
postData.writeUTFBytes((boundary + CRLF));
postData.writeUTFBytes(((("Content-Disposition: form-data; name=\"" + key) + "\"") + CRLF));
postData.writeUTFBytes(CRLF);
postData.writeUTFBytes((this._variables[key] + CRLF));
};
if (this.hasFiles){
for each (file in this._files) {
postData.writeUTFBytes((boundary + CRLF));
postData.writeUTFBytes(("Content-Disposition: form-data; name=\"Filename\"" + CRLF));
postData.writeUTFBytes(CRLF);
postData.writeUTFBytes((file.fileName + CRLF));
postData.writeUTFBytes((boundary + CRLF));
postData.writeUTFBytes(((((("Content-Disposition: form-data; name=\"" + file.dataField) + "\"; filename=\"") + file.fileName) + "\"") + CRLF));
postData.writeUTFBytes((("Content-Type: " + file.contentType) + CRLF));
postData.writeUTFBytes(CRLF);
postData.writeBytes(file.data);
postData.writeUTFBytes(CRLF);
};
postData.writeUTFBytes((boundary + CRLF));
postData.writeUTFBytes(("Content-Disposition: form-data; name=\"Upload\"" + CRLF));
postData.writeUTFBytes(CRLF);
postData.writeUTFBytes(("Submit Query" + CRLF));
};
postData.writeUTFBytes((boundary + "--"));
postData.position = 0;
postData.position = 0;
return (postData);
}
private function onComplete(e:Event):void{
dispatchEvent(e);
this.dispose();
}
private function onProgress(e:ProgressEvent):void{
dispatchEvent(e);
}
private function onIOError(e:IOErrorEvent):void{
dispatchEvent(e);
this.dispose();
}
private function onSecurityError(e:SecurityErrorEvent):void{
dispatchEvent(e);
this.dispose();
}
private function onHTTPStatus(e:HTTPStatusEvent):void{
dispatchEvent(e);
}
public static function closeAll():void{
var loader:SmartURLLoader;
for each (loader in _loaders) {
if (loader){
loader.dispose();
};
};
_loaders = new Dictionary();
}
}
}//package com.newgrounds
import flash.utils.*;
class File {
private var fileName:String;
private var data:ByteArray;
private var dataField:String;
private var contentType:String;
private function File(fileName:String, data:ByteArray, dataField:String="Filedata", contentType:String="application/octet-stream"){
super();
this.fileName = fileName;
this.data = data;
this.dataField = dataField;
this.contentType = contentType;
}
}
Section 30
//IAutomationObject (mx.automation.IAutomationObject)
package mx.automation {
import flash.events.*;
public interface IAutomationObject {
function createAutomationIDPart(:IAutomationObject):Object;
function get automationName():String;
function get showInAutomationHierarchy():Boolean;
function set automationName(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:String):void;
function getAutomationChildAt(delegate:int):IAutomationObject;
function get automationDelegate():Object;
function get automationTabularData():Object;
function resolveAutomationIDPart(Object:Object):Array;
function replayAutomatableEvent(void:Event):Boolean;
function set automationDelegate(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Object):void;
function get automationValue():Array;
function get numAutomationChildren():int;
function set showInAutomationHierarchy(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\automation;IAutomationObject.as:Boolean):void;
}
}//package mx.automation
Section 31
//Binding (mx.binding.Binding)
package mx.binding {
import mx.core.*;
import flash.utils.*;
public class Binding {
mx_internal var destFunc:Function;
mx_internal var srcFunc:Function;
mx_internal var destString:String;
mx_internal var document:Object;
private var hasHadValue:Boolean;
mx_internal var disabledRequests:Dictionary;
mx_internal var isExecuting:Boolean;
mx_internal var isHandlingEvent:Boolean;
public var twoWayCounterpart:Binding;
private var wrappedFunctionSuccessful:Boolean;
mx_internal var _isEnabled:Boolean;
public var uiComponentWatcher:int;
private var lastValue:Object;
mx_internal static const VERSION:String = "3.5.0.12683";
public function Binding(document:Object, srcFunc:Function, destFunc:Function, destString:String){
super();
this.document = document;
this.srcFunc = srcFunc;
this.destFunc = destFunc;
this.destString = destString;
_isEnabled = true;
isExecuting = false;
isHandlingEvent = false;
hasHadValue = false;
uiComponentWatcher = -1;
BindingManager.addBinding(document, destString, this);
}
private function registerDisabledExecute(o:Object):void{
if (o != null){
disabledRequests = ((disabledRequests)!=null) ? disabledRequests : new Dictionary(true);
disabledRequests[o] = true;
};
}
protected function wrapFunctionCall(thisArg:Object, wrappedFunction:Function, object:Object=null, ... _args):Object{
var result:Object;
var thisArg = thisArg;
var wrappedFunction = wrappedFunction;
var object = object;
var args = _args;
wrappedFunctionSuccessful = false;
result = wrappedFunction.apply(thisArg, args);
wrappedFunctionSuccessful = true;
return (result);
//unresolved jump
var _slot1 = itemPendingError;
_slot1.addResponder(new EvalBindingResponder(this, object));
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", error = ") + _slot1));
};
//unresolved jump
var _slot1 = rangeError;
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", error = ") + _slot1));
};
//unresolved jump
var _slot1 = error;
if (((((((((!((_slot1.errorID == 1006))) && (!((_slot1.errorID == 1009))))) && (!((_slot1.errorID == 1010))))) && (!((_slot1.errorID == 1055))))) && (!((_slot1.errorID == 1069))))){
throw (_slot1);
} else {
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", error = ") + _slot1));
};
};
return (null);
}
public function watcherFired(commitEvent:Boolean, cloneIndex:int):void{
var commitEvent = commitEvent;
var cloneIndex = cloneIndex;
if (isHandlingEvent){
return;
};
try {
try {
isHandlingEvent = true;
execute(cloneIndex);
} finally {
};
} finally {
isHandlingEvent = false;
};
}
private function nodeSeqEqual(x:XMLList, y:XMLList):Boolean{
var i:uint;
var n:uint = x.length();
if (n == y.length()){
i = 0;
while ((((i < n)) && ((x[i] === y[i])))) {
i++;
};
return ((i == n));
//unresolved jump
};
return (false);
}
mx_internal function set isEnabled(value:Boolean):void{
_isEnabled = value;
if (value){
processDisabledRequests();
};
}
private function processDisabledRequests():void{
var key:Object;
if (disabledRequests != null){
for (key in disabledRequests) {
execute(key);
};
disabledRequests = null;
};
}
public function execute(o:Object=null):void{
var o = o;
if (!isEnabled){
if (o != null){
registerDisabledExecute(o);
};
return;
};
if (((isExecuting) || (((twoWayCounterpart) && (twoWayCounterpart.isExecuting))))){
hasHadValue = true;
return;
};
try {
try {
isExecuting = true;
wrapFunctionCall(this, innerExecute, o);
} finally {
};
} finally {
isExecuting = false;
};
}
mx_internal function get isEnabled():Boolean{
return (_isEnabled);
}
private function innerExecute():void{
var value:Object = wrapFunctionCall(document, srcFunc);
if (BindingManager.debugDestinationStrings[destString]){
trace(((("Binding: destString = " + destString) + ", srcFunc result = ") + value));
};
if (((hasHadValue) || (wrappedFunctionSuccessful))){
if (((!((((((lastValue is XML)) && (lastValue.hasComplexContent()))) && ((lastValue === value))))) && (!((((((((lastValue is XMLList)) && (lastValue.hasComplexContent()))) && ((value is XMLList)))) && (nodeSeqEqual((lastValue as XMLList), (value as XMLList)))))))){
destFunc.call(document, value);
lastValue = value;
hasHadValue = true;
};
};
}
}
}//package mx.binding
Section 32
//BindingManager (mx.binding.BindingManager)
package mx.binding {
import mx.core.*;
public class BindingManager {
mx_internal static const VERSION:String = "3.5.0.12683";
static var debugDestinationStrings:Object = {};
public function BindingManager(){
super();
}
public static function executeBindings(document:Object, destStr:String, destObj:Object):void{
var binding:String;
if (((!(destStr)) || ((destStr == "")))){
return;
};
if (((((((document) && ((((document is IBindingClient)) || (document.hasOwnProperty("_bindingsByDestination")))))) && (document._bindingsByDestination))) && (document._bindingsBeginWithWord[getFirstWord(destStr)]))){
for (binding in document._bindingsByDestination) {
if (binding.charAt(0) == destStr.charAt(0)){
if ((((((binding.indexOf((destStr + ".")) == 0)) || ((binding.indexOf((destStr + "[")) == 0)))) || ((binding == destStr)))){
document._bindingsByDestination[binding].execute(destObj);
};
};
};
};
}
public static function addBinding(document:Object, destStr:String, b:Binding):void{
if (!document._bindingsByDestination){
document._bindingsByDestination = {};
document._bindingsBeginWithWord = {};
};
document._bindingsByDestination[destStr] = b;
document._bindingsBeginWithWord[getFirstWord(destStr)] = true;
}
public static function debugBinding(destinationString:String):void{
debugDestinationStrings[destinationString] = true;
}
private static function getFirstWord(destStr:String):String{
var indexPeriod:int = destStr.indexOf(".");
var indexBracket:int = destStr.indexOf("[");
if (indexPeriod == indexBracket){
return (destStr);
};
var minIndex:int = Math.min(indexPeriod, indexBracket);
if (minIndex == -1){
minIndex = Math.max(indexPeriod, indexBracket);
};
return (destStr.substr(0, minIndex));
}
public static function setEnabled(document:Object, isEnabled:Boolean):void{
var bindings:Array;
var i:uint;
var binding:Binding;
if ((((document is IBindingClient)) && (document._bindings))){
bindings = (document._bindings as Array);
i = 0;
while (i < bindings.length) {
binding = bindings[i];
binding.isEnabled = isEnabled;
i++;
};
};
}
}
}//package mx.binding
Section 33
//EvalBindingResponder (mx.binding.EvalBindingResponder)
package mx.binding {
import mx.core.*;
import mx.rpc.*;
public class EvalBindingResponder implements IResponder {
private var binding:Binding;
private var object:Object;
mx_internal static const VERSION:String = "3.5.0.12683";
public function EvalBindingResponder(binding:Binding, object:Object){
super();
this.binding = binding;
this.object = object;
}
public function fault(data:Object):void{
}
public function result(data:Object):void{
binding.execute(object);
}
}
}//package mx.binding
Section 34
//IBindingClient (mx.binding.IBindingClient)
package mx.binding {
public interface IBindingClient {
}
}//package mx.binding
Section 35
//ItemPendingError (mx.collections.errors.ItemPendingError)
package mx.collections.errors {
import mx.core.*;
import mx.rpc.*;
public class ItemPendingError extends Error {
private var _responders:Array;
mx_internal static const VERSION:String = "3.5.0.12683";
public function ItemPendingError(message:String){
super(message);
}
public function get responders():Array{
return (_responders);
}
public function addResponder(responder:IResponder):void{
if (!_responders){
_responders = [];
};
_responders.push(responder);
}
}
}//package mx.collections.errors
Section 36
//IFlexContextMenu (mx.controls.IFlexContextMenu)
package mx.controls {
import flash.display.*;
public interface IFlexContextMenu {
function setContextMenu(:InteractiveObject):void;
function unsetContextMenu(:InteractiveObject):void;
}
}//package mx.controls
Section 37
//ToolTip (mx.controls.ToolTip)
package mx.controls {
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import flash.text.*;
public class ToolTip extends UIComponent implements IToolTip, IFontContextComponent {
private var textChanged:Boolean;
private var _text:String;
protected var textField:IUITextField;
mx_internal var border:IFlexDisplayObject;
mx_internal static const VERSION:String = "3.5.0.12683";
public static var maxWidth:Number = 300;
public function ToolTip(){
super();
mouseEnabled = false;
}
public function set fontContext(moduleFactory:IFlexModuleFactory):void{
this.moduleFactory = moduleFactory;
}
override public function styleChanged(styleProp:String):void{
super.styleChanged(styleProp);
if ((((((styleProp == "borderStyle")) || ((styleProp == "styleName")))) || ((styleProp == null)))){
invalidateDisplayList();
};
}
override protected function commitProperties():void{
var index:int;
var textFormat:TextFormat;
super.commitProperties();
if (((hasFontContextChanged()) && (!((textField == null))))){
index = getChildIndex(DisplayObject(textField));
removeTextField();
createTextField(index);
invalidateSize();
textChanged = true;
};
if (textChanged){
textFormat = textField.getTextFormat();
textFormat.leftMargin = 0;
textFormat.rightMargin = 0;
textField.defaultTextFormat = textFormat;
textField.text = _text;
textChanged = false;
};
}
mx_internal function getTextField():IUITextField{
return (textField);
}
override protected function createChildren():void{
var borderClass:Class;
super.createChildren();
if (!border){
borderClass = getStyle("borderSkin");
border = new (borderClass);
if ((border is ISimpleStyleClient)){
ISimpleStyleClient(border).styleName = this;
};
addChild(DisplayObject(border));
};
createTextField(-1);
}
override protected function measure():void{
var heightSlop:Number;
super.measure();
var bm:EdgeMetrics = borderMetrics;
var leftInset:Number = (bm.left + getStyle("paddingLeft"));
var topInset:Number = (bm.top + getStyle("paddingTop"));
var rightInset:Number = (bm.right + getStyle("paddingRight"));
var bottomInset:Number = (bm.bottom + getStyle("paddingBottom"));
var widthSlop:Number = (leftInset + rightInset);
heightSlop = (topInset + bottomInset);
textField.wordWrap = false;
if ((textField.textWidth + widthSlop) > ToolTip.maxWidth){
textField.width = (ToolTip.maxWidth - widthSlop);
textField.wordWrap = true;
};
measuredWidth = (textField.width + widthSlop);
measuredHeight = (textField.height + heightSlop);
}
public function get fontContext():IFlexModuleFactory{
return (moduleFactory);
}
public function set text(value:String):void{
_text = value;
textChanged = true;
invalidateProperties();
invalidateSize();
invalidateDisplayList();
}
public function get text():String{
return (_text);
}
mx_internal function removeTextField():void{
if (textField){
removeChild(DisplayObject(textField));
textField = null;
};
}
mx_internal function createTextField(childIndex:int):void{
if (!textField){
textField = IUITextField(createInFontContext(UITextField));
textField.autoSize = TextFieldAutoSize.LEFT;
textField.mouseEnabled = false;
textField.multiline = true;
textField.selectable = false;
textField.wordWrap = false;
textField.styleName = this;
if (childIndex == -1){
addChild(DisplayObject(textField));
} else {
addChildAt(DisplayObject(textField), childIndex);
};
};
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
var bm:EdgeMetrics = borderMetrics;
var leftInset:Number = (bm.left + getStyle("paddingLeft"));
var topInset:Number = (bm.top + getStyle("paddingTop"));
var rightInset:Number = (bm.right + getStyle("paddingRight"));
var bottomInset:Number = (bm.bottom + getStyle("paddingBottom"));
var widthSlop:Number = (leftInset + rightInset);
var heightSlop:Number = (topInset + bottomInset);
border.setActualSize(unscaledWidth, unscaledHeight);
textField.move(leftInset, topInset);
textField.setActualSize((unscaledWidth - widthSlop), (unscaledHeight - heightSlop));
}
private function get borderMetrics():EdgeMetrics{
if ((border is IRectangularBorder)){
return (IRectangularBorder(border).borderMetrics);
};
return (EdgeMetrics.EMPTY);
}
}
}//package mx.controls
Section 38
//ApplicationGlobals (mx.core.ApplicationGlobals)
package mx.core {
public class ApplicationGlobals {
public static var application:Object;
public function ApplicationGlobals(){
super();
}
}
}//package mx.core
Section 39
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.5.0.12683";
public function BitmapAsset(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){
super(bitmapData, pixelSnapping, smoothing);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
width = newWidth;
height = newHeight;
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
}
}//package mx.core
Section 40
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.5.0.12683";
public function ByteArrayAsset(){
super();
}
}
}//package mx.core
Section 41
//ComponentDescriptor (mx.core.ComponentDescriptor)
package mx.core {
public class ComponentDescriptor {
public var events:Object;
public var type:Class;
public var document:Object;
private var _properties:Object;
public var propertiesFactory:Function;
public var id:String;
mx_internal static const VERSION:String = "3.5.0.12683";
public function ComponentDescriptor(descriptorProperties:Object){
var p:String;
super();
for (p in descriptorProperties) {
this[p] = descriptorProperties[p];
};
}
public function toString():String{
return (("ComponentDescriptor_" + id));
}
public function invalidateProperties():void{
_properties = null;
}
public function get properties():Object{
var cd:Array;
var n:int;
var i:int;
if (_properties){
return (_properties);
};
if (propertiesFactory != null){
_properties = propertiesFactory.call(document);
};
if (_properties){
cd = _properties.childDescriptors;
if (cd){
n = cd.length;
i = 0;
while (i < n) {
cd[i].document = document;
i++;
};
};
} else {
_properties = {};
};
return (_properties);
}
}
}//package mx.core
Section 42
//ContainerGlobals (mx.core.ContainerGlobals)
package mx.core {
import flash.display.*;
import mx.managers.*;
public class ContainerGlobals {
public static var focusedContainer:InteractiveObject;
public function ContainerGlobals(){
super();
}
public static function checkFocus(oldObj:InteractiveObject, newObj:InteractiveObject):void{
var fm:IFocusManager;
var defButton:IButton;
var objParent:InteractiveObject = newObj;
var currObj:InteractiveObject = newObj;
var lastUIComp:IUIComponent;
if (((!((newObj == null))) && ((oldObj == newObj)))){
return;
};
while (currObj) {
if (currObj.parent){
objParent = currObj.parent;
} else {
objParent = null;
};
if ((currObj is IUIComponent)){
lastUIComp = IUIComponent(currObj);
};
currObj = objParent;
if (((((currObj) && ((currObj is IContainer)))) && (IContainer(currObj).defaultButton))){
break;
};
};
if (((!((ContainerGlobals.focusedContainer == currObj))) || ((((ContainerGlobals.focusedContainer == null)) && ((currObj == null)))))){
if (!currObj){
currObj = InteractiveObject(lastUIComp);
};
if (((currObj) && ((currObj is IContainer)))){
fm = IContainer(currObj).focusManager;
if (!fm){
return;
};
defButton = (IContainer(currObj).defaultButton as IButton);
if (defButton){
ContainerGlobals.focusedContainer = InteractiveObject(currObj);
fm.defaultButton = (defButton as IButton);
} else {
ContainerGlobals.focusedContainer = InteractiveObject(currObj);
fm.defaultButton = null;
};
};
};
}
}
}//package mx.core
Section 43
//DragSource (mx.core.DragSource)
package mx.core {
public class DragSource {
private var formatHandlers:Object;
private var dataHolder:Object;
private var _formats:Array;
mx_internal static const VERSION:String = "3.5.0.12683";
public function DragSource(){
dataHolder = {};
formatHandlers = {};
_formats = [];
super();
}
public function hasFormat(format:String):Boolean{
var n:int = _formats.length;
var i:int;
while (i < n) {
if (_formats[i] == format){
return (true);
};
i++;
};
return (false);
}
public function addData(data:Object, format:String):void{
_formats.push(format);
dataHolder[format] = data;
}
public function dataForFormat(format:String):Object{
var data:Object = dataHolder[format];
if (data){
return (data);
};
if (formatHandlers[format]){
return (formatHandlers[format]());
};
return (null);
}
public function addHandler(handler:Function, format:String):void{
_formats.push(format);
formatHandlers[format] = handler;
}
public function get formats():Array{
return (_formats);
}
}
}//package mx.core
Section 44
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(left:Number=0, top:Number=0, right:Number=0, bottom:Number=0){
super();
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 45
//EmbeddedFont (mx.core.EmbeddedFont)
package mx.core {
public class EmbeddedFont {
private var _fontName:String;
private var _fontStyle:String;
mx_internal static const VERSION:String = "3.5.0.12683";
public function EmbeddedFont(fontName:String, bold:Boolean, italic:Boolean){
super();
_fontName = fontName;
_fontStyle = EmbeddedFontRegistry.getFontStyle(bold, italic);
}
public function get fontStyle():String{
return (_fontStyle);
}
public function get fontName():String{
return (_fontName);
}
}
}//package mx.core
Section 46
//EmbeddedFontRegistry (mx.core.EmbeddedFontRegistry)
package mx.core {
import flash.utils.*;
import flash.text.*;
public class EmbeddedFontRegistry implements IEmbeddedFontRegistry {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var fonts:Object = {};
private static var instance:IEmbeddedFontRegistry;
public function EmbeddedFontRegistry(){
super();
}
public function getAssociatedModuleFactory(font:EmbeddedFont, defaultModuleFactory:IFlexModuleFactory):IFlexModuleFactory{
var found:int;
var iter:Object;
var fontDictionary:Dictionary = fonts[createFontKey(font)];
if (fontDictionary){
found = fontDictionary[defaultModuleFactory];
if (found){
return (defaultModuleFactory);
};
for (iter in fontDictionary) {
return ((iter as IFlexModuleFactory));
};
};
return (null);
}
public function deregisterFont(font:EmbeddedFont, moduleFactory:IFlexModuleFactory):void{
var count:int;
var obj:Object;
var fontKey:String = createFontKey(font);
var fontDictionary:Dictionary = fonts[fontKey];
if (fontDictionary != null){
delete fontDictionary[moduleFactory];
count = 0;
for (obj in fontDictionary) {
count++;
};
if (count == 0){
delete fonts[fontKey];
};
};
}
public function getFonts():Array{
var key:String;
var fontArray:Array = [];
for (key in fonts) {
fontArray.push(createEmbeddedFont(key));
};
return (fontArray);
}
public function registerFont(font:EmbeddedFont, moduleFactory:IFlexModuleFactory):void{
var fontKey:String = createFontKey(font);
var fontDictionary:Dictionary = fonts[fontKey];
if (!fontDictionary){
fontDictionary = new Dictionary(true);
fonts[fontKey] = fontDictionary;
};
fontDictionary[moduleFactory] = 1;
}
public static function registerFonts(fonts:Object, moduleFactory:IFlexModuleFactory):void{
var f:Object;
var fontObj:Object;
var fieldIter:String;
var bold:Boolean;
var italic:Boolean;
var fontRegistry:IEmbeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
for (f in fonts) {
fontObj = fonts[f];
for (fieldIter in fontObj) {
if (fontObj[fieldIter] == false){
} else {
if (fieldIter == "regular"){
bold = false;
italic = false;
} else {
if (fieldIter == "boldItalic"){
bold = true;
italic = true;
} else {
if (fieldIter == "bold"){
bold = true;
italic = false;
} else {
if (fieldIter == "italic"){
bold = false;
italic = true;
};
};
};
};
fontRegistry.registerFont(new EmbeddedFont(String(f), bold, italic), moduleFactory);
};
};
};
}
public static function getInstance():IEmbeddedFontRegistry{
if (!instance){
instance = new (EmbeddedFontRegistry);
};
return (instance);
}
public static function getFontStyle(bold:Boolean, italic:Boolean):String{
var style:String = FontStyle.REGULAR;
if (((bold) && (italic))){
style = FontStyle.BOLD_ITALIC;
} else {
if (bold){
style = FontStyle.BOLD;
} else {
if (italic){
style = FontStyle.ITALIC;
};
};
};
return (style);
}
private static function createFontKey(font:EmbeddedFont):String{
return ((font.fontName + font.fontStyle));
}
private static function createEmbeddedFont(key:String):EmbeddedFont{
var fontName:String;
var fontBold:Boolean;
var fontItalic:Boolean;
var index:int = endsWith(key, FontStyle.REGULAR);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, false, false));
};
index = endsWith(key, FontStyle.BOLD);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, true, false));
};
index = endsWith(key, FontStyle.BOLD_ITALIC);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, true, true));
};
index = endsWith(key, FontStyle.ITALIC);
if (index > 0){
fontName = key.substring(0, index);
return (new EmbeddedFont(fontName, false, true));
};
return (new EmbeddedFont("", false, false));
}
private static function endsWith(s:String, match:String):int{
var index:int = s.lastIndexOf(match);
if ((((index > 0)) && (((index + match.length) == s.length)))){
return (index);
};
return (-1);
}
}
}//package mx.core
Section 47
//EventPriority (mx.core.EventPriority)
package mx.core {
public final class EventPriority {
public static const DEFAULT:int = 0;
public static const BINDING:int = 100;
public static const DEFAULT_HANDLER:int = -50;
public static const EFFECT:int = -100;
public static const CURSOR_MANAGEMENT:int = 200;
mx_internal static const VERSION:String = "3.5.0.12683";
public function EventPriority(){
super();
}
}
}//package mx.core
Section 48
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FlexBitmap(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){
var bitmapData = bitmapData;
var pixelSnapping = pixelSnapping;
var smoothing = smoothing;
super(bitmapData, pixelSnapping, smoothing);
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 49
//FlexLoader (mx.core.FlexLoader)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexLoader extends Loader {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FlexLoader(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 50
//FlexShape (mx.core.FlexShape)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexShape extends Shape {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FlexShape(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 51
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FlexSprite(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 52
//FlexTextField (mx.core.FlexTextField)
package mx.core {
import flash.text.*;
import mx.utils.*;
public class FlexTextField extends TextField {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FlexTextField(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 53
//FlexVersion (mx.core.FlexVersion)
package mx.core {
import mx.resources.*;
public class FlexVersion {
public static const VERSION_2_0_1:uint = 33554433;
public static const CURRENT_VERSION:uint = 50331648;
public static const VERSION_3_0:uint = 50331648;
public static const VERSION_2_0:uint = 33554432;
public static const VERSION_ALREADY_READ:String = "versionAlreadyRead";
public static const VERSION_ALREADY_SET:String = "versionAlreadySet";
mx_internal static const VERSION:String = "3.5.0.12683";
private static var compatibilityVersionChanged:Boolean = false;
private static var _compatibilityErrorFunction:Function;
private static var _compatibilityVersion:uint = 50331648;
private static var compatibilityVersionRead:Boolean = false;
public function FlexVersion(){
super();
}
mx_internal static function changeCompatibilityVersionString(value:String):void{
var pieces:Array = value.split(".");
var major:uint = parseInt(pieces[0]);
var minor:uint = parseInt(pieces[1]);
var update:uint = parseInt(pieces[2]);
_compatibilityVersion = (((major << 24) + (minor << 16)) + update);
}
public static function set compatibilityVersion(value:uint):void{
var s:String;
if (value == _compatibilityVersion){
return;
};
if (compatibilityVersionChanged){
if (compatibilityErrorFunction == null){
s = ResourceManager.getInstance().getString("core", VERSION_ALREADY_SET);
throw (new Error(s));
};
compatibilityErrorFunction(value, VERSION_ALREADY_SET);
};
if (compatibilityVersionRead){
if (compatibilityErrorFunction == null){
s = ResourceManager.getInstance().getString("core", VERSION_ALREADY_READ);
throw (new Error(s));
};
compatibilityErrorFunction(value, VERSION_ALREADY_READ);
};
_compatibilityVersion = value;
compatibilityVersionChanged = true;
}
public static function get compatibilityVersion():uint{
compatibilityVersionRead = true;
return (_compatibilityVersion);
}
public static function set compatibilityErrorFunction(value:Function):void{
_compatibilityErrorFunction = value;
}
public static function set compatibilityVersionString(value:String):void{
var pieces:Array = value.split(".");
var major:uint = parseInt(pieces[0]);
var minor:uint = parseInt(pieces[1]);
var update:uint = parseInt(pieces[2]);
compatibilityVersion = (((major << 24) + (minor << 16)) + update);
}
public static function get compatibilityErrorFunction():Function{
return (_compatibilityErrorFunction);
}
public static function get compatibilityVersionString():String{
var major:uint = ((compatibilityVersion >> 24) & 0xFF);
var minor:uint = ((compatibilityVersion >> 16) & 0xFF);
var update:uint = (compatibilityVersion & 0xFFFF);
return (((((major.toString() + ".") + minor.toString()) + ".") + update.toString()));
}
}
}//package mx.core
Section 54
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.5.0.12683";
public function FontAsset(){
super();
}
}
}//package mx.core
Section 55
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 56
//IButton (mx.core.IButton)
package mx.core {
public interface IButton extends IUIComponent {
function get emphasized():Boolean;
function set emphasized(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IButton.as:Boolean):void;
function callLater(_arg1:Function, _arg2:Array=null):void;
}
}//package mx.core
Section 57
//IChildList (mx.core.IChildList)
package mx.core {
import flash.display.*;
import flash.geom.*;
public interface IChildList {
function get numChildren():int;
function removeChild(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject;
function getChildByName(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IChildList.as:String):DisplayObject;
function removeChildAt(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject;
function getChildIndex(:DisplayObject):int;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function getObjectsUnderPoint(child:Point):Array;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function getChildAt(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IChildList.as:int):DisplayObject;
function addChild(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IChildList.as:DisplayObject):DisplayObject;
function contains(flash.display:DisplayObject):Boolean;
}
}//package mx.core
Section 58
//IConstraintClient (mx.core.IConstraintClient)
package mx.core {
public interface IConstraintClient {
function setConstraintValue(_arg1:String, _arg2):void;
function getConstraintValue(*:String);
}
}//package mx.core
Section 59
//IContainer (mx.core.IContainer)
package mx.core {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import mx.managers.*;
import flash.media.*;
public interface IContainer extends IUIComponent {
function set hitArea(mx.core:IContainer/mx.core:IContainer:graphics/get:Sprite):void;
function swapChildrenAt(_arg1:int, _arg2:int):void;
function getChildByName(Graphics:String):DisplayObject;
function get doubleClickEnabled():Boolean;
function get graphics():Graphics;
function get useHandCursor():Boolean;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function set mouseChildren(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function set creatingContentPane(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get textSnapshot():TextSnapshot;
function getChildIndex(value:DisplayObject):int;
function set doubleClickEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function getObjectsUnderPoint(lockCenter:Point):Array;
function get creatingContentPane():Boolean;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function get soundTransform():SoundTransform;
function set useHandCursor(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get numChildren():int;
function contains(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:DisplayObject):Boolean;
function get verticalScrollPosition():Number;
function set defaultButton(mx.core:IContainer/mx.core:IContainer:graphics/get:IFlexDisplayObject):void;
function swapChildren(_arg1:DisplayObject, _arg2:DisplayObject):void;
function set horizontalScrollPosition(mx.core:IContainer/mx.core:IContainer:graphics/get:Number):void;
function get focusManager():IFocusManager;
function startDrag(_arg1:Boolean=false, _arg2:Rectangle=null):void;
function set mouseEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function getChildAt(Graphics:int):DisplayObject;
function set soundTransform(mx.core:IContainer/mx.core:IContainer:graphics/get:SoundTransform):void;
function get tabChildren():Boolean;
function get tabIndex():int;
function set focusRect(mx.core:IContainer/mx.core:IContainer:graphics/get:Object):void;
function get hitArea():Sprite;
function get mouseChildren():Boolean;
function removeChildAt(Graphics:int):DisplayObject;
function get defaultButton():IFlexDisplayObject;
function stopDrag():void;
function set tabEnabled(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get horizontalScrollPosition():Number;
function get focusRect():Object;
function get viewMetrics():EdgeMetrics;
function set verticalScrollPosition(mx.core:IContainer/mx.core:IContainer:graphics/get:Number):void;
function get dropTarget():DisplayObject;
function get mouseEnabled():Boolean;
function set tabChildren(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function set buttonMode(mx.core:IContainer/mx.core:IContainer:graphics/get:Boolean):void;
function get tabEnabled():Boolean;
function get buttonMode():Boolean;
function removeChild(Graphics:DisplayObject):DisplayObject;
function set tabIndex(mx.core:IContainer/mx.core:IContainer:graphics/get:int):void;
function addChild(Graphics:DisplayObject):DisplayObject;
function areInaccessibleObjectsUnderPoint(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ISpriteInterface.as:Point):Boolean;
}
}//package mx.core
Section 60
//IDeferredInstantiationUIComponent (mx.core.IDeferredInstantiationUIComponent)
package mx.core {
public interface IDeferredInstantiationUIComponent extends IUIComponent {
function set cacheHeuristic(:Boolean):void;
function createReferenceOnParentDocument(:IFlexDisplayObject):void;
function get cachePolicy():String;
function set id(:String):void;
function registerEffects(:Array):void;
function executeBindings(:Boolean=false):void;
function get id():String;
function deleteReferenceOnParentDocument(:IFlexDisplayObject):void;
function set descriptor(:UIComponentDescriptor):void;
function get descriptor():UIComponentDescriptor;
}
}//package mx.core
Section 61
//IEmbeddedFontRegistry (mx.core.IEmbeddedFontRegistry)
package mx.core {
public interface IEmbeddedFontRegistry {
function getAssociatedModuleFactory(_arg1:EmbeddedFont, _arg2:IFlexModuleFactory):IFlexModuleFactory;
function registerFont(_arg1:EmbeddedFont, _arg2:IFlexModuleFactory):void;
function deregisterFont(_arg1:EmbeddedFont, _arg2:IFlexModuleFactory):void;
function getFonts():Array;
}
}//package mx.core
Section 62
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 63
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(void:Point):Point;
function get name():String;
function set width(flash.display:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(flash.display:String):void;
function set scaleX(flash.display:Number):void;
function set scaleY(flash.display:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(flash.display:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(void:Point):Point;
function get height():Number;
function set blendMode(flash.display:String):void;
function get parent():DisplayObjectContainer;
function getBounds(String:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(flash.display:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(flash.display:Number):void;
function set accessibilityProperties(flash.display:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(flash.display:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(flash.display:Number):void;
function set mask(flash.display:DisplayObject):void;
function getRect(String:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(flash.display:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(mx.core:IFlexDisplayObject/mx.core:IFlexDisplayObject:stage/get:DisplayObject):Boolean;
function set opaqueBackground(flash.display:Object):void;
function set visible(flash.display:Boolean):void;
function get mask():DisplayObject;
function set x(flash.display:Number):void;
function set y(flash.display:Number):void;
function get transform():Transform;
function set filters(flash.display:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(flash.display:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 64
//IFlexModule (mx.core.IFlexModule)
package mx.core {
public interface IFlexModule {
function set moduleFactory(:IFlexModuleFactory):void;
function get moduleFactory():IFlexModuleFactory;
}
}//package mx.core
Section 65
//IFlexModuleFactory (mx.core.IFlexModuleFactory)
package mx.core {
import flash.utils.*;
public interface IFlexModuleFactory {
function get preloadedRSLs():Dictionary;
function allowInsecureDomain(... _args):void;
function create(... _args):Object;
function allowDomain(... _args):void;
function info():Object;
}
}//package mx.core
Section 66
//IFontContextComponent (mx.core.IFontContextComponent)
package mx.core {
public interface IFontContextComponent {
function get fontContext():IFlexModuleFactory;
function set fontContext(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IFontContextComponent.as:IFlexModuleFactory):void;
}
}//package mx.core
Section 67
//IIMESupport (mx.core.IIMESupport)
package mx.core {
public interface IIMESupport {
function set imeMode(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IIMESupport.as:String):void;
function get imeMode():String;
}
}//package mx.core
Section 68
//IInvalidating (mx.core.IInvalidating)
package mx.core {
public interface IInvalidating {
function validateNow():void;
function invalidateSize():void;
function invalidateDisplayList():void;
function invalidateProperties():void;
}
}//package mx.core
Section 69
//IProgrammaticSkin (mx.core.IProgrammaticSkin)
package mx.core {
public interface IProgrammaticSkin {
function validateNow():void;
function validateDisplayList():void;
}
}//package mx.core
Section 70
//IPropertyChangeNotifier (mx.core.IPropertyChangeNotifier)
package mx.core {
import flash.events.*;
public interface IPropertyChangeNotifier extends IEventDispatcher, IUID {
}
}//package mx.core
Section 71
//IRawChildrenContainer (mx.core.IRawChildrenContainer)
package mx.core {
public interface IRawChildrenContainer {
function get rawChildren():IChildList;
}
}//package mx.core
Section 72
//IRectangularBorder (mx.core.IRectangularBorder)
package mx.core {
import flash.geom.*;
public interface IRectangularBorder extends IBorder {
function get backgroundImageBounds():Rectangle;
function get hasBackgroundImage():Boolean;
function set backgroundImageBounds(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRectangularBorder.as:Rectangle):void;
function layoutBackgroundImage():void;
}
}//package mx.core
Section 73
//IRepeater (mx.core.IRepeater)
package mx.core {
public interface IRepeater {
function get container():IContainer;
function set startingIndex(mx.core:IRepeater/mx.core:IRepeater:container/get:int):void;
function get startingIndex():int;
function set recycleChildren(mx.core:IRepeater/mx.core:IRepeater:container/get:Boolean):void;
function get currentItem():Object;
function get count():int;
function get recycleChildren():Boolean;
function executeChildBindings():void;
function set dataProvider(mx.core:IRepeater/mx.core:IRepeater:container/get:Object):void;
function initializeRepeater(_arg1:IContainer, _arg2:Boolean):void;
function get currentIndex():int;
function get dataProvider():Object;
function set count(mx.core:IRepeater/mx.core:IRepeater:container/get:int):void;
}
}//package mx.core
Section 74
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get isDocument():Boolean;
function set repeaters(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function initializeRepeaterArrays(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 75
//IStateClient (mx.core.IStateClient)
package mx.core {
public interface IStateClient {
function get currentState():String;
function set currentState(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IStateClient.as:String):void;
}
}//package mx.core
Section 76
//ISWFBridgeGroup (mx.core.ISWFBridgeGroup)
package mx.core {
import flash.events.*;
public interface ISWFBridgeGroup {
function getChildBridgeProvider(mx.core:ISWFBridgeGroup/mx.core:ISWFBridgeGroup:parentBridge/get:IEventDispatcher):ISWFBridgeProvider;
function removeChildBridge(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void;
function get parentBridge():IEventDispatcher;
function addChildBridge(_arg1:IEventDispatcher, _arg2:ISWFBridgeProvider):void;
function set parentBridge(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ISWFBridgeGroup.as:IEventDispatcher):void;
function containsBridge(IEventDispatcher:IEventDispatcher):Boolean;
function getChildBridges():Array;
}
}//package mx.core
Section 77
//ISWFBridgeProvider (mx.core.ISWFBridgeProvider)
package mx.core {
import flash.events.*;
public interface ISWFBridgeProvider {
function get childAllowsParent():Boolean;
function get swfBridge():IEventDispatcher;
function get parentAllowsChild():Boolean;
}
}//package mx.core
Section 78
//ISWFLoader (mx.core.ISWFLoader)
package mx.core {
import flash.geom.*;
public interface ISWFLoader extends ISWFBridgeProvider {
function getVisibleApplicationRect(mx.core:ISWFLoader/mx.core:ISWFLoader:loadForCompatibility/get:Boolean=false):Rectangle;
function set loadForCompatibility(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ISWFLoader.as:Boolean):void;
function get loadForCompatibility():Boolean;
}
}//package mx.core
Section 79
//ITextFieldFactory (mx.core.ITextFieldFactory)
package mx.core {
import flash.text.*;
public interface ITextFieldFactory {
function createTextField(:IFlexModuleFactory):TextField;
}
}//package mx.core
Section 80
//IToolTip (mx.core.IToolTip)
package mx.core {
import flash.geom.*;
public interface IToolTip extends IUIComponent {
function set text(mx.core:IToolTip/mx.core:IToolTip:screen/get:String):void;
function get screen():Rectangle;
function get text():String;
}
}//package mx.core
Section 81
//IUIComponent (mx.core.IUIComponent)
package mx.core {
import flash.display.*;
import mx.managers.*;
public interface IUIComponent extends IFlexDisplayObject {
function set focusPane(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Sprite):void;
function get enabled():Boolean;
function set enabled(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function set isPopUp(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function get explicitMinHeight():Number;
function get percentWidth():Number;
function get isPopUp():Boolean;
function get owner():DisplayObjectContainer;
function get percentHeight():Number;
function get baselinePosition():Number;
function owns(Number:DisplayObject):Boolean;
function initialize():void;
function get maxWidth():Number;
function get minWidth():Number;
function getExplicitOrMeasuredWidth():Number;
function get explicitMaxWidth():Number;
function get explicitMaxHeight():Number;
function set percentHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get minHeight():Number;
function set percentWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get document():Object;
function get focusPane():Sprite;
function getExplicitOrMeasuredHeight():Number;
function set tweeningProperties(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Array):void;
function set explicitWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function set measuredMinHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get explicitMinWidth():Number;
function get tweeningProperties():Array;
function get maxHeight():Number;
function set owner(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:DisplayObjectContainer):void;
function set includeInLayout(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Boolean):void;
function setVisible(_arg1:Boolean, _arg2:Boolean=false):void;
function parentChanged(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:DisplayObjectContainer):void;
function get explicitWidth():Number;
function get measuredMinHeight():Number;
function set measuredMinWidth(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function set explicitHeight(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Number):void;
function get includeInLayout():Boolean;
function get measuredMinWidth():Number;
function get explicitHeight():Number;
function set systemManager(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:ISystemManager):void;
function set document(mx.core:IUIComponent/mx.core:IUIComponent:baselinePosition/get:Object):void;
function get systemManager():ISystemManager;
}
}//package mx.core
Section 82
//IUID (mx.core.IUID)
package mx.core {
public interface IUID {
function get uid():String;
function set uid(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;IUID.as:String):void;
}
}//package mx.core
Section 83
//IUITextField (mx.core.IUITextField)
package mx.core {
import flash.display.*;
import mx.styles.*;
import flash.geom.*;
import flash.text.*;
import mx.managers.*;
public interface IUITextField extends IIMESupport, IFlexModule, IInvalidating, ISimpleStyleClient, IToolTipManagerClient, IUIComponent {
function replaceText(_arg1:int, _arg2:int, _arg3:String):void;
function get doubleClickEnabled():Boolean;
function get nestLevel():int;
function get caretIndex():int;
function set doubleClickEnabled(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get maxScrollH():int;
function set nestLevel(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function get numLines():int;
function get scrollH():int;
function setColor(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get maxScrollV():int;
function getImageReference(mx.core:IUITextField/mx.core:IUITextField:antiAliasType/set:String):DisplayObject;
function get scrollV():int;
function get border():Boolean;
function get text():String;
function get styleSheet():StyleSheet;
function getCharBoundaries(String:int):Rectangle;
function get background():Boolean;
function set scrollH(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function getFirstCharInParagraph(value:int):int;
function get type():String;
function replaceSelectedText(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function set borderColor(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get alwaysShowSelection():Boolean;
function get sharpness():Number;
function get tabIndex():int;
function get textColor():uint;
function set defaultTextFormat(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:TextFormat):void;
function get condenseWhite():Boolean;
function get displayAsPassword():Boolean;
function get autoSize():String;
function setSelection(_arg1:int, _arg2:int):void;
function set scrollV(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function set useRichTextClipboard(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get selectionBeginIndex():int;
function get selectable():Boolean;
function set border(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set multiline(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set background(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set embedFonts(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set text(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get selectionEndIndex():int;
function set mouseWheelEnabled(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function appendText(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get antiAliasType():String;
function set styleSheet(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:StyleSheet):void;
function set nonInheritingStyles(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void;
function set textColor(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get wordWrap():Boolean;
function getLineIndexAtPoint(_arg1:Number, _arg2:Number):int;
function get htmlText():String;
function set tabIndex(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function get thickness():Number;
function getLineIndexOfChar(value:int):int;
function get bottomScrollV():int;
function set restrict(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function set alwaysShowSelection(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function getTextFormat(_arg1:int=-1, _arg2:int=-1):TextFormat;
function set sharpness(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Number):void;
function set type(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function setTextFormat(_arg1:TextFormat, _arg2:int=-1, _arg3:int=-1):void;
function set gridFitType(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function getUITextFormat():UITextFormat;
function set inheritingStyles(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void;
function setFocus():void;
function get borderColor():uint;
function set condenseWhite(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get textWidth():Number;
function getLineOffset(value:int):int;
function set displayAsPassword(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set autoSize(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get defaultTextFormat():TextFormat;
function get useRichTextClipboard():Boolean;
function get nonZeroTextHeight():Number;
function set backgroundColor(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:uint):void;
function get embedFonts():Boolean;
function set selectable(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get multiline():Boolean;
function set maxChars(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:int):void;
function get textHeight():Number;
function get nonInheritingStyles():Object;
function getLineText(mx.core:IUITextField/mx.core:IUITextField:alwaysShowSelection/get:int):String;
function set focusRect(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Object):void;
function get mouseWheelEnabled():Boolean;
function get restrict():String;
function getParagraphLength(value:int):int;
function set mouseEnabled(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get gridFitType():String;
function get inheritingStyles():Object;
function set ignorePadding(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function set antiAliasType(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function get backgroundColor():uint;
function getCharIndexAtPoint(_arg1:Number, _arg2:Number):int;
function set tabEnabled(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get maxChars():int;
function get focusRect():Object;
function get ignorePadding():Boolean;
function get mouseEnabled():Boolean;
function get length():int;
function set wordWrap(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Boolean):void;
function get tabEnabled():Boolean;
function set thickness(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:Number):void;
function getLineLength(value:int):int;
function truncateToFit(:String=null):Boolean;
function set htmlText(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\core;ITextFieldInterface.as:String):void;
function getLineMetrics(antiAliasType:int):TextLineMetrics;
function getStyle(*:String);
}
}//package mx.core
Section 84
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 85
//ResourceModuleRSLItem (mx.core.ResourceModuleRSLItem)
package mx.core {
import flash.events.*;
import mx.events.*;
import mx.resources.*;
public class ResourceModuleRSLItem extends RSLItem {
mx_internal static const VERSION:String = "3.5.0.12683";
public function ResourceModuleRSLItem(url:String){
super(url);
}
private function resourceErrorHandler(event:ResourceEvent):void{
var errorEvent:IOErrorEvent = new IOErrorEvent(IOErrorEvent.IO_ERROR);
errorEvent.text = event.errorText;
super.itemErrorHandler(errorEvent);
}
override public function load(progressHandler:Function, completeHandler:Function, ioErrorHandler:Function, securityErrorHandler:Function, rslErrorHandler:Function):void{
chainedProgressHandler = progressHandler;
chainedCompleteHandler = completeHandler;
chainedIOErrorHandler = ioErrorHandler;
chainedSecurityErrorHandler = securityErrorHandler;
chainedRSLErrorHandler = rslErrorHandler;
var resourceManager:IResourceManager = ResourceManager.getInstance();
var eventDispatcher:IEventDispatcher = resourceManager.loadResourceModule(url);
eventDispatcher.addEventListener(ResourceEvent.PROGRESS, itemProgressHandler);
eventDispatcher.addEventListener(ResourceEvent.COMPLETE, itemCompleteHandler);
eventDispatcher.addEventListener(ResourceEvent.ERROR, resourceErrorHandler);
}
}
}//package mx.core
Section 86
//RSLItem (mx.core.RSLItem)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import mx.events.*;
import flash.net.*;
import mx.utils.*;
public class RSLItem {
protected var chainedSecurityErrorHandler:Function;
public var total:uint;// = 0
public var loaded:uint;// = 0
private var completed:Boolean;// = false
protected var chainedRSLErrorHandler:Function;
protected var chainedIOErrorHandler:Function;
protected var chainedCompleteHandler:Function;
private var errorText:String;
protected var chainedProgressHandler:Function;
public var urlRequest:URLRequest;
public var rootURL:String;
protected var url:String;
mx_internal static const VERSION:String = "3.5.0.12683";
public function RSLItem(url:String, rootURL:String=null){
super();
this.url = url;
this.rootURL = rootURL;
}
public function itemProgressHandler(event:ProgressEvent):void{
loaded = event.bytesLoaded;
total = event.bytesTotal;
if (chainedProgressHandler != null){
chainedProgressHandler(event);
};
}
public function itemErrorHandler(event:ErrorEvent):void{
errorText = decodeURI(event.text);
completed = true;
loaded = 0;
total = 0;
trace(errorText);
if ((((event.type == IOErrorEvent.IO_ERROR)) && (!((chainedIOErrorHandler == null))))){
chainedIOErrorHandler(event);
} else {
if ((((event.type == SecurityErrorEvent.SECURITY_ERROR)) && (!((chainedSecurityErrorHandler == null))))){
chainedSecurityErrorHandler(event);
} else {
if ((((event.type == RSLEvent.RSL_ERROR)) && (!((chainedRSLErrorHandler == null))))){
chainedRSLErrorHandler(event);
};
};
};
}
public function load(progressHandler:Function, completeHandler:Function, ioErrorHandler:Function, securityErrorHandler:Function, rslErrorHandler:Function):void{
chainedProgressHandler = progressHandler;
chainedCompleteHandler = completeHandler;
chainedIOErrorHandler = ioErrorHandler;
chainedSecurityErrorHandler = securityErrorHandler;
chainedRSLErrorHandler = rslErrorHandler;
var loader:Loader = new Loader();
var loaderContext:LoaderContext = new LoaderContext();
urlRequest = new URLRequest(LoaderUtil.createAbsoluteURL(rootURL, url));
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, itemProgressHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, itemCompleteHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, itemErrorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, itemErrorHandler);
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
loader.load(urlRequest, loaderContext);
}
public function itemCompleteHandler(event:Event):void{
completed = true;
if (chainedCompleteHandler != null){
chainedCompleteHandler(event);
};
}
}
}//package mx.core
Section 87
//RSLListLoader (mx.core.RSLListLoader)
package mx.core {
import flash.events.*;
public class RSLListLoader {
private var chainedSecurityErrorHandler:Function;
private var chainedIOErrorHandler:Function;
private var rslList:Array;
private var chainedRSLErrorHandler:Function;
private var chainedCompleteHandler:Function;
private var currentIndex:int;// = 0
private var chainedProgressHandler:Function;
mx_internal static const VERSION:String = "3.5.0.12683";
public function RSLListLoader(rslList:Array){
rslList = [];
super();
this.rslList = rslList;
}
private function loadNext():void{
if (!isDone()){
currentIndex++;
if (currentIndex < rslList.length){
rslList[currentIndex].load(chainedProgressHandler, listCompleteHandler, listIOErrorHandler, listSecurityErrorHandler, chainedRSLErrorHandler);
};
};
}
public function getIndex():int{
return (currentIndex);
}
public function load(progressHandler:Function, completeHandler:Function, ioErrorHandler:Function, securityErrorHandler:Function, rslErrorHandler:Function):void{
chainedProgressHandler = progressHandler;
chainedCompleteHandler = completeHandler;
chainedIOErrorHandler = ioErrorHandler;
chainedSecurityErrorHandler = securityErrorHandler;
chainedRSLErrorHandler = rslErrorHandler;
currentIndex = -1;
loadNext();
}
private function listCompleteHandler(event:Event):void{
if (chainedCompleteHandler != null){
chainedCompleteHandler(event);
};
loadNext();
}
public function isDone():Boolean{
return ((currentIndex >= rslList.length));
}
private function listSecurityErrorHandler(event:Event):void{
if (chainedSecurityErrorHandler != null){
chainedSecurityErrorHandler(event);
};
}
public function getItemCount():int{
return (rslList.length);
}
public function getItem(index:int):RSLItem{
if ((((index < 0)) || ((index >= rslList.length)))){
return (null);
};
return (rslList[index]);
}
private function listIOErrorHandler(event:Event):void{
if (chainedIOErrorHandler != null){
chainedIOErrorHandler(event);
};
}
}
}//package mx.core
Section 88
//Singleton (mx.core.Singleton)
package mx.core {
public class Singleton {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var classMap:Object = {};
public function Singleton(){
super();
}
public static function registerClass(interfaceName:String, clazz:Class):void{
var c:Class = classMap[interfaceName];
if (!c){
classMap[interfaceName] = clazz;
};
}
public static function getClass(interfaceName:String):Class{
return (classMap[interfaceName]);
}
public static function getInstance(interfaceName:String):Object{
var c:Class = classMap[interfaceName];
if (!c){
throw (new Error((("No class registered for interface '" + interfaceName) + "'.")));
};
return (c["getInstance"]());
}
}
}//package mx.core
Section 89
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.5.0.12683";
public function SoundAsset(){
super();
}
}
}//package mx.core
Section 90
//SWFBridgeGroup (mx.core.SWFBridgeGroup)
package mx.core {
import flash.events.*;
import flash.utils.*;
import mx.managers.*;
public class SWFBridgeGroup implements ISWFBridgeGroup {
private var _parentBridge:IEventDispatcher;
private var _childBridges:Dictionary;
private var _groupOwner:ISystemManager;
mx_internal static const VERSION:String = "3.5.0.12683";
public function SWFBridgeGroup(owner:ISystemManager){
super();
_groupOwner = owner;
}
public function getChildBridgeProvider(bridge:IEventDispatcher):ISWFBridgeProvider{
if (!_childBridges){
return (null);
};
return (ISWFBridgeProvider(_childBridges[bridge]));
}
public function removeChildBridge(bridge:IEventDispatcher):void{
var iter:Object;
if (((!(_childBridges)) || (!(bridge)))){
return;
};
for (iter in _childBridges) {
if (iter == bridge){
delete _childBridges[iter];
};
};
}
public function get parentBridge():IEventDispatcher{
return (_parentBridge);
}
public function containsBridge(bridge:IEventDispatcher):Boolean{
var iter:Object;
if (((parentBridge) && ((parentBridge == bridge)))){
return (true);
};
for (iter in _childBridges) {
if (bridge == iter){
return (true);
};
};
return (false);
}
public function set parentBridge(bridge:IEventDispatcher):void{
_parentBridge = bridge;
}
public function addChildBridge(bridge:IEventDispatcher, bridgeProvider:ISWFBridgeProvider):void{
if (!_childBridges){
_childBridges = new Dictionary();
};
_childBridges[bridge] = bridgeProvider;
}
public function getChildBridges():Array{
var iter:Object;
var bridges:Array = [];
for (iter in _childBridges) {
bridges.push(iter);
};
return (bridges);
}
}
}//package mx.core
Section 91
//TextFieldFactory (mx.core.TextFieldFactory)
package mx.core {
import flash.utils.*;
import flash.text.*;
public class TextFieldFactory implements ITextFieldFactory {
private var textFields:Dictionary;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var instance:ITextFieldFactory;
public function TextFieldFactory(){
textFields = new Dictionary(true);
super();
}
public function createTextField(moduleFactory:IFlexModuleFactory):TextField{
var iter:Object;
var textField:TextField;
var textFieldDictionary:Dictionary = textFields[moduleFactory];
if (textFieldDictionary){
for (iter in textFieldDictionary) {
textField = TextField(iter);
break;
};
};
if (!textField){
if (moduleFactory){
textField = TextField(moduleFactory.create("flash.text.TextField"));
} else {
textField = new TextField();
};
if (!textFieldDictionary){
textFieldDictionary = new Dictionary(true);
};
textFieldDictionary[textField] = 1;
textFields[moduleFactory] = textFieldDictionary;
};
return (textField);
}
public static function getInstance():ITextFieldFactory{
if (!instance){
instance = new (TextFieldFactory);
};
return (instance);
}
}
}//package mx.core
Section 92
//UIComponent (mx.core.UIComponent)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import mx.styles.*;
import flash.system.*;
import flash.geom.*;
import flash.text.*;
import mx.modules.*;
import mx.events.*;
import mx.resources.*;
import mx.managers.*;
import mx.automation.*;
import mx.controls.*;
import mx.states.*;
import mx.effects.*;
import mx.graphics.*;
import mx.binding.*;
import mx.utils.*;
import mx.validators.*;
public class UIComponent extends FlexSprite implements IAutomationObject, IChildList, IDeferredInstantiationUIComponent, IFlexDisplayObject, IFlexModule, IInvalidating, ILayoutManagerClient, IPropertyChangeNotifier, IRepeaterClient, ISimpleStyleClient, IStyleClient, IToolTipManagerClient, IUIComponent, IValidatorListener, IStateClient, IConstraintClient {
private var cachedEmbeddedFont:EmbeddedFont;// = null
private var errorStringChanged:Boolean;// = false
mx_internal var overlay:UIComponent;
mx_internal var automaticRadioButtonGroups:Object;
private var _currentState:String;
private var _isPopUp:Boolean;
private var _repeaters:Array;
private var _systemManager:ISystemManager;
private var _measuredWidth:Number;// = 0
private var methodQueue:Array;
mx_internal var _width:Number;
private var _tweeningProperties:Array;
private var _validationSubField:String;
private var _endingEffectInstances:Array;
mx_internal var saveBorderColor:Boolean;// = true
mx_internal var overlayColor:uint;
mx_internal var overlayReferenceCount:int;// = 0
private var hasFontContextBeenSaved:Boolean;// = false
private var _repeaterIndices:Array;
private var oldExplicitWidth:Number;
mx_internal var _descriptor:UIComponentDescriptor;
private var _initialized:Boolean;// = false
private var _focusEnabled:Boolean;// = true
private var cacheAsBitmapCount:int;// = 0
private var errorArray:Array;
private var requestedCurrentState:String;
private var listeningForRender:Boolean;// = false
mx_internal var invalidateDisplayListFlag:Boolean;// = false
private var oldScaleX:Number;// = 1
private var oldScaleY:Number;// = 1
mx_internal var _explicitMaxHeight:Number;
mx_internal var invalidatePropertiesFlag:Boolean;// = false
private var hasFocusRect:Boolean;// = false
mx_internal var invalidateSizeFlag:Boolean;// = false
private var _scaleX:Number;// = 1
private var _scaleY:Number;// = 1
private var _styleDeclaration:CSSStyleDeclaration;
private var _resourceManager:IResourceManager;
mx_internal var _affectedProperties:Object;
mx_internal var _documentDescriptor:UIComponentDescriptor;
private var _processedDescriptors:Boolean;// = false
mx_internal var origBorderColor:Number;
private var _focusManager:IFocusManager;
private var _cachePolicy:String;// = "auto"
private var _measuredHeight:Number;// = 0
private var _id:String;
private var _owner:DisplayObjectContainer;
public var transitions:Array;
mx_internal var _parent:DisplayObjectContainer;
private var _measuredMinWidth:Number;// = 0
private var oldMinWidth:Number;
private var _explicitWidth:Number;
private var _enabled:Boolean;// = false
public var states:Array;
private var _mouseFocusEnabled:Boolean;// = true
private var oldHeight:Number;// = 0
private var _currentStateChanged:Boolean;
private var cachedTextFormat:UITextFormat;
mx_internal var _height:Number;
private var _automationDelegate:IAutomationObject;
private var _percentWidth:Number;
private var _automationName:String;// = null
private var _isEffectStarted:Boolean;// = false
private var _styleName:Object;
private var lastUnscaledWidth:Number;
mx_internal var _document:Object;
mx_internal var _errorString:String;// = ""
private var oldExplicitHeight:Number;
private var _nestLevel:int;// = 0
private var _systemManagerDirty:Boolean;// = false
private var _explicitHeight:Number;
mx_internal var _toolTip:String;
private var _filters:Array;
private var _focusPane:Sprite;
private var playStateTransition:Boolean;// = true
private var _nonInheritingStyles:Object;
private var _showInAutomationHierarchy:Boolean;// = true
private var _moduleFactory:IFlexModuleFactory;
private var preventDrawFocus:Boolean;// = false
private var oldX:Number;// = 0
private var oldY:Number;// = 0
private var _instanceIndices:Array;
private var errorObjectArray:Array;
private var _visible:Boolean;// = true
private var _inheritingStyles:Object;
private var _includeInLayout:Boolean;// = true
mx_internal var _effectsStarted:Array;
mx_internal var _explicitMinWidth:Number;
private var lastUnscaledHeight:Number;
mx_internal var _explicitMaxWidth:Number;
private var _measuredMinHeight:Number;// = 0
private var _uid:String;
private var _currentTransitionEffect:IEffect;
private var _updateCompletePendingFlag:Boolean;// = false
private var oldMinHeight:Number;
private var _flexContextMenu:IFlexContextMenu;
mx_internal var _explicitMinHeight:Number;
private var _percentHeight:Number;
private var oldEmbeddedFontContext:IFlexModuleFactory;// = null
private var oldWidth:Number;// = 0
public static const DEFAULT_MEASURED_WIDTH:Number = 160;
public static const DEFAULT_MAX_WIDTH:Number = 10000;
public static const DEFAULT_MEASURED_MIN_HEIGHT:Number = 22;
public static const DEFAULT_MAX_HEIGHT:Number = 10000;
public static const DEFAULT_MEASURED_HEIGHT:Number = 22;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const DEFAULT_MEASURED_MIN_WIDTH:Number = 40;
mx_internal static var dispatchEventHook:Function;
private static var fakeMouseY:QName = new QName(mx_internal, "_mouseY");
mx_internal static var createAccessibilityImplementation:Function;
mx_internal static var STYLE_UNINITIALIZED:Object = {};
private static var fakeMouseX:QName = new QName(mx_internal, "_mouseX");
private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
public function UIComponent(){
methodQueue = [];
_resourceManager = ResourceManager.getInstance();
_inheritingStyles = UIComponent.STYLE_UNINITIALIZED;
_nonInheritingStyles = UIComponent.STYLE_UNINITIALIZED;
states = [];
transitions = [];
_effectsStarted = [];
_affectedProperties = {};
_endingEffectInstances = [];
super();
focusRect = false;
tabEnabled = (this is IFocusManagerComponent);
tabChildren = false;
enabled = true;
$visible = false;
addEventListener(Event.ADDED, addedHandler);
addEventListener(Event.REMOVED, removedHandler);
if ((this is IFocusManagerComponent)){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
resourcesChanged();
resourceManager.addEventListener(Event.CHANGE, resourceManager_changeHandler, false, 0, true);
_width = super.width;
_height = super.height;
}
override public function get filters():Array{
return ((_filters) ? _filters : super.filters);
}
public function get toolTip():String{
return (_toolTip);
}
private function transition_effectEndHandler(event:EffectEvent):void{
_currentTransitionEffect = null;
}
public function get nestLevel():int{
return (_nestLevel);
}
protected function adjustFocusRect(obj:DisplayObject=null):void{
var rectCol:Number;
var thickness:Number;
var pt:Point;
var rotRad:Number;
if (!obj){
obj = this;
};
if (((isNaN(obj.width)) || (isNaN(obj.height)))){
return;
};
var fm:IFocusManager = focusManager;
if (!fm){
return;
};
var focusObj:IFlexDisplayObject = IFlexDisplayObject(getFocusObject());
if (focusObj){
if (((errorString) && (!((errorString == ""))))){
rectCol = getStyle("errorColor");
} else {
rectCol = getStyle("themeColor");
};
thickness = getStyle("focusThickness");
if ((focusObj is IStyleClient)){
IStyleClient(focusObj).setStyle("focusColor", rectCol);
};
focusObj.setActualSize((obj.width + (2 * thickness)), (obj.height + (2 * thickness)));
if (rotation){
rotRad = ((rotation * Math.PI) / 180);
pt = new Point((obj.x - (thickness * (Math.cos(rotRad) - Math.sin(rotRad)))), (obj.y - (thickness * (Math.cos(rotRad) + Math.sin(rotRad)))));
DisplayObject(focusObj).rotation = rotation;
} else {
pt = new Point((obj.x - thickness), (obj.y - thickness));
};
if (obj.parent == this){
pt.x = (pt.x + x);
pt.y = (pt.y + y);
};
pt = parent.localToGlobal(pt);
pt = parent.globalToLocal(pt);
focusObj.move(pt.x, pt.y);
if ((focusObj is IInvalidating)){
IInvalidating(focusObj).validateNow();
} else {
if ((focusObj is IProgrammaticSkin)){
IProgrammaticSkin(focusObj).validateNow();
};
};
};
}
mx_internal function setUnscaledWidth(value:Number):void{
var scaledValue:Number = (value * Math.abs(oldScaleX));
if (_explicitWidth == scaledValue){
return;
};
if (!isNaN(scaledValue)){
_percentWidth = NaN;
};
_explicitWidth = scaledValue;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
}
private function isOnDisplayList():Boolean{
var p:DisplayObjectContainer;
p = (_parent) ? _parent : super.parent;
//unresolved jump
var _slot1 = e;
return (true);
return ((p) ? true : false);
}
public function set nestLevel(value:int):void{
var childList:IChildList;
var n:int;
var i:int;
var ui:ILayoutManagerClient;
var textField:IUITextField;
if ((((value > 1)) && (!((_nestLevel == value))))){
_nestLevel = value;
updateCallbacks();
childList = ((this is IRawChildrenContainer)) ? IRawChildrenContainer(this).rawChildren : IChildList(this);
n = childList.numChildren;
i = 0;
while (i < n) {
ui = (childList.getChildAt(i) as ILayoutManagerClient);
if (ui){
ui.nestLevel = (value + 1);
} else {
textField = (childList.getChildAt(i) as IUITextField);
if (textField){
textField.nestLevel = (value + 1);
};
};
i++;
};
};
}
public function getExplicitOrMeasuredHeight():Number{
return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight);
}
private function callLaterDispatcher(event:Event):void{
var callLaterErrorEvent:DynamicEvent;
var event = event;
UIComponentGlobals.callLaterDispatcherCount++;
if (!UIComponentGlobals.catchCallLaterExceptions){
callLaterDispatcher2(event);
} else {
callLaterDispatcher2(event);
//unresolved jump
var _slot1 = e;
callLaterErrorEvent = new DynamicEvent("callLaterError");
callLaterErrorEvent.error = _slot1;
systemManager.dispatchEvent(callLaterErrorEvent);
};
UIComponentGlobals.callLaterDispatcherCount--;
}
public function getStyle(styleProp:String){
return ((StyleManager.inheritingStyles[styleProp]) ? _inheritingStyles[styleProp] : _nonInheritingStyles[styleProp]);
}
final mx_internal function get $width():Number{
return (super.width);
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
UIComponentGlobals.tempMatrix.createGradientBox(width, height, (Math.PI / 2), x, y);
return (UIComponentGlobals.tempMatrix);
}
public function setCurrentState(stateName:String, playTransition:Boolean=true):void{
if (((!((stateName == currentState))) && (!(((isBaseState(stateName)) && (isBaseState(currentState))))))){
requestedCurrentState = stateName;
playStateTransition = playTransition;
if (initialized){
commitCurrentState();
} else {
_currentStateChanged = true;
addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
};
};
}
private function getBaseStates(state:State):Array{
var baseStates:Array = [];
while (((state) && (state.basedOn))) {
baseStates.push(state.basedOn);
state = getState(state.basedOn);
};
return (baseStates);
}
public function set minHeight(value:Number):void{
if (explicitMinHeight == value){
return;
};
explicitMinHeight = value;
}
protected function isOurFocus(target:DisplayObject):Boolean{
return ((target == this));
}
public function get errorString():String{
return (_errorString);
}
mx_internal function setUnscaledHeight(value:Number):void{
var scaledValue:Number = (value * Math.abs(oldScaleY));
if (_explicitHeight == scaledValue){
return;
};
if (!isNaN(scaledValue)){
_percentHeight = NaN;
};
_explicitHeight = scaledValue;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
}
public function get automationName():String{
if (_automationName){
return (_automationName);
};
if (automationDelegate){
return (automationDelegate.automationName);
};
return ("");
}
final mx_internal function set $width(value:Number):void{
super.width = value;
}
public function getVisibleRect(targetParent:DisplayObject=null):Rectangle{
if (!targetParent){
targetParent = DisplayObject(systemManager);
};
var thisParent:DisplayObject = ($parent) ? $parent : parent;
if (!thisParent){
return (new Rectangle());
};
var pt:Point = new Point(x, y);
pt = thisParent.localToGlobal(pt);
var bounds:Rectangle = new Rectangle(pt.x, pt.y, width, height);
var current:DisplayObject = this;
var currentRect:Rectangle = new Rectangle();
do {
if ((current is UIComponent)){
if (UIComponent(current).$parent){
current = UIComponent(current).$parent;
} else {
current = UIComponent(current).parent;
};
} else {
current = current.parent;
};
if (((current) && (current.scrollRect))){
currentRect = current.scrollRect.clone();
pt = current.localToGlobal(currentRect.topLeft);
currentRect.x = pt.x;
currentRect.y = pt.y;
bounds = bounds.intersection(currentRect);
};
} while (((current) && (!((current == targetParent)))));
return (bounds);
}
public function invalidateDisplayList():void{
if (!invalidateDisplayListFlag){
invalidateDisplayListFlag = true;
if (((isOnDisplayList()) && (UIComponentGlobals.layoutManager))){
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
};
}
mx_internal function initThemeColor():Boolean{
var tc:Object;
var rc:Number;
var sc:Number;
var classSelector:Object;
var typeSelectors:Array;
var i:int;
var typeSelector:CSSStyleDeclaration;
var styleName:Object = _styleName;
if (_styleDeclaration){
tc = _styleDeclaration.getStyle("themeColor");
rc = _styleDeclaration.getStyle("rollOverColor");
sc = _styleDeclaration.getStyle("selectionColor");
};
if ((((((tc === null)) || (!(StyleManager.isValidStyleValue(tc))))) && (((styleName) && (!((styleName is ISimpleStyleClient))))))){
classSelector = ((styleName is String)) ? StyleManager.getStyleDeclaration(("." + styleName)) : styleName;
if (classSelector){
tc = classSelector.getStyle("themeColor");
rc = classSelector.getStyle("rollOverColor");
sc = classSelector.getStyle("selectionColor");
};
};
if ((((tc === null)) || (!(StyleManager.isValidStyleValue(tc))))){
typeSelectors = getClassStyleDeclarations();
i = 0;
while (i < typeSelectors.length) {
typeSelector = typeSelectors[i];
if (typeSelector){
tc = typeSelector.getStyle("themeColor");
rc = typeSelector.getStyle("rollOverColor");
sc = typeSelector.getStyle("selectionColor");
};
if (((!((tc === null))) && (StyleManager.isValidStyleValue(tc)))){
break;
};
i++;
};
};
if (((((((!((tc === null))) && (StyleManager.isValidStyleValue(tc)))) && (isNaN(rc)))) && (isNaN(sc)))){
setThemeColor(tc);
return (true);
};
return (((((((!((tc === null))) && (StyleManager.isValidStyleValue(tc)))) && (!(isNaN(rc))))) && (!(isNaN(sc)))));
}
override public function get scaleX():Number{
return (_scaleX);
}
public function get uid():String{
if (!_uid){
_uid = toString();
};
return (_uid);
}
override public function get mouseX():Number{
if (((((!(root)) || ((root is Stage)))) || ((root[fakeMouseX] === undefined)))){
return (super.mouseX);
};
return (globalToLocal(new Point(root[fakeMouseX], 0)).x);
}
override public function stopDrag():void{
super.stopDrag();
invalidateProperties();
dispatchEvent(new Event("xChanged"));
dispatchEvent(new Event("yChanged"));
}
public function get focusPane():Sprite{
return (_focusPane);
}
public function set tweeningProperties(value:Array):void{
_tweeningProperties = value;
}
public function horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
UIComponentGlobals.tempMatrix.createGradientBox(width, height, 0, x, y);
return (UIComponentGlobals.tempMatrix);
}
public function get isDocument():Boolean{
return ((document == this));
}
public function set validationSubField(value:String):void{
_validationSubField = value;
}
override public function get scaleY():Number{
return (_scaleY);
}
protected function keyDownHandler(event:KeyboardEvent):void{
}
protected function createInFontContext(classObj:Class):Object{
hasFontContextBeenSaved = true;
var fontName:String = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
var fontWeight:String = getStyle("fontWeight");
var fontStyle:String = getStyle("fontStyle");
var bold = (fontWeight == "bold");
var italic = (fontStyle == "italic");
oldEmbeddedFontContext = getFontContext(fontName, bold, italic);
var obj:Object = createInModuleContext((oldEmbeddedFontContext) ? oldEmbeddedFontContext : moduleFactory, getQualifiedClassName(classObj));
if (obj == null){
obj = new (classObj);
};
return (obj);
}
public function get screen():Rectangle{
var sm:ISystemManager = systemManager;
return ((sm) ? sm.screen : null);
}
protected function focusInHandler(event:FocusEvent):void{
var fm:IFocusManager;
if (isOurFocus(DisplayObject(event.target))){
fm = focusManager;
if (((fm) && (fm.showFocusIndicator))){
drawFocus(true);
};
ContainerGlobals.checkFocus(event.relatedObject, this);
};
}
public function hasFontContextChanged():Boolean{
if (!hasFontContextBeenSaved){
return (false);
};
var fontName:String = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
var fontWeight:String = getStyle("fontWeight");
var fontStyle:String = getStyle("fontStyle");
var bold = (fontWeight == "bold");
var italic = (fontStyle == "italic");
var embeddedFont:EmbeddedFont = getEmbeddedFont(fontName, bold, italic);
var fontContext:IFlexModuleFactory = embeddedFontRegistry.getAssociatedModuleFactory(embeddedFont, moduleFactory);
return (!((fontContext == oldEmbeddedFontContext)));
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
override public function get x():Number{
return (super.x);
}
override public function get y():Number{
return (super.y);
}
override public function get visible():Boolean{
return (_visible);
}
mx_internal function addOverlay(color:uint, targetArea:RoundedRectangle=null):void{
if (!overlay){
overlayColor = color;
overlay = new UIComponent();
overlay.name = "overlay";
overlay.$visible = true;
fillOverlay(overlay, color, targetArea);
attachOverlay();
if (!targetArea){
addEventListener(ResizeEvent.RESIZE, overlay_resizeHandler);
};
overlay.x = 0;
overlay.y = 0;
invalidateDisplayList();
overlayReferenceCount = 1;
} else {
overlayReferenceCount++;
};
dispatchEvent(new ChildExistenceChangedEvent(ChildExistenceChangedEvent.OVERLAY_CREATED, true, false, overlay));
}
public function get percentWidth():Number{
return (_percentWidth);
}
public function set explicitMinHeight(value:Number):void{
if (_explicitMinHeight == value){
return;
};
_explicitMinHeight = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMinHeightChanged"));
}
public function set automationName(value:String):void{
_automationName = value;
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
mx_internal function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont{
if (cachedEmbeddedFont){
if ((((cachedEmbeddedFont.fontName == fontName)) && ((cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))))){
return (cachedEmbeddedFont);
};
};
cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);
return (cachedEmbeddedFont);
}
public function stylesInitialized():void{
}
public function set errorString(value:String):void{
var oldValue:String = _errorString;
_errorString = value;
ToolTipManager.registerErrorString(this, oldValue, value);
errorStringChanged = true;
invalidateProperties();
dispatchEvent(new Event("errorStringChanged"));
}
public function getExplicitOrMeasuredWidth():Number{
return ((isNaN(explicitWidth)) ? measuredWidth : explicitWidth);
}
final mx_internal function set $height(value:Number):void{
super.height = value;
}
protected function keyUpHandler(event:KeyboardEvent):void{
}
final mx_internal function $removeChild(child:DisplayObject):DisplayObject{
return (super.removeChild(child));
}
override public function set scaleX(value:Number):void{
if (_scaleX == value){
return;
};
_scaleX = value;
invalidateProperties();
invalidateSize();
dispatchEvent(new Event("scaleXChanged"));
}
override public function set scaleY(value:Number):void{
if (_scaleY == value){
return;
};
_scaleY = value;
invalidateProperties();
invalidateSize();
dispatchEvent(new Event("scaleYChanged"));
}
public function set uid(uid:String):void{
this._uid = uid;
}
public function createAutomationIDPart(child:IAutomationObject):Object{
if (automationDelegate){
return (automationDelegate.createAutomationIDPart(child));
};
return (null);
}
public function getAutomationChildAt(index:int):IAutomationObject{
if (automationDelegate){
return (automationDelegate.getAutomationChildAt(index));
};
return (null);
}
mx_internal function get isEffectStarted():Boolean{
return (_isEffectStarted);
}
override public function get parent():DisplayObjectContainer{
return ((_parent) ? _parent : super.parent);
//unresolved jump
var _slot1 = e;
return (null);
}
override public function get mouseY():Number{
if (((((!(root)) || ((root is Stage)))) || ((root[fakeMouseY] === undefined)))){
return (super.mouseY);
};
return (globalToLocal(new Point(0, root[fakeMouseY])).y);
}
public function setActualSize(w:Number, h:Number):void{
var changed:Boolean;
if (_width != w){
_width = w;
dispatchEvent(new Event("widthChanged"));
changed = true;
};
if (_height != h){
_height = h;
dispatchEvent(new Event("heightChanged"));
changed = true;
};
if (changed){
invalidateDisplayList();
dispatchResizeEvent();
};
}
private function focusObj_resizeHandler(event:ResizeEvent):void{
adjustFocusRect();
}
mx_internal function adjustSizesForScaleChanges():void{
var scalingFactor:Number;
var xScale:Number = scaleX;
var yScale:Number = scaleY;
if (xScale != oldScaleX){
scalingFactor = Math.abs((xScale / oldScaleX));
if (explicitMinWidth){
explicitMinWidth = (explicitMinWidth * scalingFactor);
};
if (!isNaN(explicitWidth)){
explicitWidth = (explicitWidth * scalingFactor);
};
if (explicitMaxWidth){
explicitMaxWidth = (explicitMaxWidth * scalingFactor);
};
oldScaleX = xScale;
};
if (yScale != oldScaleY){
scalingFactor = Math.abs((yScale / oldScaleY));
if (explicitMinHeight){
explicitMinHeight = (explicitMinHeight * scalingFactor);
};
if (explicitHeight){
explicitHeight = (explicitHeight * scalingFactor);
};
if (explicitMaxHeight){
explicitMaxHeight = (explicitMaxHeight * scalingFactor);
};
oldScaleY = yScale;
};
}
public function set focusPane(value:Sprite):void{
if (value){
addChild(value);
value.x = 0;
value.y = 0;
value.scrollRect = null;
_focusPane = value;
} else {
removeChild(_focusPane);
_focusPane.mask = null;
_focusPane = null;
};
}
public function determineTextFormatFromStyles():UITextFormat{
var font:String;
var textFormat:UITextFormat = cachedTextFormat;
if (!textFormat){
font = StringUtil.trimArrayElements(_inheritingStyles.fontFamily, ",");
textFormat = new UITextFormat(getNonNullSystemManager(), font);
textFormat.moduleFactory = moduleFactory;
textFormat.align = _inheritingStyles.textAlign;
textFormat.bold = (_inheritingStyles.fontWeight == "bold");
textFormat.color = (enabled) ? _inheritingStyles.color : _inheritingStyles.disabledColor;
textFormat.font = font;
textFormat.indent = _inheritingStyles.textIndent;
textFormat.italic = (_inheritingStyles.fontStyle == "italic");
textFormat.kerning = _inheritingStyles.kerning;
textFormat.leading = _nonInheritingStyles.leading;
textFormat.leftMargin = _nonInheritingStyles.paddingLeft;
textFormat.letterSpacing = _inheritingStyles.letterSpacing;
textFormat.rightMargin = _nonInheritingStyles.paddingRight;
textFormat.size = _inheritingStyles.fontSize;
textFormat.underline = (_nonInheritingStyles.textDecoration == "underline");
textFormat.antiAliasType = _inheritingStyles.fontAntiAliasType;
textFormat.gridFitType = _inheritingStyles.fontGridFitType;
textFormat.sharpness = _inheritingStyles.fontSharpness;
textFormat.thickness = _inheritingStyles.fontThickness;
cachedTextFormat = textFormat;
};
return (textFormat);
}
public function validationResultHandler(event:ValidationResultEvent):void{
var msg:String;
var result:ValidationResult;
var i:int;
if (errorObjectArray === null){
errorObjectArray = new Array();
errorArray = new Array();
};
var validatorIndex:int = errorObjectArray.indexOf(event.target);
if (event.type == ValidationResultEvent.VALID){
if (validatorIndex != -1){
errorObjectArray.splice(validatorIndex, 1);
errorArray.splice(validatorIndex, 1);
errorString = errorArray.join("\n");
if (errorArray.length == 0){
dispatchEvent(new FlexEvent(FlexEvent.VALID));
};
};
} else {
if (((((!((validationSubField == null))) && (!((validationSubField == ""))))) && (event.results))){
i = 0;
while (i < event.results.length) {
result = event.results[i];
if (result.subField == validationSubField){
if (result.isError){
msg = result.errorMessage;
} else {
if (validatorIndex != -1){
errorObjectArray.splice(validatorIndex, 1);
errorArray.splice(validatorIndex, 1);
errorString = errorArray.join("\n");
if (errorArray.length == 0){
dispatchEvent(new FlexEvent(FlexEvent.VALID));
};
};
};
break;
};
i++;
};
} else {
if (((event.results) && ((event.results.length > 0)))){
msg = event.results[0].errorMessage;
};
};
if (((((msg) && (!((validatorIndex == -1))))) && (!((errorArray[validatorIndex] == msg))))){
errorArray[validatorIndex] = msg;
errorString = errorArray.join("\n");
dispatchEvent(new FlexEvent(FlexEvent.INVALID));
} else {
if (((msg) && ((validatorIndex == -1)))){
errorObjectArray.push(event.target);
errorArray.push(msg);
errorString = errorArray.join("\n");
dispatchEvent(new FlexEvent(FlexEvent.INVALID));
};
};
};
}
public function invalidateProperties():void{
if (!invalidatePropertiesFlag){
invalidatePropertiesFlag = true;
if (((parent) && (UIComponentGlobals.layoutManager))){
UIComponentGlobals.layoutManager.invalidateProperties(this);
};
};
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
private function focusObj_scrollHandler(event:Event):void{
adjustFocusRect();
}
final mx_internal function get $x():Number{
return (super.x);
}
final mx_internal function get $y():Number{
return (super.y);
}
public function setConstraintValue(constraintName:String, value):void{
setStyle(constraintName, value);
}
protected function resourcesChanged():void{
}
public function registerEffects(effects:Array):void{
var event:String;
var n:int = effects.length;
var i:int;
while (i < n) {
event = EffectManager.getEventForEffectTrigger(effects[i]);
if (((!((event == null))) && (!((event == ""))))){
addEventListener(event, EffectManager.eventHandler, false, EventPriority.EFFECT);
};
i++;
};
}
public function get explicitMinWidth():Number{
return (_explicitMinWidth);
}
private function filterChangeHandler(event:Event):void{
super.filters = _filters;
}
override public function set visible(value:Boolean):void{
setVisible(value);
}
public function set explicitHeight(value:Number):void{
if (_explicitHeight == value){
return;
};
if (!isNaN(value)){
_percentHeight = NaN;
};
_explicitHeight = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitHeightChanged"));
}
override public function set x(value:Number):void{
if (super.x == value){
return;
};
super.x = value;
invalidateProperties();
dispatchEvent(new Event("xChanged"));
}
public function set showInAutomationHierarchy(value:Boolean):void{
_showInAutomationHierarchy = value;
}
override public function set y(value:Number):void{
if (super.y == value){
return;
};
super.y = value;
invalidateProperties();
dispatchEvent(new Event("yChanged"));
}
private function resourceManager_changeHandler(event:Event):void{
resourcesChanged();
}
public function set systemManager(value:ISystemManager):void{
_systemManager = value;
_systemManagerDirty = false;
}
mx_internal function getFocusObject():DisplayObject{
var fm:IFocusManager = focusManager;
if (((!(fm)) || (!(fm.focusPane)))){
return (null);
};
return (((fm.focusPane.numChildren == 0)) ? null : fm.focusPane.getChildAt(0));
}
public function set percentWidth(value:Number):void{
if (_percentWidth == value){
return;
};
if (!isNaN(value)){
_explicitWidth = NaN;
};
_percentWidth = value;
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
}
public function get moduleFactory():IFlexModuleFactory{
return (_moduleFactory);
}
override public function addChild(child:DisplayObject):DisplayObject{
var formerParent:DisplayObjectContainer = child.parent;
if (((formerParent) && (!((formerParent is Loader))))){
formerParent.removeChild(child);
};
var index:int = (((overlayReferenceCount) && (!((child == overlay))))) ? Math.max(0, (super.numChildren - 1)) : super.numChildren;
addingChild(child);
$addChildAt(child, index);
childAdded(child);
return (child);
}
public function get document():Object{
return (_document);
}
public function set mouseFocusEnabled(value:Boolean):void{
_mouseFocusEnabled = value;
}
final mx_internal function $addChild(child:DisplayObject):DisplayObject{
return (super.addChild(child));
}
mx_internal function setThemeColor(value:Object):void{
var newValue:Number;
if ((newValue is String)){
newValue = parseInt(String(value));
} else {
newValue = Number(value);
};
if (isNaN(newValue)){
newValue = StyleManager.getColorName(value);
};
var newValueS:Number = ColorUtil.adjustBrightness2(newValue, 50);
var newValueR:Number = ColorUtil.adjustBrightness2(newValue, 70);
setStyle("selectionColor", newValueS);
setStyle("rollOverColor", newValueR);
}
public function get explicitMaxWidth():Number{
return (_explicitMaxWidth);
}
public function get id():String{
return (_id);
}
override public function get height():Number{
return (_height);
}
public function set minWidth(value:Number):void{
if (explicitMinWidth == value){
return;
};
explicitMinWidth = value;
}
public function set currentState(value:String):void{
setCurrentState(value, true);
}
public function executeBindings(recurse:Boolean=false):void{
var bindingsHost:Object = (((descriptor) && (descriptor.document))) ? descriptor.document : parentDocument;
BindingManager.executeBindings(bindingsHost, id, this);
}
public function replayAutomatableEvent(event:Event):Boolean{
if (automationDelegate){
return (automationDelegate.replayAutomatableEvent(event));
};
return (false);
}
mx_internal function getFontContext(fontName:String, bold:Boolean, italic:Boolean):IFlexModuleFactory{
return (embeddedFontRegistry.getAssociatedModuleFactory(getEmbeddedFont(fontName, bold, italic), moduleFactory));
}
public function get instanceIndex():int{
return ((_instanceIndices) ? _instanceIndices[(_instanceIndices.length - 1)] : -1);
}
public function set measuredWidth(value:Number):void{
_measuredWidth = value;
}
public function effectFinished(effectInst:IEffectInstance):void{
_endingEffectInstances.push(effectInst);
invalidateProperties();
UIComponentGlobals.layoutManager.addEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler, false, 0, true);
}
public function getRepeaterItem(whichRepeater:int=-1):Object{
var repeaterArray:Array = repeaters;
if (repeaterArray.length == 0){
return (null);
};
if (whichRepeater == -1){
whichRepeater = (repeaterArray.length - 1);
};
return (repeaterArray[whichRepeater].getItemAt(repeaterIndices[whichRepeater]));
}
mx_internal function set isEffectStarted(value:Boolean):void{
_isEffectStarted = value;
}
mx_internal function fillOverlay(overlay:UIComponent, color:uint, targetArea:RoundedRectangle=null):void{
if (!targetArea){
targetArea = new RoundedRectangle(0, 0, unscaledWidth, unscaledHeight, 0);
};
var g:Graphics = overlay.graphics;
g.clear();
g.beginFill(color);
g.drawRoundRect(targetArea.x, targetArea.y, targetArea.width, targetArea.height, (targetArea.cornerRadius * 2), (targetArea.cornerRadius * 2));
g.endFill();
}
public function get instanceIndices():Array{
return ((_instanceIndices) ? _instanceIndices.slice(0) : null);
}
mx_internal function childAdded(child:DisplayObject):void{
if ((child is UIComponent)){
if (!UIComponent(child).initialized){
UIComponent(child).initialize();
};
} else {
if ((child is IUIComponent)){
IUIComponent(child).initialize();
};
};
}
public function globalToContent(point:Point):Point{
return (globalToLocal(point));
}
mx_internal function removingChild(child:DisplayObject):void{
}
mx_internal function getEffectsForProperty(propertyName:String):Array{
return (((_affectedProperties[propertyName])!=undefined) ? _affectedProperties[propertyName] : []);
}
override public function removeChildAt(index:int):DisplayObject{
var child:DisplayObject = getChildAt(index);
removingChild(child);
$removeChild(child);
childRemoved(child);
return (child);
}
protected function measure():void{
measuredMinWidth = 0;
measuredMinHeight = 0;
measuredWidth = 0;
measuredHeight = 0;
}
public function set owner(value:DisplayObjectContainer):void{
_owner = value;
}
mx_internal function getNonNullSystemManager():ISystemManager{
var sm:ISystemManager = systemManager;
if (!sm){
sm = ISystemManager(SystemManager.getSWFRoot(this));
};
if (!sm){
return (SystemManagerGlobals.topLevelSystemManagers[0]);
};
return (sm);
}
protected function get unscaledWidth():Number{
return ((width / Math.abs(scaleX)));
}
public function set processedDescriptors(value:Boolean):void{
_processedDescriptors = value;
if (value){
dispatchEvent(new FlexEvent(FlexEvent.INITIALIZE));
};
}
private function processEffectFinished(effectInsts:Array):void{
var j:int;
var effectInst:IEffectInstance;
var removedInst:IEffectInstance;
var aProps:Array;
var k:int;
var propName:String;
var l:int;
var i:int = (_effectsStarted.length - 1);
while (i >= 0) {
j = 0;
while (j < effectInsts.length) {
effectInst = effectInsts[j];
if (effectInst == _effectsStarted[i]){
removedInst = _effectsStarted[i];
_effectsStarted.splice(i, 1);
aProps = removedInst.effect.getAffectedProperties();
k = 0;
while (k < aProps.length) {
propName = aProps[k];
if (_affectedProperties[propName] != undefined){
l = 0;
while (l < _affectedProperties[propName].length) {
if (_affectedProperties[propName][l] == effectInst){
_affectedProperties[propName].splice(l, 1);
break;
};
l++;
};
if (_affectedProperties[propName].length == 0){
delete _affectedProperties[propName];
};
};
k++;
};
break;
};
j++;
};
i--;
};
isEffectStarted = ((_effectsStarted.length > 0)) ? true : false;
if (((effectInst) && (effectInst.hideFocusRing))){
preventDrawFocus = false;
};
}
private function commitCurrentState():void{
var event:StateChangeEvent;
var transition:IEffect = (playStateTransition) ? getTransition(_currentState, requestedCurrentState) : null;
var commonBaseState:String = findCommonBaseState(_currentState, requestedCurrentState);
var oldState:String = (_currentState) ? _currentState : "";
var destination:State = getState(requestedCurrentState);
if (_currentTransitionEffect){
_currentTransitionEffect.end();
};
initializeState(requestedCurrentState);
if (transition){
transition.captureStartValues();
};
event = new StateChangeEvent(StateChangeEvent.CURRENT_STATE_CHANGING);
event.oldState = oldState;
event.newState = (requestedCurrentState) ? requestedCurrentState : "";
dispatchEvent(event);
if (isBaseState(_currentState)){
dispatchEvent(new FlexEvent(FlexEvent.EXIT_STATE));
};
removeState(_currentState, commonBaseState);
_currentState = requestedCurrentState;
if (isBaseState(currentState)){
dispatchEvent(new FlexEvent(FlexEvent.ENTER_STATE));
} else {
applyState(_currentState, commonBaseState);
};
event = new StateChangeEvent(StateChangeEvent.CURRENT_STATE_CHANGE);
event.oldState = oldState;
event.newState = (_currentState) ? _currentState : "";
dispatchEvent(event);
if (transition){
UIComponentGlobals.layoutManager.validateNow();
_currentTransitionEffect = transition;
transition.addEventListener(EffectEvent.EFFECT_END, transition_effectEndHandler);
transition.play();
};
}
public function get includeInLayout():Boolean{
return (_includeInLayout);
}
private function dispatchResizeEvent():void{
var resizeEvent:ResizeEvent = new ResizeEvent(ResizeEvent.RESIZE);
resizeEvent.oldWidth = oldWidth;
resizeEvent.oldHeight = oldHeight;
dispatchEvent(resizeEvent);
oldWidth = width;
oldHeight = height;
}
public function set maxWidth(value:Number):void{
if (explicitMaxWidth == value){
return;
};
explicitMaxWidth = value;
}
public function validateDisplayList():void{
var sm:ISystemManager;
var unscaledWidth:Number;
var unscaledHeight:Number;
if (invalidateDisplayListFlag){
sm = (parent as ISystemManager);
if (sm){
if ((((sm is SystemManagerProxy)) || ((((sm == systemManager.topLevelSystemManager)) && (!((sm.document == this))))))){
setActualSize(getExplicitOrMeasuredWidth(), getExplicitOrMeasuredHeight());
};
};
unscaledWidth = ((scaleX == 0)) ? 0 : (width / scaleX);
unscaledHeight = ((scaleY == 0)) ? 0 : (height / scaleY);
if (Math.abs((unscaledWidth - lastUnscaledWidth)) < 1E-5){
unscaledWidth = lastUnscaledWidth;
};
if (Math.abs((unscaledHeight - lastUnscaledHeight)) < 1E-5){
unscaledHeight = lastUnscaledHeight;
};
updateDisplayList(unscaledWidth, unscaledHeight);
lastUnscaledWidth = unscaledWidth;
lastUnscaledHeight = unscaledHeight;
invalidateDisplayListFlag = false;
};
}
public function contentToGlobal(point:Point):Point{
return (localToGlobal(point));
}
public function resolveAutomationIDPart(criteria:Object):Array{
if (automationDelegate){
return (automationDelegate.resolveAutomationIDPart(criteria));
};
return ([]);
}
public function set inheritingStyles(value:Object):void{
_inheritingStyles = value;
}
public function setFocus():void{
var sm:ISystemManager = systemManager;
if (((sm) && (((sm.stage) || (sm.useSWFBridge()))))){
if (UIComponentGlobals.callLaterDispatcherCount == 0){
sm.stage.focus = this;
UIComponentGlobals.nextFocusObject = null;
} else {
UIComponentGlobals.nextFocusObject = this;
sm.addEventListener(FlexEvent.ENTER_FRAME, setFocusLater);
};
} else {
UIComponentGlobals.nextFocusObject = this;
callLater(setFocusLater);
};
}
private function getTransition(oldState:String, newState:String):IEffect{
var t:Transition;
var result:IEffect;
var priority:int;
if (!transitions){
return (null);
};
if (!oldState){
oldState = "";
};
if (!newState){
newState = "";
};
var i:int;
while (i < transitions.length) {
t = transitions[i];
if ((((((t.fromState == "*")) && ((t.toState == "*")))) && ((priority < 1)))){
result = t.effect;
priority = 1;
} else {
if ((((((t.fromState == oldState)) && ((t.toState == "*")))) && ((priority < 2)))){
result = t.effect;
priority = 2;
} else {
if ((((((t.fromState == "*")) && ((t.toState == newState)))) && ((priority < 3)))){
result = t.effect;
priority = 3;
} else {
if ((((((t.fromState == oldState)) && ((t.toState == newState)))) && ((priority < 4)))){
result = t.effect;
priority = 4;
break;
};
};
};
};
i++;
};
return (result);
}
public function set initialized(value:Boolean):void{
_initialized = value;
if (value){
setVisible(_visible, true);
dispatchEvent(new FlexEvent(FlexEvent.CREATION_COMPLETE));
};
}
final mx_internal function set $y(value:Number):void{
super.y = value;
}
public function owns(child:DisplayObject):Boolean{
var child = child;
var childList:IChildList = ((this is IRawChildrenContainer)) ? IRawChildrenContainer(this).rawChildren : IChildList(this);
if (childList.contains(child)){
return (true);
};
while (((child) && (!((child == this))))) {
if ((child is IUIComponent)){
child = IUIComponent(child).owner;
} else {
child = child.parent;
};
};
//unresolved jump
var _slot1 = e;
return (false);
return ((child == this));
}
public function setVisible(value:Boolean, noEvent:Boolean=false):void{
_visible = value;
if (!initialized){
return;
};
if ($visible == value){
return;
};
$visible = value;
if (!noEvent){
dispatchEvent(new FlexEvent((value) ? FlexEvent.SHOW : FlexEvent.HIDE));
};
}
final mx_internal function $addChildAt(child:DisplayObject, index:int):DisplayObject{
return (super.addChildAt(child, index));
}
public function deleteReferenceOnParentDocument(parentDocument:IFlexDisplayObject):void{
var indices:Array;
var r:Object;
var stack:Array;
var n:int;
var i:int;
var j:int;
var s:Object;
var event:PropertyChangeEvent;
if (((id) && (!((id == ""))))){
indices = _instanceIndices;
if (!indices){
parentDocument[id] = null;
} else {
r = parentDocument[id];
if (!r){
return;
};
stack = [];
stack.push(r);
n = indices.length;
i = 0;
while (i < (n - 1)) {
s = r[indices[i]];
if (!s){
return;
};
r = s;
stack.push(r);
i++;
};
r.splice(indices[(n - 1)], 1);
j = (stack.length - 1);
while (j > 0) {
if (stack[j].length == 0){
stack[(j - 1)].splice(indices[j], 1);
};
j--;
};
if ((((stack.length > 0)) && ((stack[0].length == 0)))){
parentDocument[id] = null;
} else {
event = PropertyChangeEvent.createUpdateEvent(parentDocument, id, parentDocument[id], parentDocument[id]);
parentDocument.dispatchEvent(event);
};
};
};
}
public function get nonInheritingStyles():Object{
return (_nonInheritingStyles);
}
public function effectStarted(effectInst:IEffectInstance):void{
var propName:String;
_effectsStarted.push(effectInst);
var aProps:Array = effectInst.effect.getAffectedProperties();
var j:int;
while (j < aProps.length) {
propName = aProps[j];
if (_affectedProperties[propName] == undefined){
_affectedProperties[propName] = [];
};
_affectedProperties[propName].push(effectInst);
j++;
};
isEffectStarted = true;
if (effectInst.hideFocusRing){
preventDrawFocus = true;
drawFocus(false);
};
}
final mx_internal function set $x(value:Number):void{
super.x = value;
}
private function applyState(stateName:String, lastState:String):void{
var overrides:Array;
var i:int;
var state:State = getState(stateName);
if (stateName == lastState){
return;
};
if (state){
if (state.basedOn != lastState){
applyState(state.basedOn, lastState);
};
overrides = state.overrides;
i = 0;
while (i < overrides.length) {
overrides[i].apply(this);
i++;
};
state.dispatchEnterState();
};
}
protected function commitProperties():void{
var scalingFactorX:Number;
var scalingFactorY:Number;
if (_scaleX != oldScaleX){
scalingFactorX = Math.abs((_scaleX / oldScaleX));
if (!isNaN(explicitMinWidth)){
explicitMinWidth = (explicitMinWidth * scalingFactorX);
};
if (!isNaN(explicitWidth)){
explicitWidth = (explicitWidth * scalingFactorX);
};
if (!isNaN(explicitMaxWidth)){
explicitMaxWidth = (explicitMaxWidth * scalingFactorX);
};
_width = (_width * scalingFactorX);
super.scaleX = (oldScaleX = _scaleX);
};
if (_scaleY != oldScaleY){
scalingFactorY = Math.abs((_scaleY / oldScaleY));
if (!isNaN(explicitMinHeight)){
explicitMinHeight = (explicitMinHeight * scalingFactorY);
};
if (!isNaN(explicitHeight)){
explicitHeight = (explicitHeight * scalingFactorY);
};
if (!isNaN(explicitMaxHeight)){
explicitMaxHeight = (explicitMaxHeight * scalingFactorY);
};
_height = (_height * scalingFactorY);
super.scaleY = (oldScaleY = _scaleY);
};
if (((!((x == oldX))) || (!((y == oldY))))){
dispatchMoveEvent();
};
if (((!((width == oldWidth))) || (!((height == oldHeight))))){
dispatchResizeEvent();
};
if (errorStringChanged){
errorStringChanged = false;
setBorderColorForErrorString();
};
}
public function get percentHeight():Number{
return (_percentHeight);
}
override public function get width():Number{
return (_width);
}
final mx_internal function get $parent():DisplayObjectContainer{
return (super.parent);
}
public function set explicitMinWidth(value:Number):void{
if (_explicitMinWidth == value){
return;
};
_explicitMinWidth = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMinWidthChanged"));
}
public function get isPopUp():Boolean{
return (_isPopUp);
}
private function measureSizes():Boolean{
var scalingFactor:Number;
var newValue:Number;
var xScale:Number;
var yScale:Number;
var changed:Boolean;
if (!invalidateSizeFlag){
return (changed);
};
if (((isNaN(explicitWidth)) || (isNaN(explicitHeight)))){
xScale = Math.abs(scaleX);
yScale = Math.abs(scaleY);
if (xScale != 1){
_measuredMinWidth = (_measuredMinWidth / xScale);
_measuredWidth = (_measuredWidth / xScale);
};
if (yScale != 1){
_measuredMinHeight = (_measuredMinHeight / yScale);
_measuredHeight = (_measuredHeight / yScale);
};
measure();
invalidateSizeFlag = false;
if (((!(isNaN(explicitMinWidth))) && ((measuredWidth < explicitMinWidth)))){
measuredWidth = explicitMinWidth;
};
if (((!(isNaN(explicitMaxWidth))) && ((measuredWidth > explicitMaxWidth)))){
measuredWidth = explicitMaxWidth;
};
if (((!(isNaN(explicitMinHeight))) && ((measuredHeight < explicitMinHeight)))){
measuredHeight = explicitMinHeight;
};
if (((!(isNaN(explicitMaxHeight))) && ((measuredHeight > explicitMaxHeight)))){
measuredHeight = explicitMaxHeight;
};
if (xScale != 1){
_measuredMinWidth = (_measuredMinWidth * xScale);
_measuredWidth = (_measuredWidth * xScale);
};
if (yScale != 1){
_measuredMinHeight = (_measuredMinHeight * yScale);
_measuredHeight = (_measuredHeight * yScale);
};
} else {
invalidateSizeFlag = false;
_measuredMinWidth = 0;
_measuredMinHeight = 0;
};
adjustSizesForScaleChanges();
if (isNaN(oldMinWidth)){
oldMinWidth = (isNaN(explicitMinWidth)) ? measuredMinWidth : explicitMinWidth;
oldMinHeight = (isNaN(explicitMinHeight)) ? measuredMinHeight : explicitMinHeight;
oldExplicitWidth = (isNaN(explicitWidth)) ? measuredWidth : explicitWidth;
oldExplicitHeight = (isNaN(explicitHeight)) ? measuredHeight : explicitHeight;
changed = true;
} else {
newValue = (isNaN(explicitMinWidth)) ? measuredMinWidth : explicitMinWidth;
if (newValue != oldMinWidth){
oldMinWidth = newValue;
changed = true;
};
newValue = (isNaN(explicitMinHeight)) ? measuredMinHeight : explicitMinHeight;
if (newValue != oldMinHeight){
oldMinHeight = newValue;
changed = true;
};
newValue = (isNaN(explicitWidth)) ? measuredWidth : explicitWidth;
if (newValue != oldExplicitWidth){
oldExplicitWidth = newValue;
changed = true;
};
newValue = (isNaN(explicitHeight)) ? measuredHeight : explicitHeight;
if (newValue != oldExplicitHeight){
oldExplicitHeight = newValue;
changed = true;
};
};
return (changed);
}
public function get automationTabularData():Object{
if (automationDelegate){
return (automationDelegate.automationTabularData);
};
return (null);
}
public function validateNow():void{
UIComponentGlobals.layoutManager.validateClient(this);
}
public function finishPrint(obj:Object, target:IFlexDisplayObject):void{
}
public function get repeaters():Array{
return ((_repeaters) ? _repeaters.slice(0) : []);
}
private function dispatchMoveEvent():void{
var moveEvent:MoveEvent = new MoveEvent(MoveEvent.MOVE);
moveEvent.oldX = oldX;
moveEvent.oldY = oldY;
dispatchEvent(moveEvent);
oldX = x;
oldY = y;
}
public function drawFocus(isFocused:Boolean):void{
var focusOwner:DisplayObjectContainer;
var focusClass:Class;
if (!parent){
return;
};
var focusObj:DisplayObject = getFocusObject();
var focusPane:Sprite = (focusManager) ? focusManager.focusPane : null;
if (((isFocused) && (!(preventDrawFocus)))){
focusOwner = focusPane.parent;
if (focusOwner != parent){
if (focusOwner){
if ((focusOwner is ISystemManager)){
ISystemManager(focusOwner).focusPane = null;
} else {
IUIComponent(focusOwner).focusPane = null;
};
};
if ((parent is ISystemManager)){
ISystemManager(parent).focusPane = focusPane;
} else {
IUIComponent(parent).focusPane = focusPane;
};
};
focusClass = getStyle("focusSkin");
if (((focusObj) && (!((focusObj is focusClass))))){
focusPane.removeChild(focusObj);
focusObj = null;
};
if (!focusObj){
focusObj = new (focusClass);
focusObj.name = "focus";
focusPane.addChild(focusObj);
};
if ((focusObj is ILayoutManagerClient)){
ILayoutManagerClient(focusObj).nestLevel = nestLevel;
};
if ((focusObj is ISimpleStyleClient)){
ISimpleStyleClient(focusObj).styleName = this;
};
addEventListener(MoveEvent.MOVE, focusObj_moveHandler, true);
addEventListener(MoveEvent.MOVE, focusObj_moveHandler);
addEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler, true);
addEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler);
addEventListener(Event.REMOVED, focusObj_removedHandler, true);
focusObj.visible = true;
hasFocusRect = true;
adjustFocusRect();
} else {
if (hasFocusRect){
hasFocusRect = false;
if (focusObj){
focusObj.visible = false;
if ((focusObj is ISimpleStyleClient)){
ISimpleStyleClient(focusObj).styleName = null;
};
};
removeEventListener(MoveEvent.MOVE, focusObj_moveHandler);
removeEventListener(MoveEvent.MOVE, focusObj_moveHandler, true);
removeEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler, true);
removeEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler);
removeEventListener(Event.REMOVED, focusObj_removedHandler, true);
};
};
}
public function get flexContextMenu():IFlexContextMenu{
return (_flexContextMenu);
}
private function get indexedID():String{
var s:String = id;
var indices:Array = instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
return (s);
}
public function get measuredMinHeight():Number{
return (_measuredMinHeight);
}
mx_internal function addingChild(child:DisplayObject):void{
if ((((child is IUIComponent)) && (!(IUIComponent(child).document)))){
IUIComponent(child).document = (document) ? document : ApplicationGlobals.application;
};
if ((((child is UIComponent)) && ((UIComponent(child).moduleFactory == null)))){
if (moduleFactory != null){
UIComponent(child).moduleFactory = moduleFactory;
} else {
if ((((document is IFlexModule)) && (!((document.moduleFactory == null))))){
UIComponent(child).moduleFactory = document.moduleFactory;
} else {
if ((((parent is UIComponent)) && (!((UIComponent(parent).moduleFactory == null))))){
UIComponent(child).moduleFactory = UIComponent(parent).moduleFactory;
};
};
};
};
if ((((((child is IFontContextComponent)) && ((!(child) is UIComponent)))) && ((IFontContextComponent(child).fontContext == null)))){
IFontContextComponent(child).fontContext = moduleFactory;
};
if ((child is IUIComponent)){
IUIComponent(child).parentChanged(this);
};
if ((child is ILayoutManagerClient)){
ILayoutManagerClient(child).nestLevel = (nestLevel + 1);
} else {
if ((child is IUITextField)){
IUITextField(child).nestLevel = (nestLevel + 1);
};
};
if ((child is InteractiveObject)){
if (doubleClickEnabled){
InteractiveObject(child).doubleClickEnabled = true;
};
};
if ((child is IStyleClient)){
IStyleClient(child).regenerateStyleCache(true);
} else {
if ((((child is IUITextField)) && (IUITextField(child).inheritingStyles))){
StyleProtoChain.initTextField(IUITextField(child));
};
};
if ((child is ISimpleStyleClient)){
ISimpleStyleClient(child).styleChanged(null);
};
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(null, true);
};
if ((child is UIComponent)){
UIComponent(child).initThemeColor();
};
if ((child is UIComponent)){
UIComponent(child).stylesInitialized();
};
}
public function set repeaterIndices(value:Array):void{
_repeaterIndices = value;
}
protected function initializationComplete():void{
processedDescriptors = true;
}
public function set moduleFactory(factory:IFlexModuleFactory):void{
var child:UIComponent;
var n:int = numChildren;
var i:int;
while (i < n) {
child = (getChildAt(i) as UIComponent);
if (!child){
} else {
if ((((child.moduleFactory == null)) || ((child.moduleFactory == _moduleFactory)))){
child.moduleFactory = factory;
};
};
i++;
};
_moduleFactory = factory;
}
private function focusObj_removedHandler(event:Event):void{
if (event.target != this){
return;
};
var focusObject:DisplayObject = getFocusObject();
if (focusObject){
focusObject.visible = false;
};
}
mx_internal function updateCallbacks():void{
if (invalidateDisplayListFlag){
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
if (invalidateSizeFlag){
UIComponentGlobals.layoutManager.invalidateSize(this);
};
if (invalidatePropertiesFlag){
UIComponentGlobals.layoutManager.invalidateProperties(this);
};
if (((systemManager) && (((_systemManager.stage) || (_systemManager.useSWFBridge()))))){
if ((((methodQueue.length > 0)) && (!(listeningForRender)))){
_systemManager.addEventListener(FlexEvent.RENDER, callLaterDispatcher);
_systemManager.addEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = true;
};
if (_systemManager.stage){
_systemManager.stage.invalidate();
};
};
}
public function set styleDeclaration(value:CSSStyleDeclaration):void{
_styleDeclaration = value;
}
override public function set doubleClickEnabled(value:Boolean):void{
var childList:IChildList;
var child:InteractiveObject;
super.doubleClickEnabled = value;
if ((this is IRawChildrenContainer)){
childList = IRawChildrenContainer(this).rawChildren;
} else {
childList = IChildList(this);
};
var i:int;
while (i < childList.numChildren) {
child = (childList.getChildAt(i) as InteractiveObject);
if (child){
child.doubleClickEnabled = value;
};
i++;
};
}
public function prepareToPrint(target:IFlexDisplayObject):Object{
return (null);
}
public function get minHeight():Number{
if (!isNaN(explicitMinHeight)){
return (explicitMinHeight);
};
return (measuredMinHeight);
}
public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
var child:ISimpleStyleClient;
cachedTextFormat = null;
var n:int = numChildren;
var i:int;
while (i < n) {
child = (getChildAt(i) as ISimpleStyleClient);
if (child){
child.styleChanged(styleProp);
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(styleProp, recursive);
};
};
i++;
};
}
public function get contentMouseX():Number{
return (mouseX);
}
public function get contentMouseY():Number{
return (mouseY);
}
public function get tweeningProperties():Array{
return (_tweeningProperties);
}
public function set explicitMaxWidth(value:Number):void{
if (_explicitMaxWidth == value){
return;
};
_explicitMaxWidth = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMaxWidthChanged"));
}
public function set document(value:Object):void{
var child:IUIComponent;
var n:int = numChildren;
var i:int;
while (i < n) {
child = (getChildAt(i) as IUIComponent);
if (!child){
} else {
if ((((child.document == _document)) || ((child.document == ApplicationGlobals.application)))){
child.document = value;
};
};
i++;
};
_document = value;
}
public function validateSize(recursive:Boolean=false):void{
var i:int;
var child:DisplayObject;
var sizeChanging:Boolean;
var p:IInvalidating;
if (recursive){
i = 0;
while (i < numChildren) {
child = getChildAt(i);
if ((child is ILayoutManagerClient)){
(child as ILayoutManagerClient).validateSize(true);
};
i++;
};
};
if (invalidateSizeFlag){
sizeChanging = measureSizes();
if (((sizeChanging) && (includeInLayout))){
invalidateDisplayList();
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
};
};
}
public function get validationSubField():String{
return (_validationSubField);
}
override public function dispatchEvent(event:Event):Boolean{
if (dispatchEventHook != null){
dispatchEventHook(event, this);
};
return (super.dispatchEvent(event));
}
public function set id(value:String):void{
_id = value;
}
private function overlay_resizeHandler(event:Event):void{
fillOverlay(overlay, overlayColor, null);
}
public function set updateCompletePendingFlag(value:Boolean):void{
_updateCompletePendingFlag = value;
}
final mx_internal function get $height():Number{
return (super.height);
}
protected function attachOverlay():void{
addChild(overlay);
}
public function get explicitMinHeight():Number{
return (_explicitMinHeight);
}
override public function set height(value:Number):void{
var p:IInvalidating;
if (explicitHeight != value){
explicitHeight = value;
invalidateSize();
};
if (_height != value){
invalidateProperties();
invalidateDisplayList();
p = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
_height = value;
dispatchEvent(new Event("heightChanged"));
};
}
public function get numAutomationChildren():int{
if (automationDelegate){
return (automationDelegate.numAutomationChildren);
};
return (0);
}
public function get parentApplication():Object{
var p:UIComponent;
var o:Object = systemManager.document;
if (o == this){
p = (o.systemManager.parent as UIComponent);
o = (p) ? p.systemManager.document : null;
};
return (o);
}
public function get repeaterIndex():int{
return ((_repeaterIndices) ? _repeaterIndices[(_repeaterIndices.length - 1)] : -1);
}
private function removeState(stateName:String, lastState:String):void{
var overrides:Array;
var i:int;
var state:State = getState(stateName);
if (stateName == lastState){
return;
};
if (state){
state.dispatchExitState();
overrides = state.overrides;
i = overrides.length;
while (i) {
overrides[(i - 1)].remove(this);
i--;
};
if (state.basedOn != lastState){
removeState(state.basedOn, lastState);
};
};
}
public function setStyle(styleProp:String, newValue):void{
if (styleProp == "styleName"){
styleName = newValue;
return;
};
if (EffectManager.getEventForEffectTrigger(styleProp) != ""){
EffectManager.setStyle(styleProp, this);
};
var isInheritingStyle:Boolean = StyleManager.isInheritingStyle(styleProp);
var isProtoChainInitialized = !((inheritingStyles == UIComponent.STYLE_UNINITIALIZED));
var valueChanged = !((getStyle(styleProp) == newValue));
if (!_styleDeclaration){
_styleDeclaration = new CSSStyleDeclaration();
_styleDeclaration.setStyle(styleProp, newValue);
if (isProtoChainInitialized){
regenerateStyleCache(isInheritingStyle);
};
} else {
_styleDeclaration.setStyle(styleProp, newValue);
};
if (((isProtoChainInitialized) && (valueChanged))){
styleChanged(styleProp);
notifyStyleChangeInChildren(styleProp, isInheritingStyle);
};
}
public function get showInAutomationHierarchy():Boolean{
return (_showInAutomationHierarchy);
}
public function get systemManager():ISystemManager{
var r:DisplayObject;
var o:DisplayObjectContainer;
var ui:IUIComponent;
if (((!(_systemManager)) || (_systemManagerDirty))){
r = root;
if ((_systemManager is SystemManagerProxy)){
} else {
if (((r) && (!((r is Stage))))){
_systemManager = (r as ISystemManager);
} else {
if (r){
_systemManager = (Stage(r).getChildAt(0) as ISystemManager);
} else {
o = parent;
while (o) {
ui = (o as IUIComponent);
if (ui){
_systemManager = ui.systemManager;
break;
} else {
if ((o is ISystemManager)){
_systemManager = (o as ISystemManager);
break;
};
};
o = o.parent;
};
};
};
};
_systemManagerDirty = false;
};
return (_systemManager);
}
public function localToContent(point:Point):Point{
return (point);
}
private function isBaseState(stateName:String):Boolean{
return (((!(stateName)) || ((stateName == ""))));
}
public function set enabled(value:Boolean):void{
_enabled = value;
cachedTextFormat = null;
invalidateDisplayList();
dispatchEvent(new Event("enabledChanged"));
}
public function set focusEnabled(value:Boolean):void{
_focusEnabled = value;
}
public function get minWidth():Number{
if (!isNaN(explicitMinWidth)){
return (explicitMinWidth);
};
return (measuredMinWidth);
}
private function setFocusLater(event:Event=null):void{
var sm:ISystemManager = systemManager;
if (((sm) && (sm.stage))){
sm.stage.removeEventListener(Event.ENTER_FRAME, setFocusLater);
if (UIComponentGlobals.nextFocusObject){
sm.stage.focus = UIComponentGlobals.nextFocusObject;
};
UIComponentGlobals.nextFocusObject = null;
};
}
public function get currentState():String{
return ((_currentStateChanged) ? requestedCurrentState : _currentState);
}
public function initializeRepeaterArrays(parent:IRepeaterClient):void{
if (((((((parent) && (parent.instanceIndices))) && (((!(parent.isDocument)) || (!((parent == descriptor.document))))))) && (!(_instanceIndices)))){
_instanceIndices = parent.instanceIndices;
_repeaters = parent.repeaters;
_repeaterIndices = parent.repeaterIndices;
};
}
public function get baselinePosition():Number{
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
return (NaN);
};
if (!validateBaselinePosition()){
return (NaN);
};
var lineMetrics:TextLineMetrics = measureText("Wj");
if (height < ((2 + lineMetrics.ascent) + 2)){
return (int((height + ((lineMetrics.ascent - height) / 2))));
};
return ((2 + lineMetrics.ascent));
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function set instanceIndices(value:Array):void{
_instanceIndices = value;
}
public function set cachePolicy(value:String):void{
if (_cachePolicy != value){
_cachePolicy = value;
if (value == UIComponentCachePolicy.OFF){
cacheAsBitmap = false;
} else {
if (value == UIComponentCachePolicy.ON){
cacheAsBitmap = true;
} else {
cacheAsBitmap = (cacheAsBitmapCount > 0);
};
};
};
}
public function get automationValue():Array{
if (automationDelegate){
return (automationDelegate.automationValue);
};
return ([]);
}
private function addedHandler(event:Event):void{
var event = event;
if (event.eventPhase != EventPhase.AT_TARGET){
return;
};
if ((((parent is IContainer)) && (IContainer(parent).creatingContentPane))){
event.stopImmediatePropagation();
return;
};
//unresolved jump
var _slot1 = error;
}
public function parentChanged(p:DisplayObjectContainer):void{
if (!p){
_parent = null;
_nestLevel = 0;
} else {
if ((p is IStyleClient)){
_parent = p;
} else {
if ((p is ISystemManager)){
_parent = p;
} else {
_parent = p.parent;
};
};
};
}
public function get owner():DisplayObjectContainer{
return ((_owner) ? _owner : parent);
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
var formerParent:DisplayObjectContainer = child.parent;
if (((formerParent) && (!((formerParent is Loader))))){
formerParent.removeChild(child);
};
if (((overlayReferenceCount) && (!((child == overlay))))){
index = Math.min(index, Math.max(0, (super.numChildren - 1)));
};
addingChild(child);
$addChildAt(child, index);
childAdded(child);
return (child);
}
public function get maxWidth():Number{
return ((isNaN(explicitMaxWidth)) ? DEFAULT_MAX_WIDTH : explicitMaxWidth);
}
override public function set alpha(value:Number):void{
super.alpha = value;
dispatchEvent(new Event("alphaChanged"));
}
private function removedHandler(event:Event):void{
var event = event;
if (event.eventPhase != EventPhase.AT_TARGET){
return;
};
if ((((parent is IContainer)) && (IContainer(parent).creatingContentPane))){
event.stopImmediatePropagation();
return;
};
//unresolved jump
var _slot1 = error;
_systemManagerDirty = true;
}
public function callLater(method:Function, args:Array=null):void{
methodQueue.push(new MethodQueueElement(method, args));
var sm:ISystemManager = systemManager;
if (((sm) && (((sm.stage) || (sm.useSWFBridge()))))){
if (!listeningForRender){
sm.addEventListener(FlexEvent.RENDER, callLaterDispatcher);
sm.addEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = true;
};
if (sm.stage){
sm.stage.invalidate();
};
};
}
public function get initialized():Boolean{
return (_initialized);
}
private function callLaterDispatcher2(event:Event):void{
var mqe:MethodQueueElement;
if (UIComponentGlobals.callLaterSuspendCount > 0){
return;
};
var sm:ISystemManager = systemManager;
if (((((sm) && (((sm.stage) || (sm.useSWFBridge()))))) && (listeningForRender))){
sm.removeEventListener(FlexEvent.RENDER, callLaterDispatcher);
sm.removeEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = false;
};
var queue:Array = methodQueue;
methodQueue = [];
var n:int = queue.length;
var i:int;
while (i < n) {
mqe = MethodQueueElement(queue[i]);
mqe.method.apply(null, mqe.args);
i++;
};
}
public function measureHTMLText(htmlText:String):TextLineMetrics{
return (determineTextFormatFromStyles().measureHTMLText(htmlText));
}
public function set descriptor(value:UIComponentDescriptor):void{
_descriptor = value;
}
private function getState(stateName:String):State{
if (((!(states)) || (isBaseState(stateName)))){
return (null);
};
var i:int;
while (i < states.length) {
if (states[i].name == stateName){
return (states[i]);
};
i++;
};
var message:String = resourceManager.getString("core", "stateUndefined", [stateName]);
throw (new ArgumentError(message));
}
public function validateProperties():void{
if (invalidatePropertiesFlag){
commitProperties();
invalidatePropertiesFlag = false;
};
}
mx_internal function get documentDescriptor():UIComponentDescriptor{
return (_documentDescriptor);
}
public function set includeInLayout(value:Boolean):void{
var p:IInvalidating;
if (_includeInLayout != value){
_includeInLayout = value;
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("includeInLayoutChanged"));
};
}
public function getClassStyleDeclarations():Array{
var myApplicationDomain:ApplicationDomain;
var cache:Array;
var myRoot:DisplayObject;
var s:CSSStyleDeclaration;
var factory:IFlexModuleFactory = ModuleManager.getAssociatedFactory(this);
if (factory != null){
myApplicationDomain = ApplicationDomain(factory.info()["currentDomain"]);
} else {
myRoot = SystemManager.getSWFRoot(this);
if (!myRoot){
return ([]);
};
myApplicationDomain = myRoot.loaderInfo.applicationDomain;
};
var className:String = getQualifiedClassName(this);
className = className.replace("::", ".");
cache = StyleManager.typeSelectorCache[className];
if (cache){
return (cache);
};
var decls:Array = [];
var classNames:Array = [];
var caches:Array = [];
var declcache:Array = [];
while (((((!((className == null))) && (!((className == "mx.core.UIComponent"))))) && (!((className == "mx.core.UITextField"))))) {
cache = StyleManager.typeSelectorCache[className];
if (cache){
decls = decls.concat(cache);
break;
};
s = StyleManager.getStyleDeclaration(className);
if (s){
decls.unshift(s);
classNames.push(className);
caches.push(classNames);
declcache.push(decls);
decls = [];
classNames = [];
} else {
classNames.push(className);
};
className = getQualifiedSuperclassName(myApplicationDomain.getDefinition(className));
className = className.replace("::", ".");
continue;
var _slot1 = e;
className = null;
};
caches.push(classNames);
declcache.push(decls);
decls = [];
while (caches.length) {
classNames = caches.pop();
decls = decls.concat(declcache.pop());
while (classNames.length) {
StyleManager.typeSelectorCache[classNames.pop()] = decls;
};
};
return (decls);
}
public function set measuredMinWidth(value:Number):void{
_measuredMinWidth = value;
}
private function initializeState(stateName:String):void{
var state:State = getState(stateName);
while (state) {
state.initialize();
state = getState(state.basedOn);
};
}
mx_internal function initProtoChain():void{
var classSelector:CSSStyleDeclaration;
var inheritChain:Object;
var typeSelector:CSSStyleDeclaration;
if (styleName){
if ((styleName is CSSStyleDeclaration)){
classSelector = CSSStyleDeclaration(styleName);
} else {
if ((((styleName is IFlexDisplayObject)) || ((styleName is IStyleClient)))){
StyleProtoChain.initProtoChainForUIComponentStyleName(this);
return;
};
if ((styleName is String)){
classSelector = StyleManager.getStyleDeclaration(("." + styleName));
};
};
};
var nonInheritChain:Object = StyleManager.stylesRoot;
if (((nonInheritChain) && (nonInheritChain.effects))){
registerEffects(nonInheritChain.effects);
};
var p:IStyleClient = (parent as IStyleClient);
if (p){
inheritChain = p.inheritingStyles;
if (inheritChain == UIComponent.STYLE_UNINITIALIZED){
inheritChain = nonInheritChain;
};
} else {
if (isPopUp){
if ((((((FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)) && (_owner))) && ((_owner is IStyleClient)))){
inheritChain = IStyleClient(_owner).inheritingStyles;
} else {
inheritChain = ApplicationGlobals.application.inheritingStyles;
};
} else {
inheritChain = StyleManager.stylesRoot;
};
};
var typeSelectors:Array = getClassStyleDeclarations();
var n:int = typeSelectors.length;
var i:int;
while (i < n) {
typeSelector = typeSelectors[i];
inheritChain = typeSelector.addStyleToProtoChain(inheritChain, this);
nonInheritChain = typeSelector.addStyleToProtoChain(nonInheritChain, this);
if (typeSelector.effects){
registerEffects(typeSelector.effects);
};
i++;
};
if (classSelector){
inheritChain = classSelector.addStyleToProtoChain(inheritChain, this);
nonInheritChain = classSelector.addStyleToProtoChain(nonInheritChain, this);
if (classSelector.effects){
registerEffects(classSelector.effects);
};
};
inheritingStyles = (_styleDeclaration) ? _styleDeclaration.addStyleToProtoChain(inheritChain, this) : inheritChain;
nonInheritingStyles = (_styleDeclaration) ? _styleDeclaration.addStyleToProtoChain(nonInheritChain, this) : nonInheritChain;
}
public function get repeaterIndices():Array{
return ((_repeaterIndices) ? _repeaterIndices.slice() : []);
}
override public function removeChild(child:DisplayObject):DisplayObject{
removingChild(child);
$removeChild(child);
childRemoved(child);
return (child);
}
private function focusObj_moveHandler(event:MoveEvent):void{
adjustFocusRect();
}
public function get styleDeclaration():CSSStyleDeclaration{
return (_styleDeclaration);
}
override public function get doubleClickEnabled():Boolean{
return (super.doubleClickEnabled);
}
public function contentToLocal(point:Point):Point{
return (point);
}
private function creationCompleteHandler(event:FlexEvent):void{
if (_currentStateChanged){
_currentStateChanged = false;
commitCurrentState();
validateNow();
};
removeEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
}
public function set measuredHeight(value:Number):void{
_measuredHeight = value;
}
protected function createChildren():void{
}
public function get activeEffects():Array{
return (_effectsStarted);
}
override public function setChildIndex(child:DisplayObject, newIndex:int):void{
if (((overlayReferenceCount) && (!((child == overlay))))){
newIndex = Math.min(newIndex, Math.max(0, (super.numChildren - 2)));
};
super.setChildIndex(child, newIndex);
}
public function regenerateStyleCache(recursive:Boolean):void{
var child:DisplayObject;
initProtoChain();
var childList:IChildList = ((this is IRawChildrenContainer)) ? IRawChildrenContainer(this).rawChildren : IChildList(this);
var n:int = childList.numChildren;
var i:int;
while (i < n) {
child = childList.getChildAt(i);
if ((child is IStyleClient)){
if (IStyleClient(child).inheritingStyles != UIComponent.STYLE_UNINITIALIZED){
IStyleClient(child).regenerateStyleCache(recursive);
};
} else {
if ((child is IUITextField)){
if (IUITextField(child).inheritingStyles){
StyleProtoChain.initTextField(IUITextField(child));
};
};
};
i++;
};
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
protected function focusOutHandler(event:FocusEvent):void{
if (isOurFocus(DisplayObject(event.target))){
drawFocus(false);
};
}
public function getFocus():InteractiveObject{
var sm:ISystemManager = systemManager;
if (!sm){
return (null);
};
if (UIComponentGlobals.nextFocusObject){
return (UIComponentGlobals.nextFocusObject);
};
return (sm.stage.focus);
}
public function endEffectsStarted():void{
var len:int = _effectsStarted.length;
var i:int;
while (i < len) {
_effectsStarted[i].end();
i++;
};
}
protected function get unscaledHeight():Number{
return ((height / Math.abs(scaleY)));
}
public function get enabled():Boolean{
return (_enabled);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
override public function set cacheAsBitmap(value:Boolean):void{
super.cacheAsBitmap = value;
cacheAsBitmapCount = (value) ? 1 : 0;
}
mx_internal function removeOverlay():void{
if ((((((overlayReferenceCount > 0)) && ((--overlayReferenceCount == 0)))) && (overlay))){
removeEventListener("resize", overlay_resizeHandler);
if (super.getChildByName("overlay")){
$removeChild(overlay);
};
overlay = null;
};
}
public function set cacheHeuristic(value:Boolean):void{
if (_cachePolicy == UIComponentCachePolicy.AUTO){
if (value){
cacheAsBitmapCount++;
} else {
if (cacheAsBitmapCount != 0){
cacheAsBitmapCount--;
};
};
super.cacheAsBitmap = !((cacheAsBitmapCount == 0));
};
}
public function get cachePolicy():String{
return (_cachePolicy);
}
public function set maxHeight(value:Number):void{
if (explicitMaxHeight == value){
return;
};
explicitMaxHeight = value;
}
public function getConstraintValue(constraintName:String){
return (getStyle(constraintName));
}
public function set focusManager(value:IFocusManager):void{
_focusManager = value;
}
public function clearStyle(styleProp:String):void{
setStyle(styleProp, undefined);
}
public function get descriptor():UIComponentDescriptor{
return (_descriptor);
}
public function set nonInheritingStyles(value:Object):void{
_nonInheritingStyles = value;
}
public function get cursorManager():ICursorManager{
var cm:ICursorManager;
var o:DisplayObject = parent;
while (o) {
if ((((o is IUIComponent)) && (("cursorManager" in o)))){
cm = o["cursorManager"];
return (cm);
};
o = o.parent;
};
return (CursorManager.getInstance());
}
public function set automationDelegate(value:Object):void{
_automationDelegate = (value as IAutomationObject);
}
public function get measuredMinWidth():Number{
return (_measuredMinWidth);
}
public function createReferenceOnParentDocument(parentDocument:IFlexDisplayObject):void{
var indices:Array;
var r:Object;
var n:int;
var i:int;
var event:PropertyChangeEvent;
var s:Object;
if (((id) && (!((id == ""))))){
indices = _instanceIndices;
if (!indices){
parentDocument[id] = this;
} else {
r = parentDocument[id];
if (!(r is Array)){
r = (parentDocument[id] = []);
};
n = indices.length;
i = 0;
while (i < (n - 1)) {
s = r[indices[i]];
if (!(s is Array)){
s = (r[indices[i]] = []);
};
r = s;
i++;
};
r[indices[(n - 1)]] = this;
event = PropertyChangeEvent.createUpdateEvent(parentDocument, id, parentDocument[id], parentDocument[id]);
parentDocument.dispatchEvent(event);
};
};
}
public function get repeater():IRepeater{
return ((_repeaters) ? _repeaters[(_repeaters.length - 1)] : null);
}
public function set isPopUp(value:Boolean):void{
_isPopUp = value;
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function initialize():void{
if (initialized){
return;
};
dispatchEvent(new FlexEvent(FlexEvent.PREINITIALIZE));
createChildren();
childrenCreated();
initializeAccessibility();
initializationComplete();
}
override public function set width(value:Number):void{
var p:IInvalidating;
if (explicitWidth != value){
explicitWidth = value;
invalidateSize();
};
if (_width != value){
invalidateProperties();
invalidateDisplayList();
p = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
_width = value;
dispatchEvent(new Event("widthChanged"));
};
}
public function set percentHeight(value:Number):void{
if (_percentHeight == value){
return;
};
if (!isNaN(value)){
_explicitHeight = NaN;
};
_percentHeight = value;
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
}
final mx_internal function set $visible(value:Boolean):void{
super.visible = value;
}
private function findCommonBaseState(state1:String, state2:String):String{
var firstState:State = getState(state1);
var secondState:State = getState(state2);
if (((!(firstState)) || (!(secondState)))){
return ("");
};
if (((isBaseState(firstState.basedOn)) && (isBaseState(secondState.basedOn)))){
return ("");
};
var firstBaseStates:Array = getBaseStates(firstState);
var secondBaseStates:Array = getBaseStates(secondState);
var commonBase:String = "";
while (firstBaseStates[(firstBaseStates.length - 1)] == secondBaseStates[(secondBaseStates.length - 1)]) {
commonBase = firstBaseStates.pop();
secondBaseStates.pop();
if (((!(firstBaseStates.length)) || (!(secondBaseStates.length)))){
break;
};
};
if (((firstBaseStates.length) && ((firstBaseStates[(firstBaseStates.length - 1)] == secondState.name)))){
commonBase = secondState.name;
} else {
if (((secondBaseStates.length) && ((secondBaseStates[(secondBaseStates.length - 1)] == firstState.name)))){
commonBase = firstState.name;
};
};
return (commonBase);
}
mx_internal function childRemoved(child:DisplayObject):void{
if ((child is IUIComponent)){
if (IUIComponent(child).document != child){
IUIComponent(child).document = null;
};
IUIComponent(child).parentChanged(null);
};
}
final mx_internal function $removeChildAt(index:int):DisplayObject{
return (super.removeChildAt(index));
}
public function get maxHeight():Number{
return ((isNaN(explicitMaxHeight)) ? DEFAULT_MAX_HEIGHT : explicitMaxHeight);
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function set explicitMaxHeight(value:Number):void{
if (_explicitMaxHeight == value){
return;
};
_explicitMaxHeight = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitMaxHeightChanged"));
}
public function get focusManager():IFocusManager{
if (_focusManager){
return (_focusManager);
};
var o:DisplayObject = parent;
while (o) {
if ((o is IFocusManagerContainer)){
return (IFocusManagerContainer(o).focusManager);
};
o = o.parent;
};
return (null);
}
public function set styleName(value:Object):void{
if (_styleName === value){
return;
};
_styleName = value;
if (inheritingStyles == UIComponent.STYLE_UNINITIALIZED){
return;
};
regenerateStyleCache(true);
initThemeColor();
styleChanged("styleName");
notifyStyleChangeInChildren("styleName", true);
}
public function get automationDelegate():Object{
return (_automationDelegate);
}
protected function get resourceManager():IResourceManager{
return (_resourceManager);
}
mx_internal function validateBaselinePosition():Boolean{
var w:Number;
var h:Number;
if (!parent){
return (false);
};
if ((((width == 0)) && ((height == 0)))){
validateNow();
w = getExplicitOrMeasuredWidth();
h = getExplicitOrMeasuredHeight();
setActualSize(w, h);
};
validateNow();
return (true);
}
mx_internal function cancelAllCallLaters():void{
var sm:ISystemManager = systemManager;
if (((sm) && (((sm.stage) || (sm.useSWFBridge()))))){
if (listeningForRender){
sm.removeEventListener(FlexEvent.RENDER, callLaterDispatcher);
sm.removeEventListener(FlexEvent.ENTER_FRAME, callLaterDispatcher);
listeningForRender = false;
};
};
methodQueue.splice(0);
}
private function updateCompleteHandler(event:FlexEvent):void{
UIComponentGlobals.layoutManager.removeEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler);
processEffectFinished(_endingEffectInstances);
_endingEffectInstances = [];
}
public function styleChanged(styleProp:String):void{
if ((((this is IFontContextComponent)) && (hasFontContextChanged()))){
invalidateProperties();
};
if (((((!(styleProp)) || ((styleProp == "styleName")))) || (StyleManager.isSizeInvalidatingStyle(styleProp)))){
invalidateSize();
};
if (((((!(styleProp)) || ((styleProp == "styleName")))) || ((styleProp == "themeColor")))){
initThemeColor();
};
invalidateDisplayList();
if ((parent is IInvalidating)){
if (StyleManager.isParentSizeInvalidatingStyle(styleProp)){
IInvalidating(parent).invalidateSize();
};
if (StyleManager.isParentDisplayListInvalidatingStyle(styleProp)){
IInvalidating(parent).invalidateDisplayList();
};
};
}
final mx_internal function get $visible():Boolean{
return (super.visible);
}
public function drawRoundRect(x:Number, y:Number, w:Number, h:Number, r:Object=null, c:Object=null, alpha:Object=null, rot:Object=null, gradient:String=null, ratios:Array=null, hole:Object=null):void{
var ellipseSize:Number;
var alphas:Array;
var matrix:Matrix;
var holeR:Object;
var g:Graphics = graphics;
if (((!(w)) || (!(h)))){
return;
};
if (c !== null){
if ((c is Array)){
if ((alpha is Array)){
alphas = (alpha as Array);
} else {
alphas = [alpha, alpha];
};
if (!ratios){
ratios = [0, 0xFF];
};
matrix = null;
if (rot){
if ((rot is Matrix)){
matrix = Matrix(rot);
} else {
matrix = new Matrix();
if ((rot is Number)){
matrix.createGradientBox(w, h, ((Number(rot) * Math.PI) / 180), x, y);
} else {
matrix.createGradientBox(rot.w, rot.h, rot.r, rot.x, rot.y);
};
};
};
if (gradient == GradientType.RADIAL){
g.beginGradientFill(GradientType.RADIAL, (c as Array), alphas, ratios, matrix);
} else {
g.beginGradientFill(GradientType.LINEAR, (c as Array), alphas, ratios, matrix);
};
} else {
g.beginFill(Number(c), Number(alpha));
};
};
if (!r){
g.drawRect(x, y, w, h);
} else {
if ((r is Number)){
ellipseSize = (Number(r) * 2);
g.drawRoundRect(x, y, w, h, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, x, y, w, h, r.tl, r.tr, r.bl, r.br);
};
};
if (hole){
holeR = hole.r;
if ((holeR is Number)){
ellipseSize = (Number(holeR) * 2);
g.drawRoundRect(hole.x, hole.y, hole.w, hole.h, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, hole.x, hole.y, hole.w, hole.h, holeR.tl, holeR.tr, holeR.bl, holeR.br);
};
};
if (c !== null){
g.endFill();
};
}
public function move(x:Number, y:Number):void{
var changed:Boolean;
if (x != super.x){
super.x = x;
dispatchEvent(new Event("xChanged"));
changed = true;
};
if (y != super.y){
super.y = y;
dispatchEvent(new Event("yChanged"));
changed = true;
};
if (changed){
dispatchMoveEvent();
};
}
public function set toolTip(value:String):void{
var oldValue:String = _toolTip;
_toolTip = value;
ToolTipManager.registerToolTip(this, oldValue, value);
dispatchEvent(new Event("toolTipChanged"));
}
public function set repeaters(value:Array):void{
_repeaters = value;
}
public function get explicitMaxHeight():Number{
return (_explicitMaxHeight);
}
public function measureText(text:String):TextLineMetrics{
return (determineTextFormatFromStyles().measureText(text));
}
public function get styleName():Object{
return (_styleName);
}
protected function createInModuleContext(moduleFactory:IFlexModuleFactory, className:String):Object{
var newObject:Object;
if (moduleFactory){
newObject = moduleFactory.create(className);
};
return (newObject);
}
public function get parentDocument():Object{
var p:IUIComponent;
var sm:ISystemManager;
if (document == this){
p = (parent as IUIComponent);
if (p){
return (p.document);
};
sm = (parent as ISystemManager);
if (sm){
return (sm.document);
};
return (null);
//unresolved jump
};
return (document);
}
protected function childrenCreated():void{
invalidateProperties();
invalidateSize();
invalidateDisplayList();
}
public function set flexContextMenu(value:IFlexContextMenu):void{
if (_flexContextMenu){
_flexContextMenu.unsetContextMenu(this);
};
_flexContextMenu = value;
if (value != null){
_flexContextMenu.setContextMenu(this);
};
}
public function set explicitWidth(value:Number):void{
if (_explicitWidth == value){
return;
};
if (!isNaN(value)){
_percentWidth = NaN;
};
_explicitWidth = value;
invalidateSize();
var p:IInvalidating = (parent as IInvalidating);
if (((p) && (includeInLayout))){
p.invalidateSize();
p.invalidateDisplayList();
};
dispatchEvent(new Event("explicitWidthChanged"));
}
private function setBorderColorForErrorString():void{
if (((!(_errorString)) || ((_errorString.length == 0)))){
if (!isNaN(origBorderColor)){
setStyle("borderColor", origBorderColor);
saveBorderColor = true;
};
} else {
if (saveBorderColor){
saveBorderColor = false;
origBorderColor = getStyle("borderColor");
};
setStyle("borderColor", getStyle("errorColor"));
};
styleChanged("themeColor");
var focusManager:IFocusManager = focusManager;
var focusObj:DisplayObject = (focusManager) ? DisplayObject(focusManager.getFocus()) : null;
if (((((focusManager) && (focusManager.showFocusIndicator))) && ((focusObj == this)))){
drawFocus(true);
};
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
public function invalidateSize():void{
if (!invalidateSizeFlag){
invalidateSizeFlag = true;
if (((parent) && (UIComponentGlobals.layoutManager))){
UIComponentGlobals.layoutManager.invalidateSize(this);
};
};
}
public function set measuredMinHeight(value:Number):void{
_measuredMinHeight = value;
}
protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
}
override public function set filters(value:Array):void{
var n:int;
var i:int;
var e:IEventDispatcher;
if (_filters){
n = _filters.length;
i = 0;
while (i < n) {
e = (_filters[i] as IEventDispatcher);
if (e){
e.removeEventListener("change", filterChangeHandler);
};
i++;
};
};
_filters = value;
if (_filters){
n = _filters.length;
i = 0;
while (i < n) {
e = (_filters[i] as IEventDispatcher);
if (e){
e.addEventListener("change", filterChangeHandler);
};
i++;
};
};
super.filters = _filters;
}
private static function get embeddedFontRegistry():IEmbeddedFontRegistry{
if (!_embeddedFontRegistry){
_embeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
};
return (_embeddedFontRegistry);
}
public static function resumeBackgroundProcessing():void{
var sm:ISystemManager;
if (UIComponentGlobals.callLaterSuspendCount > 0){
UIComponentGlobals.callLaterSuspendCount--;
if (UIComponentGlobals.callLaterSuspendCount == 0){
sm = SystemManagerGlobals.topLevelSystemManagers[0];
if (((sm) && (sm.stage))){
sm.stage.invalidate();
};
};
};
}
public static function suspendBackgroundProcessing():void{
UIComponentGlobals.callLaterSuspendCount++;
}
}
}//package mx.core
class MethodQueueElement {
public var method:Function;
public var args:Array;
private function MethodQueueElement(method:Function, args:Array=null){
super();
this.method = method;
this.args = args;
}
}
Section 93
//UIComponentCachePolicy (mx.core.UIComponentCachePolicy)
package mx.core {
public final class UIComponentCachePolicy {
public static const AUTO:String = "auto";
public static const ON:String = "on";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const OFF:String = "off";
public function UIComponentCachePolicy(){
super();
}
}
}//package mx.core
Section 94
//UIComponentDescriptor (mx.core.UIComponentDescriptor)
package mx.core {
public class UIComponentDescriptor extends ComponentDescriptor {
mx_internal var instanceIndices:Array;
public var stylesFactory:Function;
public var effects:Array;
mx_internal var repeaters:Array;
mx_internal var repeaterIndices:Array;
mx_internal static const VERSION:String = "3.5.0.12683";
public function UIComponentDescriptor(descriptorProperties:Object){
super(descriptorProperties);
}
override public function toString():String{
return (("UIComponentDescriptor_" + id));
}
}
}//package mx.core
Section 95
//UIComponentGlobals (mx.core.UIComponentGlobals)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
public class UIComponentGlobals {
mx_internal static var callLaterSuspendCount:int = 0;
mx_internal static var layoutManager:ILayoutManager;
mx_internal static var nextFocusObject:InteractiveObject;
mx_internal static var designTime:Boolean = false;
mx_internal static var tempMatrix:Matrix = new Matrix();
mx_internal static var callLaterDispatcherCount:int = 0;
private static var _catchCallLaterExceptions:Boolean = false;
public function UIComponentGlobals(){
super();
}
public static function set catchCallLaterExceptions(value:Boolean):void{
_catchCallLaterExceptions = value;
}
public static function get designMode():Boolean{
return (designTime);
}
public static function set designMode(value:Boolean):void{
designTime = value;
}
public static function get catchCallLaterExceptions():Boolean{
return (_catchCallLaterExceptions);
}
}
}//package mx.core
Section 96
//UITextField (mx.core.UITextField)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import mx.styles.*;
import flash.text.*;
import mx.resources.*;
import mx.managers.*;
import mx.automation.*;
import mx.utils.*;
public class UITextField extends FlexTextField implements IAutomationObject, IIMESupport, IFlexModule, IInvalidating, ISimpleStyleClient, IToolTipManagerClient, IUITextField {
private var _enabled:Boolean;// = true
private var untruncatedText:String;
private var cachedEmbeddedFont:EmbeddedFont;// = null
private var cachedTextFormat:TextFormat;
private var _automationDelegate:IAutomationObject;
private var _automationName:String;
private var _styleName:Object;
private var _document:Object;
mx_internal var _toolTip:String;
private var _nestLevel:int;// = 0
private var _explicitHeight:Number;
private var _moduleFactory:IFlexModuleFactory;
private var _initialized:Boolean;// = false
private var _nonInheritingStyles:Object;
private var _inheritingStyles:Object;
private var _includeInLayout:Boolean;// = true
private var invalidateDisplayListFlag:Boolean;// = true
mx_internal var explicitColor:uint;// = 4294967295
private var _processedDescriptors:Boolean;// = true
private var _updateCompletePendingFlag:Boolean;// = false
private var explicitHTMLText:String;// = null
mx_internal var _parent:DisplayObjectContainer;
private var _imeMode:String;// = null
private var resourceManager:IResourceManager;
mx_internal var styleChangedFlag:Boolean;// = true
private var _ignorePadding:Boolean;// = true
private var _owner:DisplayObjectContainer;
private var _explicitWidth:Number;
mx_internal static const TEXT_WIDTH_PADDING:int = 5;
mx_internal static const TEXT_HEIGHT_PADDING:int = 4;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var truncationIndicatorResource:String;
private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
mx_internal static var debuggingBorders:Boolean = false;
public function UITextField(){
resourceManager = ResourceManager.getInstance();
_inheritingStyles = UIComponent.STYLE_UNINITIALIZED;
_nonInheritingStyles = UIComponent.STYLE_UNINITIALIZED;
super();
super.text = "";
focusRect = false;
selectable = false;
tabEnabled = false;
if (debuggingBorders){
border = true;
};
if (!truncationIndicatorResource){
truncationIndicatorResource = resourceManager.getString("core", "truncationIndicator");
};
addEventListener(Event.CHANGE, changeHandler);
addEventListener("textFieldStyleChange", textFieldStyleChangeHandler);
resourceManager.addEventListener(Event.CHANGE, resourceManager_changeHandler, false, 0, true);
}
public function set imeMode(value:String):void{
_imeMode = value;
}
public function get nestLevel():int{
return (_nestLevel);
}
private function textFieldStyleChangeHandler(event:Event):void{
if (explicitHTMLText != null){
super.htmlText = explicitHTMLText;
};
}
public function truncateToFit(truncationIndicator:String=null):Boolean{
var s:String;
if (!truncationIndicator){
truncationIndicator = truncationIndicatorResource;
};
validateNow();
var originalText:String = super.text;
untruncatedText = originalText;
var w:Number = width;
if (((!((originalText == ""))) && (((textWidth + TEXT_WIDTH_PADDING) > (w + 1E-14))))){
var _local5 = originalText;
super.text = _local5;
s = _local5;
originalText.slice(0, Math.floor(((w / (textWidth + TEXT_WIDTH_PADDING)) * originalText.length)));
while ((((s.length > 1)) && (((textWidth + TEXT_WIDTH_PADDING) > w)))) {
s = s.slice(0, -1);
super.text = (s + truncationIndicator);
};
return (true);
};
return (false);
}
public function set nestLevel(value:int):void{
if ((((value > 1)) && (!((_nestLevel == value))))){
_nestLevel = value;
StyleProtoChain.initTextField(this);
styleChangedFlag = true;
validateNow();
};
}
public function get minHeight():Number{
return (0);
}
public function getExplicitOrMeasuredHeight():Number{
return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight);
}
public function getStyle(styleProp:String){
if (StyleManager.inheritingStyles[styleProp]){
return ((inheritingStyles) ? inheritingStyles[styleProp] : IStyleClient(parent).getStyle(styleProp));
//unresolved jump
};
return ((nonInheritingStyles) ? nonInheritingStyles[styleProp] : IStyleClient(parent).getStyle(styleProp));
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function setColor(color:uint):void{
explicitColor = color;
styleChangedFlag = true;
invalidateDisplayListFlag = true;
validateNow();
}
override public function replaceText(beginIndex:int, endIndex:int, newText:String):void{
super.replaceText(beginIndex, endIndex, newText);
dispatchEvent(new Event("textReplace"));
}
private function creatingSystemManager():ISystemManager{
return ((((!((moduleFactory == null))) && ((moduleFactory is ISystemManager)))) ? ISystemManager(moduleFactory) : systemManager);
}
public function set document(value:Object):void{
_document = value;
}
public function get automationName():String{
if (_automationName){
return (_automationName);
};
if (automationDelegate){
return (automationDelegate.automationName);
};
return ("");
}
public function get explicitMinHeight():Number{
return (NaN);
}
public function get focusPane():Sprite{
return (null);
}
public function getTextStyles():TextFormat{
var textFormat:TextFormat = new TextFormat();
textFormat.align = getStyle("textAlign");
textFormat.bold = (getStyle("fontWeight") == "bold");
if (enabled){
if (explicitColor == StyleManager.NOT_A_COLOR){
textFormat.color = getStyle("color");
} else {
textFormat.color = explicitColor;
};
} else {
textFormat.color = getStyle("disabledColor");
};
textFormat.font = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
textFormat.indent = getStyle("textIndent");
textFormat.italic = (getStyle("fontStyle") == "italic");
textFormat.kerning = getStyle("kerning");
textFormat.leading = getStyle("leading");
textFormat.leftMargin = (ignorePadding) ? 0 : getStyle("paddingLeft");
textFormat.letterSpacing = getStyle("letterSpacing");
textFormat.rightMargin = (ignorePadding) ? 0 : getStyle("paddingRight");
textFormat.size = getStyle("fontSize");
textFormat.underline = (getStyle("textDecoration") == "underline");
cachedTextFormat = textFormat;
return (textFormat);
}
override public function set text(value:String):void{
if (!value){
value = "";
};
if (((!(isHTML)) && ((super.text == value)))){
return;
};
super.text = value;
explicitHTMLText = null;
if (invalidateDisplayListFlag){
validateNow();
};
}
public function getExplicitOrMeasuredWidth():Number{
return ((isNaN(explicitWidth)) ? measuredWidth : explicitWidth);
}
public function get showInAutomationHierarchy():Boolean{
return (true);
}
public function set automationName(value:String):void{
_automationName = value;
}
public function get systemManager():ISystemManager{
var ui:IUIComponent;
var o:DisplayObject = parent;
while (o) {
ui = (o as IUIComponent);
if (ui){
return (ui.systemManager);
};
o = o.parent;
};
return (null);
}
public function setStyle(styleProp:String, value):void{
}
public function get percentWidth():Number{
return (NaN);
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
public function get baselinePosition():Number{
var tlm:TextLineMetrics;
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
tlm = getLineMetrics(0);
return (((height - 4) - tlm.descent));
};
if (!parent){
return (NaN);
};
var isEmpty = (text == "");
if (isEmpty){
super.text = "Wj";
};
tlm = getLineMetrics(0);
if (isEmpty){
super.text = "";
};
return ((2 + tlm.ascent));
}
public function set enabled(value:Boolean):void{
mouseEnabled = value;
_enabled = value;
styleChanged("color");
}
public function get minWidth():Number{
return (0);
}
public function get automationValue():Array{
if (automationDelegate){
return (automationDelegate.automationValue);
};
return ([""]);
}
public function get tweeningProperties():Array{
return (null);
}
public function get measuredWidth():Number{
validateNow();
if (!stage){
return ((textWidth + TEXT_WIDTH_PADDING));
};
return (((textWidth * transform.concatenatedMatrix.d) + TEXT_WIDTH_PADDING));
}
public function set tweeningProperties(value:Array):void{
}
public function createAutomationIDPart(child:IAutomationObject):Object{
return (null);
}
override public function get parent():DisplayObjectContainer{
return ((_parent) ? _parent : super.parent);
}
public function set updateCompletePendingFlag(value:Boolean):void{
_updateCompletePendingFlag = value;
}
public function setActualSize(w:Number, h:Number):void{
if (width != w){
width = w;
};
if (height != h){
height = h;
};
}
public function get numAutomationChildren():int{
return (0);
}
public function set focusPane(value:Sprite):void{
}
public function getAutomationChildAt(index:int):IAutomationObject{
return (null);
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
public function get owner():DisplayObjectContainer{
return ((_owner) ? _owner : parent);
}
public function parentChanged(p:DisplayObjectContainer):void{
if (!p){
_parent = null;
_nestLevel = 0;
} else {
if ((p is IStyleClient)){
_parent = p;
} else {
if ((p is SystemManager)){
_parent = p;
} else {
_parent = p.parent;
};
};
};
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
public function get maxWidth():Number{
return (UIComponent.DEFAULT_MAX_WIDTH);
}
private function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont{
if (cachedEmbeddedFont){
if ((((cachedEmbeddedFont.fontName == fontName)) && ((cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))))){
return (cachedEmbeddedFont);
};
};
cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);
return (cachedEmbeddedFont);
}
public function get initialized():Boolean{
return (_initialized);
}
public function invalidateDisplayList():void{
invalidateDisplayListFlag = true;
}
public function invalidateProperties():void{
}
override public function insertXMLText(beginIndex:int, endIndex:int, richText:String, pasting:Boolean=false):void{
super.insertXMLText(beginIndex, endIndex, richText, pasting);
dispatchEvent(new Event("textInsert"));
}
public function set includeInLayout(value:Boolean):void{
var p:IInvalidating;
if (_includeInLayout != value){
_includeInLayout = value;
p = (parent as IInvalidating);
if (p){
p.invalidateSize();
p.invalidateDisplayList();
};
};
}
override public function set htmlText(value:String):void{
if (!value){
value = "";
};
if (((isHTML) && ((super.htmlText == value)))){
return;
};
if (((cachedTextFormat) && ((styleSheet == null)))){
defaultTextFormat = cachedTextFormat;
};
super.htmlText = value;
explicitHTMLText = value;
if (invalidateDisplayListFlag){
validateNow();
};
}
public function set showInAutomationHierarchy(value:Boolean):void{
}
private function resourceManager_changeHandler(event:Event):void{
truncationIndicatorResource = resourceManager.getString("core", "truncationIndicator");
if (untruncatedText != null){
super.text = untruncatedText;
truncateToFit();
};
}
public function set measuredMinWidth(value:Number):void{
}
public function set explicitHeight(value:Number):void{
_explicitHeight = value;
}
public function get explicitMinWidth():Number{
return (NaN);
}
public function set percentWidth(value:Number):void{
}
public function get imeMode():String{
return (_imeMode);
}
public function get moduleFactory():IFlexModuleFactory{
return (_moduleFactory);
}
public function set systemManager(value:ISystemManager):void{
}
public function get explicitMaxWidth():Number{
return (NaN);
}
public function get document():Object{
return (_document);
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
public function replayAutomatableEvent(event:Event):Boolean{
if (automationDelegate){
return (automationDelegate.replayAutomatableEvent(event));
};
return (false);
}
public function get enabled():Boolean{
return (_enabled);
}
public function set owner(value:DisplayObjectContainer):void{
_owner = value;
}
public function get automationTabularData():Object{
return (null);
}
public function set nonInheritingStyles(value:Object):void{
_nonInheritingStyles = value;
}
public function get includeInLayout():Boolean{
return (_includeInLayout);
}
public function get measuredMinWidth():Number{
return (0);
}
public function set isPopUp(value:Boolean):void{
}
public function set automationDelegate(value:Object):void{
_automationDelegate = (value as IAutomationObject);
}
public function get measuredHeight():Number{
validateNow();
if (!stage){
return ((textHeight + TEXT_HEIGHT_PADDING));
};
return (((textHeight * transform.concatenatedMatrix.a) + TEXT_HEIGHT_PADDING));
}
public function set processedDescriptors(value:Boolean):void{
_processedDescriptors = value;
}
public function setFocus():void{
systemManager.stage.focus = this;
}
public function initialize():void{
}
public function set percentHeight(value:Number):void{
}
public function resolveAutomationIDPart(criteria:Object):Array{
return ([]);
}
public function set inheritingStyles(value:Object):void{
_inheritingStyles = value;
}
public function getUITextFormat():UITextFormat{
validateNow();
var textFormat:UITextFormat = new UITextFormat(creatingSystemManager());
textFormat.moduleFactory = moduleFactory;
textFormat.copyFrom(getTextFormat());
textFormat.antiAliasType = antiAliasType;
textFormat.gridFitType = gridFitType;
textFormat.sharpness = sharpness;
textFormat.thickness = thickness;
return (textFormat);
}
private function changeHandler(event:Event):void{
explicitHTMLText = null;
}
public function set initialized(value:Boolean):void{
_initialized = value;
}
public function get nonZeroTextHeight():Number{
var result:Number;
if (super.text == ""){
super.text = "Wj";
result = textHeight;
super.text = "";
return (result);
};
return (textHeight);
}
public function owns(child:DisplayObject):Boolean{
return ((child == this));
}
override public function setTextFormat(format:TextFormat, beginIndex:int=-1, endIndex:int=-1):void{
if (styleSheet){
return;
};
super.setTextFormat(format, beginIndex, endIndex);
dispatchEvent(new Event("textFormatChange"));
}
public function get nonInheritingStyles():Object{
return (_nonInheritingStyles);
}
public function setVisible(visible:Boolean, noEvent:Boolean=false):void{
this.visible = visible;
}
public function get maxHeight():Number{
return (UIComponent.DEFAULT_MAX_HEIGHT);
}
public function get automationDelegate():Object{
return (_automationDelegate);
}
public function get isPopUp():Boolean{
return (false);
}
public function set ignorePadding(value:Boolean):void{
_ignorePadding = value;
styleChanged(null);
}
public function set styleName(value:Object):void{
if (_styleName === value){
return;
};
_styleName = value;
if (parent){
StyleProtoChain.initTextField(this);
styleChanged("styleName");
};
}
public function styleChanged(styleProp:String):void{
styleChangedFlag = true;
if (!invalidateDisplayListFlag){
invalidateDisplayListFlag = true;
if (("callLater" in parent)){
Object(parent).callLater(validateNow);
};
};
}
public function get percentHeight():Number{
return (NaN);
}
private function get isHTML():Boolean{
return (!((explicitHTMLText == null)));
}
public function get explicitMaxHeight():Number{
return (NaN);
}
public function get styleName():Object{
return (_styleName);
}
public function set explicitWidth(value:Number):void{
_explicitWidth = value;
}
public function validateNow():void{
var textFormat:TextFormat;
var embeddedFont:EmbeddedFont;
var fontModuleFactory:IFlexModuleFactory;
var sm:ISystemManager;
if (!parent){
return;
};
if (((!(isNaN(explicitWidth))) && (!((super.width == explicitWidth))))){
super.width = ((explicitWidth)>4) ? explicitWidth : 4;
};
if (((!(isNaN(explicitHeight))) && (!((super.height == explicitHeight))))){
super.height = explicitHeight;
};
if (styleChangedFlag){
textFormat = getTextStyles();
if (textFormat.font){
embeddedFont = getEmbeddedFont(textFormat.font, textFormat.bold, textFormat.italic);
fontModuleFactory = embeddedFontRegistry.getAssociatedModuleFactory(embeddedFont, moduleFactory);
if (fontModuleFactory != null){
embedFonts = true;
} else {
sm = creatingSystemManager();
embedFonts = ((!((sm == null))) && (sm.isFontFaceEmbedded(textFormat)));
};
} else {
embedFonts = getStyle("embedFonts");
};
if (getStyle("fontAntiAliasType") != undefined){
antiAliasType = getStyle("fontAntiAliasType");
gridFitType = getStyle("fontGridFitType");
sharpness = getStyle("fontSharpness");
thickness = getStyle("fontThickness");
};
if (!styleSheet){
super.setTextFormat(textFormat);
defaultTextFormat = textFormat;
};
dispatchEvent(new Event("textFieldStyleChange"));
};
styleChangedFlag = false;
invalidateDisplayListFlag = false;
}
public function set toolTip(value:String):void{
var oldValue:String = _toolTip;
_toolTip = value;
ToolTipManager.registerToolTip(this, oldValue, value);
}
public function move(x:Number, y:Number):void{
if (this.x != x){
this.x = x;
};
if (this.y != y){
this.y = y;
};
}
public function get toolTip():String{
return (_toolTip);
}
public function get ignorePadding():Boolean{
return (_ignorePadding);
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
public function invalidateSize():void{
invalidateDisplayListFlag = true;
}
public function set measuredMinHeight(value:Number):void{
}
public function get measuredMinHeight():Number{
return (0);
}
public function set moduleFactory(factory:IFlexModuleFactory):void{
_moduleFactory = factory;
}
private static function get embeddedFontRegistry():IEmbeddedFontRegistry{
if (!_embeddedFontRegistry){
_embeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
};
return (_embeddedFontRegistry);
}
}
}//package mx.core
Section 97
//UITextFormat (mx.core.UITextFormat)
package mx.core {
import flash.text.*;
import mx.managers.*;
public class UITextFormat extends TextFormat {
private var systemManager:ISystemManager;
public var sharpness:Number;
public var gridFitType:String;
public var antiAliasType:String;
public var thickness:Number;
private var cachedEmbeddedFont:EmbeddedFont;// = null
private var _moduleFactory:IFlexModuleFactory;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
private static var _textFieldFactory:ITextFieldFactory;
public function UITextFormat(systemManager:ISystemManager, font:String=null, size:Object=null, color:Object=null, bold:Object=null, italic:Object=null, underline:Object=null, url:String=null, target:String=null, align:String=null, leftMargin:Object=null, rightMargin:Object=null, indent:Object=null, leading:Object=null){
this.systemManager = systemManager;
super(font, size, color, bold, italic, underline, url, target, align, leftMargin, rightMargin, indent, leading);
}
public function set moduleFactory(value:IFlexModuleFactory):void{
_moduleFactory = value;
}
mx_internal function copyFrom(source:TextFormat):void{
font = source.font;
size = source.size;
color = source.color;
bold = source.bold;
italic = source.italic;
underline = source.underline;
url = source.url;
target = source.target;
align = source.align;
leftMargin = source.leftMargin;
rightMargin = source.rightMargin;
indent = source.indent;
leading = source.leading;
letterSpacing = source.letterSpacing;
blockIndent = source.blockIndent;
bullet = source.bullet;
display = source.display;
indent = source.indent;
kerning = source.kerning;
tabStops = source.tabStops;
}
private function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont{
if (cachedEmbeddedFont){
if ((((cachedEmbeddedFont.fontName == fontName)) && ((cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))))){
return (cachedEmbeddedFont);
};
};
cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);
return (cachedEmbeddedFont);
}
public function measureText(text:String, roundUp:Boolean=true):TextLineMetrics{
return (measure(text, false, roundUp));
}
private function measure(s:String, html:Boolean, roundUp:Boolean):TextLineMetrics{
if (!s){
s = "";
};
var embeddedFont:Boolean;
var fontModuleFactory:IFlexModuleFactory = embeddedFontRegistry.getAssociatedModuleFactory(getEmbeddedFont(font, bold, italic), moduleFactory);
embeddedFont = !((fontModuleFactory == null));
if (fontModuleFactory == null){
fontModuleFactory = systemManager;
};
var measurementTextField:TextField;
measurementTextField = TextField(textFieldFactory.createTextField(fontModuleFactory));
if (html){
measurementTextField.htmlText = "";
} else {
measurementTextField.text = "";
};
measurementTextField.defaultTextFormat = this;
if (font){
measurementTextField.embedFonts = ((embeddedFont) || (((!((systemManager == null))) && (systemManager.isFontFaceEmbedded(this)))));
} else {
measurementTextField.embedFonts = false;
};
measurementTextField.antiAliasType = antiAliasType;
measurementTextField.gridFitType = gridFitType;
measurementTextField.sharpness = sharpness;
measurementTextField.thickness = thickness;
if (html){
measurementTextField.htmlText = s;
} else {
measurementTextField.text = s;
};
var lineMetrics:TextLineMetrics = measurementTextField.getLineMetrics(0);
if (indent != null){
lineMetrics.width = (lineMetrics.width + indent);
};
if (roundUp){
lineMetrics.width = Math.ceil(lineMetrics.width);
lineMetrics.height = Math.ceil(lineMetrics.height);
};
return (lineMetrics);
}
public function measureHTMLText(htmlText:String, roundUp:Boolean=true):TextLineMetrics{
return (measure(htmlText, true, roundUp));
}
public function get moduleFactory():IFlexModuleFactory{
return (_moduleFactory);
}
private static function get embeddedFontRegistry():IEmbeddedFontRegistry{
if (!_embeddedFontRegistry){
_embeddedFontRegistry = IEmbeddedFontRegistry(Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
};
return (_embeddedFontRegistry);
}
private static function get textFieldFactory():ITextFieldFactory{
if (!_textFieldFactory){
_textFieldFactory = ITextFieldFactory(Singleton.getInstance("mx.core::ITextFieldFactory"));
};
return (_textFieldFactory);
}
}
}//package mx.core
Section 98
//AddRemoveEffectTargetFilter (mx.effects.effectClasses.AddRemoveEffectTargetFilter)
package mx.effects.effectClasses {
import mx.core.*;
import mx.effects.*;
public class AddRemoveEffectTargetFilter extends EffectTargetFilter {
public var add:Boolean;// = true
mx_internal static const VERSION:String = "3.5.0.12683";
public function AddRemoveEffectTargetFilter(){
super();
filterProperties = ["parent"];
}
override protected function defaultFilterFunction(propChanges:Array, instanceTarget:Object):Boolean{
var props:PropertyChanges;
var n:int = propChanges.length;
var i:int;
while (i < n) {
props = propChanges[i];
if (props.target == instanceTarget){
if (add){
return ((((props.start["parent"] == null)) && (!((props.end["parent"] == null)))));
};
return (((!((props.start["parent"] == null))) && ((props.end["parent"] == null))));
};
i++;
};
return (false);
}
}
}//package mx.effects.effectClasses
Section 99
//HideShowEffectTargetFilter (mx.effects.effectClasses.HideShowEffectTargetFilter)
package mx.effects.effectClasses {
import mx.core.*;
import mx.effects.*;
public class HideShowEffectTargetFilter extends EffectTargetFilter {
public var show:Boolean;// = true
mx_internal static const VERSION:String = "3.5.0.12683";
public function HideShowEffectTargetFilter(){
super();
filterProperties = ["visible"];
}
override protected function defaultFilterFunction(propChanges:Array, instanceTarget:Object):Boolean{
var props:PropertyChanges;
var n:int = propChanges.length;
var i:int;
while (i < n) {
props = propChanges[i];
if (props.target == instanceTarget){
return ((props.end["visible"] == show));
};
i++;
};
return (false);
}
}
}//package mx.effects.effectClasses
Section 100
//PropertyChanges (mx.effects.effectClasses.PropertyChanges)
package mx.effects.effectClasses {
import mx.core.*;
public class PropertyChanges {
public var target:Object;
public var start:Object;
public var end:Object;
mx_internal static const VERSION:String = "3.5.0.12683";
public function PropertyChanges(target:Object){
end = {};
start = {};
super();
this.target = target;
}
}
}//package mx.effects.effectClasses
Section 101
//TweenEffectInstance (mx.effects.effectClasses.TweenEffectInstance)
package mx.effects.effectClasses {
import mx.core.*;
import mx.events.*;
import mx.effects.*;
public class TweenEffectInstance extends EffectInstance {
private var _seekTime:Number;// = 0
public var easingFunction:Function;
public var tween:Tween;
mx_internal var needToLayout:Boolean;// = false
mx_internal static const VERSION:String = "3.5.0.12683";
public function TweenEffectInstance(target:Object){
super(target);
}
override public function stop():void{
super.stop();
if (tween){
tween.stop();
};
}
mx_internal function applyTweenStartValues():void{
if (duration > 0){
onTweenUpdate(tween.getCurrentValue(0));
};
}
override public function get playheadTime():Number{
if (tween){
return ((tween.playheadTime + super.playheadTime));
};
return (0);
}
protected function createTween(listener:Object, startValue:Object, endValue:Object, duration:Number=-1, minFps:Number=-1):Tween{
var newTween:Tween = new Tween(listener, startValue, endValue, duration, minFps);
newTween.addEventListener(TweenEvent.TWEEN_START, tweenEventHandler);
newTween.addEventListener(TweenEvent.TWEEN_UPDATE, tweenEventHandler);
newTween.addEventListener(TweenEvent.TWEEN_END, tweenEventHandler);
if (easingFunction != null){
newTween.easingFunction = easingFunction;
};
if (_seekTime > 0){
newTween.seek(_seekTime);
};
newTween.playReversed = playReversed;
return (newTween);
}
private function tweenEventHandler(event:TweenEvent):void{
dispatchEvent(event);
}
override public function end():void{
stopRepeat = true;
if (delayTimer){
delayTimer.reset();
};
if (tween){
tween.endTween();
tween = null;
};
}
override public function reverse():void{
super.reverse();
if (tween){
tween.reverse();
};
super.playReversed = !(playReversed);
}
override mx_internal function set playReversed(value:Boolean):void{
super.playReversed = value;
if (tween){
tween.playReversed = value;
};
}
override public function resume():void{
super.resume();
if (tween){
tween.resume();
};
}
public function onTweenEnd(value:Object):void{
onTweenUpdate(value);
tween = null;
if (needToLayout){
UIComponentGlobals.layoutManager.validateNow();
};
finishRepeat();
}
public function onTweenUpdate(value:Object):void{
}
override public function pause():void{
super.pause();
if (tween){
tween.pause();
};
}
public function seek(playheadTime:Number):void{
if (tween){
tween.seek(playheadTime);
} else {
_seekTime = playheadTime;
};
}
}
}//package mx.effects.effectClasses
Section 102
//ZoomInstance (mx.effects.effectClasses.ZoomInstance)
package mx.effects.effectClasses {
import flash.events.*;
import mx.core.*;
import mx.events.*;
import mx.effects.*;
public class ZoomInstance extends TweenEffectInstance {
private var newY:Number;
public var originY:Number;
private var origX:Number;
private var origY:Number;
public var originX:Number;
private var origPercentHeight:Number;
public var zoomWidthFrom:Number;
public var zoomWidthTo:Number;
private var newX:Number;
public var captureRollEvents:Boolean;
private var origPercentWidth:Number;
public var zoomHeightFrom:Number;
private var origScaleX:Number;
public var zoomHeightTo:Number;
private var origScaleY:Number;
private var scaledOriginX:Number;
private var scaledOriginY:Number;
private var show:Boolean;// = true
private var _mouseHasMoved:Boolean;// = false
mx_internal static const VERSION:String = "3.5.0.12683";
public function ZoomInstance(target:Object){
super(target);
}
override public function finishEffect():void{
if (captureRollEvents){
target.removeEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false);
target.removeEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false);
target.removeEventListener(MouseEvent.MOUSE_MOVE, mouseEventHandler, false);
};
super.finishEffect();
}
private function getScaleFromWidth(value:Number):Number{
return ((value / (target.width / Math.abs(target.scaleX))));
}
override public function initEffect(event:Event):void{
super.initEffect(event);
if ((((event.type == FlexEvent.HIDE)) || ((event.type == Event.REMOVED)))){
show = false;
};
}
private function getScaleFromHeight(value:Number):Number{
return ((value / (target.height / Math.abs(target.scaleY))));
}
private function applyPropertyChanges():void{
var useSize:Boolean;
var useScale:Boolean;
var values:PropertyChanges = propertyChanges;
if (values){
useSize = false;
useScale = false;
if (values.end["scaleX"] !== undefined){
zoomWidthFrom = (isNaN(zoomWidthFrom)) ? target.scaleX : zoomWidthFrom;
zoomWidthTo = (isNaN(zoomWidthTo)) ? values.end["scaleX"] : zoomWidthTo;
useScale = true;
};
if (values.end["scaleY"] !== undefined){
zoomHeightFrom = (isNaN(zoomHeightFrom)) ? target.scaleY : zoomHeightFrom;
zoomHeightTo = (isNaN(zoomHeightTo)) ? values.end["scaleY"] : zoomHeightTo;
useScale = true;
};
if (useScale){
return;
};
if (values.end["width"] !== undefined){
zoomWidthFrom = (isNaN(zoomWidthFrom)) ? getScaleFromWidth(target.width) : zoomWidthFrom;
zoomWidthTo = (isNaN(zoomWidthTo)) ? getScaleFromWidth(values.end["width"]) : zoomWidthTo;
useSize = true;
};
if (values.end["height"] !== undefined){
zoomHeightFrom = (isNaN(zoomHeightFrom)) ? getScaleFromHeight(target.height) : zoomHeightFrom;
zoomHeightTo = (isNaN(zoomHeightTo)) ? getScaleFromHeight(values.end["height"]) : zoomHeightTo;
useSize = true;
};
if (useSize){
return;
};
if (values.end["visible"] !== undefined){
show = values.end["visible"];
};
};
}
private function mouseEventHandler(event:MouseEvent):void{
if (event.type == MouseEvent.MOUSE_MOVE){
_mouseHasMoved = true;
} else {
if ((((event.type == MouseEvent.ROLL_OUT)) || ((event.type == MouseEvent.ROLL_OVER)))){
if (!_mouseHasMoved){
event.stopImmediatePropagation();
};
_mouseHasMoved = false;
};
};
}
override public function play():void{
super.play();
applyPropertyChanges();
if (((((((isNaN(zoomWidthFrom)) && (isNaN(zoomWidthTo)))) && (isNaN(zoomHeightFrom)))) && (isNaN(zoomHeightTo)))){
if (show){
zoomWidthFrom = (zoomHeightFrom = 0);
zoomWidthTo = target.scaleX;
zoomHeightTo = target.scaleY;
} else {
zoomWidthFrom = target.scaleX;
zoomHeightFrom = target.scaleY;
zoomWidthTo = (zoomHeightTo = 0);
};
} else {
if (((isNaN(zoomWidthFrom)) && (isNaN(zoomWidthTo)))){
zoomWidthFrom = (zoomWidthTo = target.scaleX);
} else {
if (((isNaN(zoomHeightFrom)) && (isNaN(zoomHeightTo)))){
zoomHeightFrom = (zoomHeightTo = target.scaleY);
};
};
if (isNaN(zoomWidthFrom)){
zoomWidthFrom = target.scaleX;
} else {
if (isNaN(zoomWidthTo)){
zoomWidthTo = ((zoomWidthFrom)==1) ? 0 : 1;
};
};
if (isNaN(zoomHeightFrom)){
zoomHeightFrom = target.scaleY;
} else {
if (isNaN(zoomHeightTo)){
zoomHeightTo = ((zoomHeightFrom)==1) ? 0 : 1;
};
};
};
if (zoomWidthFrom < 0.01){
zoomWidthFrom = 0.01;
};
if (zoomWidthTo < 0.01){
zoomWidthTo = 0.01;
};
if (zoomHeightFrom < 0.01){
zoomHeightFrom = 0.01;
};
if (zoomHeightTo < 0.01){
zoomHeightTo = 0.01;
};
origScaleX = target.scaleX;
origScaleY = target.scaleY;
newX = (origX = target.x);
newY = (origY = target.y);
if (isNaN(originX)){
scaledOriginX = (target.width / 2);
} else {
scaledOriginX = (originX * origScaleX);
};
if (isNaN(originY)){
scaledOriginY = (target.height / 2);
} else {
scaledOriginY = (originY * origScaleY);
};
scaledOriginX = Number(scaledOriginX.toFixed(1));
scaledOriginY = Number(scaledOriginY.toFixed(1));
origPercentWidth = target.percentWidth;
if (!isNaN(origPercentWidth)){
target.width = target.width;
};
origPercentHeight = target.percentHeight;
if (!isNaN(origPercentHeight)){
target.height = target.height;
};
tween = createTween(this, [zoomWidthFrom, zoomHeightFrom], [zoomWidthTo, zoomHeightTo], duration);
if (captureRollEvents){
target.addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false);
target.addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false);
target.addEventListener(MouseEvent.MOUSE_MOVE, mouseEventHandler, false);
};
}
override public function onTweenEnd(value:Object):void{
var curWidth:Number;
var curHeight:Number;
if (!isNaN(origPercentWidth)){
curWidth = target.width;
target.percentWidth = origPercentWidth;
if (((target.parent) && ((target.parent.autoLayout == false)))){
target._width = curWidth;
};
};
if (!isNaN(origPercentHeight)){
curHeight = target.height;
target.percentHeight = origPercentHeight;
if (((target.parent) && ((target.parent.autoLayout == false)))){
target._height = curHeight;
};
};
super.onTweenEnd(value);
if (hideOnEffectEnd){
EffectManager.suspendEventHandling();
target.scaleX = origScaleX;
target.scaleY = origScaleY;
target.move(origX, origY);
EffectManager.resumeEventHandling();
};
}
override public function onTweenUpdate(value:Object):void{
EffectManager.suspendEventHandling();
if (Math.abs((newX - target.x)) > 0.1){
origX = (origX + (Number(target.x.toFixed(1)) - newX));
};
if (Math.abs((newY - target.y)) > 0.1){
origY = (origY + (Number(target.y.toFixed(1)) - newY));
};
target.scaleX = value[0];
target.scaleY = value[1];
var ratioX:Number = (value[0] / origScaleX);
var ratioY:Number = (value[1] / origScaleY);
var newOriginX:Number = (scaledOriginX * ratioX);
var newOriginY:Number = (scaledOriginY * ratioY);
newX = ((scaledOriginX - newOriginX) + origX);
newY = ((scaledOriginY - newOriginY) + origY);
newX = Number(newX.toFixed(1));
newY = Number(newY.toFixed(1));
target.move(newX, newY);
if (tween){
tween.needToLayout = true;
} else {
needToLayout = true;
};
EffectManager.resumeEventHandling();
}
}
}//package mx.effects.effectClasses
Section 103
//Effect (mx.effects.Effect)
package mx.effects {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import mx.events.*;
import mx.managers.*;
import mx.effects.effectClasses.*;
public class Effect extends EventDispatcher implements IEffect {
private var _perElementOffset:Number;// = 0
private var _hideFocusRing:Boolean;// = false
private var _customFilter:EffectTargetFilter;
public var repeatCount:int;// = 1
public var suspendBackgroundProcessing:Boolean;// = false
public var startDelay:int;// = 0
private var _relevantProperties:Array;
private var _callValidateNow:Boolean;// = false
mx_internal var applyActualDimensions:Boolean;// = true
private var _filter:String;
private var _triggerEvent:Event;
private var _effectTargetHost:IEffectTargetHost;
mx_internal var durationExplicitlySet:Boolean;// = false
public var repeatDelay:int;// = 0
private var _targets:Array;
mx_internal var propertyChangesArray:Array;
mx_internal var filterObject:EffectTargetFilter;
protected var endValuesCaptured:Boolean;// = false
public var instanceClass:Class;
private var _duration:Number;// = 500
private var isPaused:Boolean;// = false
private var _relevantStyles:Array;
private var _instances:Array;
mx_internal static const VERSION:String = "3.5.0.12683";
public function Effect(target:Object=null){
_instances = [];
instanceClass = IEffectInstance;
_relevantStyles = [];
_targets = [];
super();
this.target = target;
}
public function get targets():Array{
return (_targets);
}
public function set targets(value:Array):void{
var n:int = value.length;
var i:int = (n - 1);
while (i > 0) {
if (value[i] == null){
value.splice(i, 1);
};
i--;
};
_targets = value;
}
public function set hideFocusRing(value:Boolean):void{
_hideFocusRing = value;
}
public function get hideFocusRing():Boolean{
return (_hideFocusRing);
}
public function stop():void{
var instance:IEffectInstance;
var n:int = _instances.length;
var i:int = n;
while (i >= 0) {
instance = IEffectInstance(_instances[i]);
if (instance){
instance.stop();
};
i--;
};
}
public function captureStartValues():void{
if (targets.length > 0){
propertyChangesArray = captureValues(null, true);
_callValidateNow = true;
};
endValuesCaptured = false;
}
mx_internal function captureValues(propChanges:Array, setStartValues:Boolean):Array{
var n:int;
var i:int;
var valueMap:Object;
var target:Object;
var m:int;
var j:int;
if (!propChanges){
propChanges = [];
n = targets.length;
i = 0;
while (i < n) {
propChanges.push(new PropertyChanges(targets[i]));
i++;
};
};
var effectProps:Array = (filterObject) ? mergeArrays(relevantProperties, filterObject.filterProperties) : relevantProperties;
if (((effectProps) && ((effectProps.length > 0)))){
n = propChanges.length;
i = 0;
while (i < n) {
target = propChanges[i].target;
valueMap = (setStartValues) ? propChanges[i].start : propChanges[i].end;
m = effectProps.length;
j = 0;
while (j < m) {
valueMap[effectProps[j]] = getValueFromTarget(target, effectProps[j]);
j++;
};
i++;
};
};
var styles:Array = (filterObject) ? mergeArrays(relevantStyles, filterObject.filterStyles) : relevantStyles;
if (((styles) && ((styles.length > 0)))){
n = propChanges.length;
i = 0;
while (i < n) {
target = propChanges[i].target;
valueMap = (setStartValues) ? propChanges[i].start : propChanges[i].end;
m = styles.length;
j = 0;
while (j < m) {
valueMap[styles[j]] = target.getStyle(styles[j]);
j++;
};
i++;
};
};
return (propChanges);
}
protected function getValueFromTarget(target:Object, property:String){
if ((property in target)){
return (target[property]);
};
return (undefined);
}
public function set target(value:Object):void{
_targets.splice(0);
if (value){
_targets[0] = value;
};
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function set perElementOffset(value:Number):void{
_perElementOffset = value;
}
public function resume():void{
var n:int;
var i:int;
if (((isPlaying) && (isPaused))){
isPaused = false;
n = _instances.length;
i = 0;
while (i < n) {
IEffectInstance(_instances[i]).resume();
i++;
};
};
}
public function set duration(value:Number):void{
durationExplicitlySet = true;
_duration = value;
}
public function play(targets:Array=null, playReversedFromEnd:Boolean=false):Array{
var newInstance:IEffectInstance;
if ((((targets == null)) && (!((propertyChangesArray == null))))){
if (_callValidateNow){
LayoutManager.getInstance().validateNow();
};
if (!endValuesCaptured){
propertyChangesArray = captureValues(propertyChangesArray, false);
};
propertyChangesArray = stripUnchangedValues(propertyChangesArray);
applyStartValues(propertyChangesArray, this.targets);
};
var newInstances:Array = createInstances(targets);
var n:int = newInstances.length;
var i:int;
while (i < n) {
newInstance = IEffectInstance(newInstances[i]);
Object(newInstance).playReversed = playReversedFromEnd;
newInstance.startEffect();
i++;
};
return (newInstances);
}
public function captureEndValues():void{
propertyChangesArray = captureValues(propertyChangesArray, false);
endValuesCaptured = true;
}
protected function filterInstance(propChanges:Array, target:Object):Boolean{
if (filterObject){
return (filterObject.filterInstance(propChanges, effectTargetHost, target));
};
return (true);
}
public function get customFilter():EffectTargetFilter{
return (_customFilter);
}
public function get effectTargetHost():IEffectTargetHost{
return (_effectTargetHost);
}
public function set relevantProperties(value:Array):void{
_relevantProperties = value;
}
public function captureMoreStartValues(targets:Array):void{
var additionalPropertyChangesArray:Array;
if (targets.length > 0){
additionalPropertyChangesArray = captureValues(null, true);
propertyChangesArray = propertyChangesArray.concat(additionalPropertyChangesArray);
};
}
public function deleteInstance(instance:IEffectInstance):void{
EventDispatcher(instance).removeEventListener(EffectEvent.EFFECT_START, effectStartHandler);
EventDispatcher(instance).removeEventListener(EffectEvent.EFFECT_END, effectEndHandler);
var n:int = _instances.length;
var i:int;
while (i < n) {
if (_instances[i] === instance){
_instances.splice(i, 1);
};
i++;
};
}
public function get filter():String{
return (_filter);
}
public function set triggerEvent(value:Event):void{
_triggerEvent = value;
}
public function get target():Object{
if (_targets.length > 0){
return (_targets[0]);
};
return (null);
}
public function get duration():Number{
return (_duration);
}
public function set customFilter(value:EffectTargetFilter):void{
_customFilter = value;
filterObject = value;
}
public function get perElementOffset():Number{
return (_perElementOffset);
}
public function set effectTargetHost(value:IEffectTargetHost):void{
_effectTargetHost = value;
}
public function get isPlaying():Boolean{
return (((_instances) && ((_instances.length > 0))));
}
protected function effectEndHandler(event:EffectEvent):void{
var instance:IEffectInstance = IEffectInstance(event.effectInstance);
deleteInstance(instance);
dispatchEvent(event);
}
public function get relevantProperties():Array{
if (_relevantProperties){
return (_relevantProperties);
};
return (getAffectedProperties());
}
public function createInstance(target:Object=null):IEffectInstance{
var n:int;
var i:int;
if (!target){
target = this.target;
};
var newInstance:IEffectInstance;
var props:PropertyChanges;
var create:Boolean;
var setPropsArray:Boolean;
if (propertyChangesArray){
setPropsArray = true;
create = filterInstance(propertyChangesArray, target);
};
if (create){
newInstance = IEffectInstance(new instanceClass(target));
initInstance(newInstance);
if (setPropsArray){
n = propertyChangesArray.length;
i = 0;
while (i < n) {
if (propertyChangesArray[i].target == target){
newInstance.propertyChanges = propertyChangesArray[i];
};
i++;
};
};
EventDispatcher(newInstance).addEventListener(EffectEvent.EFFECT_START, effectStartHandler);
EventDispatcher(newInstance).addEventListener(EffectEvent.EFFECT_END, effectEndHandler);
_instances.push(newInstance);
if (triggerEvent){
newInstance.initEffect(triggerEvent);
};
};
return (newInstance);
}
protected function effectStartHandler(event:EffectEvent):void{
dispatchEvent(event);
}
public function getAffectedProperties():Array{
return ([]);
}
public function set relevantStyles(value:Array):void{
_relevantStyles = value;
}
public function get triggerEvent():Event{
return (_triggerEvent);
}
protected function applyValueToTarget(target:Object, property:String, value, props:Object):void{
var target = target;
var property = property;
var value = value;
var props = props;
if ((property in target)){
if (((((applyActualDimensions) && ((target is IFlexDisplayObject)))) && ((property == "height")))){
target.setActualSize(target.width, value);
} else {
if (((((applyActualDimensions) && ((target is IFlexDisplayObject)))) && ((property == "width")))){
target.setActualSize(value, target.height);
} else {
target[property] = value;
};
};
//unresolved jump
var _slot1 = e;
};
}
protected function initInstance(instance:IEffectInstance):void{
instance.duration = duration;
Object(instance).durationExplicitlySet = durationExplicitlySet;
instance.effect = this;
instance.effectTargetHost = effectTargetHost;
instance.hideFocusRing = hideFocusRing;
instance.repeatCount = repeatCount;
instance.repeatDelay = repeatDelay;
instance.startDelay = startDelay;
instance.suspendBackgroundProcessing = suspendBackgroundProcessing;
}
mx_internal function applyStartValues(propChanges:Array, targets:Array):void{
var m:int;
var j:int;
var target:Object;
var apply:Boolean;
var effectProps:Array = relevantProperties;
var n:int = propChanges.length;
var i:int;
while (i < n) {
target = propChanges[i].target;
apply = false;
m = targets.length;
j = 0;
while (j < m) {
if (targets[j] == target){
apply = filterInstance(propChanges, target);
break;
};
j++;
};
if (apply){
m = effectProps.length;
j = 0;
while (j < m) {
if ((((effectProps[j] in propChanges[i].start)) && ((effectProps[j] in target)))){
applyValueToTarget(target, effectProps[j], propChanges[i].start[effectProps[j]], propChanges[i].start);
};
j++;
};
m = relevantStyles.length;
j = 0;
while (j < m) {
if ((relevantStyles[j] in propChanges[i].start)){
target.setStyle(relevantStyles[j], propChanges[i].start[relevantStyles[j]]);
};
j++;
};
};
i++;
};
}
public function end(effectInstance:IEffectInstance=null):void{
var n:int;
var i:int;
var instance:IEffectInstance;
if (effectInstance){
effectInstance.end();
} else {
n = _instances.length;
i = n;
while (i >= 0) {
instance = IEffectInstance(_instances[i]);
if (instance){
instance.end();
};
i--;
};
};
}
public function get relevantStyles():Array{
return (_relevantStyles);
}
public function createInstances(targets:Array=null):Array{
var newInstance:IEffectInstance;
if (!targets){
targets = this.targets;
};
var newInstances:Array = [];
var n:int = targets.length;
var offsetDelay:Number = 0;
var i:int;
while (i < n) {
newInstance = createInstance(targets[i]);
if (newInstance){
newInstance.startDelay = (newInstance.startDelay + offsetDelay);
offsetDelay = (offsetDelay + perElementOffset);
newInstances.push(newInstance);
};
i++;
};
triggerEvent = null;
return (newInstances);
}
public function pause():void{
var n:int;
var i:int;
if (((isPlaying) && (!(isPaused)))){
isPaused = true;
n = _instances.length;
i = 0;
while (i < n) {
IEffectInstance(_instances[i]).pause();
i++;
};
};
}
public function set filter(value:String):void{
if (!customFilter){
_filter = value;
switch (value){
case "add":
case "remove":
filterObject = new AddRemoveEffectTargetFilter();
AddRemoveEffectTargetFilter(filterObject).add = (value == "add");
break;
case "hide":
case "show":
filterObject = new HideShowEffectTargetFilter();
HideShowEffectTargetFilter(filterObject).show = (value == "show");
break;
case "move":
filterObject = new EffectTargetFilter();
filterObject.filterProperties = ["x", "y"];
break;
case "resize":
filterObject = new EffectTargetFilter();
filterObject.filterProperties = ["width", "height"];
break;
case "addItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {added:true};
break;
case "removeItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {removed:true};
break;
case "replacedItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {replaced:true};
break;
case "replacementItem":
filterObject = new EffectTargetFilter();
filterObject.requiredSemantics = {replacement:true};
break;
default:
filterObject = null;
break;
};
};
}
public function reverse():void{
var n:int;
var i:int;
if (isPlaying){
n = _instances.length;
i = 0;
while (i < n) {
IEffectInstance(_instances[i]).reverse();
i++;
};
};
}
private static function mergeArrays(a1:Array, a2:Array):Array{
var i2:int;
var addIt:Boolean;
var i1:int;
if (a2){
i2 = 0;
while (i2 < a2.length) {
addIt = true;
i1 = 0;
while (i1 < a1.length) {
if (a1[i1] == a2[i2]){
addIt = false;
break;
};
i1++;
};
if (addIt){
a1.push(a2[i2]);
};
i2++;
};
};
return (a1);
}
private static function stripUnchangedValues(propChanges:Array):Array{
var prop:Object;
var i:int;
while (i < propChanges.length) {
for (prop in propChanges[i].start) {
if ((((propChanges[i].start[prop] == propChanges[i].end[prop])) || ((((((((typeof(propChanges[i].start[prop]) == "number")) && ((typeof(propChanges[i].end[prop]) == "number")))) && (isNaN(propChanges[i].start[prop])))) && (isNaN(propChanges[i].end[prop])))))){
delete propChanges[i].start[prop];
delete propChanges[i].end[prop];
};
};
i++;
};
return (propChanges);
}
}
}//package mx.effects
Section 104
//EffectInstance (mx.effects.EffectInstance)
package mx.effects {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import mx.events.*;
import mx.effects.effectClasses.*;
public class EffectInstance extends EventDispatcher implements IEffectInstance {
private var _hideFocusRing:Boolean;
private var delayStartTime:Number;// = 0
mx_internal var stopRepeat:Boolean;// = false
private var playCount:int;// = 0
private var _repeatCount:int;// = 0
private var _suspendBackgroundProcessing:Boolean;// = false
mx_internal var delayTimer:Timer;
private var _triggerEvent:Event;
private var _effectTargetHost:IEffectTargetHost;
mx_internal var parentCompositeEffectInstance:EffectInstance;
mx_internal var durationExplicitlySet:Boolean;// = false
private var _effect:IEffect;
private var _target:Object;
mx_internal var hideOnEffectEnd:Boolean;// = false
private var _startDelay:int;// = 0
private var delayElapsedTime:Number;// = 0
private var _repeatDelay:int;// = 0
private var _propertyChanges:PropertyChanges;
private var _duration:Number;// = 500
private var _playReversed:Boolean;
mx_internal static const VERSION:String = "3.5.0.12683";
public function EffectInstance(target:Object){
super();
this.target = target;
}
public function get playheadTime():Number{
return ((((Math.max((playCount - 1), 0) * duration) + (Math.max((playCount - 2), 0) * repeatDelay)) + (playReversed) ? 0 : startDelay));
}
public function get hideFocusRing():Boolean{
return (_hideFocusRing);
}
public function stop():void{
if (delayTimer){
delayTimer.reset();
};
stopRepeat = true;
finishEffect();
}
public function finishEffect():void{
playCount = 0;
dispatchEvent(new EffectEvent(EffectEvent.EFFECT_END, false, false, this));
if (target){
target.dispatchEvent(new EffectEvent(EffectEvent.EFFECT_END, false, false, this));
};
if ((target is UIComponent)){
UIComponent(target).effectFinished(this);
};
EffectManager.effectFinished(this);
}
public function set hideFocusRing(value:Boolean):void{
_hideFocusRing = value;
}
public function finishRepeat():void{
if (((((!(stopRepeat)) && (!((playCount == 0))))) && ((((playCount < repeatCount)) || ((repeatCount == 0)))))){
if (repeatDelay > 0){
delayTimer = new Timer(repeatDelay, 1);
delayStartTime = getTimer();
delayTimer.addEventListener(TimerEvent.TIMER, delayTimerHandler);
delayTimer.start();
} else {
play();
};
} else {
finishEffect();
};
}
mx_internal function get playReversed():Boolean{
return (_playReversed);
}
public function set effect(value:IEffect):void{
_effect = value;
}
public function get className():String{
var name:String = getQualifiedClassName(this);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
return (name);
}
public function set duration(value:Number):void{
durationExplicitlySet = true;
_duration = value;
}
mx_internal function set playReversed(value:Boolean):void{
_playReversed = value;
}
public function resume():void{
if (((((delayTimer) && (!(delayTimer.running)))) && (!(isNaN(delayElapsedTime))))){
delayTimer.delay = (playReversed) ? delayElapsedTime : (delayTimer.delay - delayElapsedTime);
delayTimer.start();
};
}
public function get propertyChanges():PropertyChanges{
return (_propertyChanges);
}
public function set target(value:Object):void{
_target = value;
}
public function get repeatCount():int{
return (_repeatCount);
}
mx_internal function playWithNoDuration():void{
duration = 0;
repeatCount = 1;
repeatDelay = 0;
startDelay = 0;
startEffect();
}
public function get startDelay():int{
return (_startDelay);
}
mx_internal function get actualDuration():Number{
var value:Number = NaN;
if (repeatCount > 0){
value = (((duration * repeatCount) + ((repeatDelay * repeatCount) - 1)) + startDelay);
};
return (value);
}
public function play():void{
playCount++;
dispatchEvent(new EffectEvent(EffectEvent.EFFECT_START, false, false, this));
if (target){
target.dispatchEvent(new EffectEvent(EffectEvent.EFFECT_START, false, false, this));
};
}
public function get suspendBackgroundProcessing():Boolean{
return (_suspendBackgroundProcessing);
}
public function get effectTargetHost():IEffectTargetHost{
return (_effectTargetHost);
}
public function set repeatDelay(value:int):void{
_repeatDelay = value;
}
public function set propertyChanges(value:PropertyChanges):void{
_propertyChanges = value;
}
mx_internal function eventHandler(event:Event):void{
if ((((event.type == FlexEvent.SHOW)) && ((hideOnEffectEnd == true)))){
hideOnEffectEnd = false;
event.target.removeEventListener(FlexEvent.SHOW, eventHandler);
};
}
public function set repeatCount(value:int):void{
_repeatCount = value;
}
private function delayTimerHandler(event:TimerEvent):void{
delayTimer.reset();
delayStartTime = NaN;
delayElapsedTime = NaN;
play();
}
public function set suspendBackgroundProcessing(value:Boolean):void{
_suspendBackgroundProcessing = value;
}
public function set triggerEvent(value:Event):void{
_triggerEvent = value;
}
public function set startDelay(value:int):void{
_startDelay = value;
}
public function get effect():IEffect{
return (_effect);
}
public function set effectTargetHost(value:IEffectTargetHost):void{
_effectTargetHost = value;
}
public function get target():Object{
return (_target);
}
public function startEffect():void{
EffectManager.effectStarted(this);
if ((target is UIComponent)){
UIComponent(target).effectStarted(this);
};
if ((((startDelay > 0)) && (!(playReversed)))){
delayTimer = new Timer(startDelay, 1);
delayStartTime = getTimer();
delayTimer.addEventListener(TimerEvent.TIMER, delayTimerHandler);
delayTimer.start();
} else {
play();
};
}
public function get repeatDelay():int{
return (_repeatDelay);
}
public function get duration():Number{
if (((!(durationExplicitlySet)) && (parentCompositeEffectInstance))){
return (parentCompositeEffectInstance.duration);
};
return (_duration);
}
public function initEffect(event:Event):void{
triggerEvent = event;
switch (event.type){
case "resizeStart":
case "resizeEnd":
if (!durationExplicitlySet){
duration = 250;
};
break;
case FlexEvent.HIDE:
target.setVisible(true, true);
hideOnEffectEnd = true;
target.addEventListener(FlexEvent.SHOW, eventHandler);
break;
};
}
public function get triggerEvent():Event{
return (_triggerEvent);
}
public function end():void{
if (delayTimer){
delayTimer.reset();
};
stopRepeat = true;
finishEffect();
}
public function reverse():void{
if (repeatCount > 0){
playCount = ((repeatCount - playCount) + 1);
};
}
public function pause():void{
if (((((delayTimer) && (delayTimer.running))) && (!(isNaN(delayStartTime))))){
delayTimer.stop();
delayElapsedTime = (getTimer() - delayStartTime);
};
}
}
}//package mx.effects
Section 105
//EffectManager (mx.effects.EffectManager)
package mx.effects {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.utils.*;
import mx.events.*;
import mx.resources.*;
public class EffectManager extends EventDispatcher {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var _resourceManager:IResourceManager;
private static var effects:Dictionary = new Dictionary(true);
mx_internal static var effectsPlaying:Array = [];
private static var targetsInfo:Array = [];
private static var effectTriggersForEvent:Object = {};
mx_internal static var lastEffectCreated:Effect;
private static var eventHandlingSuspendCount:Number = 0;
private static var eventsForEffectTriggers:Object = {};
public function EffectManager(){
super();
}
public static function suspendEventHandling():void{
eventHandlingSuspendCount++;
}
mx_internal static function registerEffectTrigger(name:String, event:String):void{
var strLen:Number;
if (name != ""){
if (event == ""){
strLen = name.length;
if ((((strLen > 6)) && ((name.substring((strLen - 6)) == "Effect")))){
event = name.substring(0, (strLen - 6));
};
};
if (event != ""){
effectTriggersForEvent[event] = name;
eventsForEffectTriggers[name] = event;
};
};
}
private static function removedEffectHandler(target:DisplayObject, parent:DisplayObjectContainer, index:int, eventObj:Event):void{
suspendEventHandling();
parent.addChildAt(target, index);
resumeEventHandling();
createAndPlayEffect(eventObj, target);
}
private static function createAndPlayEffect(eventObj:Event, target:Object):void{
var n:int;
var i:int;
var m:int;
var j:int;
var message:String;
var type:String;
var tweeningProperties:Array;
var effectProperties:Array;
var affectedProps:Array;
var runningInstances:Array;
var otherInst:EffectInstance;
var effectInst:Effect = createEffectForType(target, eventObj.type);
if (!effectInst){
return;
};
if ((((effectInst is Zoom)) && ((eventObj.type == MoveEvent.MOVE)))){
message = resourceManager.getString("effects", "incorrectTrigger");
throw (new Error(message));
};
if (target.initialized == false){
type = eventObj.type;
if ((((((((((type == MoveEvent.MOVE)) || ((type == ResizeEvent.RESIZE)))) || ((type == FlexEvent.SHOW)))) || ((type == FlexEvent.HIDE)))) || ((type == Event.CHANGE)))){
effectInst = null;
return;
};
};
if ((effectInst.target is IUIComponent)){
tweeningProperties = IUIComponent(effectInst.target).tweeningProperties;
if (((tweeningProperties) && ((tweeningProperties.length > 0)))){
effectProperties = effectInst.getAffectedProperties();
n = tweeningProperties.length;
m = effectProperties.length;
i = 0;
while (i < n) {
j = 0;
while (j < m) {
if (tweeningProperties[i] == effectProperties[j]){
effectInst = null;
return;
};
j++;
};
i++;
};
};
};
if ((((effectInst.target is UIComponent)) && (UIComponent(effectInst.target).isEffectStarted))){
affectedProps = effectInst.getAffectedProperties();
i = 0;
while (i < affectedProps.length) {
runningInstances = effectInst.target.getEffectsForProperty(affectedProps[i]);
if (runningInstances.length > 0){
if (eventObj.type == ResizeEvent.RESIZE){
return;
};
j = 0;
while (j < runningInstances.length) {
otherInst = runningInstances[j];
if ((((eventObj.type == FlexEvent.SHOW)) && (otherInst.hideOnEffectEnd))){
otherInst.target.removeEventListener(FlexEvent.SHOW, otherInst.eventHandler);
otherInst.hideOnEffectEnd = false;
};
otherInst.end();
j++;
};
};
i++;
};
};
effectInst.triggerEvent = eventObj;
effectInst.addEventListener(EffectEvent.EFFECT_END, EffectManager.effectEndHandler);
lastEffectCreated = effectInst;
var instances:Array = effectInst.play();
n = instances.length;
i = 0;
while (i < n) {
effectsPlaying.push(new EffectNode(effectInst, instances[i]));
i++;
};
if (effectInst.suspendBackgroundProcessing){
UIComponent.suspendBackgroundProcessing();
};
}
public static function endEffectsForTarget(target:IUIComponent):void{
var otherInst:EffectInstance;
var n:int = effectsPlaying.length;
var i:int = (n - 1);
while (i >= 0) {
otherInst = effectsPlaying[i].instance;
if (otherInst.target == target){
otherInst.end();
};
i--;
};
}
private static function cacheOrUncacheTargetAsBitmap(target:IUIComponent, effectStart:Boolean=true, bitmapEffect:Boolean=true):void{
var n:int;
var i:int;
var info:Object;
n = targetsInfo.length;
i = 0;
while (i < n) {
if (targetsInfo[i].target == target){
info = targetsInfo[i];
break;
};
i++;
};
if (!info){
info = {target:target, bitmapEffectsCount:0, vectorEffectsCount:0};
targetsInfo.push(info);
};
if (effectStart){
if (bitmapEffect){
info.bitmapEffectsCount++;
if ((((info.vectorEffectsCount == 0)) && ((target is IDeferredInstantiationUIComponent)))){
IDeferredInstantiationUIComponent(target).cacheHeuristic = true;
};
} else {
if ((((((info.vectorEffectsCount++ == 0)) && ((target is IDeferredInstantiationUIComponent)))) && ((IDeferredInstantiationUIComponent(target).cachePolicy == UIComponentCachePolicy.AUTO)))){
target.cacheAsBitmap = false;
};
};
} else {
if (bitmapEffect){
if (info.bitmapEffectsCount != 0){
info.bitmapEffectsCount--;
};
if ((target is IDeferredInstantiationUIComponent)){
IDeferredInstantiationUIComponent(target).cacheHeuristic = false;
};
} else {
if (info.vectorEffectsCount != 0){
if ((((--info.vectorEffectsCount == 0)) && (!((info.bitmapEffectsCount == 0))))){
n = info.bitmapEffectsCount;
i = 0;
while (i < n) {
if ((target is IDeferredInstantiationUIComponent)){
IDeferredInstantiationUIComponent(target).cacheHeuristic = true;
};
i++;
};
};
};
};
if ((((info.bitmapEffectsCount == 0)) && ((info.vectorEffectsCount == 0)))){
n = targetsInfo.length;
i = 0;
while (i < n) {
if (targetsInfo[i].target == target){
targetsInfo.splice(i, 1);
break;
};
i++;
};
};
};
}
mx_internal static function eventHandler(eventObj:Event):void{
var focusEventObj:FocusEvent;
var targ:DisplayObject;
var i:int;
var parent:DisplayObjectContainer;
var index:int;
if (!(eventObj.currentTarget is IFlexDisplayObject)){
return;
};
if (eventHandlingSuspendCount > 0){
return;
};
if ((((eventObj is FocusEvent)) && ((((eventObj.type == FocusEvent.FOCUS_OUT)) || ((eventObj.type == FocusEvent.FOCUS_IN)))))){
focusEventObj = FocusEvent(eventObj);
if (((focusEventObj.relatedObject) && (((focusEventObj.currentTarget.contains(focusEventObj.relatedObject)) || ((focusEventObj.currentTarget == focusEventObj.relatedObject)))))){
return;
};
};
if ((((((eventObj.type == Event.ADDED)) || ((eventObj.type == Event.REMOVED)))) && (!((eventObj.target == eventObj.currentTarget))))){
return;
};
if (eventObj.type == Event.REMOVED){
if ((eventObj.target is UIComponent)){
if (UIComponent(eventObj.target).initialized == false){
return;
};
if (UIComponent(eventObj.target).isEffectStarted){
i = 0;
while (i < UIComponent(eventObj.target)._effectsStarted.length) {
if (UIComponent(eventObj.target)._effectsStarted[i].triggerEvent.type == Event.REMOVED){
return;
};
i++;
};
};
};
targ = (eventObj.target as DisplayObject);
if (targ != null){
parent = (targ.parent as DisplayObjectContainer);
if (parent != null){
index = parent.getChildIndex(targ);
if (index >= 0){
if ((targ is UIComponent)){
UIComponent(targ).callLater(removedEffectHandler, [targ, parent, index, eventObj]);
};
};
};
};
} else {
createAndPlayEffect(eventObj, eventObj.currentTarget);
};
}
mx_internal static function endBitmapEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, false, true);
}
private static function animateSameProperty(a:Effect, b:Effect, c:EffectInstance):Boolean{
var aProps:Array;
var bProps:Array;
var n:int;
var m:int;
var i:int;
var j:int;
if (a.target == c.target){
aProps = a.getAffectedProperties();
bProps = b.getAffectedProperties();
n = aProps.length;
m = bProps.length;
i = 0;
while (i < n) {
j = 0;
while (j < m) {
if (aProps[i] == bProps[j]){
return (true);
};
j++;
};
i++;
};
};
return (false);
}
mx_internal static function effectFinished(effect:EffectInstance):void{
delete effects[effect];
}
mx_internal static function effectsInEffect():Boolean{
var i:*;
for (i in effects) {
return (true);
};
return (false);
}
mx_internal static function effectEndHandler(event:EffectEvent):void{
var targ:DisplayObject;
var parent:DisplayObjectContainer;
var effectInst:IEffectInstance = event.effectInstance;
var n:int = effectsPlaying.length;
var i:int = (n - 1);
while (i >= 0) {
if (effectsPlaying[i].instance == effectInst){
effectsPlaying.splice(i, 1);
break;
};
i--;
};
if (Object(effectInst).hideOnEffectEnd == true){
effectInst.target.removeEventListener(FlexEvent.SHOW, Object(effectInst).eventHandler);
effectInst.target.setVisible(false, true);
};
if (((effectInst.triggerEvent) && ((effectInst.triggerEvent.type == Event.REMOVED)))){
targ = (effectInst.target as DisplayObject);
if (targ != null){
parent = (targ.parent as DisplayObjectContainer);
if (parent != null){
suspendEventHandling();
parent.removeChild(targ);
resumeEventHandling();
};
};
};
if (effectInst.suspendBackgroundProcessing){
UIComponent.resumeBackgroundProcessing();
};
}
mx_internal static function startBitmapEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, true, true);
}
mx_internal static function setStyle(styleProp:String, target):void{
var eventName:String = eventsForEffectTriggers[styleProp];
if (((!((eventName == null))) && (!((eventName == ""))))){
target.addEventListener(eventName, EffectManager.eventHandler, false, EventPriority.EFFECT);
};
}
mx_internal static function getEventForEffectTrigger(effectTrigger:String):String{
var effectTrigger = effectTrigger;
if (eventsForEffectTriggers){
return (eventsForEffectTriggers[effectTrigger]);
//unresolved jump
var _slot1 = e;
return ("");
};
return ("");
}
mx_internal static function createEffectForType(target:Object, type:String):Effect{
var cls:Class;
var effectObj:Effect;
var doc:Object;
var target = target;
var type = type;
var trigger:String = effectTriggersForEvent[type];
if (trigger == ""){
trigger = (type + "Effect");
};
var value:Object = target.getStyle(trigger);
if (!value){
return (null);
};
if ((value is Class)){
cls = Class(value);
return (new cls(target));
};
if ((value is String)){
doc = target.parentDocument;
if (!doc){
doc = ApplicationGlobals.application;
};
effectObj = doc[value];
} else {
if ((value is Effect)){
effectObj = Effect(value);
};
};
if (effectObj){
effectObj.target = target;
return (effectObj);
};
//unresolved jump
var _slot1 = e;
var effectClass:Class = Class(target.systemManager.getDefinitionByName(("mx.effects." + value)));
if (effectClass){
return (new effectClass(target));
};
return (null);
}
mx_internal static function effectStarted(effect:EffectInstance):void{
effects[effect] = 1;
}
public static function resumeEventHandling():void{
eventHandlingSuspendCount--;
}
mx_internal static function startVectorEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, true, false);
}
mx_internal static function endVectorEffect(target:IUIComponent):void{
cacheOrUncacheTargetAsBitmap(target, false, false);
}
private static function get resourceManager():IResourceManager{
if (!_resourceManager){
_resourceManager = ResourceManager.getInstance();
};
return (_resourceManager);
}
}
}//package mx.effects
class EffectNode {
public var factory:Effect;
public var instance:EffectInstance;
private function EffectNode(factory:Effect, instance:EffectInstance){
super();
this.factory = factory;
this.instance = instance;
}
}
Section 106
//EffectTargetFilter (mx.effects.EffectTargetFilter)
package mx.effects {
import mx.core.*;
import mx.effects.effectClasses.*;
public class EffectTargetFilter {
public var filterFunction:Function;
public var filterStyles:Array;
public var filterProperties:Array;
public var requiredSemantics:Object;// = null
mx_internal static const VERSION:String = "3.5.0.12683";
public function EffectTargetFilter(){
filterFunction = defaultFilterFunctionEx;
filterProperties = [];
filterStyles = [];
super();
}
protected function defaultFilterFunctionEx(propChanges:Array, semanticsProvider:IEffectTargetHost, target:Object):Boolean{
var prop:String;
if (requiredSemantics){
for (prop in requiredSemantics) {
if (!semanticsProvider){
return (false);
};
if (semanticsProvider.getRendererSemanticValue(target, prop) != requiredSemantics[prop]){
return (false);
};
};
return (true);
};
return (defaultFilterFunction(propChanges, target));
}
protected function defaultFilterFunction(propChanges:Array, instanceTarget:Object):Boolean{
var props:PropertyChanges;
var triggers:Array;
var m:int;
var j:int;
var n:int = propChanges.length;
var i:int;
while (i < n) {
props = propChanges[i];
if (props.target == instanceTarget){
triggers = filterProperties.concat(filterStyles);
m = triggers.length;
j = 0;
while (j < m) {
if (((!((props.start[triggers[j]] === undefined))) && (!((props.end[triggers[j]] == props.start[triggers[j]]))))){
return (true);
};
j++;
};
};
i++;
};
return (false);
}
public function filterInstance(propChanges:Array, semanticsProvider:IEffectTargetHost, target:Object):Boolean{
if (filterFunction.length == 2){
return (filterFunction(propChanges, target));
};
return (filterFunction(propChanges, semanticsProvider, target));
}
}
}//package mx.effects
Section 107
//IAbstractEffect (mx.effects.IAbstractEffect)
package mx.effects {
import flash.events.*;
public interface IAbstractEffect extends IEventDispatcher {
}
}//package mx.effects
Section 108
//IEffect (mx.effects.IEffect)
package mx.effects {
import flash.events.*;
public interface IEffect extends IAbstractEffect {
function captureMoreStartValues(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
function get triggerEvent():Event;
function set targets(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
function captureStartValues():void;
function get hideFocusRing():Boolean;
function get customFilter():EffectTargetFilter;
function get effectTargetHost():IEffectTargetHost;
function set triggerEvent(mx.effects:IEffect/mx.effects:IEffect:className/get:Event):void;
function set hideFocusRing(mx.effects:IEffect/mx.effects:IEffect:className/get:Boolean):void;
function captureEndValues():void;
function get target():Object;
function set customFilter(mx.effects:IEffect/mx.effects:IEffect:className/get:EffectTargetFilter):void;
function get duration():Number;
function get perElementOffset():Number;
function get targets():Array;
function set effectTargetHost(mx.effects:IEffect/mx.effects:IEffect:className/get:IEffectTargetHost):void;
function get relevantStyles():Array;
function set relevantProperties(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
function set target(mx.effects:IEffect/mx.effects:IEffect:className/get:Object):void;
function get className():String;
function get isPlaying():Boolean;
function deleteInstance(mx.effects:IEffect/mx.effects:IEffect:className/get:IEffectInstance):void;
function set duration(mx.effects:IEffect/mx.effects:IEffect:className/get:Number):void;
function createInstances(EffectTargetFilter:Array=null):Array;
function end(mx.effects:IEffect/mx.effects:IEffect:className/get:IEffectInstance=null):void;
function set perElementOffset(mx.effects:IEffect/mx.effects:IEffect:className/get:Number):void;
function resume():void;
function stop():void;
function set filter(mx.effects:IEffect/mx.effects:IEffect:className/get:String):void;
function createInstance(void:Object=null):IEffectInstance;
function play(_arg1:Array=null, _arg2:Boolean=false):Array;
function pause():void;
function get relevantProperties():Array;
function get filter():String;
function reverse():void;
function getAffectedProperties():Array;
function set relevantStyles(mx.effects:IEffect/mx.effects:IEffect:className/get:Array):void;
}
}//package mx.effects
Section 109
//IEffectInstance (mx.effects.IEffectInstance)
package mx.effects {
import flash.events.*;
import mx.effects.effectClasses.*;
public interface IEffectInstance {
function get playheadTime():Number;
function get triggerEvent():Event;
function set triggerEvent(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Event):void;
function get hideFocusRing():Boolean;
function initEffect(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Event):void;
function set startDelay(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:int):void;
function get effectTargetHost():IEffectTargetHost;
function finishEffect():void;
function set hideFocusRing(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Boolean):void;
function finishRepeat():void;
function set repeatDelay(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:int):void;
function get effect():IEffect;
function startEffect():void;
function get duration():Number;
function get target():Object;
function get startDelay():int;
function stop():void;
function set effectTargetHost(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:IEffectTargetHost):void;
function set propertyChanges(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:PropertyChanges):void;
function set effect(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:IEffect):void;
function get className():String;
function set duration(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Number):void;
function set target(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Object):void;
function end():void;
function resume():void;
function get propertyChanges():PropertyChanges;
function set repeatCount(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:int):void;
function reverse():void;
function get repeatCount():int;
function pause():void;
function get repeatDelay():int;
function set suspendBackgroundProcessing(mx.effects:IEffectInstance/mx.effects:IEffectInstance:className/get:Boolean):void;
function play():void;
function get suspendBackgroundProcessing():Boolean;
}
}//package mx.effects
Section 110
//IEffectTargetHost (mx.effects.IEffectTargetHost)
package mx.effects {
public interface IEffectTargetHost {
function unconstrainRenderer(:Object):void;
function removeDataEffectItem(:Object):void;
function getRendererSemanticValue(_arg1:Object, _arg2:String):Object;
function addDataEffectItem(:Object):void;
}
}//package mx.effects
Section 111
//Tween (mx.effects.Tween)
package mx.effects {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import mx.events.*;
public class Tween extends EventDispatcher {
private var started:Boolean;// = false
private var previousUpdateTime:Number;
public var duration:Number;// = 3000
private var id:int;
private var arrayMode:Boolean;
private var _isPlaying:Boolean;// = true
private var startValue:Object;
public var listener:Object;
private var userEquation:Function;
mx_internal var needToLayout:Boolean;// = false
private var updateFunction:Function;
private var _doSeek:Boolean;// = false
mx_internal var startTime:Number;
private var endFunction:Function;
private var endValue:Object;
private var _doReverse:Boolean;// = false
private var _playheadTime:Number;// = 0
private var _invertValues:Boolean;// = false
private var maxDelay:Number;// = 87.5
mx_internal static const VERSION:String = "3.5.0.12683";
private static var timer:Timer = null;
private static var interval:Number = 10;
mx_internal static var activeTweens:Array = [];
mx_internal static var intervalTime:Number = NAN;
public function Tween(listener:Object, startValue:Object, endValue:Object, duration:Number=-1, minFps:Number=-1, updateFunction:Function=null, endFunction:Function=null){
userEquation = defaultEasingFunction;
super();
if (!listener){
return;
};
if ((startValue is Array)){
arrayMode = true;
};
this.listener = listener;
this.startValue = startValue;
this.endValue = endValue;
if (((!(isNaN(duration))) && (!((duration == -1))))){
this.duration = duration;
};
if (((!(isNaN(minFps))) && (!((minFps == -1))))){
maxDelay = (1000 / minFps);
};
this.updateFunction = updateFunction;
this.endFunction = endFunction;
if (duration == 0){
id = -1;
endTween();
} else {
Tween.addTween(this);
};
}
mx_internal function get playheadTime():Number{
return (_playheadTime);
}
public function stop():void{
if (id >= 0){
Tween.removeTweenAt(id);
};
}
mx_internal function get playReversed():Boolean{
return (_invertValues);
}
mx_internal function set playReversed(value:Boolean):void{
_invertValues = value;
}
public function resume():void{
_isPlaying = true;
startTime = (intervalTime - _playheadTime);
if (_doReverse){
reverse();
_doReverse = false;
};
}
public function setTweenHandlers(updateFunction:Function, endFunction:Function):void{
this.updateFunction = updateFunction;
this.endFunction = endFunction;
}
private function defaultEasingFunction(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c / 2) * (Math.sin((Math.PI * ((t / d) - 0.5))) + 1)) + b));
}
public function set easingFunction(value:Function):void{
userEquation = value;
}
public function endTween():void{
var event:TweenEvent = new TweenEvent(TweenEvent.TWEEN_END);
var value:Object = getCurrentValue(duration);
event.value = value;
dispatchEvent(event);
if (endFunction != null){
endFunction(value);
} else {
listener.onTweenEnd(value);
};
if (id >= 0){
Tween.removeTweenAt(id);
};
}
public function reverse():void{
if (_isPlaying){
_doReverse = false;
seek((duration - _playheadTime));
_invertValues = !(_invertValues);
} else {
_doReverse = !(_doReverse);
};
}
mx_internal function getCurrentValue(currentTime:Number):Object{
var returnArray:Array;
var n:int;
var i:int;
if (duration == 0){
return (endValue);
};
if (_invertValues){
currentTime = (duration - currentTime);
};
if (arrayMode){
returnArray = [];
n = startValue.length;
i = 0;
while (i < n) {
returnArray[i] = userEquation(currentTime, startValue[i], (endValue[i] - startValue[i]), duration);
i++;
};
return (returnArray);
//unresolved jump
};
return (userEquation(currentTime, startValue, (Number(endValue) - Number(startValue)), duration));
}
mx_internal function doInterval():Boolean{
var currentTime:Number;
var currentValue:Object;
var event:TweenEvent;
var startEvent:TweenEvent;
var tweenEnded:Boolean;
previousUpdateTime = intervalTime;
if (((_isPlaying) || (_doSeek))){
currentTime = (intervalTime - startTime);
_playheadTime = currentTime;
currentValue = getCurrentValue(currentTime);
if ((((currentTime >= duration)) && (!(_doSeek)))){
endTween();
tweenEnded = true;
} else {
if (!started){
startEvent = new TweenEvent(TweenEvent.TWEEN_START);
dispatchEvent(startEvent);
started = true;
};
event = new TweenEvent(TweenEvent.TWEEN_UPDATE);
event.value = currentValue;
dispatchEvent(event);
if (updateFunction != null){
updateFunction(currentValue);
} else {
listener.onTweenUpdate(currentValue);
};
};
_doSeek = false;
};
return (tweenEnded);
}
public function pause():void{
_isPlaying = false;
}
public function seek(playheadTime:Number):void{
var clockTime:Number = intervalTime;
previousUpdateTime = clockTime;
startTime = (clockTime - playheadTime);
_doSeek = true;
}
mx_internal static function removeTween(tween:Tween):void{
removeTweenAt(tween.id);
}
private static function addTween(tween:Tween):void{
tween.id = activeTweens.length;
activeTweens.push(tween);
if (!timer){
timer = new Timer(interval);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
} else {
timer.start();
};
if (isNaN(intervalTime)){
intervalTime = getTimer();
};
tween.startTime = (tween.previousUpdateTime = intervalTime);
}
private static function timerHandler(event:TimerEvent):void{
var tween:Tween;
var needToLayout:Boolean;
var oldTime:Number = intervalTime;
intervalTime = getTimer();
var n:int = activeTweens.length;
var i:int = n;
while (i >= 0) {
tween = Tween(activeTweens[i]);
if (tween){
tween.needToLayout = false;
tween.doInterval();
if (tween.needToLayout){
needToLayout = true;
};
};
i--;
};
if (needToLayout){
UIComponentGlobals.layoutManager.validateNow();
};
event.updateAfterEvent();
}
private static function removeTweenAt(index:int):void{
var curTween:Tween;
if ((((index >= activeTweens.length)) || ((index < 0)))){
return;
};
activeTweens.splice(index, 1);
var n:int = activeTweens.length;
var i:int = index;
while (i < n) {
curTween = Tween(activeTweens[i]);
curTween.id--;
i++;
};
if (n == 0){
intervalTime = NaN;
timer.reset();
};
}
}
}//package mx.effects
Section 112
//TweenEffect (mx.effects.TweenEffect)
package mx.effects {
import flash.events.*;
import mx.core.*;
import mx.events.*;
import mx.effects.effectClasses.*;
public class TweenEffect extends Effect {
public var easingFunction:Function;// = null
mx_internal static const VERSION:String = "3.5.0.12683";
public function TweenEffect(target:Object=null){
super(target);
instanceClass = TweenEffectInstance;
}
protected function tweenEventHandler(event:TweenEvent):void{
dispatchEvent(event);
}
override protected function initInstance(instance:IEffectInstance):void{
super.initInstance(instance);
TweenEffectInstance(instance).easingFunction = easingFunction;
EventDispatcher(instance).addEventListener(TweenEvent.TWEEN_START, tweenEventHandler);
EventDispatcher(instance).addEventListener(TweenEvent.TWEEN_UPDATE, tweenEventHandler);
EventDispatcher(instance).addEventListener(TweenEvent.TWEEN_END, tweenEventHandler);
}
}
}//package mx.effects
Section 113
//Zoom (mx.effects.Zoom)
package mx.effects {
import mx.core.*;
import mx.effects.effectClasses.*;
public class Zoom extends TweenEffect {
public var zoomHeightFrom:Number;
public var zoomWidthTo:Number;
public var originX:Number;
public var zoomHeightTo:Number;
public var originY:Number;
public var captureRollEvents:Boolean;
public var zoomWidthFrom:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var AFFECTED_PROPERTIES:Array = ["scaleX", "scaleY", "x", "y", "width", "height"];
public function Zoom(target:Object=null){
super(target);
instanceClass = ZoomInstance;
applyActualDimensions = false;
relevantProperties = ["scaleX", "scaleY", "width", "height", "visible"];
}
override protected function initInstance(instance:IEffectInstance):void{
var zoomInstance:ZoomInstance;
super.initInstance(instance);
zoomInstance = ZoomInstance(instance);
zoomInstance.zoomWidthFrom = zoomWidthFrom;
zoomInstance.zoomWidthTo = zoomWidthTo;
zoomInstance.zoomHeightFrom = zoomHeightFrom;
zoomInstance.zoomHeightTo = zoomHeightTo;
zoomInstance.originX = originX;
zoomInstance.originY = originY;
zoomInstance.captureRollEvents = captureRollEvents;
}
override public function getAffectedProperties():Array{
return (AFFECTED_PROPERTIES);
}
}
}//package mx.effects
Section 114
//ChildExistenceChangedEvent (mx.events.ChildExistenceChangedEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
import flash.display.*;
public class ChildExistenceChangedEvent extends Event {
public var relatedObject:DisplayObject;
public static const CHILD_REMOVE:String = "childRemove";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const OVERLAY_CREATED:String = "overlayCreated";
public static const CHILD_ADD:String = "childAdd";
public function ChildExistenceChangedEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, relatedObject:DisplayObject=null){
super(type, bubbles, cancelable);
this.relatedObject = relatedObject;
}
override public function clone():Event{
return (new ChildExistenceChangedEvent(type, bubbles, cancelable, relatedObject));
}
}
}//package mx.events
Section 115
//DragEvent (mx.events.DragEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class DragEvent extends MouseEvent {
public var draggedItem:Object;
public var action:String;
public var dragInitiator:IUIComponent;
public var dragSource:DragSource;
public static const DRAG_DROP:String = "dragDrop";
public static const DRAG_COMPLETE:String = "dragComplete";
public static const DRAG_EXIT:String = "dragExit";
public static const DRAG_ENTER:String = "dragEnter";
public static const DRAG_START:String = "dragStart";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const DRAG_OVER:String = "dragOver";
public function DragEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=true, dragInitiator:IUIComponent=null, dragSource:DragSource=null, action:String=null, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false){
super(type, bubbles, cancelable);
this.dragInitiator = dragInitiator;
this.dragSource = dragSource;
this.action = action;
this.ctrlKey = ctrlKey;
this.altKey = altKey;
this.shiftKey = shiftKey;
}
override public function clone():Event{
var cloneEvent:DragEvent = new DragEvent(type, bubbles, cancelable, dragInitiator, dragSource, action, ctrlKey, altKey, shiftKey);
cloneEvent.relatedObject = this.relatedObject;
cloneEvent.localX = this.localX;
cloneEvent.localY = this.localY;
return (cloneEvent);
}
}
}//package mx.events
Section 116
//DynamicEvent (mx.events.DynamicEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public dynamic class DynamicEvent extends Event {
mx_internal static const VERSION:String = "3.5.0.12683";
public function DynamicEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
override public function clone():Event{
var p:String;
var event:DynamicEvent = new DynamicEvent(type, bubbles, cancelable);
for (p in this) {
event[p] = this[p];
};
return (event);
}
}
}//package mx.events
Section 117
//EffectEvent (mx.events.EffectEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
import mx.effects.*;
public class EffectEvent extends Event {
public var effectInstance:IEffectInstance;
public static const EFFECT_START:String = "effectStart";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const EFFECT_END:String = "effectEnd";
public function EffectEvent(eventType:String, bubbles:Boolean=false, cancelable:Boolean=false, effectInstance:IEffectInstance=null){
super(eventType, bubbles, cancelable);
this.effectInstance = effectInstance;
}
override public function clone():Event{
return (new EffectEvent(type, bubbles, cancelable, effectInstance));
}
}
}//package mx.events
Section 118
//EventListenerRequest (mx.events.EventListenerRequest)
package mx.events {
import flash.events.*;
import mx.core.*;
public class EventListenerRequest extends SWFBridgeRequest {
private var _priority:int;
private var _useWeakReference:Boolean;
private var _eventType:String;
private var _useCapture:Boolean;
public static const REMOVE_EVENT_LISTENER_REQUEST:String = "removeEventListenerRequest";
public static const ADD_EVENT_LISTENER_REQUEST:String = "addEventListenerRequest";
mx_internal static const VERSION:String = "3.5.0.12683";
public function EventListenerRequest(type:String, bubbles:Boolean=false, cancelable:Boolean=true, eventType:String=null, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false){
super(type, false, false);
_eventType = eventType;
_useCapture = useCapture;
_priority = priority;
_useWeakReference = useWeakReference;
}
public function get priority():int{
return (_priority);
}
public function get useWeakReference():Boolean{
return (_useWeakReference);
}
public function get eventType():String{
return (_eventType);
}
override public function clone():Event{
return (new EventListenerRequest(type, bubbles, cancelable, eventType, useCapture, priority, useWeakReference));
}
public function get useCapture():Boolean{
return (_useCapture);
}
public static function marshal(event:Event):EventListenerRequest{
var eventObj:Object = event;
return (new EventListenerRequest(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.eventType, eventObj.useCapture, eventObj.priority, eventObj.useWeakReference));
}
}
}//package mx.events
Section 119
//FlexChangeEvent (mx.events.FlexChangeEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class FlexChangeEvent extends Event {
public var data:Object;
public static const REMOVE_CHILD_BRIDGE:String = "removeChildBridge";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const ADD_CHILD_BRIDGE:String = "addChildBridge";
public function FlexChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, data:Object=null){
super(type, bubbles, cancelable);
this.data = data;
}
override public function clone():Event{
return (new FlexChangeEvent(type, bubbles, cancelable, data));
}
}
}//package mx.events
Section 120
//FlexEvent (mx.events.FlexEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class FlexEvent extends Event {
public static const ADD:String = "add";
public static const TRANSFORM_CHANGE:String = "transformChange";
public static const ENTER_FRAME:String = "flexEventEnterFrame";
public static const INIT_COMPLETE:String = "initComplete";
public static const REMOVE:String = "remove";
public static const BUTTON_DOWN:String = "buttonDown";
public static const EXIT_STATE:String = "exitState";
public static const CREATION_COMPLETE:String = "creationComplete";
public static const REPEAT:String = "repeat";
public static const LOADING:String = "loading";
public static const RENDER:String = "flexEventRender";
public static const REPEAT_START:String = "repeatStart";
public static const INITIALIZE:String = "initialize";
public static const ENTER_STATE:String = "enterState";
public static const URL_CHANGED:String = "urlChanged";
public static const REPEAT_END:String = "repeatEnd";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const HIDE:String = "hide";
public static const ENTER:String = "enter";
public static const PRELOADER_DONE:String = "preloaderDone";
public static const CURSOR_UPDATE:String = "cursorUpdate";
public static const PREINITIALIZE:String = "preinitialize";
public static const INVALID:String = "invalid";
public static const IDLE:String = "idle";
public static const VALID:String = "valid";
public static const DATA_CHANGE:String = "dataChange";
public static const APPLICATION_COMPLETE:String = "applicationComplete";
public static const VALUE_COMMIT:String = "valueCommit";
public static const UPDATE_COMPLETE:String = "updateComplete";
public static const INIT_PROGRESS:String = "initProgress";
public static const SHOW:String = "show";
public function FlexEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
override public function clone():Event{
return (new FlexEvent(type, bubbles, cancelable));
}
}
}//package mx.events
Section 121
//FlexMouseEvent (mx.events.FlexMouseEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
import flash.display.*;
public class FlexMouseEvent extends MouseEvent {
public static const MOUSE_DOWN_OUTSIDE:String = "mouseDownOutside";
public static const MOUSE_WHEEL_OUTSIDE:String = "mouseWheelOutside";
mx_internal static const VERSION:String = "3.5.0.12683";
public function FlexMouseEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, localX:Number=0, localY:Number=0, relatedObject:InteractiveObject=null, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false, buttonDown:Boolean=false, delta:int=0){
super(type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta);
}
override public function clone():Event{
return (new FlexMouseEvent(type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta));
}
}
}//package mx.events
Section 122
//InterManagerRequest (mx.events.InterManagerRequest)
package mx.events {
import flash.events.*;
import mx.core.*;
public class InterManagerRequest extends Event {
public var value:Object;
public var name:String;
public static const TOOLTIP_MANAGER_REQUEST:String = "tooltipManagerRequest";
public static const SYSTEM_MANAGER_REQUEST:String = "systemManagerRequest";
public static const INIT_MANAGER_REQUEST:String = "initManagerRequest";
public static const DRAG_MANAGER_REQUEST:String = "dragManagerRequest";
public static const CURSOR_MANAGER_REQUEST:String = "cursorManagerRequest";
mx_internal static const VERSION:String = "3.5.0.12683";
public function InterManagerRequest(type:String, bubbles:Boolean=false, cancelable:Boolean=false, name:String=null, value:Object=null){
super(type, bubbles, cancelable);
this.name = name;
this.value = value;
}
override public function clone():Event{
var cloneEvent:InterManagerRequest = new InterManagerRequest(type, bubbles, cancelable, name, value);
return (cloneEvent);
}
}
}//package mx.events
Section 123
//InvalidateRequestData (mx.events.InvalidateRequestData)
package mx.events {
import mx.core.*;
public final class InvalidateRequestData {
public static const SIZE:uint = 4;
public static const PROPERTIES:uint = 2;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const DISPLAY_LIST:uint = 1;
public function InvalidateRequestData(){
super();
}
}
}//package mx.events
Section 124
//ModuleEvent (mx.events.ModuleEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
import mx.modules.*;
public class ModuleEvent extends ProgressEvent {
public var errorText:String;
private var _module:IModuleInfo;
public static const READY:String = "ready";
public static const ERROR:String = "error";
public static const PROGRESS:String = "progress";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const SETUP:String = "setup";
public static const UNLOAD:String = "unload";
public function ModuleEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:uint=0, bytesTotal:uint=0, errorText:String=null, module:IModuleInfo=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.errorText = errorText;
this._module = module;
}
public function get module():IModuleInfo{
if (_module){
return (_module);
};
return ((target as IModuleInfo));
}
override public function clone():Event{
return (new ModuleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText, module));
}
}
}//package mx.events
Section 125
//MoveEvent (mx.events.MoveEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class MoveEvent extends Event {
public var oldX:Number;
public var oldY:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const MOVE:String = "move";
public function MoveEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldX:Number=NaN, oldY:Number=NaN){
super(type, bubbles, cancelable);
this.oldX = oldX;
this.oldY = oldY;
}
override public function clone():Event{
return (new MoveEvent(type, bubbles, cancelable, oldX, oldY));
}
}
}//package mx.events
Section 126
//PropertyChangeEvent (mx.events.PropertyChangeEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class PropertyChangeEvent extends Event {
public var newValue:Object;
public var kind:String;
public var property:Object;
public var oldValue:Object;
public var source:Object;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const PROPERTY_CHANGE:String = "propertyChange";
public function PropertyChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, kind:String=null, property:Object=null, oldValue:Object=null, newValue:Object=null, source:Object=null){
super(type, bubbles, cancelable);
this.kind = kind;
this.property = property;
this.oldValue = oldValue;
this.newValue = newValue;
this.source = source;
}
override public function clone():Event{
return (new PropertyChangeEvent(type, bubbles, cancelable, kind, property, oldValue, newValue, source));
}
public static function createUpdateEvent(source:Object, property:Object, oldValue:Object, newValue:Object):PropertyChangeEvent{
var event:PropertyChangeEvent = new PropertyChangeEvent(PROPERTY_CHANGE);
event.kind = PropertyChangeEventKind.UPDATE;
event.oldValue = oldValue;
event.newValue = newValue;
event.source = source;
event.property = property;
return (event);
}
}
}//package mx.events
Section 127
//PropertyChangeEventKind (mx.events.PropertyChangeEventKind)
package mx.events {
import mx.core.*;
public final class PropertyChangeEventKind {
mx_internal static const VERSION:String = "3.5.0.12683";
public static const UPDATE:String = "update";
public static const DELETE:String = "delete";
public function PropertyChangeEventKind(){
super();
}
}
}//package mx.events
Section 128
//ResizeEvent (mx.events.ResizeEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class ResizeEvent extends Event {
public var oldHeight:Number;
public var oldWidth:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const RESIZE:String = "resize";
public function ResizeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldWidth:Number=NaN, oldHeight:Number=NaN){
super(type, bubbles, cancelable);
this.oldWidth = oldWidth;
this.oldHeight = oldHeight;
}
override public function clone():Event{
return (new ResizeEvent(type, bubbles, cancelable, oldWidth, oldHeight));
}
}
}//package mx.events
Section 129
//ResourceEvent (mx.events.ResourceEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class ResourceEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function ResourceEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:uint=0, bytesTotal:uint=0, errorText:String=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.errorText = errorText;
}
override public function clone():Event{
return (new ResourceEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 130
//RSLEvent (mx.events.RSLEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.net.*;
public class RSLEvent extends ProgressEvent {
public var loaderInfo:LoaderInfo;
public var errorText:String;
public var rslIndex:int;
public var rslTotal:int;
public var url:URLRequest;
public static const RSL_PROGRESS:String = "rslProgress";
public static const RSL_ERROR:String = "rslError";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const RSL_COMPLETE:String = "rslComplete";
public function RSLEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:int=-1, bytesTotal:int=-1, rslIndex:int=-1, rslTotal:int=-1, url:URLRequest=null, errorText:String=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.rslIndex = rslIndex;
this.rslTotal = rslTotal;
this.url = url;
this.errorText = errorText;
}
override public function clone():Event{
return (new RSLEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, rslIndex, rslTotal, url, errorText));
}
}
}//package mx.events
Section 131
//SandboxMouseEvent (mx.events.SandboxMouseEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class SandboxMouseEvent extends Event {
public var buttonDown:Boolean;
public var altKey:Boolean;
public var ctrlKey:Boolean;
public var shiftKey:Boolean;
public static const CLICK_SOMEWHERE:String = "clickSomewhere";
public static const MOUSE_UP_SOMEWHERE:String = "mouseUpSomewhere";
public static const DOUBLE_CLICK_SOMEWHERE:String = "coubleClickSomewhere";
public static const MOUSE_WHEEL_SOMEWHERE:String = "mouseWheelSomewhere";
public static const MOUSE_DOWN_SOMEWHERE:String = "mouseDownSomewhere";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const MOUSE_MOVE_SOMEWHERE:String = "mouseMoveSomewhere";
public function SandboxMouseEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, ctrlKey:Boolean=false, altKey:Boolean=false, shiftKey:Boolean=false, buttonDown:Boolean=false){
super(type, bubbles, cancelable);
this.ctrlKey = ctrlKey;
this.altKey = altKey;
this.shiftKey = shiftKey;
this.buttonDown = buttonDown;
}
override public function clone():Event{
return (new SandboxMouseEvent(type, bubbles, cancelable, ctrlKey, altKey, shiftKey, buttonDown));
}
public static function marshal(event:Event):SandboxMouseEvent{
var eventObj:Object = event;
return (new SandboxMouseEvent(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.ctrlKey, eventObj.altKey, eventObj.shiftKey, eventObj.buttonDown));
}
}
}//package mx.events
Section 132
//StateChangeEvent (mx.events.StateChangeEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class StateChangeEvent extends Event {
public var newState:String;
public var oldState:String;
public static const CURRENT_STATE_CHANGING:String = "currentStateChanging";
public static const CURRENT_STATE_CHANGE:String = "currentStateChange";
mx_internal static const VERSION:String = "3.5.0.12683";
public function StateChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, oldState:String=null, newState:String=null){
super(type, bubbles, cancelable);
this.oldState = oldState;
this.newState = newState;
}
override public function clone():Event{
return (new StateChangeEvent(type, bubbles, cancelable, oldState, newState));
}
}
}//package mx.events
Section 133
//StyleEvent (mx.events.StyleEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class StyleEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function StyleEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, bytesLoaded:uint=0, bytesTotal:uint=0, errorText:String=null){
super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
this.errorText = errorText;
}
override public function clone():Event{
return (new StyleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 134
//SWFBridgeEvent (mx.events.SWFBridgeEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class SWFBridgeEvent extends Event {
public var data:Object;
public static const BRIDGE_FOCUS_MANAGER_ACTIVATE:String = "bridgeFocusManagerActivate";
public static const BRIDGE_WINDOW_ACTIVATE:String = "bridgeWindowActivate";
public static const BRIDGE_WINDOW_DEACTIVATE:String = "brdigeWindowDeactivate";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const BRIDGE_NEW_APPLICATION:String = "bridgeNewApplication";
public static const BRIDGE_APPLICATION_UNLOADING:String = "bridgeApplicationUnloading";
public static const BRIDGE_APPLICATION_ACTIVATE:String = "bridgeApplicationActivate";
public function SWFBridgeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, data:Object=null){
super(type, bubbles, cancelable);
this.data = data;
}
override public function clone():Event{
return (new SWFBridgeEvent(type, bubbles, cancelable, data));
}
public static function marshal(event:Event):SWFBridgeEvent{
var eventObj:Object = event;
return (new SWFBridgeEvent(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.data));
}
}
}//package mx.events
Section 135
//SWFBridgeRequest (mx.events.SWFBridgeRequest)
package mx.events {
import flash.events.*;
import mx.core.*;
public class SWFBridgeRequest extends Event {
public var requestor:IEventDispatcher;
public var data:Object;
public static const SHOW_MOUSE_CURSOR_REQUEST:String = "showMouseCursorRequest";
public static const DEACTIVATE_POP_UP_REQUEST:String = "deactivatePopUpRequest";
public static const SET_ACTUAL_SIZE_REQUEST:String = "setActualSizeRequest";
public static const MOVE_FOCUS_REQUEST:String = "moveFocusRequest";
public static const GET_VISIBLE_RECT_REQUEST:String = "getVisibleRectRequest";
public static const ADD_POP_UP_PLACE_HOLDER_REQUEST:String = "addPopUpPlaceHolderRequest";
public static const REMOVE_POP_UP_PLACE_HOLDER_REQUEST:String = "removePopUpPlaceHolderRequest";
public static const RESET_MOUSE_CURSOR_REQUEST:String = "resetMouseCursorRequest";
public static const ADD_POP_UP_REQUEST:String = "addPopUpRequest";
public static const GET_SIZE_REQUEST:String = "getSizeRequest";
public static const SHOW_MODAL_WINDOW_REQUEST:String = "showModalWindowRequest";
public static const ACTIVATE_FOCUS_REQUEST:String = "activateFocusRequest";
public static const DEACTIVATE_FOCUS_REQUEST:String = "deactivateFocusRequest";
public static const HIDE_MOUSE_CURSOR_REQUEST:String = "hideMouseCursorRequest";
public static const ACTIVATE_POP_UP_REQUEST:String = "activatePopUpRequest";
public static const IS_BRIDGE_CHILD_REQUEST:String = "isBridgeChildRequest";
public static const CAN_ACTIVATE_POP_UP_REQUEST:String = "canActivateRequestPopUpRequest";
public static const HIDE_MODAL_WINDOW_REQUEST:String = "hideModalWindowRequest";
public static const INVALIDATE_REQUEST:String = "invalidateRequest";
public static const SET_SHOW_FOCUS_INDICATOR_REQUEST:String = "setShowFocusIndicatorRequest";
public static const CREATE_MODAL_WINDOW_REQUEST:String = "createModalWindowRequest";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const REMOVE_POP_UP_REQUEST:String = "removePopUpRequest";
public function SWFBridgeRequest(type:String, bubbles:Boolean=false, cancelable:Boolean=false, requestor:IEventDispatcher=null, data:Object=null){
super(type, bubbles, cancelable);
this.requestor = requestor;
this.data = data;
}
override public function clone():Event{
return (new SWFBridgeRequest(type, bubbles, cancelable, requestor, data));
}
public static function marshal(event:Event):SWFBridgeRequest{
var eventObj:Object = event;
return (new SWFBridgeRequest(eventObj.type, eventObj.bubbles, eventObj.cancelable, eventObj.requestor, eventObj.data));
}
}
}//package mx.events
Section 136
//ToolTipEvent (mx.events.ToolTipEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class ToolTipEvent extends Event {
public var toolTip:IToolTip;
public static const TOOL_TIP_SHOWN:String = "toolTipShown";
public static const TOOL_TIP_CREATE:String = "toolTipCreate";
public static const TOOL_TIP_SHOW:String = "toolTipShow";
public static const TOOL_TIP_HIDE:String = "toolTipHide";
public static const TOOL_TIP_END:String = "toolTipEnd";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const TOOL_TIP_START:String = "toolTipStart";
public function ToolTipEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, toolTip:IToolTip=null){
super(type, bubbles, cancelable);
this.toolTip = toolTip;
}
override public function clone():Event{
return (new ToolTipEvent(type, bubbles, cancelable, toolTip));
}
}
}//package mx.events
Section 137
//TweenEvent (mx.events.TweenEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class TweenEvent extends Event {
public var value:Object;
public static const TWEEN_END:String = "tweenEnd";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const TWEEN_UPDATE:String = "tweenUpdate";
public static const TWEEN_START:String = "tweenStart";
public function TweenEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, value:Object=null){
super(type, bubbles, cancelable);
this.value = value;
}
override public function clone():Event{
return (new TweenEvent(type, bubbles, cancelable, value));
}
}
}//package mx.events
Section 138
//ValidationResultEvent (mx.events.ValidationResultEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class ValidationResultEvent extends Event {
public var results:Array;
public var field:String;
public static const INVALID:String = "invalid";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const VALID:String = "valid";
public function ValidationResultEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, field:String=null, results:Array=null){
super(type, bubbles, cancelable);
this.field = field;
this.results = results;
}
public function get message():String{
var msg:String = "";
var n:int = results.length;
var i:int;
while (i < n) {
if (results[i].isError){
msg = (msg + ((msg == "")) ? "" : "\n");
msg = (msg + results[i].errorMessage);
};
i++;
};
return (msg);
}
override public function clone():Event{
return (new ValidationResultEvent(type, bubbles, cancelable, field, results));
}
}
}//package mx.events
Section 139
//RectangularDropShadow (mx.graphics.RectangularDropShadow)
package mx.graphics {
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import mx.utils.*;
import flash.filters.*;
public class RectangularDropShadow {
private var leftShadow:BitmapData;
private var _tlRadius:Number;// = 0
private var _trRadius:Number;// = 0
private var _angle:Number;// = 45
private var topShadow:BitmapData;
private var _distance:Number;// = 4
private var rightShadow:BitmapData;
private var _alpha:Number;// = 0.4
private var shadow:BitmapData;
private var _brRadius:Number;// = 0
private var _blRadius:Number;// = 0
private var _color:int;// = 0
private var bottomShadow:BitmapData;
private var changed:Boolean;// = true
mx_internal static const VERSION:String = "3.5.0.12683";
public function RectangularDropShadow(){
super();
}
public function get blRadius():Number{
return (_blRadius);
}
public function set brRadius(value:Number):void{
if (_brRadius != value){
_brRadius = value;
changed = true;
};
}
public function set color(value:int):void{
if (_color != value){
_color = value;
changed = true;
};
}
public function drawShadow(g:Graphics, x:Number, y:Number, width:Number, height:Number):void{
var tlWidth:Number;
var tlHeight:Number;
var trWidth:Number;
var trHeight:Number;
var blWidth:Number;
var blHeight:Number;
var brWidth:Number;
var brHeight:Number;
if (changed){
createShadowBitmaps();
changed = false;
};
width = Math.ceil(width);
height = Math.ceil(height);
var leftThickness:int = (leftShadow) ? leftShadow.width : 0;
var rightThickness:int = (rightShadow) ? rightShadow.width : 0;
var topThickness:int = (topShadow) ? topShadow.height : 0;
var bottomThickness:int = (bottomShadow) ? bottomShadow.height : 0;
var widthThickness:int = (leftThickness + rightThickness);
var heightThickness:int = (topThickness + bottomThickness);
var maxCornerHeight:Number = ((height + heightThickness) / 2);
var maxCornerWidth:Number = ((width + widthThickness) / 2);
var matrix:Matrix = new Matrix();
if (((leftShadow) || (topShadow))){
tlWidth = Math.min((tlRadius + widthThickness), maxCornerWidth);
tlHeight = Math.min((tlRadius + heightThickness), maxCornerHeight);
matrix.tx = (x - leftThickness);
matrix.ty = (y - topThickness);
g.beginBitmapFill(shadow, matrix);
g.drawRect((x - leftThickness), (y - topThickness), tlWidth, tlHeight);
g.endFill();
};
if (((rightShadow) || (topShadow))){
trWidth = Math.min((trRadius + widthThickness), maxCornerWidth);
trHeight = Math.min((trRadius + heightThickness), maxCornerHeight);
matrix.tx = (((x + width) + rightThickness) - shadow.width);
matrix.ty = (y - topThickness);
g.beginBitmapFill(shadow, matrix);
g.drawRect((((x + width) + rightThickness) - trWidth), (y - topThickness), trWidth, trHeight);
g.endFill();
};
if (((leftShadow) || (bottomShadow))){
blWidth = Math.min((blRadius + widthThickness), maxCornerWidth);
blHeight = Math.min((blRadius + heightThickness), maxCornerHeight);
matrix.tx = (x - leftThickness);
matrix.ty = (((y + height) + bottomThickness) - shadow.height);
g.beginBitmapFill(shadow, matrix);
g.drawRect((x - leftThickness), (((y + height) + bottomThickness) - blHeight), blWidth, blHeight);
g.endFill();
};
if (((rightShadow) || (bottomShadow))){
brWidth = Math.min((brRadius + widthThickness), maxCornerWidth);
brHeight = Math.min((brRadius + heightThickness), maxCornerHeight);
matrix.tx = (((x + width) + rightThickness) - shadow.width);
matrix.ty = (((y + height) + bottomThickness) - shadow.height);
g.beginBitmapFill(shadow, matrix);
g.drawRect((((x + width) + rightThickness) - brWidth), (((y + height) + bottomThickness) - brHeight), brWidth, brHeight);
g.endFill();
};
if (leftShadow){
matrix.tx = (x - leftThickness);
matrix.ty = 0;
g.beginBitmapFill(leftShadow, matrix);
g.drawRect((x - leftThickness), ((y - topThickness) + tlHeight), leftThickness, ((((height + topThickness) + bottomThickness) - tlHeight) - blHeight));
g.endFill();
};
if (rightShadow){
matrix.tx = (x + width);
matrix.ty = 0;
g.beginBitmapFill(rightShadow, matrix);
g.drawRect((x + width), ((y - topThickness) + trHeight), rightThickness, ((((height + topThickness) + bottomThickness) - trHeight) - brHeight));
g.endFill();
};
if (topShadow){
matrix.tx = 0;
matrix.ty = (y - topThickness);
g.beginBitmapFill(topShadow, matrix);
g.drawRect(((x - leftThickness) + tlWidth), (y - topThickness), ((((width + leftThickness) + rightThickness) - tlWidth) - trWidth), topThickness);
g.endFill();
};
if (bottomShadow){
matrix.tx = 0;
matrix.ty = (y + height);
g.beginBitmapFill(bottomShadow, matrix);
g.drawRect(((x - leftThickness) + blWidth), (y + height), ((((width + leftThickness) + rightThickness) - blWidth) - brWidth), bottomThickness);
g.endFill();
};
}
public function get brRadius():Number{
return (_brRadius);
}
public function get angle():Number{
return (_angle);
}
private function createShadowBitmaps():void{
var roundRectWidth:Number = ((Math.max(tlRadius, blRadius) + (2 * distance)) + Math.max(trRadius, brRadius));
var roundRectHeight:Number = ((Math.max(tlRadius, trRadius) + (2 * distance)) + Math.max(blRadius, brRadius));
if ((((roundRectWidth < 0)) || ((roundRectHeight < 0)))){
return;
};
var roundRect:Shape = new FlexShape();
var g:Graphics = roundRect.graphics;
g.beginFill(0xFFFFFF);
GraphicsUtil.drawRoundRectComplex(g, 0, 0, roundRectWidth, roundRectHeight, tlRadius, trRadius, blRadius, brRadius);
g.endFill();
var roundRectBitmap:BitmapData = new BitmapData(roundRectWidth, roundRectHeight, true, 0);
roundRectBitmap.draw(roundRect, new Matrix());
var filter:DropShadowFilter = new DropShadowFilter(distance, angle, color, alpha);
filter.knockout = true;
var inputRect:Rectangle = new Rectangle(0, 0, roundRectWidth, roundRectHeight);
var outputRect:Rectangle = roundRectBitmap.generateFilterRect(inputRect, filter);
var leftThickness:Number = (inputRect.left - outputRect.left);
var rightThickness:Number = (outputRect.right - inputRect.right);
var topThickness:Number = (inputRect.top - outputRect.top);
var bottomThickness:Number = (outputRect.bottom - inputRect.bottom);
shadow = new BitmapData(outputRect.width, outputRect.height);
shadow.applyFilter(roundRectBitmap, inputRect, new Point(leftThickness, topThickness), filter);
var origin:Point = new Point(0, 0);
var rect:Rectangle = new Rectangle();
if (leftThickness > 0){
rect.x = 0;
rect.y = ((tlRadius + topThickness) + bottomThickness);
rect.width = leftThickness;
rect.height = 1;
leftShadow = new BitmapData(leftThickness, 1);
leftShadow.copyPixels(shadow, rect, origin);
} else {
leftShadow = null;
};
if (rightThickness > 0){
rect.x = (shadow.width - rightThickness);
rect.y = ((trRadius + topThickness) + bottomThickness);
rect.width = rightThickness;
rect.height = 1;
rightShadow = new BitmapData(rightThickness, 1);
rightShadow.copyPixels(shadow, rect, origin);
} else {
rightShadow = null;
};
if (topThickness > 0){
rect.x = ((tlRadius + leftThickness) + rightThickness);
rect.y = 0;
rect.width = 1;
rect.height = topThickness;
topShadow = new BitmapData(1, topThickness);
topShadow.copyPixels(shadow, rect, origin);
} else {
topShadow = null;
};
if (bottomThickness > 0){
rect.x = ((blRadius + leftThickness) + rightThickness);
rect.y = (shadow.height - bottomThickness);
rect.width = 1;
rect.height = bottomThickness;
bottomShadow = new BitmapData(1, bottomThickness);
bottomShadow.copyPixels(shadow, rect, origin);
} else {
bottomShadow = null;
};
}
public function get alpha():Number{
return (_alpha);
}
public function get color():int{
return (_color);
}
public function set angle(value:Number):void{
if (_angle != value){
_angle = value;
changed = true;
};
}
public function set trRadius(value:Number):void{
if (_trRadius != value){
_trRadius = value;
changed = true;
};
}
public function set tlRadius(value:Number):void{
if (_tlRadius != value){
_tlRadius = value;
changed = true;
};
}
public function get trRadius():Number{
return (_trRadius);
}
public function set distance(value:Number):void{
if (_distance != value){
_distance = value;
changed = true;
};
}
public function get distance():Number{
return (_distance);
}
public function get tlRadius():Number{
return (_tlRadius);
}
public function set alpha(value:Number):void{
if (_alpha != value){
_alpha = value;
changed = true;
};
}
public function set blRadius(value:Number):void{
if (_blRadius != value){
_blRadius = value;
changed = true;
};
}
}
}//package mx.graphics
Section 140
//RoundedRectangle (mx.graphics.RoundedRectangle)
package mx.graphics {
import mx.core.*;
import flash.geom.*;
public class RoundedRectangle extends Rectangle {
public var cornerRadius:Number;// = 0
mx_internal static const VERSION:String = "3.5.0.12683";
public function RoundedRectangle(x:Number=0, y:Number=0, width:Number=0, height:Number=0, cornerRadius:Number=0){
super(x, y, width, height);
this.cornerRadius = cornerRadius;
}
}
}//package mx.graphics
Section 141
//PriorityQueue (mx.managers.layoutClasses.PriorityQueue)
package mx.managers.layoutClasses {
import mx.core.*;
import flash.display.*;
import mx.managers.*;
public class PriorityQueue {
private var maxPriority:int;// = -1
private var arrayOfArrays:Array;
private var minPriority:int;// = 0
mx_internal static const VERSION:String = "3.5.0.12683";
public function PriorityQueue(){
arrayOfArrays = [];
super();
}
public function addObject(obj:Object, priority:int):void{
if (!arrayOfArrays[priority]){
arrayOfArrays[priority] = [];
};
arrayOfArrays[priority].push(obj);
if (maxPriority < minPriority){
minPriority = (maxPriority = priority);
} else {
if (priority < minPriority){
minPriority = priority;
};
if (priority > maxPriority){
maxPriority = priority;
};
};
}
public function removeSmallest():Object{
var obj:Object;
if (minPriority <= maxPriority){
while (((!(arrayOfArrays[minPriority])) || ((arrayOfArrays[minPriority].length == 0)))) {
minPriority++;
if (minPriority > maxPriority){
return (null);
};
};
obj = arrayOfArrays[minPriority].shift();
while (((!(arrayOfArrays[minPriority])) || ((arrayOfArrays[minPriority].length == 0)))) {
minPriority++;
if (minPriority > maxPriority){
break;
};
};
};
return (obj);
}
public function removeLargestChild(client:ILayoutManagerClient):Object{
var i:int;
var obj:Object;
var max:int = maxPriority;
var min:int = client.nestLevel;
while (min <= max) {
if (((arrayOfArrays[max]) && ((arrayOfArrays[max].length > 0)))){
i = 0;
while (i < arrayOfArrays[max].length) {
if (contains(DisplayObject(client), arrayOfArrays[max][i])){
obj = arrayOfArrays[max][i];
arrayOfArrays[max].splice(i, 1);
return (obj);
};
i++;
};
max--;
} else {
if (max == maxPriority){
maxPriority--;
};
max--;
if (max < min){
break;
};
};
};
return (obj);
}
public function isEmpty():Boolean{
return ((minPriority > maxPriority));
}
public function removeLargest():Object{
var obj:Object;
if (minPriority <= maxPriority){
while (((!(arrayOfArrays[maxPriority])) || ((arrayOfArrays[maxPriority].length == 0)))) {
maxPriority--;
if (maxPriority < minPriority){
return (null);
};
};
obj = arrayOfArrays[maxPriority].shift();
while (((!(arrayOfArrays[maxPriority])) || ((arrayOfArrays[maxPriority].length == 0)))) {
maxPriority--;
if (maxPriority < minPriority){
break;
};
};
};
return (obj);
}
public function removeSmallestChild(client:ILayoutManagerClient):Object{
var i:int;
var obj:Object;
var min:int = client.nestLevel;
while (min <= maxPriority) {
if (((arrayOfArrays[min]) && ((arrayOfArrays[min].length > 0)))){
i = 0;
while (i < arrayOfArrays[min].length) {
if (contains(DisplayObject(client), arrayOfArrays[min][i])){
obj = arrayOfArrays[min][i];
arrayOfArrays[min].splice(i, 1);
return (obj);
};
i++;
};
min++;
} else {
if (min == minPriority){
minPriority++;
};
min++;
if (min > maxPriority){
break;
};
};
};
return (obj);
}
public function removeAll():void{
arrayOfArrays.splice(0);
minPriority = 0;
maxPriority = -1;
}
private function contains(parent:DisplayObject, child:DisplayObject):Boolean{
var rawChildren:IChildList;
if ((parent is IRawChildrenContainer)){
rawChildren = IRawChildrenContainer(parent).rawChildren;
return (rawChildren.contains(child));
};
if ((parent is DisplayObjectContainer)){
return (DisplayObjectContainer(parent).contains(child));
};
return ((parent == child));
}
}
}//package mx.managers.layoutClasses
Section 142
//EventProxy (mx.managers.systemClasses.EventProxy)
package mx.managers.systemClasses {
import flash.events.*;
import mx.events.*;
import mx.managers.*;
import mx.utils.*;
public class EventProxy extends EventDispatcher {
private var systemManager:ISystemManager;
public function EventProxy(systemManager:ISystemManager){
super();
this.systemManager = systemManager;
}
public function marshalListener(event:Event):void{
var me:MouseEvent;
var mme:SandboxMouseEvent;
if ((event is MouseEvent)){
me = (event as MouseEvent);
mme = new SandboxMouseEvent(EventUtil.mouseEventMap[event.type], false, false, me.ctrlKey, me.altKey, me.shiftKey, me.buttonDown);
systemManager.dispatchEventFromSWFBridges(mme, null, true, true);
} else {
if (event.type == Event.MOUSE_LEAVE){
mme = new SandboxMouseEvent(SandboxMouseEvent.MOUSE_UP_SOMEWHERE);
systemManager.dispatchEventFromSWFBridges(mme, null, true, true);
systemManager.dispatchEvent(mme);
};
};
}
}
}//package mx.managers.systemClasses
Section 143
//PlaceholderData (mx.managers.systemClasses.PlaceholderData)
package mx.managers.systemClasses {
import flash.events.*;
public class PlaceholderData {
public var bridge:IEventDispatcher;
public var data:Object;
public var id:String;
public function PlaceholderData(id:String, bridge:IEventDispatcher, data:Object){
super();
this.id = id;
this.bridge = bridge;
this.data = data;
}
}
}//package mx.managers.systemClasses
Section 144
//RemotePopUp (mx.managers.systemClasses.RemotePopUp)
package mx.managers.systemClasses {
public class RemotePopUp {
public var window:Object;
public var bridge:Object;
public function RemotePopUp(window:Object, bridge:Object){
super();
this.window = window;
this.bridge = bridge;
}
}
}//package mx.managers.systemClasses
Section 145
//CursorManager (mx.managers.CursorManager)
package mx.managers {
import mx.core.*;
public class CursorManager {
mx_internal static const VERSION:String = "3.5.0.12683";
public static const NO_CURSOR:int = 0;
private static var _impl:ICursorManager;
private static var implClassDependency:CursorManagerImpl;
public function CursorManager(){
super();
}
public static function set currentCursorYOffset(value:Number):void{
impl.currentCursorYOffset = value;
}
mx_internal static function registerToUseBusyCursor(source:Object):void{
impl.registerToUseBusyCursor(source);
}
public static function get currentCursorID():int{
return (impl.currentCursorID);
}
public static function getInstance():ICursorManager{
return (impl);
}
public static function removeBusyCursor():void{
impl.removeBusyCursor();
}
public static function setCursor(cursorClass:Class, priority:int=2, xOffset:Number=0, yOffset:Number=0):int{
return (impl.setCursor(cursorClass, priority, xOffset, yOffset));
}
public static function set currentCursorID(value:int):void{
impl.currentCursorID = value;
}
mx_internal static function unRegisterToUseBusyCursor(source:Object):void{
impl.unRegisterToUseBusyCursor(source);
}
private static function get impl():ICursorManager{
if (!_impl){
_impl = ICursorManager(Singleton.getInstance("mx.managers::ICursorManager"));
};
return (_impl);
}
public static function removeAllCursors():void{
impl.removeAllCursors();
}
public static function setBusyCursor():void{
impl.setBusyCursor();
}
public static function showCursor():void{
impl.showCursor();
}
public static function hideCursor():void{
impl.hideCursor();
}
public static function removeCursor(cursorID:int):void{
impl.removeCursor(cursorID);
}
public static function get currentCursorXOffset():Number{
return (impl.currentCursorXOffset);
}
public static function get currentCursorYOffset():Number{
return (impl.currentCursorYOffset);
}
public static function set currentCursorXOffset(value:Number):void{
impl.currentCursorXOffset = value;
}
}
}//package mx.managers
Section 146
//CursorManagerImpl (mx.managers.CursorManagerImpl)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import flash.geom.*;
import flash.text.*;
import mx.events.*;
import flash.ui.*;
public class CursorManagerImpl implements ICursorManager {
private var showSystemCursor:Boolean;// = false
private var nextCursorID:int;// = 1
private var systemManager:ISystemManager;// = null
private var cursorList:Array;
private var _currentCursorYOffset:Number;// = 0
private var cursorHolder:Sprite;
private var currentCursor:DisplayObject;
private var sandboxRoot:IEventDispatcher;// = null
private var showCustomCursor:Boolean;// = false
private var listenForContextMenu:Boolean;// = false
private var customCursorLeftStage:Boolean;// = false
private var _currentCursorID:int;// = 0
private var initialized:Boolean;// = false
private var overTextField:Boolean;// = false
private var _currentCursorXOffset:Number;// = 0
private var busyCursorList:Array;
private var overLink:Boolean;// = false
private var sourceArray:Array;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var instance:ICursorManager;
public function CursorManagerImpl(systemManager:ISystemManager=null){
cursorList = [];
busyCursorList = [];
sourceArray = [];
super();
if (((instance) && (!(systemManager)))){
throw (new Error("Instance already exists."));
};
if (systemManager){
this.systemManager = (systemManager as ISystemManager);
} else {
this.systemManager = (SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager);
};
sandboxRoot = this.systemManager.getSandboxRoot();
sandboxRoot.addEventListener(InterManagerRequest.CURSOR_MANAGER_REQUEST, marshalCursorManagerHandler, false, 0, true);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "update";
sandboxRoot.dispatchEvent(me);
}
private function mouseOverHandler(event:MouseEvent):void{
sandboxRoot.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
mouseMoveHandler(event);
}
public function set currentCursorYOffset(value:Number):void{
var me:InterManagerRequest;
_currentCursorYOffset = value;
if (!cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorYOffset";
me.value = currentCursorYOffset;
sandboxRoot.dispatchEvent(me);
};
}
public function get currentCursorXOffset():Number{
return (_currentCursorXOffset);
}
public function removeCursor(cursorID:int):void{
var i:Object;
var me:InterManagerRequest;
var item:CursorQueueItem;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "removeCursor";
me.value = cursorID;
sandboxRoot.dispatchEvent(me);
return;
};
for (i in cursorList) {
item = cursorList[i];
if (item.cursorID == cursorID){
cursorList.splice(i, 1);
showCurrentCursor();
break;
};
};
}
public function get currentCursorID():int{
return (_currentCursorID);
}
private function removeContextMenuHandlers():void{
var app:InteractiveObject;
var sm:InteractiveObject;
if (listenForContextMenu){
app = (systemManager.document as InteractiveObject);
sm = (systemManager as InteractiveObject);
if (((app) && (app.contextMenu))){
app.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler, true);
};
if (((sm) && (sm.contextMenu))){
sm.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler, true);
};
listenForContextMenu = false;
};
}
private function marshalMouseMoveHandler(event:Event):void{
var cursorRequest:SWFBridgeRequest;
var bridge:IEventDispatcher;
if (cursorHolder.visible){
cursorHolder.visible = false;
cursorRequest = new SWFBridgeRequest(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST);
if (systemManager.useSWFBridge()){
bridge = systemManager.swfBridgeGroup.parentBridge;
} else {
bridge = systemManager;
};
cursorRequest.requestor = bridge;
bridge.dispatchEvent(cursorRequest);
if (cursorRequest.data){
Mouse.show();
};
};
}
public function set currentCursorID(value:int):void{
var me:InterManagerRequest;
_currentCursorID = value;
if (!cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorID";
me.value = currentCursorID;
sandboxRoot.dispatchEvent(me);
};
}
private function priorityCompare(a:CursorQueueItem, b:CursorQueueItem):int{
if (a.priority < b.priority){
return (-1);
};
if (a.priority == b.priority){
return (0);
};
return (1);
}
private function mouseOutHandler(event:MouseEvent):void{
if ((((event.relatedObject == null)) && ((cursorList.length > 0)))){
customCursorLeftStage = true;
hideCursor();
Mouse.show();
};
}
public function setBusyCursor():void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "setBusyCursor";
sandboxRoot.dispatchEvent(me);
return;
};
var cursorManagerStyleDeclaration:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager");
var busyCursorClass:Class = cursorManagerStyleDeclaration.getStyle("busyCursor");
busyCursorList.push(setCursor(busyCursorClass, CursorManagerPriority.LOW));
}
private function findSource(target:Object):int{
var n:int = sourceArray.length;
var i:int;
while (i < n) {
if (sourceArray[i] === target){
return (i);
};
i++;
};
return (-1);
}
private function showCurrentCursor():void{
var item:CursorQueueItem;
var me:InterManagerRequest;
var pt:Point;
if (cursorList.length > 0){
if (!initialized){
cursorHolder = new FlexSprite();
cursorHolder.name = "cursorHolder";
cursorHolder.mouseEnabled = false;
cursorHolder.mouseChildren = false;
systemManager.addChildToSandboxRoot("cursorChildren", cursorHolder);
initialized = true;
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "initialized";
sandboxRoot.dispatchEvent(me);
};
item = cursorList[0];
if (currentCursorID == CursorManager.NO_CURSOR){
Mouse.hide();
};
if (item.cursorID != currentCursorID){
if (cursorHolder.numChildren > 0){
cursorHolder.removeChildAt(0);
};
currentCursor = new item.cursorClass();
if (currentCursor){
if ((currentCursor is InteractiveObject)){
InteractiveObject(currentCursor).mouseEnabled = false;
};
if ((currentCursor is DisplayObjectContainer)){
DisplayObjectContainer(currentCursor).mouseChildren = false;
};
cursorHolder.addChild(currentCursor);
addContextMenuHandlers();
if ((systemManager is SystemManager)){
pt = new Point((SystemManager(systemManager).mouseX + item.x), (SystemManager(systemManager).mouseY + item.y));
pt = SystemManager(systemManager).localToGlobal(pt);
pt = cursorHolder.parent.globalToLocal(pt);
cursorHolder.x = pt.x;
cursorHolder.y = pt.y;
} else {
if ((systemManager is DisplayObject)){
pt = new Point((DisplayObject(systemManager).mouseX + item.x), (DisplayObject(systemManager).mouseY + item.y));
pt = DisplayObject(systemManager).localToGlobal(pt);
pt = cursorHolder.parent.globalToLocal(pt);
cursorHolder.x = (DisplayObject(systemManager).mouseX + item.x);
cursorHolder.y = (DisplayObject(systemManager).mouseY + item.y);
} else {
cursorHolder.x = item.x;
cursorHolder.y = item.y;
};
};
if (systemManager.useSWFBridge()){
sandboxRoot.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true, EventPriority.CURSOR_MANAGEMENT);
} else {
systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true, EventPriority.CURSOR_MANAGEMENT);
};
sandboxRoot.addEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE, marshalMouseMoveHandler, false, EventPriority.CURSOR_MANAGEMENT);
if (systemManager.useSWFBridge()){
sandboxRoot.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler, true, EventPriority.CURSOR_MANAGEMENT);
} else {
systemManager.stage.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler, true, EventPriority.CURSOR_MANAGEMENT);
};
};
currentCursorID = item.cursorID;
currentCursorXOffset = item.x;
currentCursorYOffset = item.y;
};
} else {
showCustomCursor = false;
if (currentCursorID != CursorManager.NO_CURSOR){
currentCursorID = CursorManager.NO_CURSOR;
currentCursorXOffset = 0;
currentCursorYOffset = 0;
cursorHolder.removeChild(currentCursor);
removeSystemManagerHandlers();
removeContextMenuHandlers();
};
Mouse.show();
};
}
public function get currentCursorYOffset():Number{
return (_currentCursorYOffset);
}
private function contextMenu_menuSelectHandler(event:ContextMenuEvent):void{
showCustomCursor = true;
sandboxRoot.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
}
public function hideCursor():void{
var me:InterManagerRequest;
if (cursorHolder){
cursorHolder.visible = false;
} else {
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "hideCursor";
sandboxRoot.dispatchEvent(me);
};
}
public function showCursor():void{
var me:InterManagerRequest;
if (cursorHolder){
cursorHolder.visible = true;
} else {
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "showCursor";
sandboxRoot.dispatchEvent(me);
};
}
private function marshalCursorManagerHandler(event:Event):void{
var me:InterManagerRequest;
if ((event is InterManagerRequest)){
return;
};
var marshalEvent:Object = event;
switch (marshalEvent.name){
case "initialized":
initialized = marshalEvent.value;
break;
case "currentCursorID":
_currentCursorID = marshalEvent.value;
break;
case "currentCursorXOffset":
_currentCursorXOffset = marshalEvent.value;
break;
case "currentCursorYOffset":
_currentCursorYOffset = marshalEvent.value;
break;
case "showCursor":
if (cursorHolder){
cursorHolder.visible = true;
};
break;
case "hideCursor":
if (cursorHolder){
cursorHolder.visible = false;
};
break;
case "setCursor":
if (cursorHolder){
marshalEvent.value = setCursor.apply(this, marshalEvent.value);
};
break;
case "removeCursor":
if (cursorHolder){
removeCursor.apply(this, [marshalEvent.value]);
};
break;
case "removeAllCursors":
if (cursorHolder){
removeAllCursors();
};
break;
case "setBusyCursor":
if (cursorHolder){
setBusyCursor();
};
break;
case "removeBusyCursor":
if (cursorHolder){
removeBusyCursor();
};
break;
case "registerToUseBusyCursor":
if (cursorHolder){
registerToUseBusyCursor.apply(this, marshalEvent.value);
};
break;
case "unRegisterToUseBusyCursor":
if (cursorHolder){
unRegisterToUseBusyCursor.apply(this, marshalEvent.value);
};
break;
case "update":
if (cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "initialized";
me.value = true;
sandboxRoot.dispatchEvent(me);
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorID";
me.value = currentCursorID;
sandboxRoot.dispatchEvent(me);
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorXOffset";
me.value = currentCursorXOffset;
sandboxRoot.dispatchEvent(me);
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorYOffset";
me.value = currentCursorYOffset;
sandboxRoot.dispatchEvent(me);
};
};
}
public function removeAllCursors():void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "removeAllCursors";
sandboxRoot.dispatchEvent(me);
return;
};
cursorList.splice(0);
showCurrentCursor();
}
private function completeHandler(event:Event):void{
var sourceIndex:int = findSource(event.target);
if (sourceIndex != -1){
sourceArray.splice(sourceIndex, 1);
removeBusyCursor();
};
}
public function removeBusyCursor():void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "removeBusyCursor";
sandboxRoot.dispatchEvent(me);
return;
};
if (busyCursorList.length > 0){
removeCursor(int(busyCursorList.pop()));
};
}
private function addContextMenuHandlers():void{
var app:InteractiveObject;
var sm:InteractiveObject;
if (!listenForContextMenu){
app = (systemManager.document as InteractiveObject);
sm = (systemManager as InteractiveObject);
if (((app) && (app.contextMenu))){
app.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler, true, EventPriority.CURSOR_MANAGEMENT);
listenForContextMenu = true;
};
if (((sm) && (sm.contextMenu))){
sm.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler, true, EventPriority.CURSOR_MANAGEMENT);
listenForContextMenu = true;
};
};
}
public function setCursor(cursorClass:Class, priority:int=2, xOffset:Number=0, yOffset:Number=0):int{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "setCursor";
me.value = [cursorClass, priority, xOffset, yOffset];
sandboxRoot.dispatchEvent(me);
return ((me.value as int));
};
var cursorID:int = nextCursorID++;
var item:CursorQueueItem = new CursorQueueItem();
item.cursorID = cursorID;
item.cursorClass = cursorClass;
item.priority = priority;
item.x = xOffset;
item.y = yOffset;
if (systemManager){
item.systemManager = systemManager;
} else {
item.systemManager = ApplicationGlobals.application.systemManager;
};
cursorList.push(item);
cursorList.sort(priorityCompare);
showCurrentCursor();
return (cursorID);
}
private function progressHandler(event:ProgressEvent):void{
var sourceIndex:int = findSource(event.target);
if (sourceIndex == -1){
sourceArray.push(event.target);
setBusyCursor();
};
}
private function removeSystemManagerHandlers():void{
if (systemManager.useSWFBridge()){
sandboxRoot.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
} else {
systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
};
sandboxRoot.removeEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE, marshalMouseMoveHandler, false);
if (systemManager.useSWFBridge()){
sandboxRoot.removeEventListener(MouseEvent.MOUSE_OUT, mouseMoveHandler, true);
} else {
systemManager.stage.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler, true);
};
}
public function registerToUseBusyCursor(source:Object):void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "registerToUseBusyCursor";
me.value = source;
sandboxRoot.dispatchEvent(me);
return;
};
if (((source) && ((source is EventDispatcher)))){
source.addEventListener(ProgressEvent.PROGRESS, progressHandler);
source.addEventListener(Event.COMPLETE, completeHandler);
source.addEventListener(IOErrorEvent.IO_ERROR, completeHandler);
};
}
private function mouseMoveHandler(event:MouseEvent):void{
var cursorRequest:SWFBridgeRequest;
var bridge:IEventDispatcher;
var pt:Point = new Point(event.stageX, event.stageY);
pt = cursorHolder.parent.globalToLocal(pt);
pt.x = (pt.x + currentCursorXOffset);
pt.y = (pt.y + currentCursorYOffset);
cursorHolder.x = pt.x;
cursorHolder.y = pt.y;
var target:Object = event.target;
if (((((!(overTextField)) && ((target is TextField)))) && ((target.type == TextFieldType.INPUT)))){
overTextField = true;
showSystemCursor = true;
} else {
if (((overTextField) && (!((((target is TextField)) && ((target.type == TextFieldType.INPUT))))))){
overTextField = false;
showCustomCursor = true;
} else {
showCustomCursor = true;
};
};
if (showSystemCursor){
showSystemCursor = false;
cursorHolder.visible = false;
Mouse.show();
};
if (showCustomCursor){
showCustomCursor = false;
cursorHolder.visible = true;
Mouse.hide();
cursorRequest = new SWFBridgeRequest(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST);
if (systemManager.useSWFBridge()){
bridge = systemManager.swfBridgeGroup.parentBridge;
} else {
bridge = systemManager;
};
cursorRequest.requestor = bridge;
bridge.dispatchEvent(cursorRequest);
};
}
public function unRegisterToUseBusyCursor(source:Object):void{
var me:InterManagerRequest;
if (((initialized) && (!(cursorHolder)))){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "unRegisterToUseBusyCursor";
me.value = source;
sandboxRoot.dispatchEvent(me);
return;
};
if (((source) && ((source is EventDispatcher)))){
source.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
source.removeEventListener(Event.COMPLETE, completeHandler);
source.removeEventListener(IOErrorEvent.IO_ERROR, completeHandler);
};
}
public function set currentCursorXOffset(value:Number):void{
var me:InterManagerRequest;
_currentCursorXOffset = value;
if (!cursorHolder){
me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
me.name = "currentCursorXOffset";
me.value = currentCursorXOffset;
sandboxRoot.dispatchEvent(me);
};
}
public static function getInstance():ICursorManager{
if (!instance){
instance = new (CursorManagerImpl);
};
return (instance);
}
}
}//package mx.managers
import mx.core.*;
class CursorQueueItem {
public var priority:int;// = 2
public var cursorClass:Class;// = null
public var cursorID:int;// = 0
public var x:Number;
public var y:Number;
public var systemManager:ISystemManager;
mx_internal static const VERSION:String = "3.5.0.12683";
private function CursorQueueItem(){
super();
}
}
Section 147
//CursorManagerPriority (mx.managers.CursorManagerPriority)
package mx.managers {
import mx.core.*;
public final class CursorManagerPriority {
public static const HIGH:int = 1;
public static const MEDIUM:int = 2;
mx_internal static const VERSION:String = "3.5.0.12683";
public static const LOW:int = 3;
public function CursorManagerPriority(){
super();
}
}
}//package mx.managers
Section 148
//ICursorManager (mx.managers.ICursorManager)
package mx.managers {
public interface ICursorManager {
function removeAllCursors():void;
function set currentCursorYOffset(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Number):void;
function removeBusyCursor():void;
function unRegisterToUseBusyCursor(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Object):void;
function hideCursor():void;
function get currentCursorID():int;
function registerToUseBusyCursor(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Object):void;
function setBusyCursor():void;
function showCursor():void;
function set currentCursorID(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:int):void;
function setCursor(_arg1:Class, _arg2:int=2, _arg3:Number=0, _arg4:Number=0):int;
function removeCursor(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:int):void;
function get currentCursorXOffset():Number;
function get currentCursorYOffset():Number;
function set currentCursorXOffset(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ICursorManager.as:Number):void;
}
}//package mx.managers
Section 149
//IFocusManager (mx.managers.IFocusManager)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
public interface IFocusManager {
function get focusPane():Sprite;
function getFocus():IFocusManagerComponent;
function deactivate():void;
function set defaultButton(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IButton):void;
function set focusPane(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Sprite):void;
function set showFocusIndicator(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void;
function moveFocus(_arg1:String, _arg2:DisplayObject=null):void;
function addSWFBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void;
function removeSWFBridge(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IEventDispatcher):void;
function get defaultButtonEnabled():Boolean;
function findFocusManagerComponent(value:InteractiveObject):IFocusManagerComponent;
function get nextTabIndex():int;
function get defaultButton():IButton;
function get showFocusIndicator():Boolean;
function setFocus(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:IFocusManagerComponent):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManager.as:Boolean):void;
function hideFocus():void;
function getNextFocusManagerComponent(value:Boolean=false):IFocusManagerComponent;
}
}//package mx.managers
Section 150
//IFocusManagerComponent (mx.managers.IFocusManagerComponent)
package mx.managers {
public interface IFocusManagerComponent {
function set focusEnabled(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void;
function drawFocus(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManagerComponent.as:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package mx.managers
Section 151
//IFocusManagerContainer (mx.managers.IFocusManagerContainer)
package mx.managers {
import flash.events.*;
import flash.display.*;
public interface IFocusManagerContainer extends IEventDispatcher {
function set focusManager(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IFocusManagerContainer.as:IFocusManager):void;
function get focusManager():IFocusManager;
function get systemManager():ISystemManager;
function contains(mx.managers:DisplayObject):Boolean;
}
}//package mx.managers
Section 152
//ILayoutManager (mx.managers.ILayoutManager)
package mx.managers {
import flash.events.*;
public interface ILayoutManager extends IEventDispatcher {
function validateNow():void;
function validateClient(_arg1:ILayoutManagerClient, _arg2:Boolean=false):void;
function isInvalid():Boolean;
function invalidateDisplayList(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
function set usePhasedInstantiation(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:Boolean):void;
function invalidateSize(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
function get usePhasedInstantiation():Boolean;
function invalidateProperties(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManager.as:ILayoutManagerClient):void;
}
}//package mx.managers
Section 153
//ILayoutManagerClient (mx.managers.ILayoutManagerClient)
package mx.managers {
import flash.events.*;
public interface ILayoutManagerClient extends IEventDispatcher {
function get updateCompletePendingFlag():Boolean;
function set updateCompletePendingFlag(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
function set initialized(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
function validateProperties():void;
function validateDisplayList():void;
function get nestLevel():int;
function get initialized():Boolean;
function get processedDescriptors():Boolean;
function validateSize(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean=false):void;
function set nestLevel(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:int):void;
function set processedDescriptors(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ILayoutManagerClient.as:Boolean):void;
}
}//package mx.managers
Section 154
//ISystemManager (mx.managers.ISystemManager)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModuleFactory {
function set focusPane(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Sprite):void;
function get toolTipChildren():IChildList;
function useSWFBridge():Boolean;
function isFontFaceEmbedded(flash.display:TextFormat):Boolean;
function deployMouseShields(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Boolean):void;
function get rawChildren():IChildList;
function get topLevelSystemManager():ISystemManager;
function dispatchEventFromSWFBridges(_arg1:Event, _arg2:IEventDispatcher=null, _arg3:Boolean=false, _arg4:Boolean=false):void;
function getSandboxRoot():DisplayObject;
function get swfBridgeGroup():ISWFBridgeGroup;
function removeFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function addChildToSandboxRoot(_arg1:String, _arg2:DisplayObject):void;
function get document():Object;
function get focusPane():Sprite;
function get loaderInfo():LoaderInfo;
function addChildBridge(_arg1:IEventDispatcher, _arg2:DisplayObject):void;
function getTopLevelRoot():DisplayObject;
function removeChildBridge(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IEventDispatcher):void;
function isDisplayObjectInABridgedApplication(flash.display:DisplayObject):Boolean;
function get popUpChildren():IChildList;
function get screen():Rectangle;
function removeChildFromSandboxRoot(_arg1:String, _arg2:DisplayObject):void;
function getDefinitionByName(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;ISystemManager.as:String):Object;
function activate(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function deactivate(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function get cursorChildren():IChildList;
function set document(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:Object):void;
function get embeddedFontList():Object;
function set numModalWindows(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:int):void;
function isTopLevel():Boolean;
function isTopLevelRoot():Boolean;
function get numModalWindows():int;
function addFocusManager(mx.managers:ISystemManager/mx.managers:ISystemManager:cursorChildren/get:IFocusManagerContainer):void;
function get stage():Stage;
function getVisibleApplicationRect(value:Rectangle=null):Rectangle;
}
}//package mx.managers
Section 155
//IToolTipManager2 (mx.managers.IToolTipManager2)
package mx.managers {
import mx.core.*;
import flash.display.*;
import mx.effects.*;
public interface IToolTipManager2 {
function registerToolTip(_arg1:DisplayObject, _arg2:String, _arg3:String):void;
function get enabled():Boolean;
function set enabled(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Boolean):void;
function get scrubDelay():Number;
function set hideEffect(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IAbstractEffect):void;
function createToolTip(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String=null, _arg5:IUIComponent=null):IToolTip;
function set scrubDelay(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void;
function set hideDelay(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void;
function get currentTarget():DisplayObject;
function set showDelay(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Number):void;
function get showDelay():Number;
function get showEffect():IAbstractEffect;
function get hideDelay():Number;
function get currentToolTip():IToolTip;
function get hideEffect():IAbstractEffect;
function set currentToolTip(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void;
function get toolTipClass():Class;
function registerErrorString(_arg1:DisplayObject, _arg2:String, _arg3:String):void;
function destroyToolTip(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void;
function set toolTipClass(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:Class):void;
function sizeTip(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IToolTip):void;
function set currentTarget(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:DisplayObject):void;
function set showEffect(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManager2.as:IAbstractEffect):void;
}
}//package mx.managers
Section 156
//IToolTipManagerClient (mx.managers.IToolTipManagerClient)
package mx.managers {
import mx.core.*;
public interface IToolTipManagerClient extends IFlexDisplayObject {
function get toolTip():String;
function set toolTip(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\managers;IToolTipManagerClient.as:String):void;
}
}//package mx.managers
Section 157
//LayoutManager (mx.managers.LayoutManager)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import mx.events.*;
import mx.managers.layoutClasses.*;
public class LayoutManager extends EventDispatcher implements ILayoutManager {
private var invalidateClientPropertiesFlag:Boolean;// = false
private var invalidateDisplayListQueue:PriorityQueue;
private var updateCompleteQueue:PriorityQueue;
private var invalidateDisplayListFlag:Boolean;// = false
private var invalidateClientSizeFlag:Boolean;// = false
private var invalidateSizeQueue:PriorityQueue;
private var originalFrameRate:Number;
private var invalidatePropertiesFlag:Boolean;// = false
private var invalidatePropertiesQueue:PriorityQueue;
private var invalidateSizeFlag:Boolean;// = false
private var callLaterPending:Boolean;// = false
private var _usePhasedInstantiation:Boolean;// = false
private var callLaterObject:UIComponent;
private var targetLevel:int;// = 2147483647
mx_internal static const VERSION:String = "3.5.0.12683";
private static var instance:LayoutManager;
public function LayoutManager(){
updateCompleteQueue = new PriorityQueue();
invalidatePropertiesQueue = new PriorityQueue();
invalidateSizeQueue = new PriorityQueue();
invalidateDisplayListQueue = new PriorityQueue();
super();
}
public function set usePhasedInstantiation(value:Boolean):void{
var sm:ISystemManager;
var stage:Stage;
var value = value;
if (_usePhasedInstantiation != value){
_usePhasedInstantiation = value;
sm = SystemManagerGlobals.topLevelSystemManagers[0];
stage = SystemManagerGlobals.topLevelSystemManagers[0].stage;
if (stage){
if (value){
originalFrameRate = stage.frameRate;
stage.frameRate = 1000;
} else {
stage.frameRate = originalFrameRate;
};
};
//unresolved jump
var _slot1 = e;
};
}
private function waitAFrame():void{
callLaterObject.callLater(doPhasedInstantiation);
}
public function validateClient(target:ILayoutManagerClient, skipDisplayList:Boolean=false):void{
var obj:ILayoutManagerClient;
var i:int;
var done:Boolean;
var oldTargetLevel:int = targetLevel;
if (targetLevel == int.MAX_VALUE){
targetLevel = target.nestLevel;
};
while (!(done)) {
done = true;
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
while (obj) {
obj.validateProperties();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
};
if (invalidatePropertiesQueue.isEmpty()){
invalidatePropertiesFlag = false;
invalidateClientPropertiesFlag = false;
};
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
while (obj) {
obj.validateSize();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
if (invalidateClientPropertiesFlag){
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
if (obj){
invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
done = false;
break;
};
};
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
};
if (invalidateSizeQueue.isEmpty()){
invalidateSizeFlag = false;
invalidateClientSizeFlag = false;
};
if (!skipDisplayList){
obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallestChild(target));
while (obj) {
obj.validateDisplayList();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
if (invalidateClientPropertiesFlag){
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
if (obj){
invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
done = false;
break;
};
};
if (invalidateClientSizeFlag){
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
if (obj){
invalidateSizeQueue.addObject(obj, obj.nestLevel);
done = false;
break;
};
};
obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallestChild(target));
};
if (invalidateDisplayListQueue.isEmpty()){
invalidateDisplayListFlag = false;
};
};
};
if (oldTargetLevel == int.MAX_VALUE){
targetLevel = int.MAX_VALUE;
if (!skipDisplayList){
obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target));
while (obj) {
if (!obj.initialized){
obj.initialized = true;
};
obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
obj.updateCompletePendingFlag = false;
obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target));
};
};
};
}
private function validateProperties():void{
var obj:ILayoutManagerClient = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallest());
while (obj) {
obj.validateProperties();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallest());
};
if (invalidatePropertiesQueue.isEmpty()){
invalidatePropertiesFlag = false;
};
}
public function invalidateProperties(obj:ILayoutManagerClient):void{
if (((!(invalidatePropertiesFlag)) && (ApplicationGlobals.application.systemManager))){
invalidatePropertiesFlag = true;
if (!callLaterPending){
if (!callLaterObject){
callLaterObject = new UIComponent();
callLaterObject.systemManager = ApplicationGlobals.application.systemManager;
callLaterObject.callLater(waitAFrame);
} else {
callLaterObject.callLater(doPhasedInstantiation);
};
callLaterPending = true;
};
};
if (targetLevel <= obj.nestLevel){
invalidateClientPropertiesFlag = true;
};
invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
}
public function invalidateDisplayList(obj:ILayoutManagerClient):void{
if (((!(invalidateDisplayListFlag)) && (ApplicationGlobals.application.systemManager))){
invalidateDisplayListFlag = true;
if (!callLaterPending){
if (!callLaterObject){
callLaterObject = new UIComponent();
callLaterObject.systemManager = ApplicationGlobals.application.systemManager;
callLaterObject.callLater(waitAFrame);
} else {
callLaterObject.callLater(doPhasedInstantiation);
};
callLaterPending = true;
};
} else {
if (((!(invalidateDisplayListFlag)) && (!(ApplicationGlobals.application.systemManager)))){
};
};
invalidateDisplayListQueue.addObject(obj, obj.nestLevel);
}
private function validateDisplayList():void{
var obj:ILayoutManagerClient = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallest());
while (obj) {
obj.validateDisplayList();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallest());
};
if (invalidateDisplayListQueue.isEmpty()){
invalidateDisplayListFlag = false;
};
}
public function validateNow():void{
var infiniteLoopGuard:int;
if (!usePhasedInstantiation){
infiniteLoopGuard = 0;
while (((callLaterPending) && ((infiniteLoopGuard < 100)))) {
doPhasedInstantiation();
};
};
}
private function validateSize():void{
var obj:ILayoutManagerClient = ILayoutManagerClient(invalidateSizeQueue.removeLargest());
while (obj) {
obj.validateSize();
if (!obj.updateCompletePendingFlag){
updateCompleteQueue.addObject(obj, obj.nestLevel);
obj.updateCompletePendingFlag = true;
};
obj = ILayoutManagerClient(invalidateSizeQueue.removeLargest());
};
if (invalidateSizeQueue.isEmpty()){
invalidateSizeFlag = false;
};
}
private function doPhasedInstantiation():void{
var obj:ILayoutManagerClient;
if (usePhasedInstantiation){
if (invalidatePropertiesFlag){
validateProperties();
ApplicationGlobals.application.dispatchEvent(new Event("validatePropertiesComplete"));
} else {
if (invalidateSizeFlag){
validateSize();
ApplicationGlobals.application.dispatchEvent(new Event("validateSizeComplete"));
} else {
if (invalidateDisplayListFlag){
validateDisplayList();
ApplicationGlobals.application.dispatchEvent(new Event("validateDisplayListComplete"));
};
};
};
} else {
if (invalidatePropertiesFlag){
validateProperties();
};
if (invalidateSizeFlag){
validateSize();
};
if (invalidateDisplayListFlag){
validateDisplayList();
};
};
if (((((invalidatePropertiesFlag) || (invalidateSizeFlag))) || (invalidateDisplayListFlag))){
callLaterObject.callLater(doPhasedInstantiation);
} else {
usePhasedInstantiation = false;
callLaterPending = false;
obj = ILayoutManagerClient(updateCompleteQueue.removeLargest());
while (obj) {
if (((!(obj.initialized)) && (obj.processedDescriptors))){
obj.initialized = true;
};
obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
obj.updateCompletePendingFlag = false;
obj = ILayoutManagerClient(updateCompleteQueue.removeLargest());
};
dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
};
}
public function isInvalid():Boolean{
return (((((invalidatePropertiesFlag) || (invalidateSizeFlag))) || (invalidateDisplayListFlag)));
}
public function get usePhasedInstantiation():Boolean{
return (_usePhasedInstantiation);
}
public function invalidateSize(obj:ILayoutManagerClient):void{
if (((!(invalidateSizeFlag)) && (ApplicationGlobals.application.systemManager))){
invalidateSizeFlag = true;
if (!callLaterPending){
if (!callLaterObject){
callLaterObject = new UIComponent();
callLaterObject.systemManager = ApplicationGlobals.application.systemManager;
callLaterObject.callLater(waitAFrame);
} else {
callLaterObject.callLater(doPhasedInstantiation);
};
callLaterPending = true;
};
};
if (targetLevel <= obj.nestLevel){
invalidateClientSizeFlag = true;
};
invalidateSizeQueue.addObject(obj, obj.nestLevel);
}
public static function getInstance():LayoutManager{
if (!instance){
instance = new (LayoutManager);
};
return (instance);
}
}
}//package mx.managers
Section 158
//PopUpManagerChildList (mx.managers.PopUpManagerChildList)
package mx.managers {
import mx.core.*;
public final class PopUpManagerChildList {
public static const PARENT:String = "parent";
public static const APPLICATION:String = "application";
mx_internal static const VERSION:String = "3.5.0.12683";
public static const POPUP:String = "popup";
public function PopUpManagerChildList(){
super();
}
}
}//package mx.managers
Section 159
//SystemChildrenList (mx.managers.SystemChildrenList)
package mx.managers {
import mx.core.*;
import flash.display.*;
import flash.geom.*;
public class SystemChildrenList implements IChildList {
private var lowerBoundReference:QName;
private var upperBoundReference:QName;
private var owner:SystemManager;
mx_internal static const VERSION:String = "3.5.0.12683";
public function SystemChildrenList(owner:SystemManager, lowerBoundReference:QName, upperBoundReference:QName){
super();
this.owner = owner;
this.lowerBoundReference = lowerBoundReference;
this.upperBoundReference = upperBoundReference;
}
public function getChildAt(index:int):DisplayObject{
var _local3 = owner;
var retval:DisplayObject = _local3.mx_internal::rawChildren_getChildAt((owner[lowerBoundReference] + index));
return (retval);
}
public function getChildByName(name:String):DisplayObject{
return (owner.mx_internal::rawChildren_getChildByName(name));
}
public function removeChildAt(index:int):DisplayObject{
var _local3 = owner;
var child:DisplayObject = _local3.mx_internal::rawChildren_removeChildAt((index + owner[lowerBoundReference]));
_local3 = owner;
var _local4 = upperBoundReference;
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
return (child);
}
public function getChildIndex(child:DisplayObject):int{
var retval:int = owner.mx_internal::rawChildren_getChildIndex(child);
retval = (retval - owner[lowerBoundReference]);
return (retval);
}
public function addChildAt(child:DisplayObject, index:int):DisplayObject{
var _local3 = owner;
_local3.mx_internal::rawChildren_addChildAt(child, (owner[lowerBoundReference] + index));
_local3 = owner;
var _local4 = upperBoundReference;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
return (child);
}
public function getObjectsUnderPoint(point:Point):Array{
return (owner.mx_internal::rawChildren_getObjectsUnderPoint(point));
}
public function setChildIndex(child:DisplayObject, newIndex:int):void{
var _local3 = owner;
_local3.mx_internal::rawChildren_setChildIndex(child, (owner[lowerBoundReference] + newIndex));
}
public function get numChildren():int{
return ((owner[upperBoundReference] - owner[lowerBoundReference]));
}
public function contains(child:DisplayObject):Boolean{
var childIndex:int;
if (((!((child == owner))) && (owner.mx_internal::rawChildren_contains(child)))){
while (child.parent != owner) {
child = child.parent;
};
childIndex = owner.mx_internal::rawChildren_getChildIndex(child);
if ((((childIndex >= owner[lowerBoundReference])) && ((childIndex < owner[upperBoundReference])))){
return (true);
};
};
return (false);
}
public function removeChild(child:DisplayObject):DisplayObject{
var index:int = owner.mx_internal::rawChildren_getChildIndex(child);
if ((((owner[lowerBoundReference] <= index)) && ((index < owner[upperBoundReference])))){
var _local3 = owner;
_local3.mx_internal::rawChildren_removeChild(child);
_local3 = owner;
var _local4 = upperBoundReference;
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
};
return (child);
}
public function addChild(child:DisplayObject):DisplayObject{
var _local2 = owner;
_local2.mx_internal::rawChildren_addChildAt(child, owner[upperBoundReference]);
_local2 = owner;
var _local3 = upperBoundReference;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
return (child);
}
}
}//package mx.managers
Section 160
//SystemManager (mx.managers.SystemManager)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.utils.*;
import mx.styles.*;
import flash.system.*;
import flash.geom.*;
import flash.text.*;
import mx.events.*;
import mx.resources.*;
import mx.managers.systemClasses.*;
import mx.preloaders.*;
import mx.utils.*;
import mx.messaging.config.*;
public class SystemManager extends MovieClip implements IChildList, IFlexDisplayObject, IFlexModuleFactory, ISystemManager, ISWFBridgeProvider {
private var _stage:Stage;
mx_internal var nestLevel:int;// = 0
private var currentSandboxEvent:Event;
private var forms:Array;
private var mouseCatcher:Sprite;
private var _height:Number;
private var preloader:Preloader;
private var lastFrame:int;
private var _document:Object;
private var strongReferenceProxies:Dictionary;
private var _rawChildren:SystemRawChildrenList;
private var _topLevelSystemManager:ISystemManager;
private var _toolTipIndex:int;// = 0
private var _bridgeToFocusManager:Dictionary;
private var _explicitHeight:Number;
private var idToPlaceholder:Object;
private var _swfBridgeGroup:ISWFBridgeGroup;
private var _toolTipChildren:SystemChildrenList;
private var form:Object;
private var _width:Number;
private var initialized:Boolean;// = false
private var _focusPane:Sprite;
private var _fontList:Object;// = null
private var isStageRoot:Boolean;// = true
private var _popUpChildren:SystemChildrenList;
private var _topMostIndex:int;// = 0
private var nextFrameTimer:Timer;// = null
mx_internal var topLevel:Boolean;// = true
private var weakReferenceProxies:Dictionary;
private var _cursorIndex:int;// = 0
private var isBootstrapRoot:Boolean;// = false
mx_internal var _mouseY;
private var _numModalWindows:int;// = 0
mx_internal var _mouseX;
private var _screen:Rectangle;
mx_internal var idleCounter:int;// = 0
private var _cursorChildren:SystemChildrenList;
private var initCallbackFunctions:Array;
private var _noTopMostIndex:int;// = 0
private var _applicationIndex:int;// = 1
private var isDispatchingResizeEvent:Boolean;
private var idleTimer:Timer;
private var doneExecutingInitCallbacks:Boolean;// = false
private var _explicitWidth:Number;
private var eventProxy:EventProxy;
mx_internal var topLevelWindow:IUIComponent;
private static const IDLE_THRESHOLD:Number = 1000;
private static const IDLE_INTERVAL:Number = 100;
mx_internal static const VERSION:String = "3.5.0.12683";
mx_internal static var lastSystemManager:SystemManager;
mx_internal static var allSystemManagers:Dictionary = new Dictionary(true);
public function SystemManager(){
initCallbackFunctions = [];
forms = [];
weakReferenceProxies = new Dictionary(true);
strongReferenceProxies = new Dictionary(false);
super();
if (stage){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
};
if ((((SystemManagerGlobals.topLevelSystemManagers.length > 0)) && (!(stage)))){
topLevel = false;
};
if (!stage){
isStageRoot = false;
};
if (topLevel){
SystemManagerGlobals.topLevelSystemManagers.push(this);
};
lastSystemManager = this;
var compiledLocales:Array = info()["compiledLocales"];
ResourceBundle.locale = (((!((compiledLocales == null))) && ((compiledLocales.length > 0)))) ? compiledLocales[0] : "en_US";
executeCallbacks();
stop();
if (((topLevel) && (!((currentFrame == 1))))){
throw (new Error((("The SystemManager constructor was called when the currentFrame was at " + currentFrame) + " Please add this SWF to bug 129782.")));
};
if (((root) && (root.loaderInfo))){
root.loaderInfo.addEventListener(Event.INIT, initHandler);
};
}
private function removeEventListenerFromSandboxes(type:String, listener:Function, useCapture:Boolean=false, skip:IEventDispatcher=null):void{
var i:int;
if (!swfBridgeGroup){
return;
};
var request:EventListenerRequest = new EventListenerRequest(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, false, false, type, useCapture);
var parentBridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
parentBridge.removeEventListener(type, listener, useCapture);
};
var children:Array = swfBridgeGroup.getChildBridges();
while (i < children.length) {
if (children[i] != skip){
IEventDispatcher(children[i]).removeEventListener(type, listener, useCapture);
};
i++;
};
dispatchEventFromSWFBridges(request, skip);
}
mx_internal function addingChild(child:DisplayObject):void{
var obj:DisplayObjectContainer;
var newNestLevel = 1;
if (((!(topLevel)) && (parent))){
obj = parent.parent;
while (obj) {
if ((obj is ILayoutManagerClient)){
newNestLevel = (ILayoutManagerClient(obj).nestLevel + 1);
break;
};
obj = obj.parent;
};
};
nestLevel = newNestLevel;
if ((child is IUIComponent)){
IUIComponent(child).systemManager = this;
};
var uiComponentClassName:Class = Class(getDefinitionByName("mx.core.UIComponent"));
if ((((child is IUIComponent)) && (!(IUIComponent(child).document)))){
IUIComponent(child).document = document;
};
if ((child is ILayoutManagerClient)){
ILayoutManagerClient(child).nestLevel = (nestLevel + 1);
};
if ((child is InteractiveObject)){
if (doubleClickEnabled){
InteractiveObject(child).doubleClickEnabled = true;
};
};
if ((child is IUIComponent)){
IUIComponent(child).parentChanged(this);
};
if ((child is IStyleClient)){
IStyleClient(child).regenerateStyleCache(true);
};
if ((child is ISimpleStyleClient)){
ISimpleStyleClient(child).styleChanged(null);
};
if ((child is IStyleClient)){
IStyleClient(child).notifyStyleChangeInChildren(null, true);
};
if (((uiComponentClassName) && ((child is uiComponentClassName)))){
uiComponentClassName(child).initThemeColor();
};
if (((uiComponentClassName) && ((child is uiComponentClassName)))){
uiComponentClassName(child).stylesInitialized();
};
}
private function dispatchEventToOtherSystemManagers(event:Event):void{
SystemManagerGlobals.dispatchingEventToOtherSystemManagers = true;
var arr:Array = SystemManagerGlobals.topLevelSystemManagers;
var n:int = arr.length;
var i:int;
while (i < n) {
if (arr[i] != this){
arr[i].dispatchEvent(event);
};
i++;
};
SystemManagerGlobals.dispatchingEventToOtherSystemManagers = false;
}
private function idleTimer_timerHandler(event:TimerEvent):void{
idleCounter++;
if ((idleCounter * IDLE_INTERVAL) > IDLE_THRESHOLD){
dispatchEvent(new FlexEvent(FlexEvent.IDLE));
};
}
private function initManagerHandler(event:Event):void{
var event = event;
if (!SystemManagerGlobals.dispatchingEventToOtherSystemManagers){
dispatchEventToOtherSystemManagers(event);
};
if ((event is InterManagerRequest)){
return;
};
var name:String = event["name"];
Singleton.getInstance(name);
//unresolved jump
var _slot1 = e;
}
mx_internal function rawChildren_getObjectsUnderPoint(pt:Point):Array{
return (super.getObjectsUnderPoint(pt));
}
public function get preloadedRSLs():Dictionary{
return (null);
}
private function getSizeRequestHandler(event:Event):void{
var eObj:Object = Object(event);
eObj.data = {width:measuredWidth, height:measuredHeight};
}
private function beforeUnloadHandler(event:Event):void{
var sandboxRoot:DisplayObject;
if (((topLevel) && (stage))){
sandboxRoot = getSandboxRoot();
if (sandboxRoot != this){
sandboxRoot.removeEventListener(Event.RESIZE, Stage_resizeHandler);
};
};
removeParentBridgeListeners();
dispatchEvent(event);
}
public function getExplicitOrMeasuredHeight():Number{
return ((isNaN(explicitHeight)) ? measuredHeight : explicitHeight);
}
private function getVisibleRectRequestHandler(event:Event):void{
var localRect:Rectangle;
var pt:Point;
var bridge:IEventDispatcher;
if ((event is SWFBridgeRequest)){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
var rect:Rectangle = Rectangle(request.data);
var owner:DisplayObject = DisplayObject(swfBridgeGroup.getChildBridgeProvider(request.requestor));
var forwardRequest:Boolean;
if (!DisplayObjectContainer(document).contains(owner)){
forwardRequest = false;
};
if ((owner is ISWFLoader)){
localRect = ISWFLoader(owner).getVisibleApplicationRect();
} else {
localRect = owner.getBounds(this);
pt = localToGlobal(localRect.topLeft);
localRect.x = pt.x;
localRect.y = pt.y;
};
rect = rect.intersection(localRect);
request.data = rect;
if (((forwardRequest) && (useSWFBridge()))){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
};
Object(event).data = request.data;
}
mx_internal function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
var child:IStyleClient;
var foundTopLevelWindow:Boolean;
var n:int = rawChildren.numChildren;
var i:int;
while (i < n) {
child = (rawChildren.getChildAt(i) as IStyleClient);
if (child){
child.styleChanged(styleProp);
child.notifyStyleChangeInChildren(styleProp, recursive);
};
if (isTopLevelWindow(DisplayObject(child))){
foundTopLevelWindow = true;
};
n = rawChildren.numChildren;
i++;
};
if (((!(foundTopLevelWindow)) && ((topLevelWindow is IStyleClient)))){
IStyleClient(topLevelWindow).styleChanged(styleProp);
IStyleClient(topLevelWindow).notifyStyleChangeInChildren(styleProp, recursive);
};
}
private function addEventListenerToOtherSystemManagers(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
var arr:Array = SystemManagerGlobals.topLevelSystemManagers;
if (arr.length < 2){
return;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = true;
var n:int = arr.length;
var i:int;
while (i < n) {
if (arr[i] != this){
arr[i].addEventListener(type, listener, useCapture, priority, useWeakReference);
};
i++;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = false;
}
private function initHandler(event:Event):void{
var bridgeEvent:SWFBridgeEvent;
var event = event;
if (!isStageRoot){
if (root.loaderInfo.parentAllowsChild){
if (((!(parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true)))) || (!(root.loaderInfo.sharedEvents.hasEventListener(SWFBridgeEvent.BRIDGE_NEW_APPLICATION))))){
isBootstrapRoot = true;
};
//unresolved jump
var _slot1 = e;
};
};
allSystemManagers[this] = this.loaderInfo.url;
root.loaderInfo.removeEventListener(Event.INIT, initHandler);
if (useSWFBridge()){
swfBridgeGroup = new SWFBridgeGroup(this);
swfBridgeGroup.parentBridge = loaderInfo.sharedEvents;
addParentBridgeListeners();
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_NEW_APPLICATION);
bridgeEvent.data = swfBridgeGroup.parentBridge;
swfBridgeGroup.parentBridge.dispatchEvent(bridgeEvent);
addEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
root.loaderInfo.addEventListener(Event.UNLOAD, unloadHandler, false, 0, true);
};
var sbRoot:DisplayObject = getSandboxRoot();
sbRoot.addEventListener(InterManagerRequest.INIT_MANAGER_REQUEST, initManagerHandler, false, 0, true);
if (sbRoot == this){
addEventListener(InterManagerRequest.SYSTEM_MANAGER_REQUEST, systemManagerHandler);
addEventListener(InterManagerRequest.DRAG_MANAGER_REQUEST, multiWindowRedispatcher);
addEventListener("dispatchDragEvent", multiWindowRedispatcher);
addEventListener(SWFBridgeRequest.ADD_POP_UP_REQUEST, addPopupRequestHandler);
addEventListener(SWFBridgeRequest.REMOVE_POP_UP_REQUEST, removePopupRequestHandler);
addEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
addEventListener(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, removePlaceholderPopupRequestHandler);
addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, activateFormSandboxEventHandler);
addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, deactivateFormSandboxEventHandler);
addEventListener(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST, hideMouseCursorRequestHandler);
addEventListener(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST, showMouseCursorRequestHandler);
addEventListener(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST, resetMouseCursorRequestHandler);
};
var docFrame:int = ((totalFrames)==1) ? 0 : 1;
addEventListener(Event.ENTER_FRAME, docFrameListener);
initialize();
}
mx_internal function findFocusManagerContainer(smp:SystemManagerProxy):IFocusManagerContainer{
var child:DisplayObject;
var children:IChildList = smp.rawChildren;
var numChildren:int = children.numChildren;
var i:int;
while (i < numChildren) {
child = children.getChildAt(i);
if ((child is IFocusManagerContainer)){
return (IFocusManagerContainer(child));
};
i++;
};
return (null);
}
private function addPlaceholderPopupRequestHandler(event:Event):void{
var remoteForm:RemotePopUp;
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (((!((event.target == this))) && ((event is SWFBridgeRequest)))){
return;
};
if (!forwardPlaceholderRequest(popUpRequest, true)){
remoteForm = new RemotePopUp(popUpRequest.data.placeHolderId, popUpRequest.requestor);
forms.push(remoteForm);
};
}
override public function contains(child:DisplayObject):Boolean{
var childIndex:int;
var i:int;
var myChild:DisplayObject;
if (super.contains(child)){
if (child.parent == this){
childIndex = super.getChildIndex(child);
if (childIndex < noTopMostIndex){
return (true);
};
} else {
i = 0;
while (i < noTopMostIndex) {
myChild = super.getChildAt(i);
if ((myChild is IRawChildrenContainer)){
if (IRawChildrenContainer(myChild).rawChildren.contains(child)){
return (true);
};
};
if ((myChild is DisplayObjectContainer)){
if (DisplayObjectContainer(myChild).contains(child)){
return (true);
};
};
i++;
};
};
};
return (false);
}
private function modalWindowRequestHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!preProcessModalWindowRequest(request, getSandboxRoot())){
return;
};
Singleton.getInstance("mx.managers::IPopUpManager");
dispatchEvent(request);
}
private function activateApplicationSandboxEventHandler(event:Event):void{
if (!isTopLevelRoot()){
swfBridgeGroup.parentBridge.dispatchEvent(event);
return;
};
activateForm(document);
}
public function getDefinitionByName(name:String):Object{
var definition:Object;
var domain:ApplicationDomain = (((!(topLevel)) && ((parent is Loader)))) ? Loader(parent).contentLoaderInfo.applicationDomain : (info()["currentDomain"] as ApplicationDomain);
if (domain.hasDefinition(name)){
definition = domain.getDefinition(name);
};
return (definition);
}
public function removeChildFromSandboxRoot(layer:String, child:DisplayObject):void{
var me:InterManagerRequest;
if (getSandboxRoot() == this){
this[layer].removeChild(child);
} else {
removingChild(child);
me = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = (layer + ".removeChild");
me.value = child;
getSandboxRoot().dispatchEvent(me);
childRemoved(child);
};
}
private function removeEventListenerFromOtherSystemManagers(type:String, listener:Function, useCapture:Boolean=false):void{
var arr:Array = SystemManagerGlobals.topLevelSystemManagers;
if (arr.length < 2){
return;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = true;
var n:int = arr.length;
var i:int;
while (i < n) {
if (arr[i] != this){
arr[i].removeEventListener(type, listener, useCapture);
};
i++;
};
SystemManagerGlobals.changingListenersInOtherSystemManagers = false;
}
public function get embeddedFontList():Object{
var o:Object;
var p:String;
var fl:Object;
if (_fontList == null){
_fontList = {};
o = info()["fonts"];
for (p in o) {
_fontList[p] = o[p];
};
if (((!(topLevel)) && (_topLevelSystemManager))){
fl = _topLevelSystemManager.embeddedFontList;
for (p in fl) {
_fontList[p] = fl[p];
};
};
};
return (_fontList);
}
mx_internal function set cursorIndex(value:int):void{
var delta:int = (value - _cursorIndex);
_cursorIndex = value;
}
mx_internal function addChildBridgeListeners(bridge:IEventDispatcher):void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).addChildBridgeListeners(bridge);
return;
};
bridge.addEventListener(SWFBridgeRequest.ADD_POP_UP_REQUEST, addPopupRequestHandler);
bridge.addEventListener(SWFBridgeRequest.REMOVE_POP_UP_REQUEST, removePopupRequestHandler);
bridge.addEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
bridge.addEventListener(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, removePlaceholderPopupRequestHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, activateFormSandboxEventHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, deactivateFormSandboxEventHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_ACTIVATE, activateApplicationSandboxEventHandler);
bridge.addEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler, false, 0, true);
bridge.addEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler, false, 0, true);
bridge.addEventListener(SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.addEventListener(SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.addEventListener(SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.addEventListener(SWFBridgeRequest.GET_VISIBLE_RECT_REQUEST, getVisibleRectRequestHandler);
bridge.addEventListener(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST, hideMouseCursorRequestHandler);
bridge.addEventListener(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST, showMouseCursorRequestHandler);
bridge.addEventListener(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST, resetMouseCursorRequestHandler);
}
public function set document(value:Object):void{
_document = value;
}
override public function getChildAt(index:int):DisplayObject{
return (super.getChildAt((applicationIndex + index)));
}
public function get rawChildren():IChildList{
if (!_rawChildren){
_rawChildren = new SystemRawChildrenList(this);
};
return (_rawChildren);
}
private function findLastActiveForm(f:Object):Object{
var n:int = forms.length;
var i:int = (forms.length - 1);
while (i >= 0) {
if (((!((forms[i] == f))) && (canActivatePopUp(forms[i])))){
return (forms[i]);
};
i--;
};
return (null);
}
private function multiWindowRedispatcher(event:Event):void{
if (!SystemManagerGlobals.dispatchingEventToOtherSystemManagers){
dispatchEventToOtherSystemManagers(event);
};
}
public function deployMouseShields(deploy:Boolean):void{
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.DRAG_MANAGER_REQUEST, false, false, "mouseShield", deploy);
getSandboxRoot().dispatchEvent(me);
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
var actualType:String;
var type = type;
var listener = listener;
var useCapture = useCapture;
var priority = priority;
var useWeakReference = useWeakReference;
if ((((type == FlexEvent.RENDER)) || ((type == FlexEvent.ENTER_FRAME)))){
if (type == FlexEvent.RENDER){
type = Event.RENDER;
} else {
type = Event.ENTER_FRAME;
};
if (stage){
stage.addEventListener(type, listener, useCapture, priority, useWeakReference);
} else {
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
};
//unresolved jump
var _slot1 = error;
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
if (((stage) && ((type == Event.RENDER)))){
stage.invalidate();
};
return;
};
if ((((((((((type == MouseEvent.MOUSE_MOVE)) || ((type == MouseEvent.MOUSE_UP)))) || ((type == MouseEvent.MOUSE_DOWN)))) || ((type == Event.ACTIVATE)))) || ((type == Event.DEACTIVATE)))){
if (stage){
stage.addEventListener(type, stageEventHandler, false, 0, true);
};
//unresolved jump
var _slot1 = error;
};
if (type == SandboxMouseEvent.MOUSE_UP_SOMEWHERE){
if (stage){
stage.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
} else {
super.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
};
//unresolved jump
var _slot1 = error;
super.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
};
if (((hasSWFBridges()) || ((SystemManagerGlobals.topLevelSystemManagers.length > 1)))){
if (!eventProxy){
eventProxy = new EventProxy(this);
};
actualType = EventUtil.sandboxMouseEventMap[type];
if (actualType){
if (isTopLevelRoot()){
stage.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
addEventListenerToSandboxes(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
} else {
super.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
};
addEventListenerToSandboxes(type, sandboxMouseListener, useCapture, priority, useWeakReference);
if (!SystemManagerGlobals.changingListenersInOtherSystemManagers){
addEventListenerToOtherSystemManagers(type, otherSystemManagerMouseListener, useCapture, priority, useWeakReference);
};
if (getSandboxRoot() == this){
super.addEventListener(actualType, eventProxy.marshalListener, useCapture, priority, useWeakReference);
if (actualType == MouseEvent.MOUSE_UP){
if (stage){
stage.addEventListener(Event.MOUSE_LEAVE, eventProxy.marshalListener, useCapture, priority, useWeakReference);
} else {
super.addEventListener(Event.MOUSE_LEAVE, eventProxy.marshalListener, useCapture, priority, useWeakReference);
};
//unresolved jump
var _slot1 = e;
super.addEventListener(Event.MOUSE_LEAVE, eventProxy.marshalListener, useCapture, priority, useWeakReference);
};
};
super.addEventListener(type, listener, false, priority, useWeakReference);
return;
};
};
if ((((type == FlexEvent.IDLE)) && (!(idleTimer)))){
idleTimer = new Timer(IDLE_INTERVAL);
idleTimer.addEventListener(TimerEvent.TIMER, idleTimer_timerHandler);
idleTimer.start();
addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler, true);
};
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
private function activateForm(f:Object):void{
var z:IFocusManagerContainer;
if (form){
if (((!((form == f))) && ((forms.length > 1)))){
if (isRemotePopUp(form)){
if (!areRemotePopUpsEqual(form, f)){
deactivateRemotePopUp(form);
};
} else {
z = IFocusManagerContainer(form);
z.focusManager.deactivate();
};
};
};
form = f;
if (isRemotePopUp(f)){
activateRemotePopUp(f);
} else {
if (f.focusManager){
f.focusManager.activate();
};
};
updateLastActiveForm();
}
public function removeFocusManager(f:IFocusManagerContainer):void{
var n:int = forms.length;
var i:int;
while (i < n) {
if (forms[i] == f){
if (form == f){
deactivate(f);
};
dispatchDeactivatedWindowEvent(DisplayObject(f));
forms.splice(i, 1);
return;
};
i++;
};
}
private function mouseMoveHandler(event:MouseEvent):void{
idleCounter = 0;
}
private function getSandboxScreen():Rectangle{
var sandboxScreen:Rectangle;
var sm:DisplayObject;
var me:InterManagerRequest;
var sandboxRoot:DisplayObject = getSandboxRoot();
if (sandboxRoot == this){
sandboxScreen = new Rectangle(0, 0, width, height);
} else {
if (sandboxRoot == topLevelSystemManager){
sm = DisplayObject(topLevelSystemManager);
sandboxScreen = new Rectangle(0, 0, sm.width, sm.height);
} else {
me = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST, false, false, "screen");
sandboxRoot.dispatchEvent(me);
sandboxScreen = Rectangle(me.value);
};
};
return (sandboxScreen);
}
public function get focusPane():Sprite{
return (_focusPane);
}
override public function get mouseX():Number{
if (_mouseX === undefined){
return (super.mouseX);
};
return (_mouseX);
}
private function mouseDownHandler(event:MouseEvent):void{
var n:int;
var p:DisplayObject;
var isApplication:Boolean;
var i:int;
var form_i:Object;
var j:int;
var index:int;
var newIndex:int;
var childList:IChildList;
var f:DisplayObject;
var isRemotePopUp:Boolean;
var fChildIndex:int;
idleCounter = 0;
var bridge:IEventDispatcher = getSWFBridgeOfDisplayObject((event.target as DisplayObject));
if (((bridge) && ((bridgeToFocusManager[bridge] == document.focusManager)))){
if (isTopLevelRoot()){
activateForm(document);
} else {
dispatchActivatedApplicationEvent();
};
return;
};
if (numModalWindows == 0){
if (((!(isTopLevelRoot())) || ((forms.length > 1)))){
n = forms.length;
p = DisplayObject(event.target);
isApplication = document.rawChildren.contains(p);
while (p) {
i = 0;
while (i < n) {
form_i = (isRemotePopUp(forms[i])) ? forms[i].window : forms[i];
if (form_i == p){
j = 0;
if (((((!((p == form))) && ((p is IFocusManagerContainer)))) || (((!(isTopLevelRoot())) && ((p == form)))))){
if (isTopLevelRoot()){
activate(IFocusManagerContainer(p));
};
if (p == document){
dispatchActivatedApplicationEvent();
} else {
if ((p is DisplayObject)){
dispatchActivatedWindowEvent(DisplayObject(p));
};
};
};
if (popUpChildren.contains(p)){
childList = popUpChildren;
} else {
childList = this;
};
index = childList.getChildIndex(p);
newIndex = index;
n = forms.length;
j = 0;
for (;j < n;j++) {
isRemotePopUp = isRemotePopUp(forms[j]);
if (isRemotePopUp){
if ((forms[j].window is String)){
continue;
};
f = forms[j].window;
} else {
f = forms[j];
};
if (isRemotePopUp){
fChildIndex = getChildListIndex(childList, f);
if (fChildIndex > index){
newIndex = Math.max(fChildIndex, newIndex);
};
} else {
if (childList.contains(f)){
if (childList.getChildIndex(f) > index){
newIndex = Math.max(childList.getChildIndex(f), newIndex);
};
};
};
};
if ((((newIndex > index)) && (!(isApplication)))){
childList.setChildIndex(p, newIndex);
};
return;
};
i++;
};
p = p.parent;
};
} else {
dispatchActivatedApplicationEvent();
};
};
}
public function allowInsecureDomain(... _args):void{
}
private function removePopupRequestHandler(event:Event):void{
var request:SWFBridgeRequest;
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (((swfBridgeGroup.parentBridge) && (SecurityUtil.hasMutualTrustBetweenParentAndChild(this)))){
popUpRequest.requestor = swfBridgeGroup.parentBridge;
getSandboxRoot().dispatchEvent(popUpRequest);
return;
};
if (popUpChildren.contains(popUpRequest.data.window)){
popUpChildren.removeChild(popUpRequest.data.window);
} else {
removeChild(DisplayObject(popUpRequest.data.window));
};
if (popUpRequest.data.modal){
numModalWindows--;
};
removeRemotePopUp(new RemotePopUp(popUpRequest.data.window, popUpRequest.requestor));
if (((!(isTopLevelRoot())) && (swfBridgeGroup))){
request = new SWFBridgeRequest(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, false, false, popUpRequest.requestor, {placeHolderId:NameUtil.displayObjectToString(popUpRequest.data.window)});
dispatchEvent(request);
};
}
public function addChildBridge(bridge:IEventDispatcher, owner:DisplayObject):void{
var fm:IFocusManager;
var o:DisplayObject = owner;
while (o) {
if ((o is IFocusManagerContainer)){
fm = IFocusManagerContainer(o).focusManager;
break;
};
o = o.parent;
};
if (!fm){
return;
};
if (!swfBridgeGroup){
swfBridgeGroup = new SWFBridgeGroup(this);
};
swfBridgeGroup.addChildBridge(bridge, ISWFBridgeProvider(owner));
fm.addSWFBridge(bridge, owner);
if (!bridgeToFocusManager){
bridgeToFocusManager = new Dictionary();
};
bridgeToFocusManager[bridge] = fm;
addChildBridgeListeners(bridge);
dispatchEvent(new FlexChangeEvent(FlexChangeEvent.ADD_CHILD_BRIDGE, false, false, bridge));
}
public function get screen():Rectangle{
if (!_screen){
Stage_resizeHandler();
};
if (!isStageRoot){
Stage_resizeHandler();
};
return (_screen);
}
private function resetMouseCursorRequestHandler(event:Event):void{
var bridge:IEventDispatcher;
if (((!(isTopLevelRoot())) && ((event is SWFBridgeRequest)))){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!isTopLevelRoot()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
} else {
if (eventProxy){
SystemManagerGlobals.showMouseCursor = true;
};
};
}
private function preloader_rslCompleteHandler(event:RSLEvent):void{
if (event.loaderInfo){
preloadedRSLs[event.loaderInfo] = event.url.url;
};
}
mx_internal function set topMostIndex(value:int):void{
var delta:int = (value - _topMostIndex);
_topMostIndex = value;
toolTipIndex = (toolTipIndex + delta);
}
mx_internal function docFrameHandler(event:Event=null):void{
var textFieldFactory:TextFieldFactory;
var n:int;
var i:int;
var c:Class;
Singleton.registerClass("mx.managers::IBrowserManager", Class(getDefinitionByName("mx.managers::BrowserManagerImpl")));
Singleton.registerClass("mx.managers::ICursorManager", Class(getDefinitionByName("mx.managers::CursorManagerImpl")));
Singleton.registerClass("mx.managers::IHistoryManager", Class(getDefinitionByName("mx.managers::HistoryManagerImpl")));
Singleton.registerClass("mx.managers::ILayoutManager", Class(getDefinitionByName("mx.managers::LayoutManager")));
Singleton.registerClass("mx.managers::IPopUpManager", Class(getDefinitionByName("mx.managers::PopUpManagerImpl")));
Singleton.registerClass("mx.managers::IToolTipManager2", Class(getDefinitionByName("mx.managers::ToolTipManagerImpl")));
var dragManagerClass:Class;
dragManagerClass = Class(getDefinitionByName("mx.managers::NativeDragManagerImpl"));
if (dragManagerClass == null){
dragManagerClass = Class(getDefinitionByName("mx.managers::DragManagerImpl"));
};
Singleton.registerClass("mx.managers::IDragManager", dragManagerClass);
Singleton.registerClass("mx.core::ITextFieldFactory", Class(getDefinitionByName("mx.core::TextFieldFactory")));
executeCallbacks();
doneExecutingInitCallbacks = true;
var mixinList:Array = info()["mixins"];
if (((mixinList) && ((mixinList.length > 0)))){
n = mixinList.length;
i = 0;
while (i < n) {
c = Class(getDefinitionByName(mixinList[i]));
var _local8 = c;
_local8["init"](this);
i++;
};
};
installCompiledResourceBundles();
initializeTopLevelWindow(null);
deferredNextFrame();
}
public function get explicitHeight():Number{
return (_explicitHeight);
}
public function get preloaderBackgroundSize():String{
return (info()["backgroundSize"]);
}
public function isTopLevel():Boolean{
return (topLevel);
}
override public function get mouseY():Number{
if (_mouseY === undefined){
return (super.mouseY);
};
return (_mouseY);
}
public function getExplicitOrMeasuredWidth():Number{
return ((isNaN(explicitWidth)) ? measuredWidth : explicitWidth);
}
public function deactivate(f:IFocusManagerContainer):void{
deactivateForm(Object(f));
}
private function preProcessModalWindowRequest(request:SWFBridgeRequest, sbRoot:DisplayObject):Boolean{
var bridge:IEventDispatcher;
var exclude:ISWFLoader;
var excludeRect:Rectangle;
if (request.data.skip){
request.data.skip = false;
if (useSWFBridge()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
};
return (false);
};
if (this != sbRoot){
if ((((request.type == SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST)) || ((request.type == SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST)))){
exclude = (swfBridgeGroup.getChildBridgeProvider(request.requestor) as ISWFLoader);
if (exclude){
excludeRect = ISWFLoader(exclude).getVisibleApplicationRect();
request.data.excludeRect = excludeRect;
if (!DisplayObjectContainer(document).contains(DisplayObject(exclude))){
request.data.useExclude = false;
};
};
};
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
if (request.type == SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST){
sbRoot.dispatchEvent(request);
} else {
bridge.dispatchEvent(request);
};
return (false);
};
request.data.skip = false;
return (true);
}
private function resetMouseCursorTracking(event:Event):void{
var cursorRequest:SWFBridgeRequest;
var bridge:IEventDispatcher;
if (isTopLevelRoot()){
SystemManagerGlobals.showMouseCursor = true;
} else {
if (swfBridgeGroup.parentBridge){
cursorRequest = new SWFBridgeRequest(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST);
bridge = swfBridgeGroup.parentBridge;
cursorRequest.requestor = bridge;
bridge.dispatchEvent(cursorRequest);
};
};
}
mx_internal function addParentBridgeListeners():void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).addParentBridgeListeners();
return;
};
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
bridge.addEventListener(SWFBridgeRequest.SET_ACTUAL_SIZE_REQUEST, setActualSizeRequestHandler);
bridge.addEventListener(SWFBridgeRequest.GET_SIZE_REQUEST, getSizeRequestHandler);
bridge.addEventListener(SWFBridgeRequest.ACTIVATE_POP_UP_REQUEST, activateRequestHandler);
bridge.addEventListener(SWFBridgeRequest.DEACTIVATE_POP_UP_REQUEST, deactivateRequestHandler);
bridge.addEventListener(SWFBridgeRequest.IS_BRIDGE_CHILD_REQUEST, isBridgeChildHandler);
bridge.addEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.addEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.addEventListener(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, canActivateHandler);
bridge.addEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING, beforeUnloadHandler);
}
public function get swfBridgeGroup():ISWFBridgeGroup{
if (topLevel){
return (_swfBridgeGroup);
};
if (topLevelSystemManager){
return (topLevelSystemManager.swfBridgeGroup);
};
return (null);
}
override public function getChildByName(name:String):DisplayObject{
return (super.getChildByName(name));
}
public function get measuredWidth():Number{
return ((topLevelWindow) ? topLevelWindow.getExplicitOrMeasuredWidth() : loaderInfo.width);
}
public function removeChildBridge(bridge:IEventDispatcher):void{
dispatchEvent(new FlexChangeEvent(FlexChangeEvent.REMOVE_CHILD_BRIDGE, false, false, bridge));
var fm:IFocusManager = IFocusManager(bridgeToFocusManager[bridge]);
fm.removeSWFBridge(bridge);
swfBridgeGroup.removeChildBridge(bridge);
delete bridgeToFocusManager[bridge];
removeChildBridgeListeners(bridge);
}
mx_internal function removeChildBridgeListeners(bridge:IEventDispatcher):void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).removeChildBridgeListeners(bridge);
return;
};
bridge.removeEventListener(SWFBridgeRequest.ADD_POP_UP_REQUEST, addPopupRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.REMOVE_POP_UP_REQUEST, removePopupRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, addPlaceholderPopupRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.REMOVE_POP_UP_PLACE_HOLDER_REQUEST, removePlaceholderPopupRequestHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, activateFormSandboxEventHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, deactivateFormSandboxEventHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_ACTIVATE, activateApplicationSandboxEventHandler);
bridge.removeEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.CREATE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.SHOW_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.HIDE_MODAL_WINDOW_REQUEST, modalWindowRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.GET_VISIBLE_RECT_REQUEST, getVisibleRectRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST, hideMouseCursorRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST, showMouseCursorRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.RESET_MOUSE_CURSOR_REQUEST, resetMouseCursorRequestHandler);
}
override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
noTopMostIndex++;
var oldParent:DisplayObjectContainer = child.parent;
if (oldParent){
oldParent.removeChild(child);
};
return (rawChildren_addChildAt(child, (applicationIndex + index)));
}
private function Stage_resizeHandler(event:Event=null):void{
var m:Number;
var n:Number;
var sandboxScreen:Rectangle;
var event = event;
if (isDispatchingResizeEvent){
return;
};
var w:Number = 0;
var h:Number = 0;
m = loaderInfo.width;
n = loaderInfo.height;
//unresolved jump
var _slot1 = error;
if (!_screen){
_screen = new Rectangle();
};
return;
var align:String = StageAlign.TOP_LEFT;
if (stage){
w = stage.stageWidth;
h = stage.stageHeight;
align = stage.align;
};
//unresolved jump
var _slot1 = error;
sandboxScreen = getSandboxScreen();
w = sandboxScreen.width;
h = sandboxScreen.height;
var x:Number = ((m - w) / 2);
var y:Number = ((n - h) / 2);
if (align == StageAlign.TOP){
y = 0;
} else {
if (align == StageAlign.BOTTOM){
y = (n - h);
} else {
if (align == StageAlign.LEFT){
x = 0;
} else {
if (align == StageAlign.RIGHT){
x = (m - w);
} else {
if ((((align == StageAlign.TOP_LEFT)) || ((align == "LT")))){
y = 0;
x = 0;
} else {
if (align == StageAlign.TOP_RIGHT){
y = 0;
x = (m - w);
} else {
if (align == StageAlign.BOTTOM_LEFT){
y = (n - h);
x = 0;
} else {
if (align == StageAlign.BOTTOM_RIGHT){
y = (n - h);
x = (m - w);
};
};
};
};
};
};
};
};
if (!_screen){
_screen = new Rectangle();
};
_screen.x = x;
_screen.y = y;
_screen.width = w;
_screen.height = h;
if (isStageRoot){
_width = stage.stageWidth;
_height = stage.stageHeight;
};
if (event){
resizeMouseCatcher();
isDispatchingResizeEvent = true;
dispatchEvent(event);
isDispatchingResizeEvent = false;
};
}
public function get swfBridge():IEventDispatcher{
if (swfBridgeGroup){
return (swfBridgeGroup.parentBridge);
};
return (null);
}
private function findRemotePopUp(window:Object, bridge:IEventDispatcher):RemotePopUp{
var popUp:RemotePopUp;
var n:int = forms.length;
var i:int;
while (i < n) {
if (isRemotePopUp(forms[i])){
popUp = RemotePopUp(forms[i]);
if ((((popUp.window == window)) && ((popUp.bridge == bridge)))){
return (popUp);
};
};
i++;
};
return (null);
}
public function info():Object{
return ({});
}
mx_internal function get toolTipIndex():int{
return (_toolTipIndex);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
if (isStageRoot){
return;
};
_width = newWidth;
_height = newHeight;
if (mouseCatcher){
mouseCatcher.width = newWidth;
mouseCatcher.height = newHeight;
};
dispatchEvent(new Event(Event.RESIZE));
}
private function removePlaceholderPopupRequestHandler(event:Event):void{
var n:int;
var i:int;
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!forwardPlaceholderRequest(popUpRequest, false)){
n = forms.length;
i = 0;
while (i < n) {
if (isRemotePopUp(forms[i])){
if ((((forms[i].window == popUpRequest.data.placeHolderId)) && ((forms[i].bridge == popUpRequest.requestor)))){
forms.splice(i, 1);
break;
};
};
i++;
};
};
}
public function set focusPane(value:Sprite):void{
if (value){
addChild(value);
value.x = 0;
value.y = 0;
value.scrollRect = null;
_focusPane = value;
} else {
removeChild(_focusPane);
_focusPane = null;
};
}
mx_internal function removeParentBridgeListeners():void{
if (((!(topLevel)) && (topLevelSystemManager))){
SystemManager(topLevelSystemManager).removeParentBridgeListeners();
return;
};
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
bridge.removeEventListener(SWFBridgeRequest.SET_ACTUAL_SIZE_REQUEST, setActualSizeRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.GET_SIZE_REQUEST, getSizeRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.ACTIVATE_POP_UP_REQUEST, activateRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.DEACTIVATE_POP_UP_REQUEST, deactivateRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.IS_BRIDGE_CHILD_REQUEST, isBridgeChildHandler);
bridge.removeEventListener(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST, eventListenerRequestHandler);
bridge.removeEventListener(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, canActivateHandler);
bridge.removeEventListener(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING, beforeUnloadHandler);
}
override public function get parent():DisplayObjectContainer{
return (super.parent);
//unresolved jump
var _slot1 = e;
return (null);
}
private function eventListenerRequestHandler(event:Event):void{
var actualType:String;
if ((event is EventListenerRequest)){
return;
};
var request:EventListenerRequest = EventListenerRequest.marshal(event);
if (event.type == EventListenerRequest.ADD_EVENT_LISTENER_REQUEST){
if (!eventProxy){
eventProxy = new EventProxy(this);
};
actualType = EventUtil.sandboxMouseEventMap[request.eventType];
if (actualType){
if (isTopLevelRoot()){
stage.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
} else {
super.addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, (EventPriority.CURSOR_MANAGEMENT + 1), true);
};
addEventListenerToSandboxes(request.eventType, sandboxMouseListener, true, request.priority, request.useWeakReference, (event.target as IEventDispatcher));
addEventListenerToOtherSystemManagers(request.eventType, otherSystemManagerMouseListener, true, request.priority, request.useWeakReference);
if (getSandboxRoot() == this){
if (((isTopLevelRoot()) && ((((actualType == MouseEvent.MOUSE_UP)) || ((actualType == MouseEvent.MOUSE_MOVE)))))){
stage.addEventListener(actualType, eventProxy.marshalListener, false, request.priority, request.useWeakReference);
};
super.addEventListener(actualType, eventProxy.marshalListener, true, request.priority, request.useWeakReference);
};
};
} else {
if (event.type == EventListenerRequest.REMOVE_EVENT_LISTENER_REQUEST){
actualType = EventUtil.sandboxMouseEventMap[request.eventType];
if (actualType){
removeEventListenerFromOtherSystemManagers(request.eventType, otherSystemManagerMouseListener, true);
removeEventListenerFromSandboxes(request.eventType, sandboxMouseListener, true, (event.target as IEventDispatcher));
if (getSandboxRoot() == this){
if (((isTopLevelRoot()) && ((((actualType == MouseEvent.MOUSE_UP)) || ((actualType == MouseEvent.MOUSE_MOVE)))))){
stage.removeEventListener(actualType, eventProxy.marshalListener);
};
super.removeEventListener(actualType, eventProxy.marshalListener, true);
};
};
};
};
}
mx_internal function set applicationIndex(value:int):void{
_applicationIndex = value;
}
private function showMouseCursorRequestHandler(event:Event):void{
var bridge:IEventDispatcher;
if (((!(isTopLevelRoot())) && ((event is SWFBridgeRequest)))){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!isTopLevelRoot()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
Object(event).data = request.data;
} else {
if (eventProxy){
Object(event).data = SystemManagerGlobals.showMouseCursor;
};
};
}
public function get childAllowsParent():Boolean{
return (loaderInfo.childAllowsParent);
//unresolved jump
var _slot1 = error;
return (false);
}
public function dispatchEventFromSWFBridges(event:Event, skip:IEventDispatcher=null, trackClones:Boolean=false, toOtherSystemManagers:Boolean=false):void{
var clone:Event;
if (toOtherSystemManagers){
dispatchEventToOtherSystemManagers(event);
};
if (!swfBridgeGroup){
return;
};
clone = event.clone();
if (trackClones){
currentSandboxEvent = clone;
};
var parentBridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
if ((clone is SWFBridgeRequest)){
SWFBridgeRequest(clone).requestor = parentBridge;
};
parentBridge.dispatchEvent(clone);
};
var children:Array = swfBridgeGroup.getChildBridges();
var i:int;
while (i < children.length) {
if (children[i] != skip){
clone = event.clone();
if (trackClones){
currentSandboxEvent = clone;
};
if ((clone is SWFBridgeRequest)){
SWFBridgeRequest(clone).requestor = IEventDispatcher(children[i]);
};
IEventDispatcher(children[i]).dispatchEvent(clone);
};
i++;
};
currentSandboxEvent = null;
}
private function setActualSizeRequestHandler(event:Event):void{
var eObj:Object = Object(event);
setActualSize(eObj.data.width, eObj.data.height);
}
private function executeCallbacks():void{
var initFunction:Function;
if (((!(parent)) && (parentAllowsChild))){
return;
};
while (initCallbackFunctions.length > 0) {
initFunction = initCallbackFunctions.shift();
initFunction(this);
};
}
private function addPlaceholderId(id:String, previousId:String, bridge:IEventDispatcher, placeholder:Object):void{
if (!bridge){
throw (new Error());
};
if (!idToPlaceholder){
idToPlaceholder = [];
};
idToPlaceholder[id] = new PlaceholderData(previousId, bridge, placeholder);
}
private function canActivateHandler(event:Event):void{
var request:SWFBridgeRequest;
var placeholder:PlaceholderData;
var popUp:RemotePopUp;
var smp:SystemManagerProxy;
var f:IFocusManagerContainer;
var bridge:IEventDispatcher;
var eObj:Object = Object(event);
var child:Object = eObj.data;
var nextId:String;
if ((eObj.data is String)){
placeholder = idToPlaceholder[eObj.data];
child = placeholder.data;
nextId = placeholder.id;
if (nextId == null){
popUp = findRemotePopUp(child, placeholder.bridge);
if (popUp){
request = new SWFBridgeRequest(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, false, false, IEventDispatcher(popUp.bridge), popUp.window);
if (popUp.bridge){
popUp.bridge.dispatchEvent(request);
eObj.data = request.data;
};
return;
};
};
};
if ((child is SystemManagerProxy)){
smp = SystemManagerProxy(child);
f = findFocusManagerContainer(smp);
eObj.data = ((((smp) && (f))) && (canActivateLocalComponent(f)));
} else {
if ((child is IFocusManagerContainer)){
eObj.data = canActivateLocalComponent(child);
} else {
if ((child is IEventDispatcher)){
bridge = IEventDispatcher(child);
request = new SWFBridgeRequest(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, false, false, bridge, nextId);
if (bridge){
bridge.dispatchEvent(request);
eObj.data = request.data;
};
} else {
throw (new Error());
};
};
};
}
private function docFrameListener(event:Event):void{
if (currentFrame == 2){
removeEventListener(Event.ENTER_FRAME, docFrameListener);
if (totalFrames > 2){
addEventListener(Event.ENTER_FRAME, extraFrameListener);
};
docFrameHandler();
};
}
public function get popUpChildren():IChildList{
if (!topLevel){
return (_topLevelSystemManager.popUpChildren);
};
if (!_popUpChildren){
_popUpChildren = new SystemChildrenList(this, new QName(mx_internal, "noTopMostIndex"), new QName(mx_internal, "topMostIndex"));
};
return (_popUpChildren);
}
private function addEventListenerToSandboxes(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false, skip:IEventDispatcher=null):void{
var i:int;
var childBridge:IEventDispatcher;
if (!swfBridgeGroup){
return;
};
var request:EventListenerRequest = new EventListenerRequest(EventListenerRequest.ADD_EVENT_LISTENER_REQUEST, false, false, type, useCapture, priority, useWeakReference);
var parentBridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (((parentBridge) && (!((parentBridge == skip))))){
parentBridge.addEventListener(type, listener, false, priority, useWeakReference);
};
var children:Array = swfBridgeGroup.getChildBridges();
while (i < children.length) {
childBridge = IEventDispatcher(children[i]);
if (childBridge != skip){
childBridge.addEventListener(type, listener, false, priority, useWeakReference);
};
i++;
};
dispatchEventFromSWFBridges(request, skip);
}
private function forwardFormEvent(event:SWFBridgeEvent):Boolean{
var sbRoot:DisplayObject;
if (isTopLevelRoot()){
return (false);
};
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
if (bridge){
sbRoot = getSandboxRoot();
event.data.notifier = bridge;
if (sbRoot == this){
if (!(event.data.window is String)){
event.data.window = NameUtil.displayObjectToString(DisplayObject(event.data.window));
} else {
event.data.window = ((NameUtil.displayObjectToString(DisplayObject(this)) + ".") + event.data.window);
};
bridge.dispatchEvent(event);
} else {
if ((event.data.window is String)){
event.data.window = ((NameUtil.displayObjectToString(DisplayObject(this)) + ".") + event.data.window);
};
sbRoot.dispatchEvent(event);
};
};
return (true);
}
public function set explicitHeight(value:Number):void{
_explicitHeight = value;
}
override public function removeChild(child:DisplayObject):DisplayObject{
noTopMostIndex--;
return (rawChildren_removeChild(child));
}
mx_internal function rawChildren_removeChild(child:DisplayObject):DisplayObject{
removingChild(child);
super.removeChild(child);
childRemoved(child);
return (child);
}
final mx_internal function get $numChildren():int{
return (super.numChildren);
}
public function get toolTipChildren():IChildList{
if (!topLevel){
return (_topLevelSystemManager.toolTipChildren);
};
if (!_toolTipChildren){
_toolTipChildren = new SystemChildrenList(this, new QName(mx_internal, "topMostIndex"), new QName(mx_internal, "toolTipIndex"));
};
return (_toolTipChildren);
}
public function create(... _args):Object{
var url:String;
var dot:int;
var slash:int;
var mainClassName:String = info()["mainClassName"];
if (mainClassName == null){
url = loaderInfo.loaderURL;
dot = url.lastIndexOf(".");
slash = url.lastIndexOf("/");
mainClassName = url.substring((slash + 1), dot);
};
var mainClass:Class = Class(getDefinitionByName(mainClassName));
return ((mainClass) ? new (mainClass) : null);
}
override public function get stage():Stage{
var root:DisplayObject;
if (_stage){
return (_stage);
};
var s:Stage = super.stage;
if (s){
_stage = s;
return (s);
};
if (((!(topLevel)) && (_topLevelSystemManager))){
_stage = _topLevelSystemManager.stage;
return (_stage);
};
if (((!(isStageRoot)) && (topLevel))){
root = getTopLevelRoot();
if (root){
_stage = root.stage;
return (_stage);
};
};
return (null);
}
override public function addChild(child:DisplayObject):DisplayObject{
var addIndex:int = numChildren;
if (child.parent == this){
addIndex--;
};
return (addChildAt(child, addIndex));
}
private function removeRemotePopUp(form:RemotePopUp):void{
var n:int = forms.length;
var i:int;
while (i < n) {
if (isRemotePopUp(forms[i])){
if ((((forms[i].window == form.window)) && ((forms[i].bridge == form.bridge)))){
if (forms[i] == form){
deactivateForm(form);
};
forms.splice(i, 1);
break;
};
};
i++;
};
}
private function deactivateRemotePopUp(form:Object):void{
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.DEACTIVATE_POP_UP_REQUEST, false, false, form.bridge, form.window);
var bridge:Object = form.bridge;
if (bridge){
bridge.dispatchEvent(request);
};
}
override public function getChildIndex(child:DisplayObject):int{
return ((super.getChildIndex(child) - applicationIndex));
}
mx_internal function rawChildren_getChildIndex(child:DisplayObject):int{
return (super.getChildIndex(child));
}
public function activate(f:IFocusManagerContainer):void{
activateForm(f);
}
public function getSandboxRoot():DisplayObject{
var parent:DisplayObject;
var lastParent:DisplayObject;
var loader:Loader;
var loaderInfo:LoaderInfo;
var sm:ISystemManager = this;
if (sm.topLevelSystemManager){
sm = sm.topLevelSystemManager;
};
parent = DisplayObject(sm).parent;
if ((parent is Stage)){
return (DisplayObject(sm));
};
if (((parent) && (!(parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true)))))){
return (this);
};
lastParent = this;
while (parent) {
if ((parent is Stage)){
return (lastParent);
};
if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true))){
return (lastParent);
};
if ((parent is Loader)){
loader = Loader(parent);
loaderInfo = loader.contentLoaderInfo;
if (!loaderInfo.childAllowsParent){
return (loaderInfo.content);
};
};
if (parent.hasEventListener(InterManagerRequest.SYSTEM_MANAGER_REQUEST)){
lastParent = parent;
};
parent = parent.parent;
};
//unresolved jump
var _slot1 = error;
return (((lastParent)!=null) ? lastParent : DisplayObject(sm));
}
private function deferredNextFrame():void{
if ((currentFrame + 1) > totalFrames){
return;
};
if ((currentFrame + 1) <= framesLoaded){
nextFrame();
} else {
nextFrameTimer = new Timer(100);
nextFrameTimer.addEventListener(TimerEvent.TIMER, nextFrameTimerHandler);
nextFrameTimer.start();
};
}
mx_internal function get cursorIndex():int{
return (_cursorIndex);
}
mx_internal function rawChildren_contains(child:DisplayObject):Boolean{
return (super.contains(child));
}
override public function setChildIndex(child:DisplayObject, newIndex:int):void{
super.setChildIndex(child, (applicationIndex + newIndex));
}
public function get document():Object{
return (_document);
}
private function resizeMouseCatcher():void{
var g:Graphics;
var s:Rectangle;
if (mouseCatcher){
g = mouseCatcher.graphics;
s = screen;
g.clear();
g.beginFill(0, 0);
g.drawRect(0, 0, s.width, s.height);
g.endFill();
//unresolved jump
var _slot1 = e;
};
}
private function extraFrameListener(event:Event):void{
if (lastFrame == currentFrame){
return;
};
lastFrame = currentFrame;
if ((currentFrame + 1) > totalFrames){
removeEventListener(Event.ENTER_FRAME, extraFrameListener);
};
extraFrameHandler();
}
private function addPopupRequestHandler(event:Event):void{
var topMost:Boolean;
var children:IChildList;
var bridgeProvider:ISWFBridgeProvider;
var request:SWFBridgeRequest;
if (((!((event.target == this))) && ((event is SWFBridgeRequest)))){
return;
};
var popUpRequest:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (event.target != this){
bridgeProvider = swfBridgeGroup.getChildBridgeProvider(IEventDispatcher(event.target));
if (!SecurityUtil.hasMutualTrustBetweenParentAndChild(bridgeProvider)){
return;
};
};
if (((swfBridgeGroup.parentBridge) && (SecurityUtil.hasMutualTrustBetweenParentAndChild(this)))){
popUpRequest.requestor = swfBridgeGroup.parentBridge;
getSandboxRoot().dispatchEvent(popUpRequest);
return;
};
if (((!(popUpRequest.data.childList)) || ((popUpRequest.data.childList == PopUpManagerChildList.PARENT)))){
topMost = ((popUpRequest.data.parent) && (popUpChildren.contains(popUpRequest.data.parent)));
} else {
topMost = (popUpRequest.data.childList == PopUpManagerChildList.POPUP);
};
children = (topMost) ? popUpChildren : this;
children.addChild(DisplayObject(popUpRequest.data.window));
if (popUpRequest.data.modal){
numModalWindows++;
};
var remoteForm:RemotePopUp = new RemotePopUp(popUpRequest.data.window, popUpRequest.requestor);
forms.push(remoteForm);
if (((!(isTopLevelRoot())) && (swfBridgeGroup))){
request = new SWFBridgeRequest(SWFBridgeRequest.ADD_POP_UP_PLACE_HOLDER_REQUEST, false, false, popUpRequest.requestor, {window:popUpRequest.data.window});
request.data.placeHolderId = NameUtil.displayObjectToString(DisplayObject(popUpRequest.data.window));
dispatchEvent(request);
};
}
override public function get height():Number{
return (_height);
}
mx_internal function rawChildren_getChildAt(index:int):DisplayObject{
return (super.getChildAt(index));
}
private function systemManagerHandler(event:Event):void{
if (event["name"] == "sameSandbox"){
event["value"] = (currentSandboxEvent == event["value"]);
return;
};
if (event["name"] == "hasSWFBridges"){
event["value"] = hasSWFBridges();
return;
};
if ((event is InterManagerRequest)){
return;
};
var name:String = event["name"];
switch (name){
case "popUpChildren.addChild":
popUpChildren.addChild(event["value"]);
break;
case "popUpChildren.removeChild":
popUpChildren.removeChild(event["value"]);
break;
case "cursorChildren.addChild":
cursorChildren.addChild(event["value"]);
break;
case "cursorChildren.removeChild":
cursorChildren.removeChild(event["value"]);
break;
case "toolTipChildren.addChild":
toolTipChildren.addChild(event["value"]);
break;
case "toolTipChildren.removeChild":
toolTipChildren.removeChild(event["value"]);
break;
case "screen":
event["value"] = screen;
break;
case "application":
event["value"] = application;
break;
case "isTopLevelRoot":
event["value"] = isTopLevelRoot();
break;
case "getVisibleApplicationRect":
event["value"] = getVisibleApplicationRect();
break;
case "bringToFront":
if (event["value"].topMost){
popUpChildren.setChildIndex(DisplayObject(event["value"].popUp), (popUpChildren.numChildren - 1));
} else {
setChildIndex(DisplayObject(event["value"].popUp), (numChildren - 1));
};
break;
};
}
private function activateRemotePopUp(form:Object):void{
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.ACTIVATE_POP_UP_REQUEST, false, false, form.bridge, form.window);
var bridge:Object = form.bridge;
if (bridge){
bridge.dispatchEvent(request);
};
}
mx_internal function set noTopMostIndex(value:int):void{
var delta:int = (value - _noTopMostIndex);
_noTopMostIndex = value;
topMostIndex = (topMostIndex + delta);
}
override public function getObjectsUnderPoint(point:Point):Array{
var child:DisplayObject;
var temp:Array;
var children:Array = [];
var n:int = topMostIndex;
var i:int;
while (i < n) {
child = super.getChildAt(i);
if ((child is DisplayObjectContainer)){
temp = DisplayObjectContainer(child).getObjectsUnderPoint(point);
if (temp){
children = children.concat(temp);
};
};
i++;
};
return (children);
}
mx_internal function get topMostIndex():int{
return (_topMostIndex);
}
mx_internal function regenerateStyleCache(recursive:Boolean):void{
var child:IStyleClient;
var foundTopLevelWindow:Boolean;
var n:int = rawChildren.numChildren;
var i:int;
while (i < n) {
child = (rawChildren.getChildAt(i) as IStyleClient);
if (child){
child.regenerateStyleCache(recursive);
};
if (isTopLevelWindow(DisplayObject(child))){
foundTopLevelWindow = true;
};
n = rawChildren.numChildren;
i++;
};
if (((!(foundTopLevelWindow)) && ((topLevelWindow is IStyleClient)))){
IStyleClient(topLevelWindow).regenerateStyleCache(recursive);
};
}
public function addFocusManager(f:IFocusManagerContainer):void{
forms.push(f);
}
private function deactivateFormSandboxEventHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var bridgeEvent:SWFBridgeEvent = SWFBridgeEvent.marshal(event);
if (!forwardFormEvent(bridgeEvent)){
if (((((isRemotePopUp(form)) && ((RemotePopUp(form).window == bridgeEvent.data.window)))) && ((RemotePopUp(form).bridge == bridgeEvent.data.notifier)))){
deactivateForm(form);
};
};
}
public function set swfBridgeGroup(bridgeGroup:ISWFBridgeGroup):void{
if (topLevel){
_swfBridgeGroup = bridgeGroup;
} else {
if (topLevelSystemManager){
SystemManager(topLevelSystemManager).swfBridgeGroup = bridgeGroup;
};
};
}
mx_internal function rawChildren_setChildIndex(child:DisplayObject, newIndex:int):void{
super.setChildIndex(child, newIndex);
}
private function mouseUpHandler(event:MouseEvent):void{
idleCounter = 0;
}
mx_internal function childAdded(child:DisplayObject):void{
child.dispatchEvent(new FlexEvent(FlexEvent.ADD));
if ((child is IUIComponent)){
IUIComponent(child).initialize();
};
}
public function isFontFaceEmbedded(textFormat:TextFormat):Boolean{
var font:Font;
var style:String;
var fontName:String = textFormat.font;
var fl:Array = Font.enumerateFonts();
var f:int;
while (f < fl.length) {
font = Font(fl[f]);
if (font.fontName == fontName){
style = "regular";
if (((textFormat.bold) && (textFormat.italic))){
style = "boldItalic";
} else {
if (textFormat.bold){
style = "bold";
} else {
if (textFormat.italic){
style = "italic";
};
};
};
if (font.fontStyle == style){
return (true);
};
};
f++;
};
if (((((!(fontName)) || (!(embeddedFontList)))) || (!(embeddedFontList[fontName])))){
return (false);
};
var info:Object = embeddedFontList[fontName];
return (!(((((((textFormat.bold) && (!(info.bold)))) || (((textFormat.italic) && (!(info.italic)))))) || (((((!(textFormat.bold)) && (!(textFormat.italic)))) && (!(info.regular)))))));
}
private function forwardPlaceholderRequest(request:SWFBridgeRequest, addPlaceholder:Boolean):Boolean{
if (isTopLevelRoot()){
return (false);
};
var refObj:Object;
var oldId:String;
if (request.data.window){
refObj = request.data.window;
request.data.window = null;
} else {
refObj = request.requestor;
oldId = request.data.placeHolderId;
request.data.placeHolderId = ((NameUtil.displayObjectToString(this) + ".") + request.data.placeHolderId);
};
if (addPlaceholder){
addPlaceholderId(request.data.placeHolderId, oldId, request.requestor, refObj);
} else {
removePlaceholderId(request.data.placeHolderId);
};
var sbRoot:DisplayObject = getSandboxRoot();
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
request.requestor = bridge;
if (sbRoot == this){
bridge.dispatchEvent(request);
} else {
sbRoot.dispatchEvent(request);
};
return (true);
}
public function getTopLevelRoot():DisplayObject{
var sm:ISystemManager;
var parent:DisplayObject;
var lastParent:DisplayObject;
sm = this;
if (sm.topLevelSystemManager){
sm = sm.topLevelSystemManager;
};
parent = DisplayObject(sm).parent;
lastParent = parent;
while (parent) {
if ((parent is Stage)){
return (lastParent);
};
lastParent = parent;
parent = parent.parent;
};
//unresolved jump
var _slot1 = error;
return (null);
}
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
var actualType:String;
var type = type;
var listener = listener;
var useCapture = useCapture;
if ((((type == FlexEvent.RENDER)) || ((type == FlexEvent.ENTER_FRAME)))){
if (type == FlexEvent.RENDER){
type = Event.RENDER;
} else {
type = Event.ENTER_FRAME;
};
if (stage){
stage.removeEventListener(type, listener, useCapture);
};
//unresolved jump
var _slot1 = error;
super.removeEventListener(type, listener, useCapture);
return;
};
if (((hasSWFBridges()) || ((SystemManagerGlobals.topLevelSystemManagers.length > 1)))){
actualType = EventUtil.sandboxMouseEventMap[type];
if (actualType){
if ((((getSandboxRoot() == this)) && (eventProxy))){
super.removeEventListener(actualType, eventProxy.marshalListener, useCapture);
if (actualType == MouseEvent.MOUSE_UP){
if (stage){
stage.removeEventListener(Event.MOUSE_LEAVE, eventProxy.marshalListener, useCapture);
};
//unresolved jump
var _slot1 = e;
super.removeEventListener(Event.MOUSE_LEAVE, eventProxy.marshalListener, useCapture);
};
};
if (!SystemManagerGlobals.changingListenersInOtherSystemManagers){
removeEventListenerFromOtherSystemManagers(type, otherSystemManagerMouseListener, useCapture);
};
removeEventListenerFromSandboxes(type, sandboxMouseListener, useCapture);
super.removeEventListener(type, listener, false);
return;
};
};
if (type == FlexEvent.IDLE){
super.removeEventListener(type, listener, useCapture);
if (((!(hasEventListener(FlexEvent.IDLE))) && (idleTimer))){
idleTimer.stop();
idleTimer = null;
removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
};
} else {
super.removeEventListener(type, listener, useCapture);
};
if ((((((((((type == MouseEvent.MOUSE_MOVE)) || ((type == MouseEvent.MOUSE_UP)))) || ((type == MouseEvent.MOUSE_DOWN)))) || ((type == Event.ACTIVATE)))) || ((type == Event.DEACTIVATE)))){
if (!hasEventListener(type)){
if (stage){
stage.removeEventListener(type, stageEventHandler, false);
};
//unresolved jump
var _slot1 = error;
};
};
if (type == SandboxMouseEvent.MOUSE_UP_SOMEWHERE){
if (!hasEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE)){
if (stage){
stage.removeEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler);
};
//unresolved jump
var _slot1 = error;
super.removeEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler);
};
};
}
private function extraFrameHandler(event:Event=null):void{
var c:Class;
var frameList:Object = info()["frames"];
if (((frameList) && (frameList[currentLabel]))){
c = Class(getDefinitionByName(frameList[currentLabel]));
var _local4 = c;
_local4["frame"](this);
};
deferredNextFrame();
}
public function isTopLevelRoot():Boolean{
return (((isStageRoot) || (isBootstrapRoot)));
}
public function get application():IUIComponent{
return (IUIComponent(_document));
}
override public function removeChildAt(index:int):DisplayObject{
noTopMostIndex--;
return (rawChildren_removeChildAt((applicationIndex + index)));
}
mx_internal function rawChildren_removeChildAt(index:int):DisplayObject{
var child:DisplayObject = super.getChildAt(index);
removingChild(child);
super.removeChildAt(index);
childRemoved(child);
return (child);
}
private function getSWFBridgeOfDisplayObject(displayObject:DisplayObject):IEventDispatcher{
var request:SWFBridgeRequest;
var children:Array;
var n:int;
var i:int;
var childBridge:IEventDispatcher;
var bp:ISWFBridgeProvider;
if (swfBridgeGroup){
request = new SWFBridgeRequest(SWFBridgeRequest.IS_BRIDGE_CHILD_REQUEST, false, false, null, displayObject);
children = swfBridgeGroup.getChildBridges();
n = children.length;
i = 0;
while (i < n) {
childBridge = IEventDispatcher(children[i]);
bp = swfBridgeGroup.getChildBridgeProvider(childBridge);
if (SecurityUtil.hasMutualTrustBetweenParentAndChild(bp)){
childBridge.dispatchEvent(request);
if (request.data == true){
return (childBridge);
};
request.data = displayObject;
};
i++;
};
};
return (null);
}
private function deactivateRequestHandler(event:Event):void{
var placeholder:PlaceholderData;
var popUp:RemotePopUp;
var smp:SystemManagerProxy;
var f:IFocusManagerContainer;
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
var child:Object = request.data;
var nextId:String;
if ((request.data is String)){
placeholder = idToPlaceholder[request.data];
child = placeholder.data;
nextId = placeholder.id;
if (nextId == null){
popUp = findRemotePopUp(child, placeholder.bridge);
if (popUp){
deactivateRemotePopUp(popUp);
return;
};
};
};
if ((child is SystemManagerProxy)){
smp = SystemManagerProxy(child);
f = findFocusManagerContainer(smp);
if (((smp) && (f))){
smp.deactivateByProxy(f);
};
} else {
if ((child is IFocusManagerContainer)){
IFocusManagerContainer(child).focusManager.deactivate();
} else {
if ((child is IEventDispatcher)){
request.data = nextId;
request.requestor = IEventDispatcher(child);
IEventDispatcher(child).dispatchEvent(request);
return;
};
throw (new Error());
};
};
}
private function installCompiledResourceBundles():void{
var info:Object = this.info();
var applicationDomain:ApplicationDomain = (((!(topLevel)) && ((parent is Loader)))) ? Loader(parent).contentLoaderInfo.applicationDomain : info["currentDomain"];
var compiledLocales:Array = info["compiledLocales"];
var compiledResourceBundleNames:Array = info["compiledResourceBundleNames"];
var resourceManager:IResourceManager = ResourceManager.getInstance();
resourceManager.installCompiledResourceBundles(applicationDomain, compiledLocales, compiledResourceBundleNames);
if (!resourceManager.localeChain){
resourceManager.initializeLocaleChain(compiledLocales);
};
}
private function deactivateForm(f:Object):void{
if (form){
if ((((form == f)) && ((forms.length > 1)))){
if (isRemotePopUp(form)){
deactivateRemotePopUp(form);
} else {
form.focusManager.deactivate();
};
form = findLastActiveForm(f);
if (form){
if (isRemotePopUp(form)){
activateRemotePopUp(form);
} else {
form.focusManager.activate();
};
};
};
};
}
private function unloadHandler(event:Event):void{
dispatchEvent(event);
}
mx_internal function removingChild(child:DisplayObject):void{
child.dispatchEvent(new FlexEvent(FlexEvent.REMOVE));
}
mx_internal function get applicationIndex():int{
return (_applicationIndex);
}
mx_internal function set toolTipIndex(value:int):void{
var delta:int = (value - _toolTipIndex);
_toolTipIndex = value;
cursorIndex = (cursorIndex + delta);
}
private function hasSWFBridges():Boolean{
if (swfBridgeGroup){
return (true);
};
return (false);
}
private function updateLastActiveForm():void{
var n:int = forms.length;
if (n < 2){
return;
};
var index = -1;
var i:int;
while (i < n) {
if (areFormsEqual(form, forms[i])){
index = i;
break;
};
i++;
};
if (index >= 0){
forms.splice(index, 1);
forms.push(form);
};
}
mx_internal function set bridgeToFocusManager(bridgeToFMDictionary:Dictionary):void{
if (topLevel){
_bridgeToFocusManager = bridgeToFMDictionary;
} else {
if (topLevelSystemManager){
SystemManager(topLevelSystemManager).bridgeToFocusManager = bridgeToFMDictionary;
};
};
}
public function get cursorChildren():IChildList{
if (!topLevel){
return (_topLevelSystemManager.cursorChildren);
};
if (!_cursorChildren){
_cursorChildren = new SystemChildrenList(this, new QName(mx_internal, "toolTipIndex"), new QName(mx_internal, "cursorIndex"));
};
return (_cursorChildren);
}
private function sandboxMouseListener(event:Event):void{
if ((event is SandboxMouseEvent)){
return;
};
var marshaledEvent:Event = SandboxMouseEvent.marshal(event);
dispatchEventFromSWFBridges(marshaledEvent, (event.target as IEventDispatcher));
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = "sameSandbox";
me.value = event;
getSandboxRoot().dispatchEvent(me);
if (!me.value){
dispatchEvent(marshaledEvent);
};
}
public function get preloaderBackgroundImage():Object{
return (info()["backgroundImage"]);
}
public function set numModalWindows(value:int):void{
_numModalWindows = value;
}
public function get preloaderBackgroundAlpha():Number{
return (info()["backgroundAlpha"]);
}
mx_internal function rawChildren_getChildByName(name:String):DisplayObject{
return (super.getChildByName(name));
}
private function dispatchInvalidateRequest():void{
var bridge:IEventDispatcher = swfBridgeGroup.parentBridge;
var request:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.INVALIDATE_REQUEST, false, false, bridge, (InvalidateRequestData.SIZE | InvalidateRequestData.DISPLAY_LIST));
bridge.dispatchEvent(request);
}
public function allowDomain(... _args):void{
}
public function get preloaderBackgroundColor():uint{
var value:* = info()["backgroundColor"];
if (value == undefined){
return (StyleManager.NOT_A_COLOR);
};
return (StyleManager.getColorName(value));
}
public function getVisibleApplicationRect(bounds:Rectangle=null):Rectangle{
var s:Rectangle;
var pt:Point;
var bridge:IEventDispatcher;
var request:SWFBridgeRequest;
if (!bounds){
bounds = getBounds(DisplayObject(this));
s = screen;
pt = new Point(Math.max(0, bounds.x), Math.max(0, bounds.y));
pt = localToGlobal(pt);
bounds.x = pt.x;
bounds.y = pt.y;
bounds.width = s.width;
bounds.height = s.height;
};
if (useSWFBridge()){
bridge = swfBridgeGroup.parentBridge;
request = new SWFBridgeRequest(SWFBridgeRequest.GET_VISIBLE_RECT_REQUEST, false, false, bridge, bounds);
bridge.dispatchEvent(request);
bounds = Rectangle(request.data);
};
return (bounds);
}
public function get topLevelSystemManager():ISystemManager{
if (topLevel){
return (this);
};
return (_topLevelSystemManager);
}
private function appCreationCompleteHandler(event:FlexEvent):void{
var obj:DisplayObjectContainer;
if (((!(topLevel)) && (parent))){
obj = parent.parent;
while (obj) {
if ((obj is IInvalidating)){
IInvalidating(obj).invalidateSize();
IInvalidating(obj).invalidateDisplayList();
return;
};
obj = obj.parent;
};
};
if (((topLevel) && (useSWFBridge()))){
dispatchInvalidateRequest();
};
}
public function addChildToSandboxRoot(layer:String, child:DisplayObject):void{
var me:InterManagerRequest;
if (getSandboxRoot() == this){
this[layer].addChild(child);
} else {
addingChild(child);
me = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = (layer + ".addChild");
me.value = child;
getSandboxRoot().dispatchEvent(me);
childAdded(child);
};
}
private function dispatchDeactivatedWindowEvent(window:DisplayObject):void{
var sbRoot:DisplayObject;
var sendToSbRoot:Boolean;
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (swfBridgeGroup) ? swfBridgeGroup.parentBridge : null;
if (bridge){
sbRoot = getSandboxRoot();
sendToSbRoot = !((sbRoot == this));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, false, false, {notifier:bridge, window:(sendToSbRoot) ? window : NameUtil.displayObjectToString(window)});
if (sendToSbRoot){
sbRoot.dispatchEvent(bridgeEvent);
} else {
bridge.dispatchEvent(bridgeEvent);
};
};
}
private function isBridgeChildHandler(event:Event):void{
if ((event is SWFBridgeRequest)){
return;
};
var eObj:Object = Object(event);
eObj.data = ((eObj.data) && (rawChildren.contains((eObj.data as DisplayObject))));
}
public function get measuredHeight():Number{
return ((topLevelWindow) ? topLevelWindow.getExplicitOrMeasuredHeight() : loaderInfo.height);
}
private function activateRequestHandler(event:Event):void{
var placeholder:PlaceholderData;
var popUp:RemotePopUp;
var smp:SystemManagerProxy;
var f:IFocusManagerContainer;
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
var child:Object = request.data;
var nextId:String;
if ((request.data is String)){
placeholder = idToPlaceholder[request.data];
child = placeholder.data;
nextId = placeholder.id;
if (nextId == null){
popUp = findRemotePopUp(child, placeholder.bridge);
if (popUp){
activateRemotePopUp(popUp);
return;
};
};
};
if ((child is SystemManagerProxy)){
smp = SystemManagerProxy(child);
f = findFocusManagerContainer(smp);
if (((smp) && (f))){
smp.activateByProxy(f);
};
} else {
if ((child is IFocusManagerContainer)){
IFocusManagerContainer(child).focusManager.activate();
} else {
if ((child is IEventDispatcher)){
request.data = nextId;
request.requestor = IEventDispatcher(child);
IEventDispatcher(child).dispatchEvent(request);
} else {
throw (new Error());
};
};
};
}
mx_internal function rawChildren_addChildAt(child:DisplayObject, index:int):DisplayObject{
addingChild(child);
super.addChildAt(child, index);
childAdded(child);
return (child);
}
mx_internal function initialize():void{
var n:int;
var i:int;
var fontRegistry:EmbeddedFontRegistry;
var crossDomainRSLItem:Class;
var cdNode:Object;
var node:RSLItem;
if (isStageRoot){
_width = stage.stageWidth;
_height = stage.stageHeight;
} else {
_width = loaderInfo.width;
_height = loaderInfo.height;
};
preloader = new Preloader();
preloader.addEventListener(FlexEvent.INIT_PROGRESS, preloader_initProgressHandler);
preloader.addEventListener(FlexEvent.PRELOADER_DONE, preloader_preloaderDoneHandler);
preloader.addEventListener(RSLEvent.RSL_COMPLETE, preloader_rslCompleteHandler);
if (!_popUpChildren){
_popUpChildren = new SystemChildrenList(this, new QName(mx_internal, "noTopMostIndex"), new QName(mx_internal, "topMostIndex"));
};
_popUpChildren.addChild(preloader);
var rsls:Array = info()["rsls"];
var cdRsls:Array = info()["cdRsls"];
var usePreloader:Boolean;
if (info()["usePreloader"] != undefined){
usePreloader = info()["usePreloader"];
};
var preloaderDisplayClass:Class = (info()["preloader"] as Class);
if (((usePreloader) && (!(preloaderDisplayClass)))){
preloaderDisplayClass = DownloadProgressBar;
};
var rslList:Array = [];
if (((cdRsls) && ((cdRsls.length > 0)))){
crossDomainRSLItem = Class(getDefinitionByName("mx.core::CrossDomainRSLItem"));
n = cdRsls.length;
i = 0;
while (i < n) {
cdNode = new crossDomainRSLItem(cdRsls[i]["rsls"], cdRsls[i]["policyFiles"], cdRsls[i]["digests"], cdRsls[i]["types"], cdRsls[i]["isSigned"], LoaderUtil.normalizeURL(this.loaderInfo));
rslList.push(cdNode);
i++;
};
};
if (((!((rsls == null))) && ((rsls.length > 0)))){
n = rsls.length;
i = 0;
while (i < n) {
node = new RSLItem(rsls[i].url, LoaderUtil.normalizeURL(this.loaderInfo));
rslList.push(node);
i++;
};
};
Singleton.registerClass("mx.resources::IResourceManager", Class(getDefinitionByName("mx.resources::ResourceManagerImpl")));
var resourceManager:IResourceManager = ResourceManager.getInstance();
Singleton.registerClass("mx.core::IEmbeddedFontRegistry", Class(getDefinitionByName("mx.core::EmbeddedFontRegistry")));
Singleton.registerClass("mx.styles::IStyleManager", Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
Singleton.registerClass("mx.styles::IStyleManager2", Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
var localeChainList:String = loaderInfo.parameters["localeChain"];
if (((!((localeChainList == null))) && (!((localeChainList == ""))))){
resourceManager.localeChain = localeChainList.split(",");
};
var resourceModuleURLList:String = loaderInfo.parameters["resourceModuleURLs"];
var resourceModuleURLs:Array = (resourceModuleURLList) ? resourceModuleURLList.split(",") : null;
preloader.initialize(usePreloader, preloaderDisplayClass, preloaderBackgroundColor, preloaderBackgroundAlpha, preloaderBackgroundImage, preloaderBackgroundSize, (isStageRoot) ? stage.stageWidth : loaderInfo.width, (isStageRoot) ? stage.stageHeight : loaderInfo.height, null, null, rslList, resourceModuleURLs);
}
public function useSWFBridge():Boolean{
if (isStageRoot){
return (false);
};
if (((!(topLevel)) && (topLevelSystemManager))){
return (topLevelSystemManager.useSWFBridge());
};
var sbRoot:DisplayObject = getSandboxRoot();
if (((topLevel) && (!((sbRoot == this))))){
return (true);
};
if (sbRoot == this){
root.loaderInfo.parentAllowsChild;
if (((parentAllowsChild) && (childAllowsParent))){
if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isStageRoot", false, true))){
return (true);
};
//unresolved jump
var _slot1 = e;
} else {
return (true);
};
//unresolved jump
var _slot1 = e1;
return (false);
};
return (false);
}
mx_internal function childRemoved(child:DisplayObject):void{
if ((child is IUIComponent)){
IUIComponent(child).parentChanged(null);
};
}
final mx_internal function $removeChildAt(index:int):DisplayObject{
return (super.removeChildAt(index));
}
private function canActivatePopUp(f:Object):Boolean{
var remotePopUp:RemotePopUp;
var event:SWFBridgeRequest;
if (isRemotePopUp(f)){
remotePopUp = RemotePopUp(f);
event = new SWFBridgeRequest(SWFBridgeRequest.CAN_ACTIVATE_POP_UP_REQUEST, false, false, null, remotePopUp.window);
IEventDispatcher(remotePopUp.bridge).dispatchEvent(event);
return (event.data);
};
if (canActivateLocalComponent(f)){
return (true);
};
return (false);
}
mx_internal function get noTopMostIndex():int{
return (_noTopMostIndex);
}
override public function get numChildren():int{
return ((noTopMostIndex - applicationIndex));
}
private function canActivateLocalComponent(o:Object):Boolean{
if ((((((((o is Sprite)) && ((o is IUIComponent)))) && (Sprite(o).visible))) && (IUIComponent(o).enabled))){
return (true);
};
return (false);
}
private function preloader_preloaderDoneHandler(event:Event):void{
var app:IUIComponent = topLevelWindow;
preloader.removeEventListener(FlexEvent.PRELOADER_DONE, preloader_preloaderDoneHandler);
preloader.removeEventListener(RSLEvent.RSL_COMPLETE, preloader_rslCompleteHandler);
_popUpChildren.removeChild(preloader);
preloader = null;
mouseCatcher = new FlexSprite();
mouseCatcher.name = "mouseCatcher";
noTopMostIndex++;
super.addChildAt(mouseCatcher, 0);
resizeMouseCatcher();
if (!topLevel){
mouseCatcher.visible = false;
mask = mouseCatcher;
};
noTopMostIndex++;
super.addChildAt(DisplayObject(app), 1);
app.dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
}
private function initializeTopLevelWindow(event:Event):void{
var app:IUIComponent;
var obj:DisplayObjectContainer;
var sm:ISystemManager;
var sandboxRoot:DisplayObject;
initialized = true;
if (((!(parent)) && (parentAllowsChild))){
return;
};
if (!topLevel){
if (!parent){
return;
};
obj = parent.parent;
if (!obj){
return;
};
while (obj) {
if ((obj is IUIComponent)){
sm = IUIComponent(obj).systemManager;
if (((sm) && (!(sm.isTopLevel())))){
sm = sm.topLevelSystemManager;
};
_topLevelSystemManager = sm;
break;
};
obj = obj.parent;
};
};
if (((isTopLevelRoot()) || ((getSandboxRoot() == this)))){
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, true);
};
if (((isTopLevelRoot()) && (stage))){
stage.addEventListener(Event.RESIZE, Stage_resizeHandler, false, 0, true);
} else {
if (((topLevel) && (stage))){
sandboxRoot = getSandboxRoot();
if (sandboxRoot != this){
sandboxRoot.addEventListener(Event.RESIZE, Stage_resizeHandler, false, 0, true);
};
};
};
app = (topLevelWindow = IUIComponent(create()));
document = app;
if (document){
IEventDispatcher(app).addEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
if (!LoaderConfig._url){
LoaderConfig._url = loaderInfo.url;
LoaderConfig._parameters = loaderInfo.parameters;
LoaderConfig._swfVersion = loaderInfo.swfVersion;
};
if (((isStageRoot) && (stage))){
_width = stage.stageWidth;
_height = stage.stageHeight;
IFlexDisplayObject(app).setActualSize(_width, _height);
} else {
IFlexDisplayObject(app).setActualSize(loaderInfo.width, loaderInfo.height);
};
if (preloader){
preloader.registerApplication(app);
};
addingChild(DisplayObject(app));
childAdded(DisplayObject(app));
} else {
document = this;
};
}
final mx_internal function $addChildAt(child:DisplayObject, index:int):DisplayObject{
return (super.addChildAt(child, index));
}
private function stageEventHandler(event:Event):void{
if ((((event.target is Stage)) && (mouseCatcher))){
mouseCatcher.dispatchEvent(event);
};
}
private function nextFrameTimerHandler(event:TimerEvent):void{
if ((currentFrame + 1) <= framesLoaded){
nextFrame();
nextFrameTimer.removeEventListener(TimerEvent.TIMER, nextFrameTimerHandler);
nextFrameTimer.reset();
};
}
mx_internal function get bridgeToFocusManager():Dictionary{
if (topLevel){
return (_bridgeToFocusManager);
};
if (topLevelSystemManager){
return (SystemManager(topLevelSystemManager).bridgeToFocusManager);
};
return (null);
}
public function get numModalWindows():int{
return (_numModalWindows);
}
private function areFormsEqual(form1:Object, form2:Object):Boolean{
if (form1 == form2){
return (true);
};
if ((((form1 is RemotePopUp)) && ((form2 is RemotePopUp)))){
return (areRemotePopUpsEqual(form1, form2));
};
return (false);
}
public function isTopLevelWindow(object:DisplayObject):Boolean{
return ((((object is IUIComponent)) && ((IUIComponent(object) == topLevelWindow))));
}
private function removePlaceholderId(id:String):void{
delete idToPlaceholder[id];
}
mx_internal function dispatchActivatedWindowEvent(window:DisplayObject):void{
var sbRoot:DisplayObject;
var sendToSbRoot:Boolean;
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (swfBridgeGroup) ? swfBridgeGroup.parentBridge : null;
if (bridge){
sbRoot = getSandboxRoot();
sendToSbRoot = !((sbRoot == this));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, false, false, {notifier:bridge, window:(sendToSbRoot) ? window : NameUtil.displayObjectToString(window)});
if (sendToSbRoot){
sbRoot.dispatchEvent(bridgeEvent);
} else {
bridge.dispatchEvent(bridgeEvent);
};
};
}
override public function get width():Number{
return (_width);
}
private function dispatchActivatedApplicationEvent():void{
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (swfBridgeGroup) ? swfBridgeGroup.parentBridge : null;
if (bridge){
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_APPLICATION_ACTIVATE, false, false);
bridge.dispatchEvent(bridgeEvent);
};
}
private function otherSystemManagerMouseListener(event:SandboxMouseEvent):void{
if (SystemManagerGlobals.dispatchingEventToOtherSystemManagers){
return;
};
dispatchEventFromSWFBridges(event);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
me.name = "sameSandbox";
me.value = event;
getSandboxRoot().dispatchEvent(me);
if (!me.value){
dispatchEvent(event);
};
}
private function hideMouseCursorRequestHandler(event:Event):void{
var bridge:IEventDispatcher;
if (((!(isTopLevelRoot())) && ((event is SWFBridgeRequest)))){
return;
};
var request:SWFBridgeRequest = SWFBridgeRequest.marshal(event);
if (!isTopLevelRoot()){
bridge = swfBridgeGroup.parentBridge;
request.requestor = bridge;
bridge.dispatchEvent(request);
} else {
if (eventProxy){
SystemManagerGlobals.showMouseCursor = false;
};
};
}
private function getTopLevelSystemManager(parent:DisplayObject):ISystemManager{
var sm:ISystemManager;
var localRoot:DisplayObjectContainer = DisplayObjectContainer(parent.root);
if (((((!(localRoot)) || ((localRoot is Stage)))) && ((parent is IUIComponent)))){
localRoot = DisplayObjectContainer(IUIComponent(parent).systemManager);
};
if ((localRoot is ISystemManager)){
sm = ISystemManager(localRoot);
if (!sm.isTopLevel()){
sm = sm.topLevelSystemManager;
};
};
return (sm);
}
public function isDisplayObjectInABridgedApplication(displayObject:DisplayObject):Boolean{
return (!((getSWFBridgeOfDisplayObject(displayObject) == null)));
}
public function move(x:Number, y:Number):void{
}
public function set explicitWidth(value:Number):void{
_explicitWidth = value;
}
public function get parentAllowsChild():Boolean{
return (loaderInfo.parentAllowsChild);
//unresolved jump
var _slot1 = error;
return (false);
}
private function preloader_initProgressHandler(event:Event):void{
preloader.removeEventListener(FlexEvent.INIT_PROGRESS, preloader_initProgressHandler);
deferredNextFrame();
}
private function mouseLeaveHandler(event:Event):void{
dispatchEvent(new SandboxMouseEvent(SandboxMouseEvent.MOUSE_UP_SOMEWHERE));
}
public function get explicitWidth():Number{
return (_explicitWidth);
}
private function activateFormSandboxEventHandler(event:Event):void{
var bridgeEvent:SWFBridgeEvent = SWFBridgeEvent.marshal(event);
if (!forwardFormEvent(bridgeEvent)){
activateForm(new RemotePopUp(bridgeEvent.data.window, bridgeEvent.data.notifier));
};
}
mx_internal function rawChildren_addChild(child:DisplayObject):DisplayObject{
addingChild(child);
super.addChild(child);
childAdded(child);
return (child);
}
public static function getSWFRoot(object:Object):DisplayObject{
var p:*;
var sm:ISystemManager;
var domain:ApplicationDomain;
var cls:Class;
var object = object;
var className:String = getQualifiedClassName(object);
for (p in allSystemManagers) {
sm = (p as ISystemManager);
domain = sm.loaderInfo.applicationDomain;
cls = Class(domain.getDefinition(className));
if ((object is cls)){
return ((sm as DisplayObject));
};
//unresolved jump
var _slot1 = e;
};
return (null);
}
private static function areRemotePopUpsEqual(form1:Object, form2:Object):Boolean{
if (!(form1 is RemotePopUp)){
return (false);
};
if (!(form2 is RemotePopUp)){
return (false);
};
var remotePopUp1:RemotePopUp = RemotePopUp(form1);
var remotePopUp2:RemotePopUp = RemotePopUp(form2);
if ((((((remotePopUp1.window == remotePopUp2.window)) && (remotePopUp1.bridge))) && (remotePopUp2.bridge))){
return (true);
};
return (false);
}
private static function getChildListIndex(childList:IChildList, f:Object):int{
var childList = childList;
var f = f;
var index = -1;
index = childList.getChildIndex(DisplayObject(f));
//unresolved jump
var _slot1 = e;
return (index);
}
mx_internal static function registerInitCallback(initFunction:Function):void{
if (((!(allSystemManagers)) || (!(lastSystemManager)))){
return;
};
var sm:SystemManager = lastSystemManager;
if (sm.doneExecutingInitCallbacks){
initFunction(sm);
} else {
sm.initCallbackFunctions.push(initFunction);
};
}
private static function isRemotePopUp(form:Object):Boolean{
return (!((form is IFocusManagerContainer)));
}
}
}//package mx.managers
Section 161
//SystemManagerGlobals (mx.managers.SystemManagerGlobals)
package mx.managers {
public class SystemManagerGlobals {
public static var topLevelSystemManagers:Array = [];
public static var changingListenersInOtherSystemManagers:Boolean;
public static var bootstrapLoaderInfoURL:String;
public static var showMouseCursor:Boolean;
public static var dispatchingEventToOtherSystemManagers:Boolean;
public function SystemManagerGlobals(){
super();
}
}
}//package mx.managers
Section 162
//SystemManagerProxy (mx.managers.SystemManagerProxy)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import mx.events.*;
import mx.utils.*;
public class SystemManagerProxy extends SystemManager {
private var _systemManager:ISystemManager;
mx_internal static const VERSION:String = "3.5.0.12683";
public function SystemManagerProxy(systemManager:ISystemManager){
super();
_systemManager = systemManager;
topLevel = true;
super.addEventListener(MouseEvent.MOUSE_DOWN, proxyMouseDownHandler, true);
}
override public function create(... _args):Object{
return (IFlexModuleFactory(_systemManager).create.apply(this, _args));
}
public function get systemManager():ISystemManager{
return (_systemManager);
}
override public function activate(f:IFocusManagerContainer):void{
var mutualTrust:Boolean;
var bridgeEvent:SWFBridgeEvent;
var bridge:IEventDispatcher = (_systemManager.swfBridgeGroup) ? _systemManager.swfBridgeGroup.parentBridge : null;
if (bridge){
mutualTrust = SecurityUtil.hasMutualTrustBetweenParentAndChild(ISWFBridgeProvider(_systemManager));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE, false, false, {notifier:bridge, window:(mutualTrust) ? this : NameUtil.displayObjectToString(this)});
_systemManager.getSandboxRoot().dispatchEvent(bridgeEvent);
};
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
_systemManager.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public function deactivateByProxy(f:IFocusManagerContainer):void{
if (f){
f.focusManager.deactivate();
};
}
override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
super.removeEventListener(type, listener, useCapture);
_systemManager.removeEventListener(type, listener, useCapture);
}
override public function get document():Object{
return (findFocusManagerContainer(this));
}
public function activateByProxy(f:IFocusManagerContainer):void{
super.activate(f);
}
override public function removeChildBridge(bridge:IEventDispatcher):void{
_systemManager.removeChildBridge(bridge);
}
override public function get swfBridgeGroup():ISWFBridgeGroup{
return (_systemManager.swfBridgeGroup);
}
override public function addChildBridge(bridge:IEventDispatcher, owner:DisplayObject):void{
_systemManager.addChildBridge(bridge, owner);
}
override public function useSWFBridge():Boolean{
return (_systemManager.useSWFBridge());
}
override public function get screen():Rectangle{
return (_systemManager.screen);
}
override public function set swfBridgeGroup(bridgeGroup:ISWFBridgeGroup):void{
}
private function proxyMouseDownHandler(event:MouseEvent):void{
if (findFocusManagerContainer(this)){
SystemManager(_systemManager).dispatchActivatedWindowEvent(this);
};
}
override public function deactivate(f:IFocusManagerContainer):void{
var mutualTrust:Boolean;
var bridgeEvent:SWFBridgeEvent;
var sm:ISystemManager = _systemManager;
var bridge:IEventDispatcher = (sm.swfBridgeGroup) ? sm.swfBridgeGroup.parentBridge : null;
if (bridge){
mutualTrust = SecurityUtil.hasMutualTrustBetweenParentAndChild(ISWFBridgeProvider(_systemManager));
bridgeEvent = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE, false, false, {notifier:bridge, window:(mutualTrust) ? this : NameUtil.displayObjectToString(this)});
_systemManager.getSandboxRoot().dispatchEvent(bridgeEvent);
};
}
override public function set document(value:Object):void{
}
override public function getVisibleApplicationRect(bounds:Rectangle=null):Rectangle{
return (_systemManager.getVisibleApplicationRect(bounds));
}
override public function getDefinitionByName(name:String):Object{
return (_systemManager.getDefinitionByName(name));
}
}
}//package mx.managers
Section 163
//SystemRawChildrenList (mx.managers.SystemRawChildrenList)
package mx.managers {
import mx.core.*;
import flash.display.*;
import flash.geom.*;
public class SystemRawChildrenList implements IChildList {
private var owner:SystemManager;
mx_internal static const VERSION:String = "3.5.0.12683";
public function SystemRawChildrenList(owner:SystemManager){
super();
this.owner = owner;
}
public function getChildAt(index:int):DisplayObject{
return (owner.mx_internal::rawChildren_getChildAt(index));
}
public function addChild(child:DisplayObject):DisplayObject{
return (owner.mx_internal::rawChildren_addChild(child));
}
public function getChildIndex(child:DisplayObject):int{
return (owner.mx_internal::rawChildren_getChildIndex(child));
}
public function setChildIndex(child:DisplayObject, newIndex:int):void{
var _local3 = owner;
_local3.mx_internal::rawChildren_setChildIndex(child, newIndex);
}
public function getChildByName(name:String):DisplayObject{
return (owner.mx_internal::rawChildren_getChildByName(name));
}
public function removeChildAt(index:int):DisplayObject{
return (owner.mx_internal::rawChildren_removeChildAt(index));
}
public function get numChildren():int{
return (owner.mx_internal::$numChildren);
}
public function addChildAt(child:DisplayObject, index:int):DisplayObject{
return (owner.mx_internal::rawChildren_addChildAt(child, index));
}
public function getObjectsUnderPoint(point:Point):Array{
return (owner.mx_internal::rawChildren_getObjectsUnderPoint(point));
}
public function contains(child:DisplayObject):Boolean{
return (owner.mx_internal::rawChildren_contains(child));
}
public function removeChild(child:DisplayObject):DisplayObject{
return (owner.mx_internal::rawChildren_removeChild(child));
}
}
}//package mx.managers
Section 164
//ToolTipManager (mx.managers.ToolTipManager)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import mx.effects.*;
public class ToolTipManager extends EventDispatcher {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var implClassDependency:ToolTipManagerImpl;
private static var _impl:IToolTipManager2;
public function ToolTipManager(){
super();
}
mx_internal static function registerToolTip(target:DisplayObject, oldToolTip:String, newToolTip:String):void{
impl.registerToolTip(target, oldToolTip, newToolTip);
}
public static function get enabled():Boolean{
return (impl.enabled);
}
public static function set enabled(value:Boolean):void{
impl.enabled = value;
}
public static function createToolTip(text:String, x:Number, y:Number, errorTipBorderStyle:String=null, context:IUIComponent=null):IToolTip{
return (impl.createToolTip(text, x, y, errorTipBorderStyle, context));
}
public static function set hideDelay(value:Number):void{
impl.hideDelay = value;
}
public static function set showDelay(value:Number):void{
impl.showDelay = value;
}
public static function get showDelay():Number{
return (impl.showDelay);
}
public static function destroyToolTip(toolTip:IToolTip):void{
return (impl.destroyToolTip(toolTip));
}
public static function get scrubDelay():Number{
return (impl.scrubDelay);
}
public static function get toolTipClass():Class{
return (impl.toolTipClass);
}
mx_internal static function registerErrorString(target:DisplayObject, oldErrorString:String, newErrorString:String):void{
impl.registerErrorString(target, oldErrorString, newErrorString);
}
mx_internal static function sizeTip(toolTip:IToolTip):void{
impl.sizeTip(toolTip);
}
public static function set currentTarget(value:DisplayObject):void{
impl.currentTarget = value;
}
public static function set showEffect(value:IAbstractEffect):void{
impl.showEffect = value;
}
private static function get impl():IToolTipManager2{
if (!_impl){
_impl = IToolTipManager2(Singleton.getInstance("mx.managers::IToolTipManager2"));
};
return (_impl);
}
public static function get hideDelay():Number{
return (impl.hideDelay);
}
public static function set hideEffect(value:IAbstractEffect):void{
impl.hideEffect = value;
}
public static function set scrubDelay(value:Number):void{
impl.scrubDelay = value;
}
public static function get currentToolTip():IToolTip{
return (impl.currentToolTip);
}
public static function set currentToolTip(value:IToolTip):void{
impl.currentToolTip = value;
}
public static function get showEffect():IAbstractEffect{
return (impl.showEffect);
}
public static function get currentTarget():DisplayObject{
return (impl.currentTarget);
}
public static function get hideEffect():IAbstractEffect{
return (impl.hideEffect);
}
public static function set toolTipClass(value:Class):void{
impl.toolTipClass = value;
}
}
}//package mx.managers
Section 165
//ToolTipManagerImpl (mx.managers.ToolTipManagerImpl)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.utils.*;
import mx.styles.*;
import flash.geom.*;
import mx.events.*;
import mx.controls.*;
import mx.effects.*;
import mx.validators.*;
public class ToolTipManagerImpl extends EventDispatcher implements IToolTipManager2 {
private var _enabled:Boolean;// = true
private var _showDelay:Number;// = 500
private var _hideEffect:IAbstractEffect;
mx_internal var hideTimer:Timer;
private var _scrubDelay:Number;// = 100
private var _toolTipClass:Class;
mx_internal var showTimer:Timer;
private var sandboxRoot:IEventDispatcher;// = null
mx_internal var currentText:String;
private var _currentToolTip:DisplayObject;
mx_internal var scrubTimer:Timer;
mx_internal var previousTarget:DisplayObject;
private var _currentTarget:DisplayObject;
private var systemManager:ISystemManager;// = null
private var _showEffect:IAbstractEffect;
private var _hideDelay:Number;// = 10000
mx_internal var initialized:Boolean;// = false
mx_internal var isError:Boolean;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var instance:IToolTipManager2;
public function ToolTipManagerImpl(){
_toolTipClass = ToolTip;
super();
if (instance){
throw (new Error("Instance already exists."));
};
this.systemManager = (SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager);
sandboxRoot = this.systemManager.getSandboxRoot();
sandboxRoot.addEventListener(InterManagerRequest.TOOLTIP_MANAGER_REQUEST, marshalToolTipManagerHandler, false, 0, true);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = "update";
sandboxRoot.dispatchEvent(me);
}
mx_internal function systemManager_mouseDownHandler(event:MouseEvent):void{
reset();
}
public function set showDelay(value:Number):void{
_showDelay = value;
}
mx_internal function showTimer_timerHandler(event:TimerEvent):void{
if (currentTarget){
createTip();
initializeTip();
positionTip();
showTip();
};
}
mx_internal function hideEffectEnded():void{
var event:ToolTipEvent;
reset();
if (previousTarget){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_END);
event.toolTip = currentToolTip;
previousTarget.dispatchEvent(event);
};
}
public function set scrubDelay(value:Number):void{
_scrubDelay = value;
}
public function get currentToolTip():IToolTip{
return ((_currentToolTip as IToolTip));
}
private function mouseIsOver(target:DisplayObject):Boolean{
if (((!(target)) || (!(target.stage)))){
return (false);
};
if ((((target.stage.mouseX == 0)) && ((target.stage.mouseY == 0)))){
return (false);
};
return (target.hitTestPoint(target.stage.mouseX, target.stage.mouseY, true));
}
mx_internal function toolTipMouseOutHandler(event:MouseEvent):void{
checkIfTargetChanged(event.relatedObject);
}
public function get enabled():Boolean{
return (_enabled);
}
public function createToolTip(text:String, x:Number, y:Number, errorTipBorderStyle:String=null, context:IUIComponent=null):IToolTip{
var toolTip:ToolTip = new ToolTip();
var sm:ISystemManager = (context) ? (context.systemManager as ISystemManager) : (ApplicationGlobals.application.systemManager as ISystemManager);
sm.topLevelSystemManager.addChildToSandboxRoot("toolTipChildren", (toolTip as DisplayObject));
if (errorTipBorderStyle){
toolTip.setStyle("styleName", "errorTip");
toolTip.setStyle("borderStyle", errorTipBorderStyle);
};
toolTip.text = text;
sizeTip(toolTip);
toolTip.move(x, y);
return ((toolTip as IToolTip));
}
mx_internal function reset():void{
var sm:ISystemManager;
showTimer.reset();
hideTimer.reset();
if (currentToolTip){
if (((showEffect) || (hideEffect))){
currentToolTip.removeEventListener(EffectEvent.EFFECT_END, effectEndHandler);
};
EffectManager.endEffectsForTarget(currentToolTip);
sm = (currentToolTip.systemManager as ISystemManager);
sm.topLevelSystemManager.removeChildFromSandboxRoot("toolTipChildren", (currentToolTip as DisplayObject));
currentToolTip = null;
scrubTimer.delay = scrubDelay;
scrubTimer.reset();
if (scrubDelay > 0){
scrubTimer.delay = scrubDelay;
scrubTimer.start();
};
};
}
public function set currentToolTip(value:IToolTip):void{
_currentToolTip = (value as DisplayObject);
var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = "currentToolTip";
me.value = value;
sandboxRoot.dispatchEvent(me);
}
public function get toolTipClass():Class{
return (_toolTipClass);
}
private function hideImmediately(target:DisplayObject):void{
checkIfTargetChanged(null);
}
mx_internal function showTip():void{
var sm:ISystemManager;
var event:ToolTipEvent = new ToolTipEvent(ToolTipEvent.TOOL_TIP_SHOW);
event.toolTip = currentToolTip;
currentTarget.dispatchEvent(event);
if (isError){
currentTarget.addEventListener("change", changeHandler);
} else {
sm = getSystemManager(currentTarget);
sm.addEventListener(MouseEvent.MOUSE_DOWN, systemManager_mouseDownHandler);
};
currentToolTip.visible = true;
if (!showEffect){
showEffectEnded();
};
}
mx_internal function effectEndHandler(event:EffectEvent):void{
if (event.effectInstance.effect == showEffect){
showEffectEnded();
} else {
if (event.effectInstance.effect == hideEffect){
hideEffectEnded();
};
};
}
public function get hideDelay():Number{
return (_hideDelay);
}
public function get currentTarget():DisplayObject{
return (_currentTarget);
}
mx_internal function showEffectEnded():void{
var event:ToolTipEvent;
if (hideDelay == 0){
hideTip();
} else {
if (hideDelay < Infinity){
hideTimer.delay = hideDelay;
hideTimer.start();
};
};
if (currentTarget){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_SHOWN);
event.toolTip = currentToolTip;
currentTarget.dispatchEvent(event);
};
}
public function get hideEffect():IAbstractEffect{
return (_hideEffect);
}
mx_internal function changeHandler(event:Event):void{
reset();
}
public function set enabled(value:Boolean):void{
_enabled = value;
}
mx_internal function errorTipMouseOverHandler(event:MouseEvent):void{
checkIfTargetChanged(DisplayObject(event.target));
}
public function get showDelay():Number{
return (_showDelay);
}
public function get scrubDelay():Number{
return (_scrubDelay);
}
public function registerErrorString(target:DisplayObject, oldErrorString:String, newErrorString:String):void{
if (((!(oldErrorString)) && (newErrorString))){
target.addEventListener(MouseEvent.MOUSE_OVER, errorTipMouseOverHandler);
target.addEventListener(MouseEvent.MOUSE_OUT, errorTipMouseOutHandler);
if (mouseIsOver(target)){
showImmediately(target);
};
} else {
if (((oldErrorString) && (!(newErrorString)))){
target.removeEventListener(MouseEvent.MOUSE_OVER, errorTipMouseOverHandler);
target.removeEventListener(MouseEvent.MOUSE_OUT, errorTipMouseOutHandler);
if (mouseIsOver(target)){
hideImmediately(target);
};
};
};
}
mx_internal function initialize():void{
if (!showTimer){
showTimer = new Timer(0, 1);
showTimer.addEventListener(TimerEvent.TIMER, showTimer_timerHandler);
};
if (!hideTimer){
hideTimer = new Timer(0, 1);
hideTimer.addEventListener(TimerEvent.TIMER, hideTimer_timerHandler);
};
if (!scrubTimer){
scrubTimer = new Timer(0, 1);
};
initialized = true;
}
public function destroyToolTip(toolTip:IToolTip):void{
var sm:ISystemManager = (toolTip.systemManager as ISystemManager);
sm.topLevelSystemManager.removeChildFromSandboxRoot("toolTipChildren", DisplayObject(toolTip));
}
mx_internal function checkIfTargetChanged(displayObject:DisplayObject):void{
if (!enabled){
return;
};
findTarget(displayObject);
if (currentTarget != previousTarget){
targetChanged();
previousTarget = currentTarget;
};
}
private function marshalToolTipManagerHandler(event:Event):void{
var me:InterManagerRequest;
if ((event is InterManagerRequest)){
return;
};
var marshalEvent:Object = event;
switch (marshalEvent.name){
case "currentToolTip":
_currentToolTip = marshalEvent.value;
break;
case ToolTipEvent.TOOL_TIP_HIDE:
if ((_currentToolTip is IToolTip)){
hideTip();
};
break;
case "update":
event.stopImmediatePropagation();
me = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = "currentToolTip";
me.value = _currentToolTip;
sandboxRoot.dispatchEvent(me);
};
}
public function set toolTipClass(value:Class):void{
_toolTipClass = value;
}
private function getGlobalBounds(obj:DisplayObject, parent:DisplayObject):Rectangle{
var upperLeft:Point = new Point(0, 0);
upperLeft = obj.localToGlobal(upperLeft);
upperLeft = parent.globalToLocal(upperLeft);
return (new Rectangle(upperLeft.x, upperLeft.y, obj.width, obj.height));
}
mx_internal function positionTip():void{
var x:Number;
var y:Number;
var targetGlobalBounds:Rectangle;
var newWidth:Number;
var oldWidth:Number;
var sm:ISystemManager;
var toolTipWidth:Number;
var toolTipHeight:Number;
var pos:Point;
var screenWidth:Number = currentToolTip.screen.width;
var screenHeight:Number = currentToolTip.screen.height;
if (isError){
targetGlobalBounds = getGlobalBounds(currentTarget, currentToolTip.root);
x = (targetGlobalBounds.right + 4);
y = (targetGlobalBounds.top - 1);
if ((x + currentToolTip.width) > screenWidth){
newWidth = NaN;
oldWidth = NaN;
x = (targetGlobalBounds.left - 2);
if (((x + currentToolTip.width) + 4) > screenWidth){
newWidth = ((screenWidth - x) - 4);
oldWidth = Object(toolTipClass).maxWidth;
Object(toolTipClass).maxWidth = newWidth;
if ((currentToolTip is IStyleClient)){
IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipAbove");
};
currentToolTip["text"] = currentToolTip["text"];
} else {
if ((currentToolTip is IStyleClient)){
IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipAbove");
};
currentToolTip["text"] = currentToolTip["text"];
};
if ((currentToolTip.height + 2) < targetGlobalBounds.top){
y = (targetGlobalBounds.top - (currentToolTip.height + 2));
} else {
y = (targetGlobalBounds.bottom + 2);
if (!isNaN(newWidth)){
Object(toolTipClass).maxWidth = newWidth;
};
if ((currentToolTip is IStyleClient)){
IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipBelow");
};
currentToolTip["text"] = currentToolTip["text"];
};
};
sizeTip(currentToolTip);
if (!isNaN(oldWidth)){
Object(toolTipClass).maxWidth = oldWidth;
};
} else {
sm = getSystemManager(currentTarget);
x = (DisplayObject(sm).mouseX + 11);
y = (DisplayObject(sm).mouseY + 22);
toolTipWidth = currentToolTip.width;
if ((x + toolTipWidth) > screenWidth){
x = (screenWidth - toolTipWidth);
};
toolTipHeight = currentToolTip.height;
if ((y + toolTipHeight) > screenHeight){
y = (screenHeight - toolTipHeight);
};
pos = new Point(x, y);
pos = DisplayObject(sm).localToGlobal(pos);
pos = DisplayObject(sandboxRoot).globalToLocal(pos);
x = pos.x;
y = pos.y;
};
currentToolTip.move(x, y);
}
mx_internal function errorTipMouseOutHandler(event:MouseEvent):void{
checkIfTargetChanged(event.relatedObject);
}
mx_internal function findTarget(displayObject:DisplayObject):void{
while (displayObject) {
if ((displayObject is IValidatorListener)){
currentText = IValidatorListener(displayObject).errorString;
if (((!((currentText == null))) && (!((currentText == ""))))){
currentTarget = displayObject;
isError = true;
return;
};
};
if ((displayObject is IToolTipManagerClient)){
currentText = IToolTipManagerClient(displayObject).toolTip;
if (currentText != null){
currentTarget = displayObject;
isError = false;
return;
};
};
displayObject = displayObject.parent;
};
currentText = null;
currentTarget = null;
}
public function registerToolTip(target:DisplayObject, oldToolTip:String, newToolTip:String):void{
if (((!(oldToolTip)) && (newToolTip))){
target.addEventListener(MouseEvent.MOUSE_OVER, toolTipMouseOverHandler);
target.addEventListener(MouseEvent.MOUSE_OUT, toolTipMouseOutHandler);
if (mouseIsOver(target)){
showImmediately(target);
};
} else {
if (((oldToolTip) && (!(newToolTip)))){
target.removeEventListener(MouseEvent.MOUSE_OVER, toolTipMouseOverHandler);
target.removeEventListener(MouseEvent.MOUSE_OUT, toolTipMouseOutHandler);
if (mouseIsOver(target)){
hideImmediately(target);
};
};
};
}
private function showImmediately(target:DisplayObject):void{
var oldShowDelay:Number = ToolTipManager.showDelay;
ToolTipManager.showDelay = 0;
checkIfTargetChanged(target);
ToolTipManager.showDelay = oldShowDelay;
}
public function set hideDelay(value:Number):void{
_hideDelay = value;
}
private function getSystemManager(target:DisplayObject):ISystemManager{
return (((target is IUIComponent)) ? IUIComponent(target).systemManager : null);
}
public function set currentTarget(value:DisplayObject):void{
_currentTarget = value;
}
public function sizeTip(toolTip:IToolTip):void{
if ((toolTip is IInvalidating)){
IInvalidating(toolTip).validateNow();
};
toolTip.setActualSize(toolTip.getExplicitOrMeasuredWidth(), toolTip.getExplicitOrMeasuredHeight());
}
public function set showEffect(value:IAbstractEffect):void{
_showEffect = (value as IAbstractEffect);
}
mx_internal function targetChanged():void{
var event:ToolTipEvent;
var me:InterManagerRequest;
if (!initialized){
initialize();
};
if (((previousTarget) && (currentToolTip))){
if ((currentToolTip is IToolTip)){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_HIDE);
event.toolTip = currentToolTip;
previousTarget.dispatchEvent(event);
} else {
me = new InterManagerRequest(InterManagerRequest.TOOLTIP_MANAGER_REQUEST);
me.name = ToolTipEvent.TOOL_TIP_HIDE;
sandboxRoot.dispatchEvent(me);
};
};
reset();
if (currentTarget){
if (currentText == ""){
return;
};
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_START);
currentTarget.dispatchEvent(event);
if ((((showDelay == 0)) || (scrubTimer.running))){
createTip();
initializeTip();
positionTip();
showTip();
} else {
showTimer.delay = showDelay;
showTimer.start();
};
};
}
public function set hideEffect(value:IAbstractEffect):void{
_hideEffect = (value as IAbstractEffect);
}
mx_internal function hideTimer_timerHandler(event:TimerEvent):void{
hideTip();
}
mx_internal function initializeTip():void{
if ((currentToolTip is IToolTip)){
IToolTip(currentToolTip).text = currentText;
};
if (((isError) && ((currentToolTip is IStyleClient)))){
IStyleClient(currentToolTip).setStyle("styleName", "errorTip");
};
sizeTip(currentToolTip);
if ((currentToolTip is IStyleClient)){
if (showEffect){
IStyleClient(currentToolTip).setStyle("showEffect", showEffect);
};
if (hideEffect){
IStyleClient(currentToolTip).setStyle("hideEffect", hideEffect);
};
};
if (((showEffect) || (hideEffect))){
currentToolTip.addEventListener(EffectEvent.EFFECT_END, effectEndHandler);
};
}
public function get showEffect():IAbstractEffect{
return (_showEffect);
}
mx_internal function toolTipMouseOverHandler(event:MouseEvent):void{
checkIfTargetChanged(DisplayObject(event.target));
}
mx_internal function hideTip():void{
var event:ToolTipEvent;
var sm:ISystemManager;
if (previousTarget){
event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_HIDE);
event.toolTip = currentToolTip;
previousTarget.dispatchEvent(event);
};
if (currentToolTip){
currentToolTip.visible = false;
};
if (isError){
if (currentTarget){
currentTarget.removeEventListener("change", changeHandler);
};
} else {
if (previousTarget){
sm = getSystemManager(previousTarget);
sm.removeEventListener(MouseEvent.MOUSE_DOWN, systemManager_mouseDownHandler);
};
};
if (!hideEffect){
hideEffectEnded();
};
}
mx_internal function createTip():void{
var event:ToolTipEvent = new ToolTipEvent(ToolTipEvent.TOOL_TIP_CREATE);
currentTarget.dispatchEvent(event);
if (event.toolTip){
currentToolTip = event.toolTip;
} else {
currentToolTip = new toolTipClass();
};
currentToolTip.visible = false;
var sm:ISystemManager = (getSystemManager(currentTarget) as ISystemManager);
sm.topLevelSystemManager.addChildToSandboxRoot("toolTipChildren", (currentToolTip as DisplayObject));
}
public static function getInstance():IToolTipManager2{
if (!instance){
instance = new (ToolTipManagerImpl);
};
return (instance);
}
}
}//package mx.managers
Section 166
//LoaderConfig (mx.messaging.config.LoaderConfig)
package mx.messaging.config {
import mx.core.*;
public class LoaderConfig {
mx_internal static const VERSION:String = "3.5.0.12683";
mx_internal static var _parameters:Object;
mx_internal static var _swfVersion:uint;
mx_internal static var _url:String = null;
public function LoaderConfig(){
super();
}
public static function get parameters():Object{
return (_parameters);
}
public static function get url():String{
return (_url);
}
public static function get swfVersion():uint{
return (_swfVersion);
}
}
}//package mx.messaging.config
Section 167
//IModuleInfo (mx.modules.IModuleInfo)
package mx.modules {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import flash.system.*;
public interface IModuleInfo extends IEventDispatcher {
function get ready():Boolean;
function get loaded():Boolean;
function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null, _arg3:ByteArray=null):void;
function release():void;
function get error():Boolean;
function get data():Object;
function publish(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:IFlexModuleFactory):void;
function get factory():IFlexModuleFactory;
function set data(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\modules;IModuleInfo.as:Object):void;
function get url():String;
function get setup():Boolean;
function unload():void;
}
}//package mx.modules
Section 168
//ModuleManager (mx.modules.ModuleManager)
package mx.modules {
import mx.core.*;
public class ModuleManager {
mx_internal static const VERSION:String = "3.5.0.12683";
public function ModuleManager(){
super();
}
public static function getModule(url:String):IModuleInfo{
return (getSingleton().getModule(url));
}
private static function getSingleton():Object{
if (!ModuleManagerGlobals.managerSingleton){
ModuleManagerGlobals.managerSingleton = new ModuleManagerImpl();
};
return (ModuleManagerGlobals.managerSingleton);
}
public static function getAssociatedFactory(object:Object):IFlexModuleFactory{
return (getSingleton().getAssociatedFactory(object));
}
}
}//package mx.modules
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
import mx.events.*;
import flash.net.*;
class ModuleInfoProxy extends EventDispatcher implements IModuleInfo {
private var _data:Object;
private var info:ModuleInfo;
private var referenced:Boolean;// = false
private function ModuleInfoProxy(info:ModuleInfo){
super();
this.info = info;
info.addEventListener(ModuleEvent.SETUP, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.PROGRESS, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.READY, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.ERROR, moduleEventHandler, false, 0, true);
info.addEventListener(ModuleEvent.UNLOAD, moduleEventHandler, false, 0, true);
}
public function get loaded():Boolean{
return (info.loaded);
}
public function release():void{
if (referenced){
info.removeReference();
referenced = false;
};
}
public function get error():Boolean{
return (info.error);
}
public function get factory():IFlexModuleFactory{
return (info.factory);
}
public function publish(factory:IFlexModuleFactory):void{
info.publish(factory);
}
public function set data(value:Object):void{
_data = value;
}
public function get ready():Boolean{
return (info.ready);
}
public function load(applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null, bytes:ByteArray=null):void{
var moduleEvent:ModuleEvent;
info.resurrect();
if (!referenced){
info.addReference();
referenced = true;
};
if (info.error){
dispatchEvent(new ModuleEvent(ModuleEvent.ERROR));
} else {
if (info.loaded){
if (info.setup){
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
if (info.ready){
moduleEvent = new ModuleEvent(ModuleEvent.PROGRESS);
moduleEvent.bytesLoaded = info.size;
moduleEvent.bytesTotal = info.size;
dispatchEvent(moduleEvent);
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
};
};
} else {
info.load(applicationDomain, securityDomain, bytes);
};
};
}
private function moduleEventHandler(event:ModuleEvent):void{
dispatchEvent(event);
}
public function get url():String{
return (info.url);
}
public function get data():Object{
return (_data);
}
public function get setup():Boolean{
return (info.setup);
}
public function unload():void{
info.unload();
info.removeEventListener(ModuleEvent.SETUP, moduleEventHandler);
info.removeEventListener(ModuleEvent.PROGRESS, moduleEventHandler);
info.removeEventListener(ModuleEvent.READY, moduleEventHandler);
info.removeEventListener(ModuleEvent.ERROR, moduleEventHandler);
info.removeEventListener(ModuleEvent.UNLOAD, moduleEventHandler);
}
}
class ModuleManagerImpl extends EventDispatcher {
private var moduleList:Object;
private function ModuleManagerImpl(){
moduleList = {};
super();
}
public function getModule(url:String):IModuleInfo{
var info:ModuleInfo = (moduleList[url] as ModuleInfo);
if (!info){
info = new ModuleInfo(url);
moduleList[url] = info;
};
return (new ModuleInfoProxy(info));
}
public function getAssociatedFactory(object:Object):IFlexModuleFactory{
var m:Object;
var info:ModuleInfo;
var domain:ApplicationDomain;
var cls:Class;
var object = object;
var className:String = getQualifiedClassName(object);
for each (m in moduleList) {
info = (m as ModuleInfo);
if (!info.ready){
} else {
domain = info.applicationDomain;
cls = Class(domain.getDefinition(className));
if ((object is cls)){
return (info.factory);
};
//unresolved jump
var _slot1 = error;
};
};
return (null);
}
}
class ModuleInfo extends EventDispatcher {
private var _error:Boolean;// = false
private var loader:Loader;
private var factoryInfo:FactoryInfo;
private var limbo:Dictionary;
private var _loaded:Boolean;// = false
private var _ready:Boolean;// = false
private var numReferences:int;// = 0
private var _url:String;
private var _setup:Boolean;// = false
private function ModuleInfo(url:String){
super();
_url = url;
}
private function clearLoader():void{
if (loader){
if (loader.contentLoaderInfo){
loader.contentLoaderInfo.removeEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
};
if (loader.content){
loader.content.removeEventListener("ready", readyHandler);
loader.content.removeEventListener("error", moduleErrorHandler);
};
//unresolved jump
var _slot1 = error;
if (_loaded){
loader.close();
//unresolved jump
var _slot1 = error;
};
loader.unload();
//unresolved jump
var _slot1 = error;
loader = null;
};
}
public function get size():int{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.bytesTotal : 0);
}
public function get loaded():Boolean{
return ((limbo) ? false : _loaded);
}
public function release():void{
if (((_ready) && (!(limbo)))){
limbo = new Dictionary(true);
limbo[factoryInfo] = 1;
factoryInfo = null;
} else {
unload();
};
}
public function get error():Boolean{
return ((limbo) ? false : _error);
}
public function get factory():IFlexModuleFactory{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.factory : null);
}
public function completeHandler(event:Event):void{
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = loader.contentLoaderInfo.bytesLoaded;
moduleEvent.bytesTotal = loader.contentLoaderInfo.bytesTotal;
dispatchEvent(moduleEvent);
}
public function publish(factory:IFlexModuleFactory):void{
if (factoryInfo){
return;
};
if (_url.indexOf("published://") != 0){
return;
};
factoryInfo = new FactoryInfo();
factoryInfo.factory = factory;
_loaded = true;
_setup = true;
_ready = true;
_error = false;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
dispatchEvent(new ModuleEvent(ModuleEvent.PROGRESS));
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
public function initHandler(event:Event):void{
var moduleEvent:ModuleEvent;
var event = event;
factoryInfo = new FactoryInfo();
factoryInfo.factory = (loader.content as IFlexModuleFactory);
//unresolved jump
var _slot1 = error;
if (!factoryInfo.factory){
moduleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = 0;
moduleEvent.bytesTotal = 0;
moduleEvent.errorText = "SWF is not a loadable module";
dispatchEvent(moduleEvent);
return;
};
loader.content.addEventListener("ready", readyHandler);
loader.content.addEventListener("error", moduleErrorHandler);
factoryInfo.applicationDomain = loader.contentLoaderInfo.applicationDomain;
//unresolved jump
var _slot1 = error;
_setup = true;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
}
public function resurrect():void{
var f:Object;
if (((!(factoryInfo)) && (limbo))){
for (f in limbo) {
factoryInfo = (f as FactoryInfo);
break;
};
limbo = null;
};
if (!factoryInfo){
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
loader = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
};
}
public function errorHandler(event:ErrorEvent):void{
_error = true;
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = 0;
moduleEvent.bytesTotal = 0;
moduleEvent.errorText = event.text;
dispatchEvent(moduleEvent);
}
public function get ready():Boolean{
return ((limbo) ? false : _ready);
}
private function loadBytes(applicationDomain:ApplicationDomain, bytes:ByteArray):void{
var c:LoaderContext = new LoaderContext();
c.applicationDomain = (applicationDomain) ? applicationDomain : new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in c)){
c["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
loader.loadBytes(bytes, c);
}
public function removeReference():void{
numReferences--;
if (numReferences == 0){
release();
};
}
public function addReference():void{
numReferences++;
}
public function progressHandler(event:ProgressEvent):void{
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = event.bytesLoaded;
moduleEvent.bytesTotal = event.bytesTotal;
dispatchEvent(moduleEvent);
}
public function load(applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null, bytes:ByteArray=null):void{
if (_loaded){
return;
};
_loaded = true;
limbo = null;
if (bytes){
loadBytes(applicationDomain, bytes);
return;
};
if (_url.indexOf("published://") == 0){
return;
};
var r:URLRequest = new URLRequest(_url);
var c:LoaderContext = new LoaderContext();
c.applicationDomain = (applicationDomain) ? applicationDomain : new ApplicationDomain(ApplicationDomain.currentDomain);
c.securityDomain = securityDomain;
if ((((securityDomain == null)) && ((Security.sandboxType == Security.REMOTE)))){
c.securityDomain = SecurityDomain.currentDomain;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
loader.load(r, c);
}
public function get url():String{
return (_url);
}
public function get applicationDomain():ApplicationDomain{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.applicationDomain : null);
}
public function moduleErrorHandler(event:Event):void{
var errorEvent:ModuleEvent;
_ready = true;
factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
if ((event is ModuleEvent)){
errorEvent = ModuleEvent(event);
} else {
errorEvent = new ModuleEvent(ModuleEvent.ERROR);
};
dispatchEvent(errorEvent);
}
public function readyHandler(event:Event):void{
_ready = true;
factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal;
var moduleEvent:ModuleEvent = new ModuleEvent(ModuleEvent.READY);
moduleEvent.bytesLoaded = loader.contentLoaderInfo.bytesLoaded;
moduleEvent.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
dispatchEvent(moduleEvent);
}
public function get setup():Boolean{
return ((limbo) ? false : _setup);
}
public function unload():void{
clearLoader();
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
limbo = null;
factoryInfo = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
}
}
class FactoryInfo {
public var bytesTotal:int;// = 0
public var factory:IFlexModuleFactory;
public var applicationDomain:ApplicationDomain;
private function FactoryInfo(){
super();
}
}
Section 169
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals)
package mx.modules {
public class ModuleManagerGlobals {
public static var managerSingleton:Object = null;
public function ModuleManagerGlobals(){
super();
}
}
}//package mx.modules
Section 170
//DownloadProgressBar (mx.preloaders.DownloadProgressBar)
package mx.preloaders {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
import flash.geom.*;
import flash.text.*;
import mx.events.*;
import mx.graphics.*;
import flash.net.*;
public class DownloadProgressBar extends Sprite implements IPreloaderDisplay {
protected var MINIMUM_DISPLAY_TIME:uint;// = 0
private var _barFrameRect:RoundedRectangle;
private var _stageHeight:Number;// = 375
private var _stageWidth:Number;// = 500
private var _percentRect:Rectangle;
private var _percentObj:TextField;
private var _downloadingLabel:String;// = "Loading"
private var _showProgressBar:Boolean;// = true
private var _yOffset:Number;// = 20
private var _initProgressCount:uint;// = 0
private var _barSprite:Sprite;
private var _visible:Boolean;// = false
private var _barRect:RoundedRectangle;
private var _showingDisplay:Boolean;// = false
private var _backgroundSize:String;// = ""
private var _initProgressTotal:uint;// = 12
private var _startedInit:Boolean;// = false
private var _showLabel:Boolean;// = true
private var _value:Number;// = 0
private var _labelRect:Rectangle;
private var _backgroundImage:Object;
private var _backgroundAlpha:Number;// = 1
private var _backgroundColor:uint;
private var _startedLoading:Boolean;// = false
private var _showPercentage:Boolean;// = false
private var _barFrameSprite:Sprite;
protected var DOWNLOAD_PERCENTAGE:uint;// = 60
private var _displayStartCount:uint;// = 0
private var _labelObj:TextField;
private var _borderRect:RoundedRectangle;
private var _maximum:Number;// = 0
private var _displayTime:int;
private var _label:String;// = ""
private var _preloader:Sprite;
private var _xOffset:Number;// = 20
private var _startTime:int;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var _initializingLabel:String = "Initializing";
public function DownloadProgressBar(){
_labelRect = labelRect;
_percentRect = percentRect;
_borderRect = borderRect;
_barFrameRect = barFrameRect;
_barRect = barRect;
super();
}
protected function getPercentLoaded(loaded:Number, total:Number):Number{
var perc:Number;
if ((((((((loaded == 0)) || ((total == 0)))) || (isNaN(total)))) || (isNaN(loaded)))){
return (0);
};
perc = ((100 * loaded) / total);
if (((isNaN(perc)) || ((perc <= 0)))){
return (0);
};
if (perc > 99){
return (99);
};
return (Math.round(perc));
}
protected function get labelFormat():TextFormat{
var tf:TextFormat = new TextFormat();
tf.color = 0x333333;
tf.font = "Verdana";
tf.size = 10;
return (tf);
}
private function calcScale():void{
var scale:Number;
if ((((stageWidth < 160)) || ((stageHeight < 120)))){
scaleX = 1;
scaleY = 1;
} else {
if ((((stageWidth < 240)) || ((stageHeight < 150)))){
createChildren();
scale = Math.min((stageWidth / 240), (stageHeight / 150));
scaleX = scale;
scaleY = scale;
} else {
createChildren();
};
};
}
protected function get percentRect():Rectangle{
return (new Rectangle(108, 4, 34, 16));
}
protected function set showLabel(value:Boolean):void{
_showLabel = value;
draw();
}
private function calcBackgroundSize():Number{
var index:int;
var percentage:Number = NaN;
if (backgroundSize){
index = backgroundSize.indexOf("%");
if (index != -1){
percentage = Number(backgroundSize.substr(0, index));
};
};
return (percentage);
}
private function show():void{
_showingDisplay = true;
calcScale();
draw();
_displayTime = getTimer();
}
private function loadBackgroundImage(classOrString:Object):void{
var cls:Class;
var newStyleObj:DisplayObject;
var loader:Loader;
var loaderContext:LoaderContext;
var classOrString = classOrString;
if (((classOrString) && ((classOrString as Class)))){
cls = Class(classOrString);
initBackgroundImage(new (cls));
} else {
if (((classOrString) && ((classOrString is String)))){
cls = Class(getDefinitionByName(String(classOrString)));
//unresolved jump
var _slot1 = e;
if (cls){
newStyleObj = new (cls);
initBackgroundImage(newStyleObj);
} else {
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loader_ioErrorHandler);
loaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load(new URLRequest(String(classOrString)), loaderContext);
};
};
};
}
protected function set showPercentage(value:Boolean):void{
_showPercentage = value;
draw();
}
protected function get barFrameRect():RoundedRectangle{
return (new RoundedRectangle(14, 40, 154, 4));
}
private function loader_ioErrorHandler(event:IOErrorEvent):void{
}
protected function rslErrorHandler(event:RSLEvent):void{
_preloader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
_preloader.removeEventListener(Event.COMPLETE, completeHandler);
_preloader.removeEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
_preloader.removeEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
_preloader.removeEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
_preloader.removeEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
_preloader.removeEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
if (!_showingDisplay){
show();
_showingDisplay = true;
};
label = ((("RSL Error " + (event.rslIndex + 1)) + " of ") + event.rslTotal);
var errorField:ErrorField = new ErrorField(this);
errorField.show(event.errorText);
}
protected function rslCompleteHandler(event:RSLEvent):void{
label = ((("Loaded library " + event.rslIndex) + " of ") + event.rslTotal);
}
protected function get borderRect():RoundedRectangle{
return (new RoundedRectangle(0, 0, 182, 60, 4));
}
protected function showDisplayForDownloading(elapsedTime:int, event:ProgressEvent):Boolean{
return ((((elapsedTime > 700)) && ((event.bytesLoaded < (event.bytesTotal / 2)))));
}
protected function createChildren():void{
var labelObj:TextField;
var percentObj:TextField;
var g:Graphics = graphics;
if (backgroundColor != 4294967295){
g.beginFill(backgroundColor, backgroundAlpha);
g.drawRect(0, 0, stageWidth, stageHeight);
};
if (backgroundImage != null){
loadBackgroundImage(backgroundImage);
};
_barFrameSprite = new Sprite();
_barSprite = new Sprite();
addChild(_barFrameSprite);
addChild(_barSprite);
g.beginFill(0xCCCCCC, 0.4);
g.drawRoundRect(calcX(_borderRect.x), calcY(_borderRect.y), _borderRect.width, _borderRect.height, (_borderRect.cornerRadius * 2), (_borderRect.cornerRadius * 2));
g.drawRoundRect(calcX((_borderRect.x + 1)), calcY((_borderRect.y + 1)), (_borderRect.width - 2), (_borderRect.height - 2), (_borderRect.cornerRadius - (1 * 2)), (_borderRect.cornerRadius - (1 * 2)));
g.endFill();
g.beginFill(0xCCCCCC, 0.4);
g.drawRoundRect(calcX((_borderRect.x + 1)), calcY((_borderRect.y + 1)), (_borderRect.width - 2), (_borderRect.height - 2), (_borderRect.cornerRadius - (1 * 2)), (_borderRect.cornerRadius - (1 * 2)));
g.endFill();
var frame_g:Graphics = _barFrameSprite.graphics;
var matrix:Matrix = new Matrix();
matrix.createGradientBox(_barFrameRect.width, _barFrameRect.height, (Math.PI / 2), calcX(_barFrameRect.x), calcY(_barFrameRect.y));
frame_g.beginGradientFill(GradientType.LINEAR, [6054502, 11909306], [1, 1], [0, 0xFF], matrix);
frame_g.drawRoundRect(calcX(_barFrameRect.x), calcY(_barFrameRect.y), _barFrameRect.width, _barFrameRect.height, (_barFrameRect.cornerRadius * 2), (_barFrameRect.cornerRadius * 2));
frame_g.drawRoundRect(calcX((_barFrameRect.x + 1)), calcY((_barFrameRect.y + 1)), (_barFrameRect.width - 2), (_barFrameRect.height - 2), (_barFrameRect.cornerRadius * 2), (_barFrameRect.cornerRadius * 2));
frame_g.endFill();
_labelObj = new TextField();
_labelObj.x = calcX(_labelRect.x);
_labelObj.y = calcY(_labelRect.y);
_labelObj.width = _labelRect.width;
_labelObj.height = _labelRect.height;
_labelObj.selectable = false;
_labelObj.defaultTextFormat = labelFormat;
addChild(_labelObj);
_percentObj = new TextField();
_percentObj.x = calcX(_percentRect.x);
_percentObj.y = calcY(_percentRect.y);
_percentObj.width = _percentRect.width;
_percentObj.height = _percentRect.height;
_percentObj.selectable = false;
_percentObj.defaultTextFormat = percentFormat;
addChild(_percentObj);
var ds:RectangularDropShadow = new RectangularDropShadow();
ds.color = 0;
ds.angle = 90;
ds.alpha = 0.6;
ds.distance = 2;
ds.tlRadius = (ds.trRadius = (ds.blRadius = (ds.brRadius = _borderRect.cornerRadius)));
ds.drawShadow(g, calcX(_borderRect.x), calcY(_borderRect.y), _borderRect.width, _borderRect.height);
g.lineStyle(1, 0xFFFFFF, 0.3);
g.moveTo((calcX(_borderRect.x) + _borderRect.cornerRadius), calcY(_borderRect.y));
g.lineTo(((calcX(_borderRect.x) - _borderRect.cornerRadius) + _borderRect.width), calcY(_borderRect.y));
}
private function draw():void{
var percentage:Number;
if (_startedLoading){
if (!_startedInit){
percentage = Math.round(((getPercentLoaded(_value, _maximum) * DOWNLOAD_PERCENTAGE) / 100));
} else {
percentage = Math.round((((getPercentLoaded(_value, _maximum) * (100 - DOWNLOAD_PERCENTAGE)) / 100) + DOWNLOAD_PERCENTAGE));
};
} else {
percentage = getPercentLoaded(_value, _maximum);
};
if (_labelObj){
_labelObj.text = _label;
};
if (_percentObj){
if (!_showPercentage){
_percentObj.visible = false;
_percentObj.text = "";
} else {
_percentObj.text = (String(percentage) + "%");
};
};
if (((_barSprite) && (_barFrameSprite))){
if (!_showProgressBar){
_barSprite.visible = false;
_barFrameSprite.visible = false;
} else {
drawProgressBar(percentage);
};
};
}
private function timerHandler(event:Event=null):void{
dispatchEvent(new Event(Event.COMPLETE));
}
private function hide():void{
}
public function get backgroundSize():String{
return (_backgroundSize);
}
protected function center(width:Number, height:Number):void{
_xOffset = Math.floor(((width - _borderRect.width) / 2));
_yOffset = Math.floor(((height - _borderRect.height) / 2));
}
protected function progressHandler(event:ProgressEvent):void{
var loaded:uint = event.bytesLoaded;
var total:uint = event.bytesTotal;
var elapsedTime:int = (getTimer() - _startTime);
if (((_showingDisplay) || (showDisplayForDownloading(elapsedTime, event)))){
if (!_startedLoading){
show();
label = downloadingLabel;
_startedLoading = true;
};
setProgress(event.bytesLoaded, event.bytesTotal);
};
}
protected function initProgressHandler(event:Event):void{
var loaded:Number;
var elapsedTime:int = (getTimer() - _startTime);
_initProgressCount++;
if (((!(_showingDisplay)) && (showDisplayForInit(elapsedTime, _initProgressCount)))){
_displayStartCount = _initProgressCount;
show();
} else {
if (_showingDisplay){
if (!_startedInit){
_startedInit = true;
label = initializingLabel;
};
loaded = ((100 * _initProgressCount) / (_initProgressTotal - _displayStartCount));
setProgress(loaded, 100);
};
};
}
protected function set downloadingLabel(value:String):void{
_downloadingLabel = value;
}
public function get stageWidth():Number{
return (_stageWidth);
}
protected function get showPercentage():Boolean{
return (_showPercentage);
}
override public function get visible():Boolean{
return (_visible);
}
public function set stageHeight(value:Number):void{
_stageHeight = value;
}
public function initialize():void{
_startTime = getTimer();
center(stageWidth, stageHeight);
}
protected function rslProgressHandler(event:RSLEvent):void{
}
protected function get barRect():RoundedRectangle{
return (new RoundedRectangle(14, 39, 154, 6, 0));
}
protected function get percentFormat():TextFormat{
var tf:TextFormat = new TextFormat();
tf.align = "right";
tf.color = 0;
tf.font = "Verdana";
tf.size = 10;
return (tf);
}
public function set backgroundImage(value:Object):void{
_backgroundImage = value;
}
private function calcX(base:Number):Number{
return ((base + _xOffset));
}
private function calcY(base:Number):Number{
return ((base + _yOffset));
}
public function set backgroundAlpha(value:Number):void{
_backgroundAlpha = value;
}
private function initCompleteHandler(event:Event):void{
var timer:Timer;
var elapsedTime:int = (getTimer() - _displayTime);
if (((_showingDisplay) && ((elapsedTime < MINIMUM_DISPLAY_TIME)))){
timer = new Timer((MINIMUM_DISPLAY_TIME - elapsedTime), 1);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
} else {
timerHandler();
};
}
public function set backgroundColor(value:uint):void{
_backgroundColor = value;
}
private function initBackgroundImage(image:DisplayObject):void{
var sX:Number;
var sY:Number;
var scale:Number;
addChildAt(image, 0);
var backgroundImageWidth:Number = image.width;
var backgroundImageHeight:Number = image.height;
var percentage:Number = calcBackgroundSize();
if (isNaN(percentage)){
sX = 1;
sY = 1;
} else {
scale = (percentage * 0.01);
sX = ((scale * stageWidth) / backgroundImageWidth);
sY = ((scale * stageHeight) / backgroundImageHeight);
};
image.scaleX = sX;
image.scaleY = sY;
var offsetX:Number = Math.round((0.5 * (stageWidth - (backgroundImageWidth * sX))));
var offsetY:Number = Math.round((0.5 * (stageHeight - (backgroundImageHeight * sY))));
image.x = offsetX;
image.y = offsetY;
if (!isNaN(backgroundAlpha)){
image.alpha = backgroundAlpha;
};
}
public function set backgroundSize(value:String):void{
_backgroundSize = value;
}
protected function showDisplayForInit(elapsedTime:int, count:int):Boolean{
return ((((elapsedTime > 300)) && ((count == 2))));
}
protected function get downloadingLabel():String{
return (_downloadingLabel);
}
private function loader_completeHandler(event:Event):void{
var target:DisplayObject = DisplayObject(LoaderInfo(event.target).loader);
initBackgroundImage(target);
}
protected function setProgress(completed:Number, total:Number):void{
if (((((((!(isNaN(completed))) && (!(isNaN(total))))) && ((completed >= 0)))) && ((total > 0)))){
_value = Number(completed);
_maximum = Number(total);
draw();
};
}
public function get stageHeight():Number{
return (_stageHeight);
}
public function get backgroundImage():Object{
return (_backgroundImage);
}
public function get backgroundAlpha():Number{
if (!isNaN(_backgroundAlpha)){
return (_backgroundAlpha);
};
return (1);
}
private function drawProgressBar(percentage:Number):void{
var barY2:Number;
var g:Graphics = _barSprite.graphics;
g.clear();
var colors:Array = [0xFFFFFF, 0xFFFFFF];
var ratios:Array = [0, 0xFF];
var matrix:Matrix = new Matrix();
var barWidth:Number = ((_barRect.width * percentage) / 100);
var barWidthSplit:Number = (barWidth / 2);
var barHeight:Number = (_barRect.height - 4);
var barX:Number = calcX(_barRect.x);
var barY:Number = (calcY(_barRect.y) + 2);
matrix.createGradientBox(barWidthSplit, barHeight, 0, barX, barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.39, 0.85], ratios, matrix);
g.drawRect(barX, barY, barWidthSplit, barHeight);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + barWidthSplit), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.85, 1], ratios, matrix);
g.drawRect((barX + barWidthSplit), barY, barWidthSplit, barHeight);
barWidthSplit = (barWidth / 3);
barHeight = _barRect.height;
barY = calcY(_barRect.y);
barY2 = ((barY + barHeight) - 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, barX, barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.05, 0.15], ratios, matrix);
g.drawRect(barX, barY, barWidthSplit, 1);
g.drawRect(barX, barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + barWidthSplit), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.15, 0.25], ratios, matrix);
g.drawRect((barX + barWidthSplit), barY, barWidthSplit, 1);
g.drawRect((barX + barWidthSplit), barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + (barWidthSplit * 2)), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.25, 0.1], ratios, matrix);
g.drawRect((barX + (barWidthSplit * 2)), barY, barWidthSplit, 1);
g.drawRect((barX + (barWidthSplit * 2)), barY2, barWidthSplit, 1);
barWidthSplit = (barWidth / 3);
barHeight = _barRect.height;
barY = (calcY(_barRect.y) + 1);
barY2 = ((calcY(_barRect.y) + barHeight) - 2);
matrix.createGradientBox(barWidthSplit, barHeight, 0, barX, barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.15, 0.3], ratios, matrix);
g.drawRect(barX, barY, barWidthSplit, 1);
g.drawRect(barX, barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + barWidthSplit), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.3, 0.4], ratios, matrix);
g.drawRect((barX + barWidthSplit), barY, barWidthSplit, 1);
g.drawRect((barX + barWidthSplit), barY2, barWidthSplit, 1);
matrix.createGradientBox(barWidthSplit, barHeight, 0, (barX + (barWidthSplit * 2)), barY);
g.beginGradientFill(GradientType.LINEAR, colors, [0.4, 0.25], ratios, matrix);
g.drawRect((barX + (barWidthSplit * 2)), barY, barWidthSplit, 1);
g.drawRect((barX + (barWidthSplit * 2)), barY2, barWidthSplit, 1);
}
public function get backgroundColor():uint{
return (_backgroundColor);
}
public function set stageWidth(value:Number):void{
_stageWidth = value;
}
protected function completeHandler(event:Event):void{
}
protected function set label(value:String):void{
if (!(value is Function)){
_label = value;
};
draw();
}
public function set preloader(value:Sprite):void{
_preloader = value;
value.addEventListener(ProgressEvent.PROGRESS, progressHandler);
value.addEventListener(Event.COMPLETE, completeHandler);
value.addEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
value.addEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
value.addEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
value.addEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
value.addEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
}
protected function get label():String{
return (_label);
}
protected function get labelRect():Rectangle{
return (new Rectangle(14, 17, 100, 16));
}
override public function set visible(value:Boolean):void{
if (((!(_visible)) && (value))){
show();
} else {
if (((_visible) && (!(value)))){
hide();
};
};
_visible = value;
}
protected function get showLabel():Boolean{
return (_showLabel);
}
public static function get initializingLabel():String{
return (_initializingLabel);
}
public static function set initializingLabel(value:String):void{
_initializingLabel = value;
}
}
}//package mx.preloaders
import flash.display.*;
import flash.system.*;
import flash.text.*;
class ErrorField extends Sprite {
private const TEXT_MARGIN_PX:int = 10;
private const MAX_WIDTH_INCHES:int = 6;
private const MIN_WIDTH_INCHES:int = 2;
private var downloadProgressBar:DownloadProgressBar;
private function ErrorField(downloadProgressBar:DownloadProgressBar){
super();
this.downloadProgressBar = downloadProgressBar;
}
protected function get labelFormat():TextFormat{
var tf:TextFormat = new TextFormat();
tf.color = 0;
tf.font = "Verdana";
tf.size = 10;
return (tf);
}
public function show(errorText:String):void{
if ((((errorText == null)) || ((errorText.length == 0)))){
return;
};
var screenWidth:Number = downloadProgressBar.stageWidth;
var screenHeight:Number = downloadProgressBar.stageHeight;
var textField:TextField = new TextField();
textField.autoSize = TextFieldAutoSize.LEFT;
textField.multiline = true;
textField.wordWrap = true;
textField.background = true;
textField.defaultTextFormat = labelFormat;
textField.text = errorText;
textField.width = Math.max((MIN_WIDTH_INCHES * Capabilities.screenDPI), (screenWidth - (TEXT_MARGIN_PX * 2)));
textField.width = Math.min((MAX_WIDTH_INCHES * Capabilities.screenDPI), textField.width);
textField.y = Math.max(0, ((screenHeight - TEXT_MARGIN_PX) - textField.height));
textField.x = ((screenWidth - textField.width) / 2);
downloadProgressBar.parent.addChild(this);
this.addChild(textField);
}
}
Section 171
//IPreloaderDisplay (mx.preloaders.IPreloaderDisplay)
package mx.preloaders {
import flash.events.*;
import flash.display.*;
public interface IPreloaderDisplay extends IEventDispatcher {
function set backgroundAlpha(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void;
function get stageHeight():Number;
function get stageWidth():Number;
function set backgroundColor(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:uint):void;
function set preloader(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Sprite):void;
function get backgroundImage():Object;
function get backgroundSize():String;
function get backgroundAlpha():Number;
function set stageHeight(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void;
function get backgroundColor():uint;
function set stageWidth(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Number):void;
function set backgroundImage(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:Object):void;
function set backgroundSize(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\preloaders;IPreloaderDisplay.as:String):void;
function initialize():void;
}
}//package mx.preloaders
Section 172
//Preloader (mx.preloaders.Preloader)
package mx.preloaders {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.utils.*;
import mx.events.*;
public class Preloader extends Sprite {
private var app:IEventDispatcher;// = null
private var showDisplay:Boolean;
private var timer:Timer;
private var rslDone:Boolean;// = false
private var displayClass:IPreloaderDisplay;// = null
private var rslListLoader:RSLListLoader;
mx_internal static const VERSION:String = "3.5.0.12683";
public function Preloader(){
super();
}
private function getByteValues():Object{
var li:LoaderInfo = root.loaderInfo;
var loaded:int = li.bytesLoaded;
var total:int = li.bytesTotal;
var n:int = (rslListLoader) ? rslListLoader.getItemCount() : 0;
var i:int;
while (i < n) {
loaded = (loaded + rslListLoader.getItem(i).loaded);
total = (total + rslListLoader.getItem(i).total);
i++;
};
return ({loaded:loaded, total:total});
}
private function appProgressHandler(event:Event):void{
dispatchEvent(new FlexEvent(FlexEvent.INIT_PROGRESS));
}
private function dispatchAppEndEvent(event:Object=null):void{
dispatchEvent(new FlexEvent(FlexEvent.INIT_COMPLETE));
if (!showDisplay){
displayClassCompleteHandler(null);
};
}
private function ioErrorHandler(event:IOErrorEvent):void{
}
private function appCreationCompleteHandler(event:FlexEvent):void{
dispatchAppEndEvent();
}
mx_internal function rslErrorHandler(event:ErrorEvent):void{
var index:int = rslListLoader.getIndex();
var item:RSLItem = rslListLoader.getItem(index);
var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_ERROR);
rslEvent.bytesLoaded = 0;
rslEvent.bytesTotal = 0;
rslEvent.rslIndex = index;
rslEvent.rslTotal = rslListLoader.getItemCount();
rslEvent.url = item.urlRequest;
rslEvent.errorText = decodeURI(event.text);
dispatchEvent(rslEvent);
}
public function initialize(showDisplay:Boolean, displayClassName:Class, backgroundColor:uint, backgroundAlpha:Number, backgroundImage:Object, backgroundSize:String, displayWidth:Number, displayHeight:Number, libs:Array=null, sizes:Array=null, rslList:Array=null, resourceModuleURLs:Array=null):void{
var n:int;
var i:int;
var node:RSLItem;
var resourceModuleNode:ResourceModuleRSLItem;
if (((((!((libs == null))) || (!((sizes == null))))) && (!((rslList == null))))){
throw (new Error("RSLs may only be specified by using libs and sizes or rslList, not both."));
};
root.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
if (((libs) && ((libs.length > 0)))){
if (rslList == null){
rslList = [];
};
n = libs.length;
i = 0;
while (i < n) {
node = new RSLItem(libs[i]);
rslList.push(node);
i++;
};
};
if (((resourceModuleURLs) && ((resourceModuleURLs.length > 0)))){
n = resourceModuleURLs.length;
i = 0;
while (i < n) {
resourceModuleNode = new ResourceModuleRSLItem(resourceModuleURLs[i]);
rslList.push(resourceModuleNode);
i++;
};
};
rslListLoader = new RSLListLoader(rslList);
this.showDisplay = showDisplay;
timer = new Timer(10);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
if (showDisplay){
displayClass = new (displayClassName);
displayClass.addEventListener(Event.COMPLETE, displayClassCompleteHandler);
addChild(DisplayObject(displayClass));
displayClass.backgroundColor = backgroundColor;
displayClass.backgroundAlpha = backgroundAlpha;
displayClass.backgroundImage = backgroundImage;
displayClass.backgroundSize = backgroundSize;
displayClass.stageWidth = displayWidth;
displayClass.stageHeight = displayHeight;
displayClass.initialize();
displayClass.preloader = this;
};
if (rslListLoader.getItemCount() > 0){
rslListLoader.load(mx_internal::rslProgressHandler, mx_internal::rslCompleteHandler, mx_internal::rslErrorHandler, mx_internal::rslErrorHandler, mx_internal::rslErrorHandler);
} else {
rslDone = true;
};
}
mx_internal function rslProgressHandler(event:ProgressEvent):void{
var index:int = rslListLoader.getIndex();
var item:RSLItem = rslListLoader.getItem(index);
var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_PROGRESS);
rslEvent.bytesLoaded = event.bytesLoaded;
rslEvent.bytesTotal = event.bytesTotal;
rslEvent.rslIndex = index;
rslEvent.rslTotal = rslListLoader.getItemCount();
rslEvent.url = item.urlRequest;
dispatchEvent(rslEvent);
}
public function registerApplication(app:IEventDispatcher):void{
app.addEventListener("validatePropertiesComplete", appProgressHandler);
app.addEventListener("validateSizeComplete", appProgressHandler);
app.addEventListener("validateDisplayListComplete", appProgressHandler);
app.addEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
this.app = app;
}
mx_internal function rslCompleteHandler(event:Event):void{
var index:int = rslListLoader.getIndex();
var item:RSLItem = rslListLoader.getItem(index);
var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_COMPLETE);
rslEvent.bytesLoaded = item.total;
rslEvent.bytesTotal = item.total;
rslEvent.loaderInfo = (event.target as LoaderInfo);
rslEvent.rslIndex = index;
rslEvent.rslTotal = rslListLoader.getItemCount();
rslEvent.url = item.urlRequest;
dispatchEvent(rslEvent);
rslDone = ((index + 1) == rslEvent.rslTotal);
}
private function timerHandler(event:TimerEvent):void{
if (!root){
return;
};
var bytes:Object = getByteValues();
var loaded:int = bytes.loaded;
var total:int = bytes.total;
dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, loaded, total));
if (((rslDone) && ((((((((loaded >= total)) && ((total > 0)))) || ((((total == 0)) && ((loaded > 0)))))) || ((((((root is MovieClip)) && ((MovieClip(root).totalFrames > 2)))) && ((MovieClip(root).framesLoaded >= 2)))))))){
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.reset();
dispatchEvent(new Event(Event.COMPLETE));
dispatchEvent(new FlexEvent(FlexEvent.INIT_PROGRESS));
};
}
private function displayClassCompleteHandler(event:Event):void{
if (displayClass){
displayClass.removeEventListener(Event.COMPLETE, displayClassCompleteHandler);
};
if (root){
root.loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
};
if (app){
app.removeEventListener("validatePropertiesComplete", appProgressHandler);
app.removeEventListener("validateSizeComplete", appProgressHandler);
app.removeEventListener("validateDisplayListComplete", appProgressHandler);
app.removeEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
app = null;
};
dispatchEvent(new FlexEvent(FlexEvent.PRELOADER_DONE));
}
}
}//package mx.preloaders
Section 173
//IResourceBundle (mx.resources.IResourceBundle)
package mx.resources {
public interface IResourceBundle {
function get content():Object;
function get locale():String;
function get bundleName():String;
}
}//package mx.resources
Section 174
//IResourceManager (mx.resources.IResourceManager)
package mx.resources {
import flash.events.*;
import flash.system.*;
public interface IResourceManager extends IEventDispatcher {
function loadResourceModule(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
function getBoolean(_arg1:String, _arg2:String, _arg3:String=null):Boolean;
function getClass(_arg1:String, _arg2:String, _arg3:String=null):Class;
function getLocales():Array;
function removeResourceBundlesForLocale(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:String):void;
function getResourceBundle(_arg1:String, _arg2:String):IResourceBundle;
function get localeChain():Array;
function getInt(_arg1:String, _arg2:String, _arg3:String=null):int;
function update():void;
function set localeChain(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:Array):void;
function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint;
function addResourceBundle(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:IResourceBundle):void;
function getStringArray(_arg1:String, _arg2:String, _arg3:String=null):Array;
function getBundleNamesForLocale(:String):Array;
function removeResourceBundle(_arg1:String, _arg2:String):void;
function getObject(_arg1:String, _arg2:String, _arg3:String=null);
function getString(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null):String;
function installCompiledResourceBundles(_arg1:ApplicationDomain, _arg2:Array, _arg3:Array):void;
function unloadResourceModule(_arg1:String, _arg2:Boolean=true):void;
function getPreferredLocaleChain():Array;
function findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle;
function initializeLocaleChain(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\resources;IResourceManager.as:Array):void;
function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number;
}
}//package mx.resources
Section 175
//IResourceModule (mx.resources.IResourceModule)
package mx.resources {
public interface IResourceModule {
function get resourceBundles():Array;
}
}//package mx.resources
Section 176
//LocaleSorter (mx.resources.LocaleSorter)
package mx.resources {
import mx.core.*;
public class LocaleSorter {
mx_internal static const VERSION:String = "3.5.0.12683";
public function LocaleSorter(){
super();
}
private static function normalizeLocale(locale:String):String{
return (locale.toLowerCase().replace(/-/g, "_"));
}
public static function sortLocalesByPreference(appLocales:Array, systemPreferences:Array, ultimateFallbackLocale:String=null, addAll:Boolean=false):Array{
var result:Array;
var hasLocale:Object;
var i:int;
var j:int;
var k:int;
var l:int;
var locale:String;
var plocale:LocaleID;
var appLocales = appLocales;
var systemPreferences = systemPreferences;
var ultimateFallbackLocale = ultimateFallbackLocale;
var addAll = addAll;
var promote:Function = function (locale:String):void{
if (typeof(hasLocale[locale]) != "undefined"){
result.push(appLocales[hasLocale[locale]]);
delete hasLocale[locale];
};
};
result = [];
hasLocale = {};
var locales:Array = trimAndNormalize(appLocales);
var preferenceLocales:Array = trimAndNormalize(systemPreferences);
addUltimateFallbackLocale(preferenceLocales, ultimateFallbackLocale);
j = 0;
while (j < locales.length) {
hasLocale[locales[j]] = j;
j = (j + 1);
};
i = 0;
l = preferenceLocales.length;
while (i < l) {
plocale = LocaleID.fromString(preferenceLocales[i]);
promote(preferenceLocales[i]);
promote(plocale.toString());
while (plocale.transformToParent()) {
promote(plocale.toString());
};
plocale = LocaleID.fromString(preferenceLocales[i]);
j = 0;
while (j < l) {
locale = preferenceLocales[j];
if (plocale.isSiblingOf(LocaleID.fromString(locale))){
promote(locale);
};
j = (j + 1);
};
j = 0;
k = locales.length;
while (j < k) {
locale = locales[j];
if (plocale.isSiblingOf(LocaleID.fromString(locale))){
promote(locale);
};
j = (j + 1);
};
i = (i + 1);
};
if (addAll){
j = 0;
k = locales.length;
while (j < k) {
promote(locales[j]);
j = (j + 1);
};
};
return (result);
}
private static function addUltimateFallbackLocale(preferenceLocales:Array, ultimateFallbackLocale:String):void{
var locale:String;
if (((!((ultimateFallbackLocale == null))) && (!((ultimateFallbackLocale == ""))))){
locale = normalizeLocale(ultimateFallbackLocale);
if (preferenceLocales.indexOf(locale) == -1){
preferenceLocales.push(locale);
};
};
}
private static function trimAndNormalize(list:Array):Array{
var resultList:Array = [];
var i:int;
while (i < list.length) {
resultList.push(normalizeLocale(list[i]));
i++;
};
return (resultList);
}
}
}//package mx.resources
class LocaleID {
private var privateLangs:Boolean;// = false
private var script:String;// = ""
private var variants:Array;
private var privates:Array;
private var extensions:Object;
private var lang:String;// = ""
private var region:String;// = ""
private var extended_langs:Array;
public static const STATE_PRIMARY_LANGUAGE:int = 0;
public static const STATE_REGION:int = 3;
public static const STATE_EXTENDED_LANGUAGES:int = 1;
public static const STATE_EXTENSIONS:int = 5;
public static const STATE_SCRIPT:int = 2;
public static const STATE_VARIANTS:int = 4;
public static const STATE_PRIVATES:int = 6;
private function LocaleID(){
extended_langs = [];
variants = [];
extensions = {};
privates = [];
super();
}
public function equals(locale:LocaleID):Boolean{
return ((toString() == locale.toString()));
}
public function canonicalize():void{
var i:String;
for (i in extensions) {
if (extensions.hasOwnProperty(i)){
if (extensions[i].length == 0){
delete extensions[i];
} else {
extensions[i] = extensions[i].sort();
};
};
};
extended_langs = extended_langs.sort();
variants = variants.sort();
privates = privates.sort();
if (script == ""){
script = LocaleRegistry.getScriptByLang(lang);
};
if ((((script == "")) && (!((region == ""))))){
script = LocaleRegistry.getScriptByLangAndRegion(lang, region);
};
if ((((region == "")) && (!((script == ""))))){
region = LocaleRegistry.getDefaultRegionForLangAndScript(lang, script);
};
}
public function toString():String{
var i:String;
var stack:Array = [lang];
appendElements(stack, extended_langs);
if (script != ""){
stack.push(script);
};
if (region != ""){
stack.push(region);
};
appendElements(stack, variants);
for (i in extensions) {
if (extensions.hasOwnProperty(i)){
stack.push(i);
appendElements(stack, extensions[i]);
};
};
if (privates.length > 0){
stack.push("x");
appendElements(stack, privates);
};
return (stack.join("_"));
}
public function isSiblingOf(other:LocaleID):Boolean{
return ((((lang == other.lang)) && ((script == other.script))));
}
public function transformToParent():Boolean{
var i:String;
var lastExtension:Array;
var defaultRegion:String;
if (privates.length > 0){
privates.splice((privates.length - 1), 1);
return (true);
};
var lastExtensionName:String;
for (i in extensions) {
if (extensions.hasOwnProperty(i)){
lastExtensionName = i;
};
};
if (lastExtensionName){
lastExtension = extensions[lastExtensionName];
if (lastExtension.length == 1){
delete extensions[lastExtensionName];
return (true);
};
lastExtension.splice((lastExtension.length - 1), 1);
return (true);
};
if (variants.length > 0){
variants.splice((variants.length - 1), 1);
return (true);
};
if (script != ""){
if (LocaleRegistry.getScriptByLang(lang) != ""){
script = "";
return (true);
};
if (region == ""){
defaultRegion = LocaleRegistry.getDefaultRegionForLangAndScript(lang, script);
if (defaultRegion != ""){
region = defaultRegion;
script = "";
return (true);
};
};
};
if (region != ""){
if (!(((script == "")) && ((LocaleRegistry.getScriptByLang(lang) == "")))){
region = "";
return (true);
};
};
if (extended_langs.length > 0){
extended_langs.splice((extended_langs.length - 1), 1);
return (true);
};
return (false);
}
private static function appendElements(dest:Array, src:Array):void{
var i:uint;
var argc:uint = src.length;
while (i < argc) {
dest.push(src[i]);
i++;
};
}
public static function fromString(str:String):LocaleID{
var last_extension:Array;
var subtag:String;
var subtag_length:int;
var firstChar:String;
var localeID:LocaleID = new (LocaleID);
var state:int = STATE_PRIMARY_LANGUAGE;
var subtags:Array = str.replace(/-/g, "_").split("_");
var i:int;
var l:int = subtags.length;
while (i < l) {
subtag = subtags[i].toLowerCase();
if (state == STATE_PRIMARY_LANGUAGE){
if (subtag == "x"){
localeID.privateLangs = true;
} else {
if (subtag == "i"){
localeID.lang = (localeID.lang + "i-");
} else {
localeID.lang = (localeID.lang + subtag);
state = STATE_EXTENDED_LANGUAGES;
};
};
} else {
subtag_length = subtag.length;
if (subtag_length == 0){
} else {
firstChar = subtag.charAt(0).toLowerCase();
if ((((state <= STATE_EXTENDED_LANGUAGES)) && ((subtag_length == 3)))){
localeID.extended_langs.push(subtag);
if (localeID.extended_langs.length == 3){
state = STATE_SCRIPT;
};
} else {
if ((((state <= STATE_SCRIPT)) && ((subtag_length == 4)))){
localeID.script = subtag;
state = STATE_REGION;
} else {
if ((((state <= STATE_REGION)) && ((((subtag_length == 2)) || ((subtag_length == 3)))))){
localeID.region = subtag;
state = STATE_VARIANTS;
} else {
if ((((state <= STATE_VARIANTS)) && ((((((((firstChar >= "a")) && ((firstChar <= "z")))) && ((subtag_length >= 5)))) || ((((((firstChar >= "0")) && ((firstChar <= "9")))) && ((subtag_length >= 4)))))))){
localeID.variants.push(subtag);
state = STATE_VARIANTS;
} else {
if ((((state < STATE_PRIVATES)) && ((subtag_length == 1)))){
if (subtag == "x"){
state = STATE_PRIVATES;
last_extension = localeID.privates;
} else {
state = STATE_EXTENSIONS;
last_extension = ((localeID.extensions[subtag]) || ([]));
localeID.extensions[subtag] = last_extension;
};
} else {
if (state >= STATE_EXTENSIONS){
last_extension.push(subtag);
};
};
};
};
};
};
};
};
i++;
};
localeID.canonicalize();
return (localeID);
}
}
class LocaleRegistry {
private static const SCRIPT_ID_BY_LANG:Object = {ab:5, af:1, am:2, ar:3, as:4, ay:1, be:5, bg:5, bn:4, bs:1, ca:1, ch:1, cs:1, cy:1, da:1, de:1, dv:6, dz:7, el:8, en:1, eo:1, es:1, et:1, eu:1, fa:3, fi:1, fj:1, fo:1, fr:1, frr:1, fy:1, ga:1, gl:1, gn:1, gu:9, gv:1, he:10, hi:11, hr:1, ht:1, hu:1, hy:12, id:1, in:1, is:1, it:1, iw:10, ja:13, ka:14, kk:5, kl:1, km:15, kn:16, ko:17, la:1, lb:1, ln:1, lo:18, lt:1, lv:1, mg:1, mh:1, mk:5, ml:19, mo:1, mr:11, ms:1, mt:1, my:20, na:1, nb:1, nd:1, ne:11, nl:1, nn:1, no:1, nr:1, ny:1, om:1, or:21, pa:22, pl:1, ps:3, pt:1, qu:1, rn:1, ro:1, ru:5, rw:1, sg:1, si:23, sk:1, sl:1, sm:1, so:1, sq:1, ss:1, st:1, sv:1, sw:1, ta:24, te:25, th:26, ti:2, tl:1, tn:1, to:1, tr:1, ts:1, uk:5, ur:3, ve:1, vi:1, wo:1, xh:1, yi:10, zu:1, cpe:1, dsb:1, frs:1, gsw:1, hsb:1, kok:11, mai:11, men:1, nds:1, niu:1, nqo:27, nso:1, son:1, tem:1, tkl:1, tmh:1, tpi:1, tvl:1, zbl:28};
private static const SCRIPTS:Array = ["", "latn", "ethi", "arab", "beng", "cyrl", "thaa", "tibt", "grek", "gujr", "hebr", "deva", "armn", "jpan", "geor", "khmr", "knda", "kore", "laoo", "mlym", "mymr", "orya", "guru", "sinh", "taml", "telu", "thai", "nkoo", "blis", "hans", "hant", "mong", "syrc"];
private static const DEFAULT_REGION_BY_LANG_AND_SCRIPT:Object = {bg:{5:"bg"}, ca:{1:"es"}, zh:{30:"tw", 29:"cn"}, cs:{1:"cz"}, da:{1:"dk"}, de:{1:"de"}, el:{8:"gr"}, en:{1:"us"}, es:{1:"es"}, fi:{1:"fi"}, fr:{1:"fr"}, he:{10:"il"}, hu:{1:"hu"}, is:{1:"is"}, it:{1:"it"}, ja:{13:"jp"}, ko:{17:"kr"}, nl:{1:"nl"}, nb:{1:"no"}, pl:{1:"pl"}, pt:{1:"br"}, ro:{1:"ro"}, ru:{5:"ru"}, hr:{1:"hr"}, sk:{1:"sk"}, sq:{1:"al"}, sv:{1:"se"}, th:{26:"th"}, tr:{1:"tr"}, ur:{3:"pk"}, id:{1:"id"}, uk:{5:"ua"}, be:{5:"by"}, sl:{1:"si"}, et:{1:"ee"}, lv:{1:"lv"}, lt:{1:"lt"}, fa:{3:"ir"}, vi:{1:"vn"}, hy:{12:"am"}, az:{1:"az", 5:"az"}, eu:{1:"es"}, mk:{5:"mk"}, af:{1:"za"}, ka:{14:"ge"}, fo:{1:"fo"}, hi:{11:"in"}, ms:{1:"my"}, kk:{5:"kz"}, ky:{5:"kg"}, sw:{1:"ke"}, uz:{1:"uz", 5:"uz"}, tt:{5:"ru"}, pa:{22:"in"}, gu:{9:"in"}, ta:{24:"in"}, te:{25:"in"}, kn:{16:"in"}, mr:{11:"in"}, sa:{11:"in"}, mn:{5:"mn"}, gl:{1:"es"}, kok:{11:"in"}, syr:{32:"sy"}, dv:{6:"mv"}, nn:{1:"no"}, sr:{1:"cs", 5:"cs"}, cy:{1:"gb"}, mi:{1:"nz"}, mt:{1:"mt"}, quz:{1:"bo"}, tn:{1:"za"}, xh:{1:"za"}, zu:{1:"za"}, nso:{1:"za"}, se:{1:"no"}, smj:{1:"no"}, sma:{1:"no"}, sms:{1:"fi"}, smn:{1:"fi"}, bs:{1:"ba"}};
private static const SCRIPT_BY_ID:Object = {latn:1, ethi:2, arab:3, beng:4, cyrl:5, thaa:6, tibt:7, grek:8, gujr:9, hebr:10, deva:11, armn:12, jpan:13, geor:14, khmr:15, knda:16, kore:17, laoo:18, mlym:19, mymr:20, orya:21, guru:22, sinh:23, taml:24, telu:25, thai:26, nkoo:27, blis:28, hans:29, hant:30, mong:31, syrc:32};
private static const SCRIPT_ID_BY_LANG_AND_REGION:Object = {zh:{cn:29, sg:29, tw:30, hk:30, mo:30}, mn:{cn:31, sg:5}, pa:{pk:3, in:22}, ha:{gh:1, ne:1}};
private function LocaleRegistry(){
super();
}
public static function getScriptByLangAndRegion(lang:String, region:String):String{
var langRegions:Object = SCRIPT_ID_BY_LANG_AND_REGION[lang];
if (langRegions == null){
return ("");
};
var scriptID:Object = langRegions[region];
if (scriptID == null){
return ("");
};
return (SCRIPTS[int(scriptID)].toLowerCase());
}
public static function getScriptByLang(lang:String):String{
var scriptID:Object = SCRIPT_ID_BY_LANG[lang];
if (scriptID == null){
return ("");
};
return (SCRIPTS[int(scriptID)].toLowerCase());
}
public static function getDefaultRegionForLangAndScript(lang:String, script:String):String{
var langObj:Object = DEFAULT_REGION_BY_LANG_AND_SCRIPT[lang];
var scriptID:Object = SCRIPT_BY_ID[script];
if ((((langObj == null)) || ((scriptID == null)))){
return ("");
};
return (((langObj[int(scriptID)]) || ("")));
}
}
Section 177
//ResourceBundle (mx.resources.ResourceBundle)
package mx.resources {
import mx.core.*;
import flash.system.*;
import mx.utils.*;
public class ResourceBundle implements IResourceBundle {
mx_internal var _locale:String;
private var _content:Object;
mx_internal var _bundleName:String;
mx_internal static const VERSION:String = "3.5.0.12683";
mx_internal static var backupApplicationDomain:ApplicationDomain;
mx_internal static var locale:String;
public function ResourceBundle(locale:String=null, bundleName:String=null){
_content = {};
super();
mx_internal::_locale = locale;
mx_internal::_bundleName = bundleName;
_content = getContent();
}
protected function getContent():Object{
return ({});
}
public function getString(key:String):String{
return (String(_getObject(key)));
}
public function get content():Object{
return (_content);
}
public function getBoolean(key:String, defaultValue:Boolean=true):Boolean{
var temp:String = _getObject(key).toLowerCase();
if (temp == "false"){
return (false);
};
if (temp == "true"){
return (true);
};
return (defaultValue);
}
public function getStringArray(key:String):Array{
var array:Array = _getObject(key).split(",");
var n:int = array.length;
var i:int;
while (i < n) {
array[i] = StringUtil.trim(array[i]);
i++;
};
return (array);
}
public function getObject(key:String):Object{
return (_getObject(key));
}
private function _getObject(key:String):Object{
var value:Object = content[key];
if (!value){
throw (new Error(((("Key " + key) + " was not found in resource bundle ") + bundleName)));
};
return (value);
}
public function get locale():String{
return (mx_internal::_locale);
}
public function get bundleName():String{
return (mx_internal::_bundleName);
}
public function getNumber(key:String):Number{
return (Number(_getObject(key)));
}
private static function getClassByName(name:String, domain:ApplicationDomain):Class{
var c:Class;
if (domain.hasDefinition(name)){
c = (domain.getDefinition(name) as Class);
};
return (c);
}
public static function getResourceBundle(baseName:String, currentDomain:ApplicationDomain=null):ResourceBundle{
var className:String;
var bundleClass:Class;
var bundleObj:Object;
var bundle:ResourceBundle;
if (!currentDomain){
currentDomain = ApplicationDomain.currentDomain;
};
className = (((mx_internal::locale + "$") + baseName) + "_properties");
bundleClass = getClassByName(className, currentDomain);
if (!bundleClass){
className = (baseName + "_properties");
bundleClass = getClassByName(className, currentDomain);
};
if (!bundleClass){
className = baseName;
bundleClass = getClassByName(className, currentDomain);
};
if (((!(bundleClass)) && (mx_internal::backupApplicationDomain))){
className = (baseName + "_properties");
bundleClass = getClassByName(className, mx_internal::backupApplicationDomain);
if (!bundleClass){
className = baseName;
bundleClass = getClassByName(className, mx_internal::backupApplicationDomain);
};
};
if (bundleClass){
bundleObj = new (bundleClass);
if ((bundleObj is ResourceBundle)){
bundle = ResourceBundle(bundleObj);
return (bundle);
};
};
throw (new Error(("Could not find resource bundle " + baseName)));
}
}
}//package mx.resources
Section 178
//ResourceManager (mx.resources.ResourceManager)
package mx.resources {
import mx.core.*;
public class ResourceManager {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var implClassDependency:ResourceManagerImpl;
private static var instance:IResourceManager;
public function ResourceManager(){
super();
}
public static function getInstance():IResourceManager{
if (!instance){
instance = IResourceManager(Singleton.getInstance("mx.resources::IResourceManager"));
//unresolved jump
var _slot1 = e;
instance = new ResourceManagerImpl();
};
return (instance);
}
}
}//package mx.resources
Section 179
//ResourceManagerImpl (mx.resources.ResourceManagerImpl)
package mx.resources {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import flash.system.*;
import mx.modules.*;
import mx.events.*;
import mx.utils.*;
public class ResourceManagerImpl extends EventDispatcher implements IResourceManager {
private var resourceModules:Object;
private var initializedForNonFrameworkApp:Boolean;// = false
private var localeMap:Object;
private var _localeChain:Array;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var instance:IResourceManager;
public function ResourceManagerImpl(){
localeMap = {};
resourceModules = {};
super();
}
public function get localeChain():Array{
return (_localeChain);
}
public function set localeChain(value:Array):void{
_localeChain = value;
update();
}
public function getStringArray(bundleName:String, resourceName:String, locale:String=null):Array{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (null);
};
var value:* = resourceBundle.content[resourceName];
var array:Array = String(value).split(",");
var n:int = array.length;
var i:int;
while (i < n) {
array[i] = StringUtil.trim(array[i]);
i++;
};
return (array);
}
mx_internal function installCompiledResourceBundle(applicationDomain:ApplicationDomain, locale:String, bundleName:String):void{
var packageName:String;
var localName:String = bundleName;
var colonIndex:int = bundleName.indexOf(":");
if (colonIndex != -1){
packageName = bundleName.substring(0, colonIndex);
localName = bundleName.substring((colonIndex + 1));
};
if (getResourceBundle(locale, bundleName)){
return;
};
var resourceBundleClassName = (((locale + "$") + localName) + "_properties");
if (packageName != null){
resourceBundleClassName = ((packageName + ".") + resourceBundleClassName);
};
var bundleClass:Class;
if (applicationDomain.hasDefinition(resourceBundleClassName)){
bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName));
};
if (!bundleClass){
resourceBundleClassName = bundleName;
if (applicationDomain.hasDefinition(resourceBundleClassName)){
bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName));
};
};
if (!bundleClass){
resourceBundleClassName = (bundleName + "_properties");
if (applicationDomain.hasDefinition(resourceBundleClassName)){
bundleClass = Class(applicationDomain.getDefinition(resourceBundleClassName));
};
};
if (!bundleClass){
throw (new Error((((("Could not find compiled resource bundle '" + bundleName) + "' for locale '") + locale) + "'.")));
};
var resourceBundle:ResourceBundle = ResourceBundle(new (bundleClass));
resourceBundle.mx_internal::_locale = locale;
resourceBundle.mx_internal::_bundleName = bundleName;
addResourceBundle(resourceBundle);
}
public function getString(bundleName:String, resourceName:String, parameters:Array=null, locale:String=null):String{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (null);
};
var value:String = String(resourceBundle.content[resourceName]);
if (parameters){
value = StringUtil.substitute(value, parameters);
};
return (value);
}
public function loadResourceModule(url:String, updateFlag:Boolean=true, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null):IEventDispatcher{
var moduleInfo:IModuleInfo;
var resourceEventDispatcher:ResourceEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = url;
var updateFlag = updateFlag;
var applicationDomain = applicationDomain;
var securityDomain = securityDomain;
moduleInfo = ModuleManager.getModule(url);
resourceEventDispatcher = new ResourceEventDispatcher(moduleInfo);
var readyHandler:Function = function (event:ModuleEvent):void{
var resourceModule:* = event.module.factory.create();
resourceModules[event.module.url].resourceModule = resourceModule;
if (updateFlag){
update();
};
};
moduleInfo.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
var errorHandler:Function = function (event:ModuleEvent):void{
var resourceEvent:ResourceEvent;
var message:String = ("Unable to load resource module from " + url);
if (resourceEventDispatcher.willTrigger(ResourceEvent.ERROR)){
resourceEvent = new ResourceEvent(ResourceEvent.ERROR, event.bubbles, event.cancelable);
resourceEvent.bytesLoaded = 0;
resourceEvent.bytesTotal = 0;
resourceEvent.errorText = message;
resourceEventDispatcher.dispatchEvent(resourceEvent);
} else {
throw (new Error(message));
};
};
moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
resourceModules[url] = new ResourceModuleInfo(moduleInfo, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (event:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
moduleInfo.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (resourceEventDispatcher);
}
public function getLocales():Array{
var p:String;
var locales:Array = [];
for (p in localeMap) {
locales.push(p);
};
return (locales);
}
public function removeResourceBundlesForLocale(locale:String):void{
delete localeMap[locale];
}
public function getResourceBundle(locale:String, bundleName:String):IResourceBundle{
var bundleMap:Object = localeMap[locale];
if (!bundleMap){
return (null);
};
return (bundleMap[bundleName]);
}
private function dumpResourceModule(resourceModule):void{
var bundle:ResourceBundle;
var p:String;
for each (bundle in resourceModule.resourceBundles) {
trace(bundle.locale, bundle.bundleName);
for (p in bundle.content) {
};
};
}
public function addResourceBundle(resourceBundle:IResourceBundle):void{
var locale:String = resourceBundle.locale;
var bundleName:String = resourceBundle.bundleName;
if (!localeMap[locale]){
localeMap[locale] = {};
};
localeMap[locale][bundleName] = resourceBundle;
}
public function getObject(bundleName:String, resourceName:String, locale:String=null){
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (undefined);
};
return (resourceBundle.content[resourceName]);
}
public function getInt(bundleName:String, resourceName:String, locale:String=null):int{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (0);
};
var value:* = resourceBundle.content[resourceName];
return (int(value));
}
private function findBundle(bundleName:String, resourceName:String, locale:String):IResourceBundle{
supportNonFrameworkApps();
return (((locale)!=null) ? getResourceBundle(locale, bundleName) : findResourceBundleWithResource(bundleName, resourceName));
}
private function supportNonFrameworkApps():void{
if (initializedForNonFrameworkApp){
return;
};
initializedForNonFrameworkApp = true;
if (getLocales().length > 0){
return;
};
var applicationDomain:ApplicationDomain = ApplicationDomain.currentDomain;
if (!applicationDomain.hasDefinition("_CompiledResourceBundleInfo")){
return;
};
var c:Class = Class(applicationDomain.getDefinition("_CompiledResourceBundleInfo"));
var locales:Array = c.compiledLocales;
var bundleNames:Array = c.compiledResourceBundleNames;
installCompiledResourceBundles(applicationDomain, locales, bundleNames);
localeChain = locales;
}
public function getBundleNamesForLocale(locale:String):Array{
var p:String;
var bundleNames:Array = [];
for (p in localeMap[locale]) {
bundleNames.push(p);
};
return (bundleNames);
}
public function getPreferredLocaleChain():Array{
return (LocaleSorter.sortLocalesByPreference(getLocales(), getSystemPreferredLocales(), null, true));
}
public function getNumber(bundleName:String, resourceName:String, locale:String=null):Number{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (NaN);
};
var value:* = resourceBundle.content[resourceName];
return (Number(value));
}
public function update():void{
dispatchEvent(new Event(Event.CHANGE));
}
public function getClass(bundleName:String, resourceName:String, locale:String=null):Class{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (null);
};
var value:* = resourceBundle.content[resourceName];
return ((value as Class));
}
public function removeResourceBundle(locale:String, bundleName:String):void{
delete localeMap[locale][bundleName];
if (getBundleNamesForLocale(locale).length == 0){
delete localeMap[locale];
};
}
public function initializeLocaleChain(compiledLocales:Array):void{
localeChain = LocaleSorter.sortLocalesByPreference(compiledLocales, getSystemPreferredLocales(), null, true);
}
public function findResourceBundleWithResource(bundleName:String, resourceName:String):IResourceBundle{
var locale:String;
var bundleMap:Object;
var bundle:ResourceBundle;
if (!_localeChain){
return (null);
};
var n:int = _localeChain.length;
var i:int;
while (i < n) {
locale = localeChain[i];
bundleMap = localeMap[locale];
if (!bundleMap){
} else {
bundle = bundleMap[bundleName];
if (!bundle){
} else {
if ((resourceName in bundle.content)){
return (bundle);
};
};
};
i++;
};
return (null);
}
public function getUint(bundleName:String, resourceName:String, locale:String=null):uint{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (0);
};
var value:* = resourceBundle.content[resourceName];
return (uint(value));
}
private function getSystemPreferredLocales():Array{
var systemPreferences:Array;
if (Capabilities["languages"]){
systemPreferences = Capabilities["languages"];
} else {
systemPreferences = [Capabilities.language];
};
return (systemPreferences);
}
public function installCompiledResourceBundles(applicationDomain:ApplicationDomain, locales:Array, bundleNames:Array):void{
var locale:String;
var j:int;
var bundleName:String;
var n:int = (locales) ? locales.length : 0;
var m:int = (bundleNames) ? bundleNames.length : 0;
var i:int;
while (i < n) {
locale = locales[i];
j = 0;
while (j < m) {
bundleName = bundleNames[j];
mx_internal::installCompiledResourceBundle(applicationDomain, locale, bundleName);
j++;
};
i++;
};
}
public function getBoolean(bundleName:String, resourceName:String, locale:String=null):Boolean{
var resourceBundle:IResourceBundle = findBundle(bundleName, resourceName, locale);
if (!resourceBundle){
return (false);
};
var value:* = resourceBundle.content[resourceName];
return ((String(value).toLowerCase() == "true"));
}
public function unloadResourceModule(url:String, update:Boolean=true):void{
var bundles:Array;
var n:int;
var i:int;
var locale:String;
var bundleName:String;
var rmi:ResourceModuleInfo = resourceModules[url];
if (!rmi){
return;
};
if (rmi.resourceModule){
bundles = rmi.resourceModule.resourceBundles;
if (bundles){
n = bundles.length;
i = 0;
while (i < n) {
locale = bundles[i].locale;
bundleName = bundles[i].bundleName;
removeResourceBundle(locale, bundleName);
i++;
};
};
};
resourceModules[url] = null;
delete resourceModules[url];
rmi.moduleInfo.unload();
if (update){
this.update();
};
}
public static function getInstance():IResourceManager{
if (!instance){
instance = new (ResourceManagerImpl);
};
return (instance);
}
}
}//package mx.resources
import flash.events.*;
import mx.modules.*;
import mx.events.*;
class ResourceModuleInfo {
public var resourceModule:IResourceModule;
public var errorHandler:Function;
public var readyHandler:Function;
public var moduleInfo:IModuleInfo;
private function ResourceModuleInfo(moduleInfo:IModuleInfo, readyHandler:Function, errorHandler:Function){
super();
this.moduleInfo = moduleInfo;
this.readyHandler = readyHandler;
this.errorHandler = errorHandler;
}
}
class ResourceEventDispatcher extends EventDispatcher {
private function ResourceEventDispatcher(moduleInfo:IModuleInfo){
super();
moduleInfo.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(event:ModuleEvent):void{
var resourceEvent:ResourceEvent = new ResourceEvent(ResourceEvent.PROGRESS, event.bubbles, event.cancelable);
resourceEvent.bytesLoaded = event.bytesLoaded;
resourceEvent.bytesTotal = event.bytesTotal;
dispatchEvent(resourceEvent);
}
private function moduleInfo_readyHandler(event:ModuleEvent):void{
var resourceEvent:ResourceEvent = new ResourceEvent(ResourceEvent.COMPLETE);
dispatchEvent(resourceEvent);
}
private function moduleInfo_errorHandler(event:ModuleEvent):void{
var resourceEvent:ResourceEvent = new ResourceEvent(ResourceEvent.ERROR, event.bubbles, event.cancelable);
resourceEvent.bytesLoaded = event.bytesLoaded;
resourceEvent.bytesTotal = event.bytesTotal;
resourceEvent.errorText = event.errorText;
dispatchEvent(resourceEvent);
}
}
Section 180
//IResponder (mx.rpc.IResponder)
package mx.rpc {
public interface IResponder {
function fault(:Object):void;
function result(:Object):void;
}
}//package mx.rpc
Section 181
//ButtonSkin (mx.skins.halo.ButtonSkin)
package mx.skins.halo {
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class ButtonSkin extends Border {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var cache:Object = {};
public function ButtonSkin(){
super();
}
override public function get measuredWidth():Number{
return (UIComponent.DEFAULT_MEASURED_MIN_WIDTH);
}
override public function get measuredHeight():Number{
return (UIComponent.DEFAULT_MEASURED_MIN_HEIGHT);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var tmp:Number;
var upFillColors:Array;
var upFillAlphas:Array;
var overFillColors:Array;
var overFillAlphas:Array;
var disFillColors:Array;
var disFillAlphas:Array;
super.updateDisplayList(w, h);
var borderColor:uint = getStyle("borderColor");
var cornerRadius:Number = getStyle("cornerRadius");
var fillAlphas:Array = getStyle("fillAlphas");
var fillColors:Array = getStyle("fillColors");
StyleManager.getColorNames(fillColors);
var highlightAlphas:Array = getStyle("highlightAlphas");
var themeColor:uint = getStyle("themeColor");
var derStyles:Object = calcDerivedStyles(themeColor, fillColors[0], fillColors[1]);
var borderColorDrk1:Number = ColorUtil.adjustBrightness2(borderColor, -50);
var themeColorDrk1:Number = ColorUtil.adjustBrightness2(themeColor, -25);
var emph:Boolean;
if ((parent is IButton)){
emph = IButton(parent).emphasized;
};
var cr:Number = Math.max(0, cornerRadius);
var cr1:Number = Math.max(0, (cornerRadius - 1));
var cr2:Number = Math.max(0, (cornerRadius - 2));
graphics.clear();
switch (name){
case "selectedUpSkin":
case "selectedOverSkin":
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, [fillColors[1], fillColors[1]], 1, verticalGradientMatrix(0, 0, (w - 2), (h - 2)));
break;
case "upSkin":
upFillColors = [fillColors[0], fillColors[1]];
upFillAlphas = [fillAlphas[0], fillAlphas[1]];
if (emph){
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:2, y:2, w:(w - 4), h:(h - 4), r:(cornerRadius - 2)});
drawRoundRect(2, 2, (w - 4), (h - 4), cr2, upFillColors, upFillAlphas, verticalGradientMatrix(2, 2, (w - 2), (h - 2)));
drawRoundRect(2, 2, (w - 4), ((h - 4) / 2), {tl:cr2, tr:cr2, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
} else {
drawRoundRect(0, 0, w, h, cr, [borderColor, borderColorDrk1], 1, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:(cornerRadius - 1)});
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, upFillColors, upFillAlphas, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
drawRoundRect(1, 1, (w - 2), ((h - 2) / 2), {tl:cr1, tr:cr1, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
};
break;
case "overSkin":
if (fillColors.length > 2){
overFillColors = [fillColors[2], fillColors[3]];
} else {
overFillColors = [fillColors[0], fillColors[1]];
};
if (fillAlphas.length > 2){
overFillAlphas = [fillAlphas[2], fillAlphas[3]];
} else {
overFillAlphas = [fillAlphas[0], fillAlphas[1]];
};
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:(cornerRadius - 1)});
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, overFillColors, overFillAlphas, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
drawRoundRect(1, 1, (w - 2), ((h - 2) / 2), {tl:cr1, tr:cr1, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
break;
case "downSkin":
case "selectedDownSkin":
drawRoundRect(0, 0, w, h, cr, [themeColor, themeColorDrk1], 1, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, [derStyles.fillColorPress1, derStyles.fillColorPress2], 1, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
drawRoundRect(2, 2, (w - 4), ((h - 4) / 2), {tl:cr2, tr:cr2, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(1, 1, (w - 2), ((h - 2) / 2)));
break;
case "disabledSkin":
case "selectedDisabledSkin":
disFillColors = [fillColors[0], fillColors[1]];
disFillAlphas = [Math.max(0, (fillAlphas[0] - 0.15)), Math.max(0, (fillAlphas[1] - 0.15))];
drawRoundRect(0, 0, w, h, cr, [borderColor, borderColorDrk1], 0.5, verticalGradientMatrix(0, 0, w, h), GradientType.LINEAR, null, {x:1, y:1, w:(w - 2), h:(h - 2), r:(cornerRadius - 1)});
drawRoundRect(1, 1, (w - 2), (h - 2), cr1, disFillColors, disFillAlphas, verticalGradientMatrix(1, 1, (w - 2), (h - 2)));
break;
};
}
private static function calcDerivedStyles(themeColor:uint, fillColor0:uint, fillColor1:uint):Object{
var o:Object;
var key:String = HaloColors.getCacheKey(themeColor, fillColor0, fillColor1);
if (!cache[key]){
o = (cache[key] = {});
HaloColors.addHaloColors(o, themeColor, fillColor0, fillColor1);
};
return (cache[key]);
}
}
}//package mx.skins.halo
Section 182
//HaloBorder (mx.skins.halo.HaloBorder)
package mx.skins.halo {
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import mx.graphics.*;
import mx.skins.*;
import mx.utils.*;
public class HaloBorder extends RectangularBorder {
mx_internal var radiusObj:Object;
mx_internal var backgroundHole:Object;
mx_internal var radius:Number;
mx_internal var bRoundedCorners:Boolean;
mx_internal var backgroundColor:Object;
private var dropShadow:RectangularDropShadow;
protected var _borderMetrics:EdgeMetrics;
mx_internal var backgroundAlphaName:String;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var BORDER_WIDTHS:Object = {none:0, solid:1, inset:2, outset:2, alert:3, dropdown:2, menuBorder:1, comboNonEdit:2};
public function HaloBorder(){
super();
BORDER_WIDTHS["default"] = 3;
}
override public function styleChanged(styleProp:String):void{
if ((((((((((styleProp == null)) || ((styleProp == "styleName")))) || ((styleProp == "borderStyle")))) || ((styleProp == "borderThickness")))) || ((styleProp == "borderSides")))){
_borderMetrics = null;
};
invalidateDisplayList();
}
override protected function updateDisplayList(w:Number, h:Number):void{
if (((isNaN(w)) || (isNaN(h)))){
return;
};
super.updateDisplayList(w, h);
backgroundColor = getBackgroundColor();
bRoundedCorners = false;
backgroundAlphaName = "backgroundAlpha";
backgroundHole = null;
radius = 0;
radiusObj = null;
drawBorder(w, h);
drawBackground(w, h);
}
mx_internal function drawBorder(w:Number, h:Number):void{
var backgroundAlpha:Number;
var borderCapColor:uint;
var borderColor:uint;
var borderSides:String;
var borderThickness:Number;
var buttonColor:uint;
var docked:Boolean;
var dropdownBorderColor:uint;
var fillColors:Array;
var footerColors:Array;
var highlightColor:uint;
var shadowCapColor:uint;
var shadowColor:uint;
var themeColor:uint;
var translucent:Boolean;
var hole:Object;
var borderColorDrk1:Number;
var borderColorDrk2:Number;
var borderColorLt1:Number;
var borderInnerColor:Object;
var contentAlpha:Number;
var br:Number;
var parentContainer:IContainer;
var vm:EdgeMetrics;
var showChrome:Boolean;
var borderAlpha:Number;
var fillAlphas:Array;
var backgroundColorNum:uint;
var bHasAllSides:Boolean;
var holeRadius:Number;
var borderStyle:String = getStyle("borderStyle");
var highlightAlphas:Array = getStyle("highlightAlphas");
var drawTopHighlight:Boolean;
var g:Graphics = graphics;
g.clear();
if (borderStyle){
switch (borderStyle){
case "none":
break;
case "inset":
borderColor = getStyle("borderColor");
borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -40);
borderColorDrk2 = ColorUtil.adjustBrightness2(borderColor, 25);
borderColorLt1 = ColorUtil.adjustBrightness2(borderColor, 40);
borderInnerColor = backgroundColor;
if ((((borderInnerColor === null)) || ((borderInnerColor === "")))){
borderInnerColor = borderColor;
};
draw3dBorder(borderColorDrk2, borderColorDrk1, borderColorLt1, Number(borderInnerColor), Number(borderInnerColor), Number(borderInnerColor));
break;
case "outset":
borderColor = getStyle("borderColor");
borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -40);
borderColorDrk2 = ColorUtil.adjustBrightness2(borderColor, -25);
borderColorLt1 = ColorUtil.adjustBrightness2(borderColor, 40);
borderInnerColor = backgroundColor;
if ((((borderInnerColor === null)) || ((borderInnerColor === "")))){
borderInnerColor = borderColor;
};
draw3dBorder(borderColorDrk2, borderColorLt1, borderColorDrk1, Number(borderInnerColor), Number(borderInnerColor), Number(borderInnerColor));
break;
case "alert":
case "default":
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
contentAlpha = getStyle("backgroundAlpha");
backgroundAlpha = getStyle("borderAlpha");
backgroundAlphaName = "borderAlpha";
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
br = (bRoundedCorners) ? radius : 0;
drawDropShadow(0, 0, w, h, radius, radius, br, br);
if (!bRoundedCorners){
radiusObj = {};
};
parentContainer = (parent as IContainer);
if (parentContainer){
vm = parentContainer.viewMetrics;
backgroundHole = {x:vm.left, y:vm.top, w:Math.max(0, ((w - vm.left) - vm.right)), h:Math.max(0, ((h - vm.top) - vm.bottom)), r:0};
if ((((backgroundHole.w > 0)) && ((backgroundHole.h > 0)))){
if (contentAlpha != backgroundAlpha){
drawDropShadow(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h, 0, 0, 0, 0);
};
g.beginFill(Number(backgroundColor), contentAlpha);
g.drawRect(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h);
g.endFill();
};
};
backgroundColor = getStyle("borderColor");
};
break;
case "dropdown":
dropdownBorderColor = getStyle("dropdownBorderColor");
drawDropShadow(0, 0, w, h, 4, 0, 0, 4);
drawRoundRect(0, 0, w, h, {tl:4, tr:0, br:0, bl:4}, 5068126, 1);
drawRoundRect(0, 0, w, h, {tl:4, tr:0, br:0, bl:4}, [0xFFFFFF, 0xFFFFFF], [0.7, 0], verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 1, (w - 1), (h - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (w - 1), (h - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (w - 1), (h - 3)));
if (!isNaN(dropdownBorderColor)){
drawRoundRect(0, 0, (w + 1), h, {tl:4, tr:0, br:0, bl:4}, dropdownBorderColor, 0.5);
drawRoundRect(1, 1, (w - 1), (h - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (w - 1), (h - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (w - 1), (h - 3)));
};
backgroundColor = null;
break;
case "menuBorder":
borderColor = getStyle("borderColor");
drawRoundRect(0, 0, w, h, 0, borderColor, 1);
drawDropShadow(1, 1, (w - 2), (h - 2), 0, 0, 0, 0);
break;
case "comboNonEdit":
break;
case "controlBar":
if ((((w == 0)) || ((h == 0)))){
backgroundColor = null;
break;
};
footerColors = getStyle("footerColors");
showChrome = !((footerColors == null));
borderAlpha = getStyle("borderAlpha");
if (showChrome){
g.lineStyle(0, ((footerColors.length > 0)) ? footerColors[1] : footerColors[0], borderAlpha);
g.moveTo(0, 0);
g.lineTo(w, 0);
g.lineStyle(0, 0, 0);
if (((((parent) && (parent.parent))) && ((parent.parent is IStyleClient)))){
radius = IStyleClient(parent.parent).getStyle("cornerRadius");
borderAlpha = IStyleClient(parent.parent).getStyle("borderAlpha");
};
if (isNaN(radius)){
radius = 0;
};
if (IStyleClient(parent.parent).getStyle("roundedBottomCorners").toString().toLowerCase() != "true"){
radius = 0;
};
drawRoundRect(0, 1, w, (h - 1), {tl:0, tr:0, bl:radius, br:radius}, footerColors, borderAlpha, verticalGradientMatrix(0, 0, w, h));
if ((((footerColors.length > 1)) && (!((footerColors[0] == footerColors[1]))))){
drawRoundRect(0, 1, w, (h - 1), {tl:0, tr:0, bl:radius, br:radius}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(1, 2, (w - 2), (h - 3), {tl:0, tr:0, bl:(radius - 1), br:(radius - 1)}, footerColors, borderAlpha, verticalGradientMatrix(0, 0, w, h));
};
};
backgroundColor = null;
break;
case "applicationControlBar":
fillColors = getStyle("fillColors");
backgroundAlpha = getStyle("backgroundAlpha");
highlightAlphas = getStyle("highlightAlphas");
fillAlphas = getStyle("fillAlphas");
docked = getStyle("docked");
backgroundColorNum = uint(backgroundColor);
radius = getStyle("cornerRadius");
if (!radius){
radius = 0;
};
drawDropShadow(0, 1, w, (h - 1), radius, radius, radius, radius);
if (((!((backgroundColor === null))) && (StyleManager.isValidStyleValue(backgroundColor)))){
drawRoundRect(0, 1, w, (h - 1), radius, backgroundColorNum, backgroundAlpha, verticalGradientMatrix(0, 0, w, h));
};
drawRoundRect(0, 1, w, (h - 1), radius, fillColors, fillAlphas, verticalGradientMatrix(0, 0, w, h));
drawRoundRect(0, 1, w, ((h / 2) - 1), {tl:radius, tr:radius, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], highlightAlphas, verticalGradientMatrix(0, 0, w, ((h / 2) - 1)));
drawRoundRect(0, 1, w, (h - 1), {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, 0.3, null, GradientType.LINEAR, null, {x:0, y:2, w:w, h:(h - 2), r:{tl:radius, tr:radius, bl:0, br:0}});
backgroundColor = null;
break;
default:
borderColor = getStyle("borderColor");
borderThickness = getStyle("borderThickness");
borderSides = getStyle("borderSides");
bHasAllSides = true;
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
holeRadius = Math.max((radius - borderThickness), 0);
hole = {x:borderThickness, y:borderThickness, w:(w - (borderThickness * 2)), h:(h - (borderThickness * 2)), r:holeRadius};
if (!bRoundedCorners){
radiusObj = {tl:radius, tr:radius, bl:0, br:0};
hole.r = {tl:holeRadius, tr:holeRadius, bl:0, br:0};
};
if (borderSides != "left top right bottom"){
hole.r = {tl:holeRadius, tr:holeRadius, bl:(bRoundedCorners) ? holeRadius : 0, br:(bRoundedCorners) ? holeRadius : 0};
radiusObj = {tl:radius, tr:radius, bl:(bRoundedCorners) ? radius : 0, br:(bRoundedCorners) ? radius : 0};
borderSides = borderSides.toLowerCase();
if (borderSides.indexOf("left") == -1){
hole.x = 0;
hole.w = (hole.w + borderThickness);
hole.r.tl = 0;
hole.r.bl = 0;
radiusObj.tl = 0;
radiusObj.bl = 0;
bHasAllSides = false;
};
if (borderSides.indexOf("top") == -1){
hole.y = 0;
hole.h = (hole.h + borderThickness);
hole.r.tl = 0;
hole.r.tr = 0;
radiusObj.tl = 0;
radiusObj.tr = 0;
bHasAllSides = false;
};
if (borderSides.indexOf("right") == -1){
hole.w = (hole.w + borderThickness);
hole.r.tr = 0;
hole.r.br = 0;
radiusObj.tr = 0;
radiusObj.br = 0;
bHasAllSides = false;
};
if (borderSides.indexOf("bottom") == -1){
hole.h = (hole.h + borderThickness);
hole.r.bl = 0;
hole.r.br = 0;
radiusObj.bl = 0;
radiusObj.br = 0;
bHasAllSides = false;
};
};
if ((((radius == 0)) && (bHasAllSides))){
drawDropShadow(0, 0, w, h, 0, 0, 0, 0);
g.beginFill(borderColor);
g.drawRect(0, 0, w, h);
g.drawRect(borderThickness, borderThickness, (w - (2 * borderThickness)), (h - (2 * borderThickness)));
g.endFill();
} else {
if (radiusObj){
drawDropShadow(0, 0, w, h, radiusObj.tl, radiusObj.tr, radiusObj.br, radiusObj.bl);
drawRoundRect(0, 0, w, h, radiusObj, borderColor, 1, null, null, null, hole);
radiusObj.tl = Math.max((radius - borderThickness), 0);
radiusObj.tr = Math.max((radius - borderThickness), 0);
radiusObj.bl = (bRoundedCorners) ? Math.max((radius - borderThickness), 0) : 0;
radiusObj.br = (bRoundedCorners) ? Math.max((radius - borderThickness), 0) : 0;
} else {
drawDropShadow(0, 0, w, h, radius, radius, radius, radius);
drawRoundRect(0, 0, w, h, radius, borderColor, 1, null, null, null, hole);
radius = Math.max((getStyle("cornerRadius") - borderThickness), 0);
};
};
};
};
}
mx_internal function drawBackground(w:Number, h:Number):void{
var nd:Number;
var alpha:Number;
var bm:EdgeMetrics;
var g:Graphics;
var bottom:Number;
var topRadius:Number;
var bottomRadius:Number;
var highlightAlphas:Array;
var highlightAlpha:Number;
if (((((((!((backgroundColor === null))) && (!((backgroundColor === ""))))) || (getStyle("mouseShield")))) || (getStyle("mouseShieldChildren")))){
nd = Number(backgroundColor);
alpha = 1;
bm = getBackgroundColorMetrics();
g = graphics;
if (((((isNaN(nd)) || ((backgroundColor === "")))) || ((backgroundColor === null)))){
alpha = 0;
nd = 0xFFFFFF;
} else {
alpha = getStyle(backgroundAlphaName);
};
if (((!((radius == 0))) || (backgroundHole))){
bottom = bm.bottom;
if (radiusObj){
topRadius = Math.max((radius - Math.max(bm.top, bm.left, bm.right)), 0);
bottomRadius = (bRoundedCorners) ? Math.max((radius - Math.max(bm.bottom, bm.left, bm.right)), 0) : 0;
radiusObj = {tl:topRadius, tr:topRadius, bl:bottomRadius, br:bottomRadius};
drawRoundRect(bm.left, bm.top, (width - (bm.left + bm.right)), (height - (bm.top + bottom)), radiusObj, nd, alpha, null, GradientType.LINEAR, null, backgroundHole);
} else {
drawRoundRect(bm.left, bm.top, (width - (bm.left + bm.right)), (height - (bm.top + bottom)), radius, nd, alpha, null, GradientType.LINEAR, null, backgroundHole);
};
} else {
g.beginFill(nd, alpha);
g.drawRect(bm.left, bm.top, ((w - bm.right) - bm.left), ((h - bm.bottom) - bm.top));
g.endFill();
};
};
var borderStyle:String = getStyle("borderStyle");
if ((((((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) && ((((borderStyle == "alert")) || ((borderStyle == "default")))))) && ((getStyle("headerColors") == null)))){
highlightAlphas = getStyle("highlightAlphas");
highlightAlpha = (highlightAlphas) ? highlightAlphas[0] : 0.3;
drawRoundRect(0, 0, w, h, {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, highlightAlpha, null, GradientType.LINEAR, null, {x:0, y:1, w:w, h:(h - 1), r:{tl:radius, tr:radius, bl:0, br:0}});
};
}
mx_internal function drawDropShadow(x:Number, y:Number, width:Number, height:Number, tlRadius:Number, trRadius:Number, brRadius:Number, blRadius:Number):void{
var angle:Number;
var docked:Boolean;
if ((((((((getStyle("dropShadowEnabled") == false)) || ((getStyle("dropShadowEnabled") == "false")))) || ((width == 0)))) || ((height == 0)))){
return;
};
var distance:Number = getStyle("shadowDistance");
var direction:String = getStyle("shadowDirection");
if (getStyle("borderStyle") == "applicationControlBar"){
docked = getStyle("docked");
angle = (docked) ? 90 : getDropShadowAngle(distance, direction);
distance = Math.abs(distance);
} else {
angle = getDropShadowAngle(distance, direction);
distance = (Math.abs(distance) + 2);
};
if (!dropShadow){
dropShadow = new RectangularDropShadow();
};
dropShadow.distance = distance;
dropShadow.angle = angle;
dropShadow.color = getStyle("dropShadowColor");
dropShadow.alpha = 0.4;
dropShadow.tlRadius = tlRadius;
dropShadow.trRadius = trRadius;
dropShadow.blRadius = blRadius;
dropShadow.brRadius = brRadius;
dropShadow.drawShadow(graphics, x, y, width, height);
}
mx_internal function getBackgroundColor():Object{
var color:Object;
var p:IUIComponent = (parent as IUIComponent);
if (((p) && (!(p.enabled)))){
color = getStyle("backgroundDisabledColor");
if (((!((color === null))) && (StyleManager.isValidStyleValue(color)))){
return (color);
};
};
return (getStyle("backgroundColor"));
}
mx_internal function draw3dBorder(c1:Number, c2:Number, c3:Number, c4:Number, c5:Number, c6:Number):void{
var w:Number = width;
var h:Number = height;
drawDropShadow(0, 0, width, height, 0, 0, 0, 0);
var g:Graphics = graphics;
g.beginFill(c1);
g.drawRect(0, 0, w, h);
g.drawRect(1, 0, (w - 2), h);
g.endFill();
g.beginFill(c2);
g.drawRect(1, 0, (w - 2), 1);
g.endFill();
g.beginFill(c3);
g.drawRect(1, (h - 1), (w - 2), 1);
g.endFill();
g.beginFill(c4);
g.drawRect(1, 1, (w - 2), 1);
g.endFill();
g.beginFill(c5);
g.drawRect(1, (h - 2), (w - 2), 1);
g.endFill();
g.beginFill(c6);
g.drawRect(1, 2, (w - 2), (h - 4));
g.drawRect(2, 2, (w - 4), (h - 4));
g.endFill();
}
mx_internal function getBackgroundColorMetrics():EdgeMetrics{
return (borderMetrics);
}
mx_internal function getDropShadowAngle(distance:Number, direction:String):Number{
if (direction == "left"){
return (((distance >= 0)) ? 135 : 225);
} else {
if (direction == "right"){
return (((distance >= 0)) ? 45 : 315);
//unresolved jump
};
};
return (!NULL!);
}
override public function get borderMetrics():EdgeMetrics{
var borderThickness:Number;
var borderSides:String;
if (_borderMetrics){
return (_borderMetrics);
};
var borderStyle:String = getStyle("borderStyle");
if ((((borderStyle == "default")) || ((borderStyle == "alert")))){
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
_borderMetrics = new EdgeMetrics(0, 0, 0, 0);
} else {
return (EdgeMetrics.EMPTY);
};
} else {
if ((((borderStyle == "controlBar")) || ((borderStyle == "applicationControlBar")))){
_borderMetrics = new EdgeMetrics(1, 1, 1, 1);
} else {
if (borderStyle == "solid"){
borderThickness = getStyle("borderThickness");
if (isNaN(borderThickness)){
borderThickness = 0;
};
_borderMetrics = new EdgeMetrics(borderThickness, borderThickness, borderThickness, borderThickness);
borderSides = getStyle("borderSides");
if (borderSides != "left top right bottom"){
if (borderSides.indexOf("left") == -1){
_borderMetrics.left = 0;
};
if (borderSides.indexOf("top") == -1){
_borderMetrics.top = 0;
};
if (borderSides.indexOf("right") == -1){
_borderMetrics.right = 0;
};
if (borderSides.indexOf("bottom") == -1){
_borderMetrics.bottom = 0;
};
};
} else {
borderThickness = BORDER_WIDTHS[borderStyle];
if (isNaN(borderThickness)){
borderThickness = 0;
};
_borderMetrics = new EdgeMetrics(borderThickness, borderThickness, borderThickness, borderThickness);
};
};
};
return (_borderMetrics);
}
}
}//package mx.skins.halo
Section 183
//HaloColors (mx.skins.halo.HaloColors)
package mx.skins.halo {
import mx.core.*;
import mx.utils.*;
public class HaloColors {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var cache:Object = {};
public function HaloColors(){
super();
}
public static function getCacheKey(... _args):String{
return (_args.join(","));
}
public static function addHaloColors(colors:Object, themeColor:uint, fillColor0:uint, fillColor1:uint):void{
var key:String = getCacheKey(themeColor, fillColor0, fillColor1);
var o:Object = cache[key];
if (!o){
o = (cache[key] = {});
o.themeColLgt = ColorUtil.adjustBrightness(themeColor, 100);
o.themeColDrk1 = ColorUtil.adjustBrightness(themeColor, -75);
o.themeColDrk2 = ColorUtil.adjustBrightness(themeColor, -25);
o.fillColorBright1 = ColorUtil.adjustBrightness2(fillColor0, 15);
o.fillColorBright2 = ColorUtil.adjustBrightness2(fillColor1, 15);
o.fillColorPress1 = ColorUtil.adjustBrightness2(themeColor, 85);
o.fillColorPress2 = ColorUtil.adjustBrightness2(themeColor, 60);
o.bevelHighlight1 = ColorUtil.adjustBrightness2(fillColor0, 40);
o.bevelHighlight2 = ColorUtil.adjustBrightness2(fillColor1, 40);
};
colors.themeColLgt = o.themeColLgt;
colors.themeColDrk1 = o.themeColDrk1;
colors.themeColDrk2 = o.themeColDrk2;
colors.fillColorBright1 = o.fillColorBright1;
colors.fillColorBright2 = o.fillColorBright2;
colors.fillColorPress1 = o.fillColorPress1;
colors.fillColorPress2 = o.fillColorPress2;
colors.bevelHighlight1 = o.bevelHighlight1;
colors.bevelHighlight2 = o.bevelHighlight2;
}
}
}//package mx.skins.halo
Section 184
//HaloFocusRect (mx.skins.halo.HaloFocusRect)
package mx.skins.halo {
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class HaloFocusRect extends ProgrammaticSkin implements IStyleClient {
private var _focusColor:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
public function HaloFocusRect(){
super();
}
public function get inheritingStyles():Object{
return (styleName.inheritingStyles);
}
public function set inheritingStyles(value:Object):void{
}
public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
}
public function registerEffects(effects:Array):void{
}
public function regenerateStyleCache(recursive:Boolean):void{
}
public function get styleDeclaration():CSSStyleDeclaration{
return (CSSStyleDeclaration(styleName));
}
public function getClassStyleDeclarations():Array{
return ([]);
}
public function get className():String{
return ("HaloFocusRect");
}
public function clearStyle(styleProp:String):void{
if (styleProp == "focusColor"){
_focusColor = NaN;
};
}
public function setStyle(styleProp:String, newValue):void{
if (styleProp == "focusColor"){
_focusColor = newValue;
};
}
public function set nonInheritingStyles(value:Object):void{
}
public function get nonInheritingStyles():Object{
return (styleName.nonInheritingStyles);
}
override protected function updateDisplayList(w:Number, h:Number):void{
var tl:Number;
var bl:Number;
var tr:Number;
var br:Number;
var nr:Number;
var ellipseSize:Number;
super.updateDisplayList(w, h);
var focusBlendMode:String = getStyle("focusBlendMode");
var focusAlpha:Number = getStyle("focusAlpha");
var focusColor:Number = getStyle("focusColor");
var cornerRadius:Number = getStyle("cornerRadius");
var focusThickness:Number = getStyle("focusThickness");
var focusRoundedCorners:String = getStyle("focusRoundedCorners");
var themeColor:Number = getStyle("themeColor");
var rectColor:Number = focusColor;
if (isNaN(rectColor)){
rectColor = themeColor;
};
var g:Graphics = graphics;
g.clear();
if (focusBlendMode){
blendMode = focusBlendMode;
};
if (((!((focusRoundedCorners == "tl tr bl br"))) && ((cornerRadius > 0)))){
tl = 0;
bl = 0;
tr = 0;
br = 0;
nr = (cornerRadius + focusThickness);
if (focusRoundedCorners.indexOf("tl") >= 0){
tl = nr;
};
if (focusRoundedCorners.indexOf("tr") >= 0){
tr = nr;
};
if (focusRoundedCorners.indexOf("bl") >= 0){
bl = nr;
};
if (focusRoundedCorners.indexOf("br") >= 0){
br = nr;
};
g.beginFill(rectColor, focusAlpha);
GraphicsUtil.drawRoundRectComplex(g, 0, 0, w, h, tl, tr, bl, br);
tl = (tl) ? cornerRadius : 0;
tr = (tr) ? cornerRadius : 0;
bl = (bl) ? cornerRadius : 0;
br = (br) ? cornerRadius : 0;
GraphicsUtil.drawRoundRectComplex(g, focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), tl, tr, bl, br);
g.endFill();
nr = (cornerRadius + (focusThickness / 2));
tl = (tl) ? nr : 0;
tr = (tr) ? nr : 0;
bl = (bl) ? nr : 0;
br = (br) ? nr : 0;
g.beginFill(rectColor, focusAlpha);
GraphicsUtil.drawRoundRectComplex(g, (focusThickness / 2), (focusThickness / 2), (w - focusThickness), (h - focusThickness), tl, tr, bl, br);
tl = (tl) ? cornerRadius : 0;
tr = (tr) ? cornerRadius : 0;
bl = (bl) ? cornerRadius : 0;
br = (br) ? cornerRadius : 0;
GraphicsUtil.drawRoundRectComplex(g, focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), tl, tr, bl, br);
g.endFill();
} else {
g.beginFill(rectColor, focusAlpha);
ellipseSize = (((cornerRadius > 0)) ? (cornerRadius + focusThickness) : 0 * 2);
g.drawRoundRect(0, 0, w, h, ellipseSize, ellipseSize);
ellipseSize = (cornerRadius * 2);
g.drawRoundRect(focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), ellipseSize, ellipseSize);
g.endFill();
g.beginFill(rectColor, focusAlpha);
ellipseSize = (((cornerRadius > 0)) ? (cornerRadius + (focusThickness / 2)) : 0 * 2);
g.drawRoundRect((focusThickness / 2), (focusThickness / 2), (w - focusThickness), (h - focusThickness), ellipseSize, ellipseSize);
ellipseSize = (cornerRadius * 2);
g.drawRoundRect(focusThickness, focusThickness, (w - (2 * focusThickness)), (h - (2 * focusThickness)), ellipseSize, ellipseSize);
g.endFill();
};
}
override public function getStyle(styleProp:String){
return (((styleProp == "focusColor")) ? _focusColor : super.getStyle(styleProp));
}
public function set styleDeclaration(value:CSSStyleDeclaration):void{
}
}
}//package mx.skins.halo
Section 185
//Border (mx.skins.Border)
package mx.skins {
import mx.core.*;
public class Border extends ProgrammaticSkin implements IBorder {
mx_internal static const VERSION:String = "3.5.0.12683";
public function Border(){
super();
}
public function get borderMetrics():EdgeMetrics{
return (EdgeMetrics.EMPTY);
}
}
}//package mx.skins
Section 186
//ProgrammaticSkin (mx.skins.ProgrammaticSkin)
package mx.skins {
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import flash.geom.*;
import mx.managers.*;
import mx.utils.*;
public class ProgrammaticSkin extends FlexShape implements IFlexDisplayObject, IInvalidating, ILayoutManagerClient, ISimpleStyleClient, IProgrammaticSkin {
private var _initialized:Boolean;// = false
private var _height:Number;
private var invalidateDisplayListFlag:Boolean;// = false
private var _styleName:IStyleClient;
private var _nestLevel:int;// = 0
private var _processedDescriptors:Boolean;// = false
private var _updateCompletePendingFlag:Boolean;// = true
private var _width:Number;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var tempMatrix:Matrix = new Matrix();
public function ProgrammaticSkin(){
super();
_width = measuredWidth;
_height = measuredHeight;
}
public function getStyle(styleProp:String){
return ((_styleName) ? _styleName.getStyle(styleProp) : null);
}
protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
}
public function get nestLevel():int{
return (_nestLevel);
}
public function set nestLevel(value:int):void{
_nestLevel = value;
invalidateDisplayList();
}
override public function get height():Number{
return (_height);
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
protected function verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
return (rotatedGradientMatrix(x, y, width, height, 90));
}
public function validateSize(recursive:Boolean=false):void{
}
public function invalidateDisplayList():void{
if (((!(invalidateDisplayListFlag)) && ((nestLevel > 0)))){
invalidateDisplayListFlag = true;
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
}
public function set updateCompletePendingFlag(value:Boolean):void{
_updateCompletePendingFlag = value;
}
protected function horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix{
return (rotatedGradientMatrix(x, y, width, height, 0));
}
override public function set height(value:Number):void{
_height = value;
invalidateDisplayList();
}
public function set processedDescriptors(value:Boolean):void{
_processedDescriptors = value;
}
public function validateDisplayList():void{
invalidateDisplayListFlag = false;
updateDisplayList(width, height);
}
public function get measuredWidth():Number{
return (0);
}
override public function set width(value:Number):void{
_width = value;
invalidateDisplayList();
}
public function get measuredHeight():Number{
return (0);
}
public function set initialized(value:Boolean):void{
_initialized = value;
}
protected function drawRoundRect(x:Number, y:Number, width:Number, height:Number, cornerRadius:Object=null, color:Object=null, alpha:Object=null, gradientMatrix:Matrix=null, gradientType:String="linear", gradientRatios:Array=null, hole:Object=null):void{
var ellipseSize:Number;
var alphas:Array;
var holeR:Object;
var g:Graphics = graphics;
if ((((width == 0)) || ((height == 0)))){
return;
};
if (color !== null){
if ((color is uint)){
g.beginFill(uint(color), Number(alpha));
} else {
if ((color is Array)){
alphas = ((alpha is Array)) ? (alpha as Array) : [alpha, alpha];
if (!gradientRatios){
gradientRatios = [0, 0xFF];
};
g.beginGradientFill(gradientType, (color as Array), alphas, gradientRatios, gradientMatrix);
};
};
};
if (!cornerRadius){
g.drawRect(x, y, width, height);
} else {
if ((cornerRadius is Number)){
ellipseSize = (Number(cornerRadius) * 2);
g.drawRoundRect(x, y, width, height, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, x, y, width, height, cornerRadius.tl, cornerRadius.tr, cornerRadius.bl, cornerRadius.br);
};
};
if (hole){
holeR = hole.r;
if ((holeR is Number)){
ellipseSize = (Number(holeR) * 2);
g.drawRoundRect(hole.x, hole.y, hole.w, hole.h, ellipseSize, ellipseSize);
} else {
GraphicsUtil.drawRoundRectComplex(g, hole.x, hole.y, hole.w, hole.h, holeR.tl, holeR.tr, holeR.bl, holeR.br);
};
};
if (color !== null){
g.endFill();
};
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
public function set styleName(value:Object):void{
if (_styleName != value){
_styleName = (value as IStyleClient);
invalidateDisplayList();
};
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
var changed:Boolean;
if (_width != newWidth){
_width = newWidth;
changed = true;
};
if (_height != newHeight){
_height = newHeight;
changed = true;
};
if (changed){
invalidateDisplayList();
};
}
public function styleChanged(styleProp:String):void{
invalidateDisplayList();
}
override public function get width():Number{
return (_width);
}
public function invalidateProperties():void{
}
public function get initialized():Boolean{
return (_initialized);
}
protected function rotatedGradientMatrix(x:Number, y:Number, width:Number, height:Number, rotation:Number):Matrix{
tempMatrix.createGradientBox(width, height, ((rotation * Math.PI) / 180), x, y);
return (tempMatrix);
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
public function get styleName():Object{
return (_styleName);
}
public function validateNow():void{
if (invalidateDisplayListFlag){
validateDisplayList();
};
}
public function invalidateSize():void{
}
public function validateProperties():void{
}
}
}//package mx.skins
Section 187
//RectangularBorder (mx.skins.RectangularBorder)
package mx.skins {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.utils.*;
import mx.styles.*;
import flash.system.*;
import flash.geom.*;
import mx.resources.*;
import flash.net.*;
public class RectangularBorder extends Border implements IRectangularBorder {
private var backgroundImage:DisplayObject;
private var backgroundImageHeight:Number;
private var _backgroundImageBounds:Rectangle;
private var backgroundImageStyle:Object;
private var backgroundImageWidth:Number;
private var resourceManager:IResourceManager;
mx_internal static const VERSION:String = "3.5.0.12683";
public function RectangularBorder(){
resourceManager = ResourceManager.getInstance();
super();
addEventListener(Event.REMOVED, removedHandler);
}
public function layoutBackgroundImage():void{
var sW:Number;
var sH:Number;
var sX:Number;
var sY:Number;
var scale:Number;
var g:Graphics;
var p:DisplayObject = parent;
var bm:EdgeMetrics = ((p is IContainer)) ? IContainer(p).viewMetrics : borderMetrics;
var scrollableBk = !((getStyle("backgroundAttachment") == "fixed"));
if (_backgroundImageBounds){
sW = _backgroundImageBounds.width;
sH = _backgroundImageBounds.height;
} else {
sW = ((width - bm.left) - bm.right);
sH = ((height - bm.top) - bm.bottom);
};
var percentage:Number = getBackgroundSize();
if (isNaN(percentage)){
sX = 1;
sY = 1;
} else {
scale = (percentage * 0.01);
sX = ((scale * sW) / backgroundImageWidth);
sY = ((scale * sH) / backgroundImageHeight);
};
backgroundImage.scaleX = sX;
backgroundImage.scaleY = sY;
var offsetX:Number = Math.round((0.5 * (sW - (backgroundImageWidth * sX))));
var offsetY:Number = Math.round((0.5 * (sH - (backgroundImageHeight * sY))));
backgroundImage.x = bm.left;
backgroundImage.y = bm.top;
var backgroundMask:Shape = Shape(backgroundImage.mask);
backgroundMask.x = bm.left;
backgroundMask.y = bm.top;
if (((scrollableBk) && ((p is IContainer)))){
offsetX = (offsetX - IContainer(p).horizontalScrollPosition);
offsetY = (offsetY - IContainer(p).verticalScrollPosition);
};
backgroundImage.alpha = getStyle("backgroundAlpha");
backgroundImage.x = (backgroundImage.x + offsetX);
backgroundImage.y = (backgroundImage.y + offsetY);
var maskWidth:Number = ((width - bm.left) - bm.right);
var maskHeight:Number = ((height - bm.top) - bm.bottom);
if (((!((backgroundMask.width == maskWidth))) || (!((backgroundMask.height == maskHeight))))){
g = backgroundMask.graphics;
g.clear();
g.beginFill(0xFFFFFF);
g.drawRect(0, 0, maskWidth, maskHeight);
g.endFill();
};
}
public function set backgroundImageBounds(value:Rectangle):void{
if (((((_backgroundImageBounds) && (value))) && (_backgroundImageBounds.equals(value)))){
return;
};
_backgroundImageBounds = value;
invalidateDisplayList();
}
private function getBackgroundSize():Number{
var index:int;
var percentage:Number = NaN;
var backgroundSize:Object = getStyle("backgroundSize");
if (((backgroundSize) && ((backgroundSize is String)))){
index = backgroundSize.indexOf("%");
if (index != -1){
percentage = Number(backgroundSize.substr(0, index));
};
};
return (percentage);
}
private function removedHandler(event:Event):void{
var childrenList:IChildList;
if (backgroundImage){
childrenList = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
childrenList.removeChild(backgroundImage.mask);
childrenList.removeChild(backgroundImage);
backgroundImage = null;
};
}
private function initBackgroundImage(image:DisplayObject):void{
backgroundImage = image;
if ((image is Loader)){
backgroundImageWidth = Loader(image).contentLoaderInfo.width;
backgroundImageHeight = Loader(image).contentLoaderInfo.height;
} else {
backgroundImageWidth = backgroundImage.width;
backgroundImageHeight = backgroundImage.height;
if ((image is ISimpleStyleClient)){
ISimpleStyleClient(image).styleName = styleName;
};
};
var childrenList:IChildList = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
var backgroundMask:Shape = new FlexShape();
backgroundMask.name = "backgroundMask";
backgroundMask.x = 0;
backgroundMask.y = 0;
childrenList.addChild(backgroundMask);
var myIndex:int = childrenList.getChildIndex(this);
childrenList.addChildAt(backgroundImage, (myIndex + 1));
backgroundImage.mask = backgroundMask;
}
public function get backgroundImageBounds():Rectangle{
return (_backgroundImageBounds);
}
public function get hasBackgroundImage():Boolean{
return (!((backgroundImage == null)));
}
private function completeEventHandler(event:Event):void{
if (!parent){
return;
};
var target:DisplayObject = DisplayObject(LoaderInfo(event.target).loader);
initBackgroundImage(target);
layoutBackgroundImage();
dispatchEvent(event.clone());
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
var cls:Class;
var newStyleObj:DisplayObject;
var loader:Loader;
var loaderContext:LoaderContext;
var message:String;
var unscaledWidth = unscaledWidth;
var unscaledHeight = unscaledHeight;
if (!parent){
return;
};
var newStyle:Object = getStyle("backgroundImage");
if (newStyle != backgroundImageStyle){
removedHandler(null);
backgroundImageStyle = newStyle;
if (((newStyle) && ((newStyle as Class)))){
cls = Class(newStyle);
initBackgroundImage(new (cls));
} else {
if (((newStyle) && ((newStyle is String)))){
cls = Class(getDefinitionByName(String(newStyle)));
//unresolved jump
var _slot1 = e;
if (cls){
newStyleObj = new (cls);
initBackgroundImage(newStyleObj);
} else {
loader = new FlexLoader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeEventHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorEventHandler);
loader.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, errorEventHandler);
loaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load(new URLRequest(String(newStyle)), loaderContext);
};
} else {
if (newStyle){
message = resourceManager.getString("skins", "notLoaded", [newStyle]);
throw (new Error(message));
};
};
};
};
if (backgroundImage){
layoutBackgroundImage();
};
}
private function errorEventHandler(event:Event):void{
}
}
}//package mx.skins
Section 188
//IOverride (mx.states.IOverride)
package mx.states {
import mx.core.*;
public interface IOverride {
function initialize():void;
function remove(:UIComponent):void;
function apply(:UIComponent):void;
}
}//package mx.states
Section 189
//State (mx.states.State)
package mx.states {
import flash.events.*;
import mx.core.*;
import mx.events.*;
public class State extends EventDispatcher {
public var basedOn:String;
private var initialized:Boolean;// = false
public var overrides:Array;
public var name:String;
mx_internal static const VERSION:String = "3.5.0.12683";
public function State(){
overrides = [];
super();
}
mx_internal function initialize():void{
var i:int;
if (!initialized){
initialized = true;
i = 0;
while (i < overrides.length) {
IOverride(overrides[i]).initialize();
i++;
};
};
}
mx_internal function dispatchExitState():void{
dispatchEvent(new FlexEvent(FlexEvent.EXIT_STATE));
}
mx_internal function dispatchEnterState():void{
dispatchEvent(new FlexEvent(FlexEvent.ENTER_STATE));
}
}
}//package mx.states
Section 190
//Transition (mx.states.Transition)
package mx.states {
import mx.core.*;
import mx.effects.*;
public class Transition {
public var effect:IEffect;
public var toState:String;// = "*"
public var fromState:String;// = "*"
mx_internal static const VERSION:String = "3.5.0.12683";
public function Transition(){
super();
}
}
}//package mx.states
Section 191
//CSSStyleDeclaration (mx.styles.CSSStyleDeclaration)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.utils.*;
import mx.managers.*;
public class CSSStyleDeclaration extends EventDispatcher {
mx_internal var effects:Array;
protected var overrides:Object;
public var defaultFactory:Function;
public var factory:Function;
mx_internal var selectorRefCount:int;// = 0
private var styleManager:IStyleManager2;
private var clones:Dictionary;
mx_internal static const VERSION:String = "3.5.0.12683";
private static const NOT_A_COLOR:uint = 4294967295;
private static const FILTERMAP_PROP:String = "__reserved__filterMap";
public function CSSStyleDeclaration(selector:String=null){
clones = new Dictionary(true);
super();
if (selector){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
styleManager.setStyleDeclaration(selector, this, false);
};
}
mx_internal function addStyleToProtoChain(chain:Object, target:DisplayObject, filterMap:Object=null):Object{
var p:String;
var emptyObjectFactory:Function;
var filteredChain:Object;
var filterObjectFactory:Function;
var i:String;
var chain = chain;
var target = target;
var filterMap = filterMap;
var nodeAddedToChain:Boolean;
var originalChain:Object = chain;
if (filterMap){
chain = {};
};
if (defaultFactory != null){
defaultFactory.prototype = chain;
chain = new defaultFactory();
nodeAddedToChain = true;
};
if (factory != null){
factory.prototype = chain;
chain = new factory();
nodeAddedToChain = true;
};
if (overrides){
if ((((defaultFactory == null)) && ((factory == null)))){
emptyObjectFactory = function ():void{
};
emptyObjectFactory.prototype = chain;
chain = new (emptyObjectFactory);
nodeAddedToChain = true;
};
for (p in overrides) {
if (overrides[p] === undefined){
delete chain[p];
} else {
chain[p] = overrides[p];
};
};
};
if (filterMap){
if (nodeAddedToChain){
filteredChain = {};
filterObjectFactory = function ():void{
};
filterObjectFactory.prototype = originalChain;
filteredChain = new (filterObjectFactory);
for (i in chain) {
if (filterMap[i] != null){
filteredChain[filterMap[i]] = chain[i];
};
};
chain = filteredChain;
chain[FILTERMAP_PROP] = filterMap;
} else {
chain = originalChain;
};
};
if (nodeAddedToChain){
clones[chain] = 1;
};
return (chain);
}
public function getStyle(styleProp:String){
var o:*;
var v:*;
if (overrides){
if ((((styleProp in overrides)) && ((overrides[styleProp] === undefined)))){
return (undefined);
};
v = overrides[styleProp];
if (v !== undefined){
return (v);
};
};
if (factory != null){
factory.prototype = {};
o = new factory();
v = o[styleProp];
if (v !== undefined){
return (v);
};
};
if (defaultFactory != null){
defaultFactory.prototype = {};
o = new defaultFactory();
v = o[styleProp];
if (v !== undefined){
return (v);
};
};
return (undefined);
}
public function clearStyle(styleProp:String):void{
setStyle(styleProp, undefined);
}
public function setStyle(styleProp:String, newValue):void{
var i:int;
var sm:Object;
var oldValue:Object = getStyle(styleProp);
var regenerate:Boolean;
if ((((((((((selectorRefCount > 0)) && ((factory == null)))) && ((defaultFactory == null)))) && (!(overrides)))) && (!((oldValue === newValue))))){
regenerate = true;
};
if (newValue !== undefined){
setStyle(styleProp, newValue);
} else {
if (newValue == oldValue){
return;
};
setStyle(styleProp, newValue);
};
var sms:Array = SystemManagerGlobals.topLevelSystemManagers;
var n:int = sms.length;
if (regenerate){
i = 0;
while (i < n) {
sm = sms[i];
sm.regenerateStyleCache(true);
i++;
};
};
i = 0;
while (i < n) {
sm = sms[i];
sm.notifyStyleChangeInChildren(styleProp, true);
i++;
};
}
private function clearStyleAttr(styleProp:String):void{
var clone:*;
if (!overrides){
overrides = {};
};
overrides[styleProp] = undefined;
for (clone in clones) {
delete clone[styleProp];
};
}
mx_internal function createProtoChainRoot():Object{
var root:Object = {};
if (defaultFactory != null){
defaultFactory.prototype = root;
root = new defaultFactory();
};
if (factory != null){
factory.prototype = root;
root = new factory();
};
clones[root] = 1;
return (root);
}
mx_internal function clearOverride(styleProp:String):void{
if (((overrides) && (overrides[styleProp]))){
delete overrides[styleProp];
};
}
mx_internal function setStyle(styleProp:String, value):void{
var o:Object;
var clone:*;
var colorNumber:Number;
var cloneFilter:Object;
if (value === undefined){
clearStyleAttr(styleProp);
return;
};
if ((value is String)){
if (!styleManager){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
};
colorNumber = styleManager.getColorName(value);
if (colorNumber != NOT_A_COLOR){
value = colorNumber;
};
};
if (defaultFactory != null){
o = new defaultFactory();
if (o[styleProp] !== value){
if (!overrides){
overrides = {};
};
overrides[styleProp] = value;
} else {
if (overrides){
delete overrides[styleProp];
};
};
};
if (factory != null){
o = new factory();
if (o[styleProp] !== value){
if (!overrides){
overrides = {};
};
overrides[styleProp] = value;
} else {
if (overrides){
delete overrides[styleProp];
};
};
};
if ((((defaultFactory == null)) && ((factory == null)))){
if (!overrides){
overrides = {};
};
overrides[styleProp] = value;
};
for (clone in clones) {
cloneFilter = clone[FILTERMAP_PROP];
if (cloneFilter){
if (cloneFilter[styleProp] != null){
clone[cloneFilter[styleProp]] = value;
};
} else {
clone[styleProp] = value;
};
};
}
}
}//package mx.styles
Section 192
//ISimpleStyleClient (mx.styles.ISimpleStyleClient)
package mx.styles {
public interface ISimpleStyleClient {
function set styleName(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:Object):void;
function styleChanged(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;ISimpleStyleClient.as:String):void;
function get styleName():Object;
}
}//package mx.styles
Section 193
//IStyleClient (mx.styles.IStyleClient)
package mx.styles {
public interface IStyleClient extends ISimpleStyleClient {
function regenerateStyleCache(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Boolean):void;
function get className():String;
function clearStyle(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:String):void;
function getClassStyleDeclarations():Array;
function get inheritingStyles():Object;
function set nonInheritingStyles(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Object):void;
function setStyle(_arg1:String, _arg2):void;
function get styleDeclaration():CSSStyleDeclaration;
function set styleDeclaration(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:CSSStyleDeclaration):void;
function get nonInheritingStyles():Object;
function set inheritingStyles(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Object):void;
function getStyle(*:String);
function notifyStyleChangeInChildren(_arg1:String, _arg2:Boolean):void;
function registerEffects(mx.styles:IStyleClient/mx.styles:IStyleClient:className/get:Array):void;
}
}//package mx.styles
Section 194
//IStyleManager (mx.styles.IStyleManager)
package mx.styles {
import flash.events.*;
public interface IStyleManager {
function isColorName(value:String):Boolean;
function registerParentDisplayListInvalidatingStyle(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function registerInheritingStyle(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function set stylesRoot(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void;
function get typeSelectorCache():Object;
function styleDeclarationsChanged():void;
function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void;
function isParentDisplayListInvalidatingStyle(value:String):Boolean;
function isSizeInvalidatingStyle(value:String):Boolean;
function get inheritingStyles():Object;
function isValidStyleValue(value):Boolean;
function isParentSizeInvalidatingStyle(value:String):Boolean;
function getColorName(mx.styles:IStyleManager/mx.styles:IStyleManager:inheritingStyles/set:Object):uint;
function set typeSelectorCache(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void;
function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void;
function getColorNames(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Array):void;
function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false):IEventDispatcher;
function isInheritingStyle(value:String):Boolean;
function set inheritingStyles(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:Object):void;
function get stylesRoot():Object;
function initProtoChainRoots():void;
function registerColorName(_arg1:String, _arg2:uint):void;
function registerParentSizeInvalidatingStyle(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function registerSizeInvalidatingStyle(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\styles;IStyleManager.as:String):void;
function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void;
function isInheritingTextFormatStyle(value:String):Boolean;
function getStyleDeclaration(mx.styles:IStyleManager/mx.styles:IStyleManager:inheritingStyles/get:String):CSSStyleDeclaration;
}
}//package mx.styles
Section 195
//IStyleManager2 (mx.styles.IStyleManager2)
package mx.styles {
import flash.events.*;
import flash.system.*;
public interface IStyleManager2 extends IStyleManager {
function get selectors():Array;
function loadStyleDeclarations2(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
}
}//package mx.styles
Section 196
//IStyleModule (mx.styles.IStyleModule)
package mx.styles {
public interface IStyleModule {
function unload():void;
}
}//package mx.styles
Section 197
//StyleManager (mx.styles.StyleManager)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.system.*;
public class StyleManager {
mx_internal static const VERSION:String = "3.5.0.12683";
public static const NOT_A_COLOR:uint = 4294967295;
private static var _impl:IStyleManager2;
private static var implClassDependency:StyleManagerImpl;
public function StyleManager(){
super();
}
public static function isParentSizeInvalidatingStyle(styleName:String):Boolean{
return (impl.isParentSizeInvalidatingStyle(styleName));
}
public static function registerInheritingStyle(styleName:String):void{
impl.registerInheritingStyle(styleName);
}
mx_internal static function set stylesRoot(value:Object):void{
impl.stylesRoot = value;
}
mx_internal static function get inheritingStyles():Object{
return (impl.inheritingStyles);
}
mx_internal static function styleDeclarationsChanged():void{
impl.styleDeclarationsChanged();
}
public static function setStyleDeclaration(selector:String, styleDeclaration:CSSStyleDeclaration, update:Boolean):void{
impl.setStyleDeclaration(selector, styleDeclaration, update);
}
public static function registerParentDisplayListInvalidatingStyle(styleName:String):void{
impl.registerParentDisplayListInvalidatingStyle(styleName);
}
mx_internal static function get typeSelectorCache():Object{
return (impl.typeSelectorCache);
}
mx_internal static function set inheritingStyles(value:Object):void{
impl.inheritingStyles = value;
}
public static function isColorName(colorName:String):Boolean{
return (impl.isColorName(colorName));
}
public static function isParentDisplayListInvalidatingStyle(styleName:String):Boolean{
return (impl.isParentDisplayListInvalidatingStyle(styleName));
}
public static function isSizeInvalidatingStyle(styleName:String):Boolean{
return (impl.isSizeInvalidatingStyle(styleName));
}
public static function getColorName(colorName:Object):uint{
return (impl.getColorName(colorName));
}
mx_internal static function set typeSelectorCache(value:Object):void{
impl.typeSelectorCache = value;
}
public static function unloadStyleDeclarations(url:String, update:Boolean=true):void{
impl.unloadStyleDeclarations(url, update);
}
public static function getColorNames(colors:Array):void{
impl.getColorNames(colors);
}
public static function loadStyleDeclarations(url:String, update:Boolean=true, trustContent:Boolean=false, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null):IEventDispatcher{
return (impl.loadStyleDeclarations2(url, update, applicationDomain, securityDomain));
}
private static function get impl():IStyleManager2{
if (!_impl){
_impl = IStyleManager2(Singleton.getInstance("mx.styles::IStyleManager2"));
};
return (_impl);
}
public static function isValidStyleValue(value):Boolean{
return (impl.isValidStyleValue(value));
}
mx_internal static function get stylesRoot():Object{
return (impl.stylesRoot);
}
public static function isInheritingStyle(styleName:String):Boolean{
return (impl.isInheritingStyle(styleName));
}
mx_internal static function initProtoChainRoots():void{
impl.initProtoChainRoots();
}
public static function registerParentSizeInvalidatingStyle(styleName:String):void{
impl.registerParentSizeInvalidatingStyle(styleName);
}
public static function get selectors():Array{
return (impl.selectors);
}
public static function registerSizeInvalidatingStyle(styleName:String):void{
impl.registerSizeInvalidatingStyle(styleName);
}
public static function clearStyleDeclaration(selector:String, update:Boolean):void{
impl.clearStyleDeclaration(selector, update);
}
public static function registerColorName(colorName:String, colorValue:uint):void{
impl.registerColorName(colorName, colorValue);
}
public static function isInheritingTextFormatStyle(styleName:String):Boolean{
return (impl.isInheritingTextFormatStyle(styleName));
}
public static function getStyleDeclaration(selector:String):CSSStyleDeclaration{
return (impl.getStyleDeclaration(selector));
}
}
}//package mx.styles
Section 198
//StyleManagerImpl (mx.styles.StyleManagerImpl)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import flash.system.*;
import mx.modules.*;
import mx.events.*;
import mx.resources.*;
import mx.managers.*;
public class StyleManagerImpl implements IStyleManager2 {
private var _stylesRoot:Object;
private var _selectors:Object;
private var styleModules:Object;
private var _inheritingStyles:Object;
private var resourceManager:IResourceManager;
private var _typeSelectorCache:Object;
mx_internal static const VERSION:String = "3.5.0.12683";
private static var parentSizeInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var colorNames:Object = {transparent:"transparent", black:0, blue:0xFF, green:0x8000, gray:0x808080, silver:0xC0C0C0, lime:0xFF00, olive:0x808000, white:0xFFFFFF, yellow:0xFFFF00, maroon:0x800000, navy:128, red:0xFF0000, purple:0x800080, teal:0x8080, fuchsia:0xFF00FF, aqua:0xFFFF, magenta:0xFF00FF, cyan:0xFFFF, halogreen:8453965, haloblue:40447, haloorange:0xFFB600, halosilver:11455193};
private static var inheritingTextFormatStyles:Object = {align:true, bold:true, color:true, font:true, indent:true, italic:true, size:true};
private static var instance:IStyleManager2;
private static var parentDisplayListInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var sizeInvalidatingStyles:Object = {borderStyle:true, borderThickness:true, fontAntiAliasType:true, fontFamily:true, fontGridFitType:true, fontSharpness:true, fontSize:true, fontStyle:true, fontThickness:true, fontWeight:true, headerHeight:true, horizontalAlign:true, horizontalGap:true, kerning:true, leading:true, letterSpacing:true, paddingBottom:true, paddingLeft:true, paddingRight:true, paddingTop:true, strokeWidth:true, tabHeight:true, tabWidth:true, verticalAlign:true, verticalGap:true};
public function StyleManagerImpl(){
_selectors = {};
styleModules = {};
resourceManager = ResourceManager.getInstance();
_inheritingStyles = {};
_typeSelectorCache = {};
super();
}
public function setStyleDeclaration(selector:String, styleDeclaration:CSSStyleDeclaration, update:Boolean):void{
styleDeclaration.selectorRefCount++;
_selectors[selector] = styleDeclaration;
typeSelectorCache = {};
if (update){
styleDeclarationsChanged();
};
}
public function registerParentDisplayListInvalidatingStyle(styleName:String):void{
parentDisplayListInvalidatingStyles[styleName] = true;
}
public function getStyleDeclaration(selector:String):CSSStyleDeclaration{
var index:int;
if (selector.charAt(0) != "."){
index = selector.lastIndexOf(".");
if (index != -1){
selector = selector.substr((index + 1));
};
};
return (_selectors[selector]);
}
public function set typeSelectorCache(value:Object):void{
_typeSelectorCache = value;
}
public function isColorName(colorName:String):Boolean{
return (!((colorNames[colorName.toLowerCase()] === undefined)));
}
public function set inheritingStyles(value:Object):void{
_inheritingStyles = value;
}
public function getColorNames(colors:Array):void{
var colorNumber:uint;
if (!colors){
return;
};
var n:int = colors.length;
var i:int;
while (i < n) {
if (((!((colors[i] == null))) && (isNaN(colors[i])))){
colorNumber = getColorName(colors[i]);
if (colorNumber != StyleManager.NOT_A_COLOR){
colors[i] = colorNumber;
};
};
i++;
};
}
public function isInheritingTextFormatStyle(styleName:String):Boolean{
return ((inheritingTextFormatStyles[styleName] == true));
}
public function registerParentSizeInvalidatingStyle(styleName:String):void{
parentSizeInvalidatingStyles[styleName] = true;
}
public function registerColorName(colorName:String, colorValue:uint):void{
colorNames[colorName.toLowerCase()] = colorValue;
}
public function isParentSizeInvalidatingStyle(styleName:String):Boolean{
return ((parentSizeInvalidatingStyles[styleName] == true));
}
public function registerInheritingStyle(styleName:String):void{
inheritingStyles[styleName] = true;
}
public function set stylesRoot(value:Object):void{
_stylesRoot = value;
}
public function get typeSelectorCache():Object{
return (_typeSelectorCache);
}
public function isParentDisplayListInvalidatingStyle(styleName:String):Boolean{
return ((parentDisplayListInvalidatingStyles[styleName] == true));
}
public function isSizeInvalidatingStyle(styleName:String):Boolean{
return ((sizeInvalidatingStyles[styleName] == true));
}
public function styleDeclarationsChanged():void{
var sm:Object;
var sms:Array = SystemManagerGlobals.topLevelSystemManagers;
var n:int = sms.length;
var i:int;
while (i < n) {
sm = sms[i];
sm.regenerateStyleCache(true);
sm.notifyStyleChangeInChildren(null, true);
i++;
};
}
public function isValidStyleValue(value):Boolean{
return (!((value === undefined)));
}
public function loadStyleDeclarations(url:String, update:Boolean=true, trustContent:Boolean=false):IEventDispatcher{
return (loadStyleDeclarations2(url, update));
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
public function unloadStyleDeclarations(url:String, update:Boolean=true):void{
var module:IModuleInfo;
var styleModuleInfo:StyleModuleInfo = styleModules[url];
if (styleModuleInfo){
styleModuleInfo.styleModule.unload();
module = styleModuleInfo.module;
module.unload();
module.removeEventListener(ModuleEvent.READY, styleModuleInfo.readyHandler);
module.removeEventListener(ModuleEvent.ERROR, styleModuleInfo.errorHandler);
styleModules[url] = null;
};
if (update){
styleDeclarationsChanged();
};
}
public function getColorName(colorName:Object):uint{
var n:Number;
var c:*;
if ((colorName is String)){
if (colorName.charAt(0) == "#"){
n = Number(("0x" + colorName.slice(1)));
return ((isNaN(n)) ? StyleManager.NOT_A_COLOR : uint(n));
};
if ((((colorName.charAt(1) == "x")) && ((colorName.charAt(0) == "0")))){
n = Number(colorName);
return ((isNaN(n)) ? StyleManager.NOT_A_COLOR : uint(n));
};
c = colorNames[colorName.toLowerCase()];
if (c === undefined){
return (StyleManager.NOT_A_COLOR);
};
return (uint(c));
};
return (uint(colorName));
}
public function isInheritingStyle(styleName:String):Boolean{
return ((inheritingStyles[styleName] == true));
}
public function get stylesRoot():Object{
return (_stylesRoot);
}
public function initProtoChainRoots():void{
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
delete _inheritingStyles["textDecoration"];
delete _inheritingStyles["leading"];
};
if (!stylesRoot){
stylesRoot = _selectors["global"].addStyleToProtoChain({}, null);
};
}
public function loadStyleDeclarations2(url:String, update:Boolean=true, applicationDomain:ApplicationDomain=null, securityDomain:SecurityDomain=null):IEventDispatcher{
var module:IModuleInfo;
var styleEventDispatcher:StyleEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = url;
var update = update;
var applicationDomain = applicationDomain;
var securityDomain = securityDomain;
module = ModuleManager.getModule(url);
var readyHandler:Function = function (moduleEvent:ModuleEvent):void{
var styleModule:IStyleModule = IStyleModule(moduleEvent.module.factory.create());
styleModules[moduleEvent.module.url].styleModule = styleModule;
if (update){
styleDeclarationsChanged();
};
};
module.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
styleEventDispatcher = new StyleEventDispatcher(module);
var errorHandler:Function = function (moduleEvent:ModuleEvent):void{
var styleEvent:StyleEvent;
var errorText:String = resourceManager.getString("styles", "unableToLoad", [moduleEvent.errorText, url]);
if (styleEventDispatcher.willTrigger(StyleEvent.ERROR)){
styleEvent = new StyleEvent(StyleEvent.ERROR, moduleEvent.bubbles, moduleEvent.cancelable);
styleEvent.bytesLoaded = 0;
styleEvent.bytesTotal = 0;
styleEvent.errorText = errorText;
styleEventDispatcher.dispatchEvent(styleEvent);
} else {
throw (new Error(errorText));
};
};
module.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
styleModules[url] = new StyleModuleInfo(module, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (event:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
module.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (styleEventDispatcher);
}
public function registerSizeInvalidatingStyle(styleName:String):void{
sizeInvalidatingStyles[styleName] = true;
}
public function clearStyleDeclaration(selector:String, update:Boolean):void{
var styleDeclaration:CSSStyleDeclaration = getStyleDeclaration(selector);
if (((styleDeclaration) && ((styleDeclaration.selectorRefCount > 0)))){
styleDeclaration.selectorRefCount--;
};
delete _selectors[selector];
if (update){
styleDeclarationsChanged();
};
}
public function get selectors():Array{
var i:String;
var theSelectors:Array = [];
for (i in _selectors) {
theSelectors.push(i);
};
return (theSelectors);
}
public static function getInstance():IStyleManager2{
if (!instance){
instance = new (StyleManagerImpl);
};
return (instance);
}
}
}//package mx.styles
import flash.events.*;
import mx.modules.*;
import mx.events.*;
class StyleEventDispatcher extends EventDispatcher {
private function StyleEventDispatcher(moduleInfo:IModuleInfo){
super();
moduleInfo.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
moduleInfo.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(event:ModuleEvent):void{
var styleEvent:StyleEvent = new StyleEvent(StyleEvent.PROGRESS, event.bubbles, event.cancelable);
styleEvent.bytesLoaded = event.bytesLoaded;
styleEvent.bytesTotal = event.bytesTotal;
dispatchEvent(styleEvent);
}
private function moduleInfo_readyHandler(event:ModuleEvent):void{
var styleEvent:StyleEvent = new StyleEvent(StyleEvent.COMPLETE);
styleEvent.bytesLoaded = event.bytesLoaded;
styleEvent.bytesTotal = event.bytesTotal;
dispatchEvent(styleEvent);
}
private function moduleInfo_errorHandler(event:ModuleEvent):void{
var styleEvent:StyleEvent = new StyleEvent(StyleEvent.ERROR, event.bubbles, event.cancelable);
styleEvent.bytesLoaded = event.bytesLoaded;
styleEvent.bytesTotal = event.bytesTotal;
styleEvent.errorText = event.errorText;
dispatchEvent(styleEvent);
}
}
class StyleModuleInfo {
public var errorHandler:Function;
public var readyHandler:Function;
public var module:IModuleInfo;
public var styleModule:IStyleModule;
private function StyleModuleInfo(module:IModuleInfo, readyHandler:Function, errorHandler:Function){
super();
this.module = module;
this.readyHandler = readyHandler;
this.errorHandler = errorHandler;
}
}
Section 199
//StyleProtoChain (mx.styles.StyleProtoChain)
package mx.styles {
import mx.core.*;
import flash.display.*;
public class StyleProtoChain {
mx_internal static const VERSION:String = "3.5.0.12683";
public function StyleProtoChain(){
super();
}
public static function initProtoChainForUIComponentStyleName(obj:IStyleClient):void{
var typeSelector:CSSStyleDeclaration;
var styleName:IStyleClient = IStyleClient(obj.styleName);
var target:DisplayObject = (obj as DisplayObject);
var nonInheritChain:Object = styleName.nonInheritingStyles;
if (((!(nonInheritChain)) || ((nonInheritChain == UIComponent.STYLE_UNINITIALIZED)))){
nonInheritChain = StyleManager.stylesRoot;
if (nonInheritChain.effects){
obj.registerEffects(nonInheritChain.effects);
};
};
var inheritChain:Object = styleName.inheritingStyles;
if (((!(inheritChain)) || ((inheritChain == UIComponent.STYLE_UNINITIALIZED)))){
inheritChain = StyleManager.stylesRoot;
};
var typeSelectors:Array = obj.getClassStyleDeclarations();
var n:int = typeSelectors.length;
if ((styleName is StyleProxy)){
if (n == 0){
nonInheritChain = addProperties(nonInheritChain, styleName, false);
};
target = (StyleProxy(styleName).source as DisplayObject);
};
var i:int;
while (i < n) {
typeSelector = typeSelectors[i];
inheritChain = typeSelector.addStyleToProtoChain(inheritChain, target);
inheritChain = addProperties(inheritChain, styleName, true);
nonInheritChain = typeSelector.addStyleToProtoChain(nonInheritChain, target);
nonInheritChain = addProperties(nonInheritChain, styleName, false);
if (typeSelector.effects){
obj.registerEffects(typeSelector.effects);
};
i++;
};
obj.inheritingStyles = (obj.styleDeclaration) ? obj.styleDeclaration.addStyleToProtoChain(inheritChain, target) : inheritChain;
obj.nonInheritingStyles = (obj.styleDeclaration) ? obj.styleDeclaration.addStyleToProtoChain(nonInheritChain, target) : nonInheritChain;
}
private static function addProperties(chain:Object, obj:IStyleClient, bInheriting:Boolean):Object{
var typeSelector:CSSStyleDeclaration;
var classSelector:CSSStyleDeclaration;
var filterMap:Object = ((((obj is StyleProxy)) && (!(bInheriting)))) ? StyleProxy(obj).filterMap : null;
var curObj:IStyleClient = obj;
while ((curObj is StyleProxy)) {
curObj = StyleProxy(curObj).source;
};
var target:DisplayObject = (curObj as DisplayObject);
var typeSelectors:Array = obj.getClassStyleDeclarations();
var n:int = typeSelectors.length;
var i:int;
while (i < n) {
typeSelector = typeSelectors[i];
chain = typeSelector.addStyleToProtoChain(chain, target, filterMap);
if (typeSelector.effects){
obj.registerEffects(typeSelector.effects);
};
i++;
};
var styleName:Object = obj.styleName;
if (styleName){
if (typeof(styleName) == "object"){
if ((styleName is CSSStyleDeclaration)){
classSelector = CSSStyleDeclaration(styleName);
} else {
chain = addProperties(chain, IStyleClient(styleName), bInheriting);
};
} else {
classSelector = StyleManager.getStyleDeclaration(("." + styleName));
};
if (classSelector){
chain = classSelector.addStyleToProtoChain(chain, target, filterMap);
if (classSelector.effects){
obj.registerEffects(classSelector.effects);
};
};
};
if (obj.styleDeclaration){
chain = obj.styleDeclaration.addStyleToProtoChain(chain, target, filterMap);
};
return (chain);
}
public static function initTextField(obj:IUITextField):void{
var classSelector:CSSStyleDeclaration;
var styleName:Object = obj.styleName;
if (styleName){
if (typeof(styleName) == "object"){
if ((styleName is CSSStyleDeclaration)){
classSelector = CSSStyleDeclaration(styleName);
} else {
if ((styleName is StyleProxy)){
obj.inheritingStyles = IStyleClient(styleName).inheritingStyles;
obj.nonInheritingStyles = addProperties(StyleManager.stylesRoot, IStyleClient(styleName), false);
return;
};
obj.inheritingStyles = IStyleClient(styleName).inheritingStyles;
obj.nonInheritingStyles = IStyleClient(styleName).nonInheritingStyles;
return;
};
} else {
classSelector = StyleManager.getStyleDeclaration(("." + styleName));
};
};
var inheritChain:Object = IStyleClient(obj.parent).inheritingStyles;
var nonInheritChain:Object = StyleManager.stylesRoot;
if (!inheritChain){
inheritChain = StyleManager.stylesRoot;
};
if (classSelector){
inheritChain = classSelector.addStyleToProtoChain(inheritChain, DisplayObject(obj));
nonInheritChain = classSelector.addStyleToProtoChain(nonInheritChain, DisplayObject(obj));
};
obj.inheritingStyles = inheritChain;
obj.nonInheritingStyles = nonInheritChain;
}
}
}//package mx.styles
Section 200
//StyleProxy (mx.styles.StyleProxy)
package mx.styles {
import mx.core.*;
public class StyleProxy implements IStyleClient {
private var _source:IStyleClient;
private var _filterMap:Object;
mx_internal static const VERSION:String = "3.5.0.12683";
public function StyleProxy(source:IStyleClient, filterMap:Object){
super();
this.filterMap = filterMap;
this.source = source;
}
public function styleChanged(styleProp:String):void{
return (_source.styleChanged(styleProp));
}
public function get filterMap():Object{
return (((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) ? null : _filterMap);
}
public function set filterMap(value:Object):void{
_filterMap = value;
}
public function get styleDeclaration():CSSStyleDeclaration{
return (_source.styleDeclaration);
}
public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void{
return (_source.notifyStyleChangeInChildren(styleProp, recursive));
}
public function set inheritingStyles(value:Object):void{
}
public function get source():IStyleClient{
return (_source);
}
public function get styleName():Object{
if ((_source.styleName is IStyleClient)){
return (new StyleProxy(IStyleClient(_source.styleName), filterMap));
};
return (_source.styleName);
}
public function registerEffects(effects:Array):void{
return (_source.registerEffects(effects));
}
public function regenerateStyleCache(recursive:Boolean):void{
_source.regenerateStyleCache(recursive);
}
public function get inheritingStyles():Object{
return (_source.inheritingStyles);
}
public function get className():String{
return (_source.className);
}
public function clearStyle(styleProp:String):void{
_source.clearStyle(styleProp);
}
public function getClassStyleDeclarations():Array{
return (_source.getClassStyleDeclarations());
}
public function set nonInheritingStyles(value:Object):void{
}
public function setStyle(styleProp:String, newValue):void{
_source.setStyle(styleProp, newValue);
}
public function get nonInheritingStyles():Object{
return (((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) ? _source.nonInheritingStyles : null);
}
public function set styleName(value:Object):void{
_source.styleName = value;
}
public function getStyle(styleProp:String){
return (_source.getStyle(styleProp));
}
public function set source(value:IStyleClient):void{
_source = value;
}
public function set styleDeclaration(value:CSSStyleDeclaration):void{
_source.styleDeclaration = styleDeclaration;
}
}
}//package mx.styles
Section 201
//ColorUtil (mx.utils.ColorUtil)
package mx.utils {
import mx.core.*;
public class ColorUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
public function ColorUtil(){
super();
}
public static function adjustBrightness2(rgb:uint, brite:Number):uint{
var r:Number;
var g:Number;
var b:Number;
if (brite == 0){
return (rgb);
};
if (brite < 0){
brite = ((100 + brite) / 100);
r = (((rgb >> 16) & 0xFF) * brite);
g = (((rgb >> 8) & 0xFF) * brite);
b = ((rgb & 0xFF) * brite);
} else {
brite = (brite / 100);
r = ((rgb >> 16) & 0xFF);
g = ((rgb >> 8) & 0xFF);
b = (rgb & 0xFF);
r = (r + ((0xFF - r) * brite));
g = (g + ((0xFF - g) * brite));
b = (b + ((0xFF - b) * brite));
r = Math.min(r, 0xFF);
g = Math.min(g, 0xFF);
b = Math.min(b, 0xFF);
};
return ((((r << 16) | (g << 8)) | b));
}
public static function rgbMultiply(rgb1:uint, rgb2:uint):uint{
var r1:Number = ((rgb1 >> 16) & 0xFF);
var g1:Number = ((rgb1 >> 8) & 0xFF);
var b1:Number = (rgb1 & 0xFF);
var r2:Number = ((rgb2 >> 16) & 0xFF);
var g2:Number = ((rgb2 >> 8) & 0xFF);
var b2:Number = (rgb2 & 0xFF);
return ((((((r1 * r2) / 0xFF) << 16) | (((g1 * g2) / 0xFF) << 8)) | ((b1 * b2) / 0xFF)));
}
public static function adjustBrightness(rgb:uint, brite:Number):uint{
var r:Number = Math.max(Math.min((((rgb >> 16) & 0xFF) + brite), 0xFF), 0);
var g:Number = Math.max(Math.min((((rgb >> 8) & 0xFF) + brite), 0xFF), 0);
var b:Number = Math.max(Math.min(((rgb & 0xFF) + brite), 0xFF), 0);
return ((((r << 16) | (g << 8)) | b));
}
}
}//package mx.utils
Section 202
//EventUtil (mx.utils.EventUtil)
package mx.utils {
import flash.events.*;
import mx.core.*;
import mx.events.*;
public class EventUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var _sandboxEventMap:Object;
private static var _mouseEventMap:Object;
public function EventUtil(){
super();
}
public static function get sandboxMouseEventMap():Object{
if (!_sandboxEventMap){
_sandboxEventMap = {};
_sandboxEventMap[SandboxMouseEvent.CLICK_SOMEWHERE] = MouseEvent.CLICK;
_sandboxEventMap[SandboxMouseEvent.DOUBLE_CLICK_SOMEWHERE] = MouseEvent.DOUBLE_CLICK;
_sandboxEventMap[SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE] = MouseEvent.MOUSE_DOWN;
_sandboxEventMap[SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE] = MouseEvent.MOUSE_MOVE;
_sandboxEventMap[SandboxMouseEvent.MOUSE_UP_SOMEWHERE] = MouseEvent.MOUSE_UP;
_sandboxEventMap[SandboxMouseEvent.MOUSE_WHEEL_SOMEWHERE] = MouseEvent.MOUSE_WHEEL;
};
return (_sandboxEventMap);
}
public static function get mouseEventMap():Object{
if (!_mouseEventMap){
_mouseEventMap = {};
_mouseEventMap[MouseEvent.CLICK] = SandboxMouseEvent.CLICK_SOMEWHERE;
_mouseEventMap[MouseEvent.DOUBLE_CLICK] = SandboxMouseEvent.DOUBLE_CLICK_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_DOWN] = SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_MOVE] = SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_UP] = SandboxMouseEvent.MOUSE_UP_SOMEWHERE;
_mouseEventMap[MouseEvent.MOUSE_WHEEL] = SandboxMouseEvent.MOUSE_WHEEL_SOMEWHERE;
};
return (_mouseEventMap);
}
}
}//package mx.utils
Section 203
//GraphicsUtil (mx.utils.GraphicsUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
public class GraphicsUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
public function GraphicsUtil(){
super();
}
public static function drawRoundRectComplex(graphics:Graphics, x:Number, y:Number, width:Number, height:Number, topLeftRadius:Number, topRightRadius:Number, bottomLeftRadius:Number, bottomRightRadius:Number):void{
var xw:Number = (x + width);
var yh:Number = (y + height);
var minSize:Number = ((width < height)) ? (width * 2) : (height * 2);
topLeftRadius = ((topLeftRadius < minSize)) ? topLeftRadius : minSize;
topRightRadius = ((topRightRadius < minSize)) ? topRightRadius : minSize;
bottomLeftRadius = ((bottomLeftRadius < minSize)) ? bottomLeftRadius : minSize;
bottomRightRadius = ((bottomRightRadius < minSize)) ? bottomRightRadius : minSize;
var a:Number = (bottomRightRadius * 0.292893218813453);
var s:Number = (bottomRightRadius * 0.585786437626905);
graphics.moveTo(xw, (yh - bottomRightRadius));
graphics.curveTo(xw, (yh - s), (xw - a), (yh - a));
graphics.curveTo((xw - s), yh, (xw - bottomRightRadius), yh);
a = (bottomLeftRadius * 0.292893218813453);
s = (bottomLeftRadius * 0.585786437626905);
graphics.lineTo((x + bottomLeftRadius), yh);
graphics.curveTo((x + s), yh, (x + a), (yh - a));
graphics.curveTo(x, (yh - s), x, (yh - bottomLeftRadius));
a = (topLeftRadius * 0.292893218813453);
s = (topLeftRadius * 0.585786437626905);
graphics.lineTo(x, (y + topLeftRadius));
graphics.curveTo(x, (y + s), (x + a), (y + a));
graphics.curveTo((x + s), y, (x + topLeftRadius), y);
a = (topRightRadius * 0.292893218813453);
s = (topRightRadius * 0.585786437626905);
graphics.lineTo((xw - topRightRadius), y);
graphics.curveTo((xw - s), y, (xw - a), (y + a));
graphics.curveTo(xw, (y + s), xw, (y + topRightRadius));
graphics.lineTo(xw, (yh - bottomRightRadius));
}
}
}//package mx.utils
Section 204
//LoaderUtil (mx.utils.LoaderUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
public class LoaderUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
mx_internal static var urlFilters:Array = [{searchString:"/[[DYNAMIC]]/", filterFunction:dynamicURLFilter}, {searchString:"/[[IMPORT]]/", filterFunction:importURLFilter}];
public function LoaderUtil(){
super();
}
private static function importURLFilter(url:String, index:int):String{
var protocolIndex:int = url.indexOf("://");
return ((url.substring(0, (protocolIndex + 3)) + url.substring((index + 12))));
}
public static function normalizeURL(loaderInfo:LoaderInfo):String{
var index:int;
var searchString:String;
var urlFilter:Function;
var url:String = loaderInfo.url;
var n:uint = LoaderUtil.mx_internal::urlFilters.length;
var i:uint;
while (i < n) {
searchString = LoaderUtil.mx_internal::urlFilters[i].searchString;
index = url.indexOf(searchString);
if (index != -1){
urlFilter = LoaderUtil.mx_internal::urlFilters[i].filterFunction;
url = urlFilter(url, index);
};
i++;
};
return (url);
}
public static function createAbsoluteURL(rootURL:String, url:String):String{
var index:int;
var lastIndex:int;
var absoluteURL:String = url;
if (((rootURL) && (!((((((url.indexOf(":") > -1)) || ((url.indexOf("/") == 0)))) || ((url.indexOf("\\") == 0))))))){
index = rootURL.indexOf("?");
if (index != -1){
rootURL = rootURL.substring(0, index);
};
index = rootURL.indexOf("#");
if (index != -1){
rootURL = rootURL.substring(0, index);
};
lastIndex = Math.max(rootURL.lastIndexOf("\\"), rootURL.lastIndexOf("/"));
if (url.indexOf("./") == 0){
url = url.substring(2);
} else {
while (url.indexOf("../") == 0) {
url = url.substring(3);
lastIndex = Math.max(rootURL.lastIndexOf("\\", (lastIndex - 1)), rootURL.lastIndexOf("/", (lastIndex - 1)));
};
};
if (lastIndex != -1){
absoluteURL = (rootURL.substr(0, (lastIndex + 1)) + url);
};
};
return (absoluteURL);
}
private static function dynamicURLFilter(url:String, index:int):String{
return (url.substring(0, index));
}
}
}//package mx.utils
Section 205
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
private static var counter:int = 0;
public function NameUtil(){
super();
}
public static function displayObjectToString(displayObject:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = displayObject;
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
//unresolved jump
var _slot1 = e;
return (result);
}
public static function createUniqueName(object:Object):String{
if (!object){
return (null);
};
var name:String = getQualifiedClassName(object);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
var charCode:int = name.charCodeAt((name.length - 1));
if ((((charCode >= 48)) && ((charCode <= 57)))){
name = (name + "_");
};
return ((name + counter++));
}
}
}//package mx.utils
Section 206
//SecurityUtil (mx.utils.SecurityUtil)
package mx.utils {
import mx.core.*;
public class SecurityUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
public function SecurityUtil(){
super();
}
public static function hasMutualTrustBetweenParentAndChild(bp:ISWFBridgeProvider):Boolean{
if (((((bp) && (bp.childAllowsParent))) && (bp.parentAllowsChild))){
return (true);
};
return (false);
}
}
}//package mx.utils
Section 207
//StringUtil (mx.utils.StringUtil)
package mx.utils {
import mx.core.*;
public class StringUtil {
mx_internal static const VERSION:String = "3.5.0.12683";
public function StringUtil(){
super();
}
public static function trim(str:String):String{
if (str == null){
return ("");
};
var startIndex:int;
while (isWhitespace(str.charAt(startIndex))) {
startIndex++;
};
var endIndex:int = (str.length - 1);
while (isWhitespace(str.charAt(endIndex))) {
endIndex--;
};
if (endIndex >= startIndex){
return (str.slice(startIndex, (endIndex + 1)));
};
return ("");
}
public static function isWhitespace(character:String):Boolean{
switch (character){
case " ":
case "\t":
case "\r":
case "\n":
case "\f":
return (true);
default:
return (false);
};
}
public static function substitute(str:String, ... _args):String{
var args:Array;
if (str == null){
return ("");
};
var len:uint = _args.length;
if ((((len == 1)) && ((_args[0] is Array)))){
args = (_args[0] as Array);
len = args.length;
} else {
args = _args;
};
var i:int;
while (i < len) {
str = str.replace(new RegExp((("\\{" + i) + "\\}"), "g"), args[i]);
i++;
};
return (str);
}
public static function trimArrayElements(value:String, delimiter:String):String{
var items:Array;
var len:int;
var i:int;
if (((!((value == ""))) && (!((value == null))))){
items = value.split(delimiter);
len = items.length;
i = 0;
while (i < len) {
items[i] = StringUtil.trim(items[i]);
i++;
};
if (len > 0){
value = items.join(delimiter);
};
};
return (value);
}
}
}//package mx.utils
Section 208
//IValidatorListener (mx.validators.IValidatorListener)
package mx.validators {
import mx.events.*;
public interface IValidatorListener {
function set errorString(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:String):void;
function get validationSubField():String;
function validationResultHandler(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:ValidationResultEvent):void;
function set validationSubField(C:\autobuild\3.5.0\frameworks\projects\framework\src;mx\validators;IValidatorListener.as:String):void;
function get errorString():String;
}
}//package mx.validators
Section 209
//ValidationResult (mx.validators.ValidationResult)
package mx.validators {
import mx.core.*;
public class ValidationResult {
public var subField:String;
public var errorCode:String;
public var isError:Boolean;
public var errorMessage:String;
mx_internal static const VERSION:String = "3.5.0.12683";
public function ValidationResult(isError:Boolean, subField:String="", errorCode:String="", errorMessage:String=""){
super();
this.isError = isError;
this.subField = subField;
this.errorMessage = errorMessage;
this.errorCode = errorCode;
}
}
}//package mx.validators
Section 210
//NewgroundsAPIAsset_FlashAd_Container_23 (NewgroundsAPI_fla.NewgroundsAPIAsset_FlashAd_Container_23)
package NewgroundsAPI_fla {
import flash.events.*;
import com.newgrounds.*;
import flash.display.*;
public dynamic class NewgroundsAPIAsset_FlashAd_Container_23 extends MovieClip {
public var adMask:MovieClip;
public var ngLinkButton:SimpleButton;
public function NewgroundsAPIAsset_FlashAd_Container_23(){
addFrameScript(0, this.frame1, 10, this.frame11);
}
public function onNGLinkClicked(e:MouseEvent):void{
API.loadNewgrounds();
}
function frame1(){
this.ngLinkButton.addEventListener(MouseEvent.CLICK, this.onNGLinkClicked);
}
function frame11(){
gotoAndPlay(1);
}
}
}//package NewgroundsAPI_fla
Section 211
//NewgroundsAPIAsset_Load_Indicator_3 (NewgroundsAPI_fla.NewgroundsAPIAsset_Load_Indicator_3)
package NewgroundsAPI_fla {
import flash.events.*;
import flash.display.*;
public dynamic class NewgroundsAPIAsset_Load_Indicator_3 extends MovieClip {
public function NewgroundsAPIAsset_Load_Indicator_3(){
addFrameScript(0, this.frame1);
}
public function onEnterFrame(e:Event):void{
if (((visible) && (stage))){
rotation = (rotation + 30);
} else {
removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
};
}
function frame1(){
addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
}
}//package NewgroundsAPI_fla
Section 212
//FlxAnim (org.flixel.data.FlxAnim)
package org.flixel.data {
public class FlxAnim {
public var delay:Number;
public var frames:Array;
public var looped:Boolean;
public var name:String;
public function FlxAnim(Name:String, Frames:Array, FrameRate:Number=0, Looped:Boolean=true){
super();
name = Name;
delay = 0;
if (FrameRate > 0){
delay = (1 / FrameRate);
};
frames = Frames;
looped = Looped;
}
}
}//package org.flixel.data
Section 213
//FlxConsole (org.flixel.data.FlxConsole)
package org.flixel.data {
import org.flixel.*;
import flash.display.*;
import flash.text.*;
public class FlxConsole extends Sprite {
protected const MAX_CONSOLE_LINES:uint = 0x0100;
protected var _lines:Array;
protected var _text:TextField;
public var mtrUpdate:FlxMonitor;
public var mtrTotal:FlxMonitor;
protected var _Y:Number;
protected var _console:Sprite;
public var mtrRender:FlxMonitor;
protected var _curFPS:uint;
protected var _extraDisplay:TextField;
protected var _bx:int;
protected var _by:int;
protected var _YT:Number;
protected var _byt:int;
protected var _fpsDisplay:TextField;
public function FlxConsole(X:uint, Y:uint, Zoom:uint){
super();
visible = false;
x = (X * Zoom);
_by = (Y * Zoom);
_byt = (_by - (FlxG.height * Zoom));
_YT = (_Y = (y = _byt));
var tmp:Bitmap = new Bitmap(new BitmapData((FlxG.width * Zoom), (FlxG.height * Zoom), true, 2130706432));
addChild(tmp);
mtrUpdate = new FlxMonitor(16);
mtrRender = new FlxMonitor(16);
mtrTotal = new FlxMonitor(16);
_text = new TextField();
_text.width = tmp.width;
_text.height = tmp.height;
_text.multiline = true;
_text.wordWrap = true;
_text.embedFonts = true;
_text.selectable = false;
_text.antiAliasType = AntiAliasType.NORMAL;
_text.gridFitType = GridFitType.PIXEL;
_text.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF);
addChild(_text);
_fpsDisplay = new TextField();
_fpsDisplay.width = 100;
_fpsDisplay.x = (tmp.width - 100);
_fpsDisplay.height = 20;
_fpsDisplay.multiline = true;
_fpsDisplay.wordWrap = true;
_fpsDisplay.embedFonts = true;
_fpsDisplay.selectable = false;
_fpsDisplay.antiAliasType = AntiAliasType.NORMAL;
_fpsDisplay.gridFitType = GridFitType.PIXEL;
_fpsDisplay.defaultTextFormat = new TextFormat("system", 16, 0xFFFFFF, true, null, null, null, null, "right");
addChild(_fpsDisplay);
_extraDisplay = new TextField();
_extraDisplay.width = 100;
_extraDisplay.x = (tmp.width - 100);
_extraDisplay.height = 64;
_extraDisplay.y = 20;
_extraDisplay.alpha = 0.5;
_extraDisplay.multiline = true;
_extraDisplay.wordWrap = true;
_extraDisplay.embedFonts = true;
_extraDisplay.selectable = false;
_extraDisplay.antiAliasType = AntiAliasType.NORMAL;
_extraDisplay.gridFitType = GridFitType.PIXEL;
_extraDisplay.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF, true, null, null, null, null, "right");
addChild(_extraDisplay);
_lines = new Array();
}
public function log(Text:String):void{
var newText:String;
var i:uint;
if (Text == null){
Text = "NULL";
};
trace(Text);
if (FlxG.mobile){
return;
};
_lines.push(Text);
if (_lines.length > MAX_CONSOLE_LINES){
_lines.shift();
newText = "";
i = 0;
while (i < _lines.length) {
newText = (newText + (_lines[i] + "\n"));
i++;
};
_text.text = newText;
} else {
_text.appendText((Text + "\n"));
};
_text.scrollV = _text.height;
}
public function update():void{
var total:Number = mtrTotal.average();
_fpsDisplay.text = (uint((1000 / total)) + " fps");
_extraDisplay.text = printTimingData();
if (_Y < _YT){
_Y = (_Y + ((FlxG.height * 10) * FlxG.elapsed));
} else {
if (_Y > _YT){
_Y = (_Y - ((FlxG.height * 10) * FlxG.elapsed));
};
};
if (_Y > _by){
_Y = _by;
} else {
if (_Y < _byt){
_Y = _byt;
visible = false;
};
};
y = Math.floor(_Y);
}
public function toggle():void{
if (FlxG.mobile){
log((("FRAME TIMING DATA:\n=========================\n" + printTimingData()) + "\n"));
return;
};
if (_YT == _by){
_YT = _byt;
} else {
_YT = _by;
visible = true;
};
}
protected function printTimingData():String{
var up:uint = mtrUpdate.average();
var rn:uint = mtrRender.average();
var fx:uint = (up + rn);
var tt:uint = mtrTotal.average();
return ((((((((((up + "ms update\n") + rn) + "ms render\n") + fx) + "ms flixel\n") + (tt - fx)) + "ms flash\n") + tt) + "ms total"));
}
}
}//package org.flixel.data
Section 214
//FlxFade (org.flixel.data.FlxFade)
package org.flixel.data {
import org.flixel.*;
public class FlxFade extends FlxSprite {
protected var _delay:Number;
protected var _complete:Function;
public function FlxFade(){
super();
createGraphic(FlxG.width, FlxG.height, 0, true);
scrollFactor.x = 0;
scrollFactor.y = 0;
exists = false;
solid = false;
fixed = true;
}
override public function update():void{
alpha = (alpha + (FlxG.elapsed / _delay));
if (alpha >= 1){
alpha = 1;
if (_complete != null){
_complete();
};
};
}
public function start(Color:uint=4278190080, Duration:Number=1, FadeComplete:Function=null, Force:Boolean=false):void{
if (((!(Force)) && (exists))){
return;
};
fill(Color);
_delay = Duration;
_complete = FadeComplete;
alpha = 0;
exists = true;
}
public function stop():void{
exists = false;
}
}
}//package org.flixel.data
Section 215
//FlxFlash (org.flixel.data.FlxFlash)
package org.flixel.data {
import org.flixel.*;
public class FlxFlash extends FlxSprite {
protected var _delay:Number;
protected var _complete:Function;
public function FlxFlash(){
super();
createGraphic(FlxG.width, FlxG.height, 0, true);
scrollFactor.x = 0;
scrollFactor.y = 0;
exists = false;
solid = false;
fixed = true;
}
override public function update():void{
alpha = (alpha - (FlxG.elapsed / _delay));
if (alpha <= 0){
exists = false;
if (_complete != null){
_complete();
};
};
}
public function start(Color:uint=4294967295, Duration:Number=1, FlashComplete:Function=null, Force:Boolean=false):void{
if (((!(Force)) && (exists))){
return;
};
fill(Color);
_delay = Duration;
_complete = FlashComplete;
alpha = 1;
exists = true;
}
public function stop():void{
exists = false;
}
}
}//package org.flixel.data
Section 216
//FlxGamepad (org.flixel.data.FlxGamepad)
package org.flixel.data {
import org.flixel.*;
public class FlxGamepad extends FlxInput {
public var A:Boolean;
public var RIGHT:Boolean;
public var LEFT:Boolean;
public var B:Boolean;
public var START:Boolean;
public var X:Boolean;
public var Y:Boolean;
public var UP:Boolean;
public var R1:Boolean;
public var R2:Boolean;
public var DOWN:Boolean;
public var L1:Boolean;
public var L2:Boolean;
public var SELECT:Boolean;
public function FlxGamepad(){
super();
}
public function bind(Up:String=null, Down:String=null, Left:String=null, Right:String=null, AButton:String=null, BButton:String=null, XButton:String=null, YButton:String=null, StartButton:String=null, SelectButton:String=null, L1Button:String=null, L2Button:String=null, R1Button:String=null, R2Button:String=null):void{
if (Up != null){
addKey("UP", FlxG.keys._lookup[Up]);
};
if (Down != null){
addKey("DOWN", FlxG.keys._lookup[Down]);
};
if (Left != null){
addKey("LEFT", FlxG.keys._lookup[Left]);
};
if (Right != null){
addKey("RIGHT", FlxG.keys._lookup[Right]);
};
if (AButton != null){
addKey("A", FlxG.keys._lookup[AButton]);
};
if (BButton != null){
addKey("B", FlxG.keys._lookup[BButton]);
};
if (XButton != null){
addKey("X", FlxG.keys._lookup[XButton]);
};
if (YButton != null){
addKey("Y", FlxG.keys._lookup[YButton]);
};
if (StartButton != null){
addKey("START", FlxG.keys._lookup[StartButton]);
};
if (SelectButton != null){
addKey("SELECT", FlxG.keys._lookup[SelectButton]);
};
if (L1Button != null){
addKey("L1", FlxG.keys._lookup[L1Button]);
};
if (L2Button != null){
addKey("L2", FlxG.keys._lookup[L2Button]);
};
if (R1Button != null){
addKey("R1", FlxG.keys._lookup[R1Button]);
};
if (R2Button != null){
addKey("R2", FlxG.keys._lookup[R2Button]);
};
}
}
}//package org.flixel.data
Section 217
//FlxInput (org.flixel.data.FlxInput)
package org.flixel.data {
import flash.events.*;
public class FlxInput {
const _t:uint = 0x0100;
var _lookup:Object;
var _map:Array;
public function FlxInput(){
super();
_lookup = new Object();
_map = new Array(_t);
}
public function handleKeyDown(event:KeyboardEvent):void{
var o:Object = _map[event.keyCode];
if (o == null){
return;
};
if (o.current > 0){
o.current = 1;
} else {
o.current = 2;
};
this[o.name] = true;
}
public function handleKeyUp(event:KeyboardEvent):void{
var o:Object = _map[event.keyCode];
if (o == null){
return;
};
if (o.current > 0){
o.current = -1;
} else {
o.current = 0;
};
this[o.name] = false;
}
public function pressed(Key:String):Boolean{
return (this[Key]);
}
public function update():void{
var o:Object;
var i:uint;
while (i < _t) {
var _temp1 = i;
i = (i + 1);
o = _map[_temp1];
if (o == null){
} else {
if ((((o.last == -1)) && ((o.current == -1)))){
o.current = 0;
} else {
if ((((o.last == 2)) && ((o.current == 2)))){
o.current = 1;
};
};
o.last = o.current;
};
};
}
public function reset():void{
var o:Object;
var i:uint;
while (i < _t) {
var _temp1 = i;
i = (i + 1);
o = _map[_temp1];
if (o == null){
} else {
this[o.name] = false;
o.current = 0;
o.last = 0;
};
};
}
public function justReleased(Key:String):Boolean{
return ((_map[_lookup[Key]].current == -1));
}
public function justPressed(Key:String):Boolean{
return ((_map[_lookup[Key]].current == 2));
}
function addKey(KeyName:String, KeyCode:uint):void{
_lookup[KeyName] = KeyCode;
_map[KeyCode] = {name:KeyName, current:0, last:0};
}
}
}//package org.flixel.data
Section 218
//FlxKeyboard (org.flixel.data.FlxKeyboard)
package org.flixel.data {
public class FlxKeyboard extends FlxInput {
public var RIGHT:Boolean;
public var LEFT:Boolean;
public var SPACE:Boolean;
public var NUMPADMINUS:Boolean;
public var FOUR:Boolean;
public var TWO:Boolean;
public var NUMPADSLASH:Boolean;
public var CONTROL:Boolean;
public var A:Boolean;
public var NUMPADEIGHT:Boolean;
public var C:Boolean;
public var D:Boolean;
public var E:Boolean;
public var ONE:Boolean;
public var G:Boolean;
public var H:Boolean;
public var I:Boolean;
public var J:Boolean;
public var K:Boolean;
public var N:Boolean;
public var O:Boolean;
public var NUMPADTHREE:Boolean;
public var R:Boolean;
public var S:Boolean;
public var T:Boolean;
public var U:Boolean;
public var MINUS:Boolean;
public var Y:Boolean;
public var L:Boolean;
public var NUMPADSIX:Boolean;
public var Z:Boolean;
public var V:Boolean;
public var NUMPADPLUS:Boolean;
public var P:Boolean;
public var Q:Boolean;
public var SLASH:Boolean;
public var BACKSPACE:Boolean;
public var EIGHT:Boolean;
public var SHIFT:Boolean;
public var QUOTE:Boolean;
public var NUMPADZERO:Boolean;
public var W:Boolean;
public var X:Boolean;
public var B:Boolean;
public var THREE:Boolean;
public var NUMPADNINE:Boolean;
public var ESCAPE:Boolean;
public var NUMPADFIVE:Boolean;
public var NUMPADPERIOD:Boolean;
public var SEMICOLON:Boolean;
public var CAPSLOCK:Boolean;
public var PLUS:Boolean;
public var M:Boolean;
public var ZERO:Boolean;
public var F1:Boolean;
public var F2:Boolean;
public var F3:Boolean;
public var F4:Boolean;
public var F5:Boolean;
public var F6:Boolean;
public var F7:Boolean;
public var F9:Boolean;
public var ALT:Boolean;
public var NINE:Boolean;
public var DELETE:Boolean;
public var LBRACKET:Boolean;
public var UP:Boolean;
public var NUMPADTWO:Boolean;
public var NUMPADSEVEN:Boolean;
public var F8:Boolean;
public var SIX:Boolean;
public var ENTER:Boolean;
public var COMMA:Boolean;
public var DOWN:Boolean;
public var PERIOD:Boolean;
public var FIVE:Boolean;
public var BACKSLASH:Boolean;
public var NUMPADONE:Boolean;
public var F:Boolean;
public var F10:Boolean;
public var F12:Boolean;
public var SEVEN:Boolean;
public var NUMPADFOUR:Boolean;
public var F11:Boolean;
public var RBRACKET:Boolean;
public function FlxKeyboard(){
var i:uint;
super();
i = 65;
while (i <= 90) {
var _temp1 = String.fromCharCode(i);
var _temp2 = i;
i = (i + 1);
addKey(_temp1, _temp2);
};
i = 48;
var _temp3 = i;
i = (i + 1);
addKey("ZERO", _temp3);
var _temp4 = i;
i = (i + 1);
addKey("ONE", _temp4);
var _temp5 = i;
i = (i + 1);
addKey("TWO", _temp5);
var _temp6 = i;
i = (i + 1);
addKey("THREE", _temp6);
var _temp7 = i;
i = (i + 1);
addKey("FOUR", _temp7);
var _temp8 = i;
i = (i + 1);
addKey("FIVE", _temp8);
var _temp9 = i;
i = (i + 1);
addKey("SIX", _temp9);
var _temp10 = i;
i = (i + 1);
addKey("SEVEN", _temp10);
var _temp11 = i;
i = (i + 1);
addKey("EIGHT", _temp11);
var _temp12 = i;
i = (i + 1);
addKey("NINE", _temp12);
i = 96;
var _temp13 = i;
i = (i + 1);
addKey("NUMPADZERO", _temp13);
var _temp14 = i;
i = (i + 1);
addKey("NUMPADONE", _temp14);
var _temp15 = i;
i = (i + 1);
addKey("NUMPADTWO", _temp15);
var _temp16 = i;
i = (i + 1);
addKey("NUMPADTHREE", _temp16);
var _temp17 = i;
i = (i + 1);
addKey("NUMPADFOUR", _temp17);
var _temp18 = i;
i = (i + 1);
addKey("NUMPADFIVE", _temp18);
var _temp19 = i;
i = (i + 1);
addKey("NUMPADSIX", _temp19);
var _temp20 = i;
i = (i + 1);
addKey("NUMPADSEVEN", _temp20);
var _temp21 = i;
i = (i + 1);
addKey("NUMPADEIGHT", _temp21);
var _temp22 = i;
i = (i + 1);
addKey("NUMPADNINE", _temp22);
i = 1;
while (i <= 12) {
var _temp23 = ("F" + i);
var _temp24 = i;
i = (i + 1);
addKey(_temp23, (111 + _temp24));
};
addKey("ESCAPE", 27);
addKey("MINUS", 189);
addKey("NUMPADMINUS", 109);
addKey("PLUS", 187);
addKey("NUMPADPLUS", 107);
addKey("DELETE", 46);
addKey("BACKSPACE", 8);
addKey("LBRACKET", 219);
addKey("RBRACKET", 221);
addKey("BACKSLASH", 220);
addKey("CAPSLOCK", 20);
addKey("SEMICOLON", 186);
addKey("QUOTE", 222);
addKey("ENTER", 13);
addKey("SHIFT", 16);
addKey("COMMA", 188);
addKey("PERIOD", 190);
addKey("NUMPADPERIOD", 110);
addKey("SLASH", 191);
addKey("NUMPADSLASH", 191);
addKey("CONTROL", 17);
addKey("ALT", 18);
addKey("SPACE", 32);
addKey("UP", 38);
addKey("DOWN", 40);
addKey("LEFT", 37);
addKey("RIGHT", 39);
}
}
}//package org.flixel.data
Section 219
//FlxKong (org.flixel.data.FlxKong)
package org.flixel.data {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class FlxKong extends Sprite {
public var API;
public function FlxKong(){
super();
API = null;
}
public function init():void{
var paramObj:Object = LoaderInfo(root.loaderInfo).parameters;
var api_url:String = ((paramObj.api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
var request:URLRequest = new URLRequest(api_url);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, APILoaded);
loader.load(request);
this.addChild(loader);
}
protected function APILoaded(event:Event):void{
API = event.target.content;
API.services.connect();
}
}
}//package org.flixel.data
Section 220
//FlxList (org.flixel.data.FlxList)
package org.flixel.data {
import org.flixel.*;
public class FlxList {
public var next:FlxList;
public var object:FlxObject;
public function FlxList(){
super();
object = null;
next = null;
}
}
}//package org.flixel.data
Section 221
//FlxMouse (org.flixel.data.FlxMouse)
package org.flixel.data {
import org.flixel.*;
import flash.events.*;
public class FlxMouse {
protected var _out:Boolean;
protected var ImgDefaultCursor:Class;
public var cursor:FlxSprite;
public var wheel:int;
public var screenX:int;
public var screenY:int;
protected var _last:int;
public var x:int;
public var y:int;
protected var _current:int;
public function FlxMouse(){
ImgDefaultCursor = FlxMouse_ImgDefaultCursor;
super();
x = 0;
y = 0;
screenX = 0;
screenY = 0;
_current = 0;
_last = 0;
cursor = null;
_out = false;
}
public function hide():void{
if (cursor != null){
cursor.visible = false;
_out = false;
};
}
public function handleMouseUp(event:MouseEvent):void{
if (_current > 0){
_current = -1;
} else {
_current = 0;
};
}
public function update(X:int, Y:int, XScroll:Number, YScroll:Number):void{
screenX = X;
screenY = Y;
x = (screenX - FlxU.floor(XScroll));
y = (screenY - FlxU.floor(YScroll));
if (cursor != null){
cursor.x = x;
cursor.y = y;
};
if ((((_last == -1)) && ((_current == -1)))){
_current = 0;
} else {
if ((((_last == 2)) && ((_current == 2)))){
_current = 1;
};
};
_last = _current;
}
public function justReleased():Boolean{
return ((_current == -1));
}
public function handleMouseOver(event:MouseEvent):void{
if (cursor != null){
cursor.visible = _out;
};
}
public function justPressed():Boolean{
return ((_current == 2));
}
public function handleMouseDown(event:MouseEvent):void{
if (_current > 0){
_current = 1;
} else {
_current = 2;
};
}
public function pressed():Boolean{
return ((_current > 0));
}
public function load(Graphic:Class, XOffset:int=0, YOffset:int=0):void{
if (Graphic == null){
Graphic = ImgDefaultCursor;
};
cursor = new FlxSprite(screenX, screenY, Graphic);
cursor.solid = false;
cursor.offset.x = XOffset;
cursor.offset.y = YOffset;
}
public function reset():void{
_current = 0;
_last = 0;
}
public function handleMouseOut(event:MouseEvent):void{
if (cursor != null){
_out = cursor.visible;
cursor.visible = false;
};
}
public function show(Graphic:Class=null, XOffset:int=0, YOffset:int=0):void{
_out = true;
if (Graphic != null){
load(Graphic, XOffset, YOffset);
} else {
if (cursor != null){
cursor.visible = true;
} else {
load(null);
};
};
}
public function handleMouseWheel(event:MouseEvent):void{
wheel = event.delta;
}
public function unload():void{
if (cursor != null){
if (cursor.visible){
load(null);
} else {
cursor = null;
};
};
}
}
}//package org.flixel.data
Section 222
//FlxMouse_ImgDefaultCursor (org.flixel.data.FlxMouse_ImgDefaultCursor)
package org.flixel.data {
import mx.core.*;
public class FlxMouse_ImgDefaultCursor extends BitmapAsset {
}
}//package org.flixel.data
Section 223
//FlxPanel (org.flixel.data.FlxPanel)
package org.flixel.data {
import org.flixel.*;
import flash.ui.*;
public class FlxPanel extends FlxObject {
protected var _close:FlxButton;
protected var _digg:FlxButton;
protected var _gameTitle:String;
protected var _closed:Boolean;
protected var _payPalID:String;
protected var _donate:FlxButton;
private var ImgClose:Class;
protected var _topBar:FlxSprite;
protected var _ty:Number;
protected var _caption:FlxText;
protected var _initialized:Boolean;
protected var _twitter:FlxButton;
protected var _delicious:FlxButton;
protected var _stumble:FlxButton;
private var ImgDelicious:Class;
private var ImgTwitter:Class;
protected var _mainBar:FlxSprite;
protected var _gameURL:String;
private var ImgStumble:Class;
private var ImgReddit:Class;
private var ImgDigg:Class;
protected var _bottomBar:FlxSprite;
protected var _payPalAmount:Number;
protected var _s:Number;
private var ImgDonate:Class;
protected var _reddit:FlxButton;
public function FlxPanel(){
ImgDonate = FlxPanel_ImgDonate;
ImgStumble = FlxPanel_ImgStumble;
ImgDigg = FlxPanel_ImgDigg;
ImgReddit = FlxPanel_ImgReddit;
ImgDelicious = FlxPanel_ImgDelicious;
ImgTwitter = FlxPanel_ImgTwitter;
ImgClose = FlxPanel_ImgClose;
super();
y = -21;
_ty = y;
_closed = false;
_initialized = false;
_topBar = new FlxSprite();
_topBar.createGraphic(FlxG.width, 1, 2147483647);
_topBar.scrollFactor.x = 0;
_topBar.scrollFactor.y = 0;
_mainBar = new FlxSprite();
_mainBar.createGraphic(FlxG.width, 19, 2130706432);
_mainBar.scrollFactor.x = 0;
_mainBar.scrollFactor.y = 0;
_bottomBar = new FlxSprite();
_bottomBar.createGraphic(FlxG.width, 1, 2147483647);
_bottomBar.scrollFactor.x = 0;
_bottomBar.scrollFactor.y = 0;
_donate = new FlxButton(3, 0, onDonate);
_donate.loadGraphic(new FlxSprite(0, 0, ImgDonate));
_donate.scrollFactor.x = 0;
_donate.scrollFactor.y = 0;
_stumble = new FlxButton(((((((FlxG.width / 2) - 6) - 13) - 6) - 13) - 6), 0, onStumble);
_stumble.loadGraphic(new FlxSprite(0, 0, ImgStumble));
_stumble.scrollFactor.x = 0;
_stumble.scrollFactor.y = 0;
_digg = new FlxButton(((((FlxG.width / 2) - 6) - 13) - 6), 0, onDigg);
_digg.loadGraphic(new FlxSprite(0, 0, ImgDigg));
_digg.scrollFactor.x = 0;
_digg.scrollFactor.y = 0;
_reddit = new FlxButton(((FlxG.width / 2) - 6), 0, onReddit);
_reddit.loadGraphic(new FlxSprite(0, 0, ImgReddit));
_reddit.scrollFactor.x = 0;
_reddit.scrollFactor.y = 0;
_delicious = new FlxButton((((FlxG.width / 2) + 7) + 6), 0, onDelicious);
_delicious.loadGraphic(new FlxSprite(0, 0, ImgDelicious));
_delicious.scrollFactor.x = 0;
_delicious.scrollFactor.y = 0;
_twitter = new FlxButton((((((FlxG.width / 2) + 7) + 6) + 12) + 6), 0, onTwitter);
_twitter.loadGraphic(new FlxSprite(0, 0, ImgTwitter));
_twitter.scrollFactor.x = 0;
_twitter.scrollFactor.y = 0;
_caption = new FlxText((FlxG.width / 2), 0, ((FlxG.width / 2) - 19), "");
_caption.alignment = "right";
_caption.scrollFactor.x = 0;
_caption.scrollFactor.y = 0;
_close = new FlxButton((FlxG.width - 16), 0, onClose);
_close.loadGraphic(new FlxSprite(0, 0, ImgClose));
_close.scrollFactor.x = 0;
_close.scrollFactor.y = 0;
hide();
visible = false;
_s = 50;
}
public function onDelicious():void{
FlxU.openURL(((("http://delicious.com/save?v=5&noui&jump=close&url=" + encodeURIComponent(_gameURL)) + "&title=") + encodeURIComponent(_gameTitle)));
}
public function onTwitter():void{
FlxU.openURL(("http://twitter.com/home?status=Playing" + encodeURIComponent((((" " + _gameTitle) + " - ") + _gameURL))));
}
public function setup(PayPalID:String, PayPalAmount:Number, GameTitle:String, GameURL:String, Caption:String):void{
_payPalID = PayPalID;
if (_payPalID.length <= 0){
_donate.visible = false;
};
_payPalAmount = PayPalAmount;
_gameTitle = GameTitle;
_gameURL = GameURL;
_caption.text = Caption;
_initialized = true;
}
public function onStumble():void{
FlxU.openURL(("http://www.stumbleupon.com/submit?url=" + encodeURIComponent(_gameURL)));
}
override public function render():void{
if (!_initialized){
return;
};
if (_topBar.visible){
_topBar.render();
};
if (_mainBar.visible){
_mainBar.render();
};
if (_bottomBar.visible){
_bottomBar.render();
};
if (_donate.visible){
_donate.render();
};
if (_stumble.visible){
_stumble.render();
};
if (_digg.visible){
_digg.render();
};
if (_reddit.visible){
_reddit.render();
};
if (_delicious.visible){
_delicious.render();
};
if (_twitter.visible){
_twitter.render();
};
if (_caption.visible){
_caption.render();
};
if (_close.visible){
_close.render();
};
}
public function onDigg():void{
FlxU.openURL(((("http://digg.com/submit?url=" + encodeURIComponent(_gameURL)) + "&title=") + encodeURIComponent(_gameTitle)));
}
public function onReddit():void{
FlxU.openURL(("http://www.reddit.com/submit?url=" + encodeURIComponent(_gameURL)));
}
public function onDonate():void{
FlxU.openURL(((((("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" + encodeURIComponent(_payPalID)) + "&item_name=") + encodeURIComponent(((_gameTitle + " Contribution (") + _gameURL))) + ")¤cy_code=USD&amount=") + _payPalAmount));
}
override public function update():void{
if (!_initialized){
return;
};
if (_ty != y){
if (y < _ty){
y = (y + (FlxG.elapsed * _s));
if (y > _ty){
y = _ty;
};
} else {
y = (y - (FlxG.elapsed * _s));
if (y < _ty){
y = _ty;
};
};
_topBar.y = y;
_mainBar.y = (y + 1);
_bottomBar.y = (y + 20);
_donate.reset(_donate.x, (y + 4));
_stumble.reset(_stumble.x, (y + 4));
_digg.reset(_digg.x, (y + 4));
_reddit.reset(_reddit.x, (y + 4));
_delicious.reset(_delicious.x, (y + 5));
_twitter.reset(_twitter.x, (y + 4));
_caption.reset(_caption.x, (y + 4));
_close.reset(_close.x, (y + 4));
};
if ((((y <= -21)) || ((y >= FlxG.height)))){
visible = false;
} else {
visible = true;
};
if (visible){
if (_donate.active){
_donate.update();
};
if (_stumble.active){
_stumble.update();
};
if (_digg.active){
_digg.update();
};
if (_reddit.active){
_reddit.update();
};
if (_delicious.active){
_delicious.update();
};
if (_twitter.active){
_twitter.update();
};
if (_caption.active){
_caption.update();
};
if (_close.active){
_close.update();
};
};
}
public function show(Top:Boolean=true):void{
if (_closed){
return;
};
if (!_initialized){
FlxG.log("SUPPORT PANEL ERROR: Uninitialized.\nYou forgot to call FlxGame.setupSupportPanel()\nfrom your game constructor.");
return;
};
if (Top){
y = -21;
_ty = -1;
} else {
y = FlxG.height;
_ty = (FlxG.height - 20);
};
_donate.reset(_donate.x, (y + 4));
_stumble.reset(_stumble.x, (y + 4));
_digg.reset(_digg.x, (y + 4));
_reddit.reset(_reddit.x, (y + 4));
_delicious.reset(_delicious.x, (y + 5));
_twitter.reset(_twitter.x, (y + 4));
_caption.reset(_caption.x, (y + 4));
_close.reset(_close.x, (y + 4));
if (!FlxG.mouse.cursor.visible){
Mouse.show();
};
visible = true;
}
public function onClose():void{
_closed = true;
hide();
}
public function hide():void{
if (y < 0){
_ty = -21;
} else {
_ty = FlxG.height;
};
Mouse.hide();
}
}
}//package org.flixel.data
Section 224
//FlxPanel_ImgClose (org.flixel.data.FlxPanel_ImgClose)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgClose extends BitmapAsset {
}
}//package org.flixel.data
Section 225
//FlxPanel_ImgDelicious (org.flixel.data.FlxPanel_ImgDelicious)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgDelicious extends BitmapAsset {
}
}//package org.flixel.data
Section 226
//FlxPanel_ImgDigg (org.flixel.data.FlxPanel_ImgDigg)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgDigg extends BitmapAsset {
}
}//package org.flixel.data
Section 227
//FlxPanel_ImgDonate (org.flixel.data.FlxPanel_ImgDonate)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgDonate extends BitmapAsset {
}
}//package org.flixel.data
Section 228
//FlxPanel_ImgReddit (org.flixel.data.FlxPanel_ImgReddit)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgReddit extends BitmapAsset {
}
}//package org.flixel.data
Section 229
//FlxPanel_ImgStumble (org.flixel.data.FlxPanel_ImgStumble)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgStumble extends BitmapAsset {
}
}//package org.flixel.data
Section 230
//FlxPanel_ImgTwitter (org.flixel.data.FlxPanel_ImgTwitter)
package org.flixel.data {
import mx.core.*;
public class FlxPanel_ImgTwitter extends BitmapAsset {
}
}//package org.flixel.data
Section 231
//FlxParticle (org.flixel.data.FlxParticle)
package org.flixel.data {
import org.flixel.*;
public class FlxParticle extends FlxSprite {
protected var _bounce:Number;
public function FlxParticle(Bounce:Number){
super();
_bounce = Bounce;
}
override public function hitSide(Contact:FlxObject, Velocity:Number):void{
velocity.x = (-(velocity.x) * _bounce);
if (angularVelocity != 0){
angularVelocity = (-(angularVelocity) * _bounce);
};
}
override public function hitBottom(Contact:FlxObject, Velocity:Number):void{
onFloor = true;
if (((velocity.y)>0) ? velocity.y : -(velocity.y) > (_bounce * 100)){
velocity.y = (-(velocity.y) * _bounce);
if (angularVelocity != 0){
angularVelocity = (angularVelocity * -(_bounce));
};
} else {
angularVelocity = 0;
super.hitBottom(Contact, Velocity);
};
velocity.x = (velocity.x * _bounce);
}
}
}//package org.flixel.data
Section 232
//FlxPause (org.flixel.data.FlxPause)
package org.flixel.data {
import org.flixel.*;
public class FlxPause extends FlxGroup {
private var ImgKeyP:Class;
private var ImgKey0:Class;
private var ImgKeyPlus:Class;
private var ImgKeyMinus:Class;
public function FlxPause(){
var h:uint;
var s:FlxSprite;
ImgKeyMinus = FlxPause_ImgKeyMinus;
ImgKeyPlus = FlxPause_ImgKeyPlus;
ImgKey0 = FlxPause_ImgKey0;
ImgKeyP = FlxPause_ImgKeyP;
super();
scrollFactor.x = 0;
scrollFactor.y = 0;
var w:uint = 80;
h = 92;
x = ((FlxG.width - w) / 2);
y = ((FlxG.height - h) / 2);
s = new FlxSprite().createGraphic(w, h, 2852126720, true);
s.solid = false;
add(s, true);
(add(new FlxText(0, 0, w, "this game is"), true) as FlxText).alignment = "center";
add(new FlxText(0, 10, w, "PAUSED").setFormat(null, 16, 0xFFFFFF, "center"), true);
s = new FlxSprite(4, 36, ImgKeyP);
s.solid = false;
add(s, true);
add(new FlxText(16, 36, (w - 16), "Pause Game"), true);
s = new FlxSprite(4, 50, ImgKey0);
s.solid = false;
add(s, true);
add(new FlxText(16, 50, (w - 16), "Mute Sound"), true);
s = new FlxSprite(4, 64, ImgKeyMinus);
s.solid = false;
add(s, true);
add(new FlxText(16, 64, (w - 16), "Sound Down"), true);
s = new FlxSprite(4, 78, ImgKeyPlus);
s.solid = false;
add(s, true);
add(new FlxText(16, 78, (w - 16), "Sound Up"), true);
}
}
}//package org.flixel.data
Section 233
//FlxPause_ImgKey0 (org.flixel.data.FlxPause_ImgKey0)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKey0 extends BitmapAsset {
}
}//package org.flixel.data
Section 234
//FlxPause_ImgKeyMinus (org.flixel.data.FlxPause_ImgKeyMinus)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKeyMinus extends BitmapAsset {
}
}//package org.flixel.data
Section 235
//FlxPause_ImgKeyP (org.flixel.data.FlxPause_ImgKeyP)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKeyP extends BitmapAsset {
}
}//package org.flixel.data
Section 236
//FlxPause_ImgKeyPlus (org.flixel.data.FlxPause_ImgKeyPlus)
package org.flixel.data {
import mx.core.*;
public class FlxPause_ImgKeyPlus extends BitmapAsset {
}
}//package org.flixel.data
Section 237
//FlxQuake (org.flixel.data.FlxQuake)
package org.flixel.data {
import org.flixel.*;
public class FlxQuake {
public var y:int;
protected var _timer:Number;
protected var _intensity:Number;
public var x:int;
protected var _zoom:uint;
public function FlxQuake(Zoom:uint){
super();
_zoom = Zoom;
start(0);
}
public function update():void{
if (_timer > 0){
_timer = (_timer - FlxG.elapsed);
if (_timer <= 0){
_timer = 0;
x = 0;
y = 0;
} else {
x = (((((Math.random() * _intensity) * FlxG.width) * 2) - (_intensity * FlxG.width)) * _zoom);
y = (((((Math.random() * _intensity) * FlxG.height) * 2) - (_intensity * FlxG.height)) * _zoom);
};
};
}
public function start(Intensity:Number=0.05, Duration:Number=0.5):void{
stop();
_intensity = Intensity;
_timer = Duration;
}
public function stop():void{
x = 0;
y = 0;
_intensity = 0;
_timer = 0;
}
}
}//package org.flixel.data
Section 238
//FlxButton (org.flixel.FlxButton)
package org.flixel {
import flash.events.*;
public class FlxButton extends FlxGroup {
protected var _initialized:Boolean;
protected var _onT:FlxText;
protected var _pressed:Boolean;
protected var _offT:FlxText;
public var pauseProof:Boolean;
protected var _off:FlxSprite;
protected var _onToggle:Boolean;
protected var _sf:FlxPoint;
protected var _callback:Function;
protected var _on:FlxSprite;
public function FlxButton(X:int, Y:int, Callback:Function){
super();
x = X;
y = Y;
width = 100;
height = 20;
_off = new FlxSprite().createGraphic(width, height, 4286545791);
_off.solid = false;
add(_off, true);
_on = new FlxSprite().createGraphic(width, height, 4294967295);
_on.solid = false;
add(_on, true);
_offT = null;
_onT = null;
_callback = Callback;
_onToggle = false;
_pressed = false;
_initialized = false;
_sf = null;
pauseProof = false;
}
override public function destroy():void{
if (FlxG.stage != null){
FlxG.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
};
}
public function set on(On:Boolean):void{
_onToggle = On;
}
override public function update():void{
if (!_initialized){
if (FlxG.stage != null){
FlxG.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
_initialized = true;
};
};
super.update();
visibility(false);
if (overlapsPoint(FlxG.mouse.x, FlxG.mouse.y)){
if (!FlxG.mouse.pressed()){
_pressed = false;
} else {
if (!_pressed){
_pressed = true;
};
};
visibility(!(_pressed));
};
if (_onToggle){
visibility(_off.visible);
};
}
protected function onMouseUp(event:MouseEvent):void{
if (((((((((((!(exists)) || (!(visible)))) || (!(active)))) || (!(FlxG.mouse.justReleased())))) || (((FlxG.pause) && (!(pauseProof)))))) || ((_callback == null)))){
return;
};
if (overlapsPoint(FlxG.mouse.x, FlxG.mouse.y)){
_callback();
};
}
protected function visibility(On:Boolean):void{
if (On){
_off.visible = false;
if (_offT != null){
_offT.visible = false;
};
_on.visible = true;
if (_onT != null){
_onT.visible = true;
};
} else {
_on.visible = false;
if (_onT != null){
_onT.visible = false;
};
_off.visible = true;
if (_offT != null){
_offT.visible = true;
};
};
}
public function get on():Boolean{
return (_onToggle);
}
public function loadGraphic(Image:FlxSprite, ImageHighlight:FlxSprite=null):FlxButton{
_off = (replace(_off, Image) as FlxSprite);
if (ImageHighlight == null){
if (_on != _off){
remove(_on);
};
_on = _off;
} else {
_on = (replace(_on, ImageHighlight) as FlxSprite);
};
_on.solid = (_off.solid = false);
_off.scrollFactor = scrollFactor;
_on.scrollFactor = scrollFactor;
width = _off.width;
height = _off.height;
refreshHulls();
return (this);
}
public function loadText(Text:FlxText, TextHighlight:FlxText=null):FlxButton{
if (Text != null){
if (_offT == null){
_offT = Text;
add(_offT);
} else {
_offT = (replace(_offT, Text) as FlxText);
};
};
if (TextHighlight == null){
_onT = _offT;
} else {
if (_onT == null){
_onT = TextHighlight;
add(_onT);
} else {
_onT = (replace(_onT, TextHighlight) as FlxText);
};
};
_offT.scrollFactor = scrollFactor;
_onT.scrollFactor = scrollFactor;
return (this);
}
}
}//package org.flixel
Section 239
//FlxEmitter (org.flixel.FlxEmitter)
package org.flixel {
import org.flixel.data.*;
public class FlxEmitter extends FlxGroup {
public var maxRotation:Number;
public var delay:Number;
public var quantity:uint;
protected var _timer:Number;
public var gravity:Number;
public var justEmitted:Boolean;
public var particleDrag:FlxPoint;
public var maxParticleSpeed:FlxPoint;
public var on:Boolean;
protected var _explode:Boolean;
protected var _particle:uint;
public var minParticleSpeed:FlxPoint;
public var minRotation:Number;
protected var _counter:uint;
public function FlxEmitter(X:Number=0, Y:Number=0){
super();
x = X;
y = Y;
width = 0;
height = 0;
minParticleSpeed = new FlxPoint(-100, -100);
maxParticleSpeed = new FlxPoint(100, 100);
minRotation = -360;
maxRotation = 360;
gravity = 400;
particleDrag = new FlxPoint();
delay = 0;
quantity = 0;
_counter = 0;
_explode = true;
exists = false;
on = false;
justEmitted = false;
}
public function setRotation(Min:Number=0, Max:Number=0):void{
minRotation = Min;
maxRotation = Max;
}
override public function update():void{
justEmitted = false;
super.update();
updateEmitter();
}
public function setYSpeed(Min:Number=0, Max:Number=0):void{
minParticleSpeed.y = Min;
maxParticleSpeed.y = Max;
}
public function stop(Delay:Number=3):void{
_explode = true;
delay = Delay;
if (delay < 0){
delay = -(Delay);
};
on = false;
}
public function setSize(Width:uint, Height:uint):void{
width = Width;
height = Height;
}
public function at(Object:FlxObject):void{
x = (Object.x + Object.origin.x);
y = (Object.y + Object.origin.y);
}
override protected function updateMembers():void{
var o:FlxObject;
var i:uint;
var l:uint = members.length;
while (i < l) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (((((!((o == null))) && (o.exists))) && (o.active))){
o.update();
};
};
}
public function start(Explode:Boolean=true, Delay:Number=0, Quantity:uint=0):void{
if (members.length <= 0){
FlxG.log("WARNING: there are no sprites loaded in your emitter.\nAdd some to FlxEmitter.members or use FlxEmitter.createSprites().");
return;
};
_explode = Explode;
if (!_explode){
_counter = 0;
};
if (!exists){
_particle = 0;
};
exists = true;
visible = true;
active = true;
dead = false;
on = true;
_timer = 0;
if (quantity == 0){
quantity = Quantity;
} else {
if (Quantity != 0){
quantity = Quantity;
};
};
if (Delay != 0){
delay = Delay;
};
if (delay < 0){
delay = -(delay);
};
if (delay == 0){
if (Explode){
delay = 3;
} else {
delay = 0.1;
};
};
}
protected function updateEmitter():void{
var i:uint;
var l:uint;
if (_explode){
_timer = (_timer + FlxG.elapsed);
if ((((delay > 0)) && ((_timer > delay)))){
kill();
return;
};
if (on){
on = false;
i = _particle;
l = members.length;
if (quantity > 0){
l = quantity;
};
l = (l + _particle);
while (i < l) {
emitParticle();
i++;
};
};
return;
};
if (!on){
return;
};
_timer = (_timer + FlxG.elapsed);
while ((((_timer > delay)) && ((((quantity <= 0)) || ((_counter < quantity)))))) {
_timer = (_timer - delay);
emitParticle();
};
}
override public function kill():void{
super.kill();
on = false;
}
public function setXSpeed(Min:Number=0, Max:Number=0):void{
minParticleSpeed.x = Min;
maxParticleSpeed.x = Max;
}
public function createSprites(Graphics:Class, Quantity:uint=50, BakedRotations:uint=16, Multiple:Boolean=true, Collide:Number=0, Bounce:Number=0):FlxEmitter{
var r:uint;
var s:FlxSprite;
var sw:Number;
var sh:Number;
members = new Array();
var tf:uint = 1;
if (Multiple){
s = new FlxSprite();
s.loadGraphic(Graphics, true);
tf = s.frames;
};
var i:uint;
while (i < Quantity) {
if ((((Collide > 0)) && ((Bounce > 0)))){
s = (new FlxParticle(Bounce) as FlxSprite);
} else {
s = new FlxSprite();
};
if (Multiple){
r = (FlxU.random() * tf);
if (BakedRotations > 0){
s.loadRotatedGraphic(Graphics, BakedRotations, r);
} else {
s.loadGraphic(Graphics, true);
s.frame = r;
};
} else {
if (BakedRotations > 0){
s.loadRotatedGraphic(Graphics, BakedRotations);
} else {
s.loadGraphic(Graphics);
};
};
if (Collide > 0){
sw = s.width;
sh = s.height;
s.width = (s.width * Collide);
s.height = (s.height * Collide);
s.offset.x = ((sw - s.width) / 2);
s.offset.y = ((sh - s.height) / 2);
s.solid = true;
} else {
s.solid = false;
};
s.exists = false;
s.scrollFactor = scrollFactor;
add(s);
i++;
};
return (this);
}
public function emitParticle():void{
_counter++;
var s:FlxSprite = (members[_particle] as FlxSprite);
s.visible = true;
s.exists = true;
s.active = true;
s.x = ((x - (s.width >> 1)) + (FlxU.random() * width));
s.y = ((y - (s.height >> 1)) + (FlxU.random() * height));
s.velocity.x = minParticleSpeed.x;
if (minParticleSpeed.x != maxParticleSpeed.x){
s.velocity.x = (s.velocity.x + (FlxU.random() * (maxParticleSpeed.x - minParticleSpeed.x)));
};
s.velocity.y = minParticleSpeed.y;
if (minParticleSpeed.y != maxParticleSpeed.y){
s.velocity.y = (s.velocity.y + (FlxU.random() * (maxParticleSpeed.y - minParticleSpeed.y)));
};
s.acceleration.y = gravity;
s.angularVelocity = minRotation;
if (minRotation != maxRotation){
s.angularVelocity = (s.angularVelocity + (FlxU.random() * (maxRotation - minRotation)));
};
if (s.angularVelocity != 0){
s.angle = ((FlxU.random() * 360) - 180);
};
s.drag.x = particleDrag.x;
s.drag.y = particleDrag.y;
_particle++;
if (_particle >= members.length){
_particle = 0;
};
s.onEmit();
justEmitted = true;
}
}
}//package org.flixel
Section 240
//FlxG (org.flixel.FlxG)
package org.flixel {
import flash.display.*;
import flash.geom.*;
import org.flixel.data.*;
public class FlxG {
public static var panel:FlxPanel;
protected static var _mute:Boolean;
public static var showBounds:Boolean;
public static var kong:FlxKong;
public static var scores:Array;
public static var music:FlxSound;
public static var height:uint;
public static var gamepads:Array;
protected static var _volume:Number;
public static var buffer:BitmapData;
public static var sounds:Array;
public static var debug:Boolean;
public static var LIBRARY_MINOR_VERSION:uint = 43;
public static var LIBRARY_MAJOR_VERSION:uint = 2;
public static var levels:Array;
public static var maxElapsed:Number;
public static var fade:FlxFade;
public static var timeScale:Number;
protected static var _cache:Object;
public static var level:int;
public static var elapsed:Number;
public static var score:int;
public static var save:int;
public static var saves:Array;
protected static var _scrollTarget:Point;
public static var mouse:FlxMouse;
public static var mobile:Boolean;
public static var followLead:Point;
public static var LIBRARY_NAME:String = "flixel";
public static var followTarget:FlxObject;
public static var width:uint;
public static var followLerp:Number;
protected static var _game:FlxGame;
public static var scroll:Point;
public static var quake:FlxQuake;
public static var followMin:Point;
public static var flash:FlxFlash;
public static var followMax:Point;
public static var keys:FlxKeyboard;
protected static var _pause:Boolean;
public function FlxG(){
super();
}
public static function get stage():Stage{
if (((!((_game._state == null))) && (!((_game._state.parent == null))))){
return (_game._state.parent.stage);
};
return (null);
}
protected static function changeSounds():void{
var s:FlxSound;
if (((!((music == null))) && (music.active))){
music.updateTransform();
};
var i:uint;
var sl:uint = sounds.length;
while (i < sl) {
var _temp1 = i;
i = (i + 1);
s = (sounds[_temp1] as FlxSound);
if (((!((s == null))) && (s.active))){
s.updateTransform();
};
};
}
public static function get mute():Boolean{
return (_mute);
}
public static function get volume():Number{
return (_volume);
}
static function doFollow():void{
if (followTarget != null){
_scrollTarget.x = (((width >> 1) - followTarget.x) - (followTarget.width >> 1));
_scrollTarget.y = (((height >> 1) - followTarget.y) - (followTarget.height >> 1));
if (((!((followLead == null))) && ((followTarget is FlxSprite)))){
_scrollTarget.x = (_scrollTarget.x - ((followTarget as FlxSprite).velocity.x * followLead.x));
_scrollTarget.y = (_scrollTarget.y - ((followTarget as FlxSprite).velocity.y * followLead.y));
};
scroll.x = (scroll.x + (((_scrollTarget.x - scroll.x) * followLerp) * FlxG.elapsed));
scroll.y = (scroll.y + (((_scrollTarget.y - scroll.y) * followLerp) * FlxG.elapsed));
if (followMin != null){
if (scroll.x > followMin.x){
scroll.x = followMin.x;
};
if (scroll.y > followMin.y){
scroll.y = followMin.y;
};
};
if (followMax != null){
if (scroll.x < followMax.x){
scroll.x = followMax.x;
};
if (scroll.y < followMax.y){
scroll.y = followMax.y;
};
};
};
}
public static function getMuteValue():uint{
if (_mute){
return (0);
};
return (1);
}
public static function addBitmap(Graphic:Class, Reverse:Boolean=false, Unique:Boolean=false, Key:String=null):BitmapData{
var inc:uint;
var ukey:String;
var newPixels:BitmapData;
var mtx:Matrix;
var needReverse:Boolean;
var key:String = Key;
if (key == null){
key = String(Graphic);
if (((((Unique) && (!((_cache[key] == undefined))))) && (!((_cache[key] == null))))){
inc = 0;
do {
var _temp1 = inc;
inc = (inc + 1);
ukey = (key + _temp1);
} while (((!((_cache[ukey] == undefined))) && (!((_cache[ukey] == null)))));
key = ukey;
};
};
if (!checkBitmapCache(key)){
_cache[key] = new (Graphic).bitmapData;
if (Reverse){
needReverse = true;
};
};
var pixels:BitmapData = _cache[key];
if (((((!(needReverse)) && (Reverse))) && ((pixels.width == new (Graphic).bitmapData.width)))){
needReverse = true;
};
if (needReverse){
newPixels = new BitmapData((pixels.width << 1), pixels.height, true, 0);
newPixels.draw(pixels);
mtx = new Matrix();
mtx.scale(-1, 1);
mtx.translate(newPixels.width, 0);
newPixels.draw(pixels, mtx);
pixels = newPixels;
};
return (pixels);
}
public static function set state(State:FlxState):void{
_game.switchState(State);
}
public static function play(EmbeddedSound:Class, Volume:Number=1, Looped:Boolean=false):FlxSound{
var i:uint;
var sl:uint = sounds.length;
while (i < sl) {
if (!(sounds[i] as FlxSound).active){
break;
};
i++;
};
if (sounds[i] == null){
sounds[i] = new FlxSound();
};
var s:FlxSound = sounds[i];
s.loadEmbedded(EmbeddedSound, Looped);
s.volume = Volume;
s.play();
return (s);
}
public static function set volume(Volume:Number):void{
_volume = Volume;
if (_volume < 0){
_volume = 0;
} else {
if (_volume > 1){
_volume = 1;
};
};
changeSounds();
}
static function setGameData(Game:FlxGame, Width:uint, Height:uint, Zoom:uint):void{
_game = Game;
_cache = new Object();
width = Width;
height = Height;
_mute = false;
_volume = 0.5;
sounds = new Array();
mouse = new FlxMouse();
keys = new FlxKeyboard();
gamepads = new Array(4);
gamepads[0] = new FlxGamepad();
gamepads[1] = new FlxGamepad();
gamepads[2] = new FlxGamepad();
gamepads[3] = new FlxGamepad();
scroll = null;
_scrollTarget = null;
unfollow();
FlxG.levels = new Array();
FlxG.scores = new Array();
level = 0;
score = 0;
kong = null;
pause = false;
timeScale = 1;
framerate = 60;
frameratePaused = 10;
maxElapsed = 0.0333333;
FlxG.elapsed = 0;
showBounds = false;
mobile = false;
panel = new FlxPanel();
quake = new FlxQuake(Zoom);
flash = new FlxFlash();
fade = new FlxFade();
FlxU.setWorldBounds(0, 0, FlxG.width, FlxG.height);
}
public static function createBitmap(Width:uint, Height:uint, Color:uint, Unique:Boolean=false, Key:String=null):BitmapData{
var inc:uint;
var ukey:String;
var key:String = Key;
if (key == null){
key = ((((Width + "x") + Height) + ":") + Color);
if (((((Unique) && (!((_cache[key] == undefined))))) && (!((_cache[key] == null))))){
inc = 0;
do {
var _temp1 = inc;
inc = (inc + 1);
ukey = (key + _temp1);
} while (((!((_cache[ukey] == undefined))) && (!((_cache[ukey] == null)))));
key = ukey;
};
};
if (!checkBitmapCache(key)){
_cache[key] = new BitmapData(Width, Height, true, Color);
};
return (_cache[key]);
}
public static function set mute(Mute:Boolean):void{
_mute = Mute;
changeSounds();
}
public static function playMusic(Music:Class, Volume:Number=1):void{
if (music == null){
music = new FlxSound();
} else {
if (music.active){
music.stop();
};
};
music.loadEmbedded(Music, true);
music.volume = Volume;
music.survive = true;
music.play();
}
public static function get frameratePaused():uint{
return (_game._frameratePaused);
}
public static function log(Data:Object):void{
if (((!((_game == null))) && (!((_game._console == null))))){
_game._console.log(((Data)==null) ? "ERROR: null object" : Data.toString());
};
}
public static function checkBitmapCache(Key:String):Boolean{
return (((!((_cache[Key] == undefined))) && (!((_cache[Key] == null)))));
}
static function updateSounds():void{
var s:FlxSound;
if (((!((music == null))) && (music.active))){
music.update();
};
var i:uint;
var sl:uint = sounds.length;
while (i < sl) {
var _temp1 = i;
i = (i + 1);
s = (sounds[_temp1] as FlxSound);
if (((!((s == null))) && (s.active))){
s.update();
};
};
}
static function updateInput():void{
keys.update();
mouse.update(state.mouseX, state.mouseY, scroll.x, scroll.y);
var i:uint;
var l:uint = gamepads.length;
while (i < l) {
var _temp1 = i;
i = (i + 1);
gamepads[_temp1].update();
};
}
public static function stream(URL:String, Volume:Number=1, Looped:Boolean=false):FlxSound{
var i:uint;
var sl:uint = sounds.length;
while (i < sl) {
if (!(sounds[i] as FlxSound).active){
break;
};
i++;
};
if (sounds[i] == null){
sounds[i] = new FlxSound();
};
var s:FlxSound = sounds[i];
s.loadStream(URL, Looped);
s.volume = Volume;
s.play();
return (s);
}
public static function unfollow():void{
followTarget = null;
followLead = null;
followLerp = 1;
followMin = null;
followMax = null;
if (scroll == null){
scroll = new Point();
} else {
scroll.x = (scroll.y = 0);
};
if (_scrollTarget == null){
_scrollTarget = new Point();
} else {
_scrollTarget.x = (_scrollTarget.y = 0);
};
}
public static function get state():FlxState{
return (_game._state);
}
protected static function playSounds():void{
var s:FlxSound;
if (((!((music == null))) && (music.active))){
music.play();
};
var i:uint;
var sl:uint = sounds.length;
while (i < sl) {
var _temp1 = i;
i = (i + 1);
s = (sounds[_temp1] as FlxSound);
if (((!((s == null))) && (s.active))){
s.play();
};
};
}
public static function followAdjust(LeadX:Number=0, LeadY:Number=0):void{
followLead = new Point(LeadX, LeadY);
}
public static function set framerate(Framerate:uint):void{
_game._framerate = Framerate;
if (((!(_game._paused)) && (!((_game.stage == null))))){
_game.stage.frameRate = Framerate;
};
}
public static function set frameratePaused(Framerate:uint):void{
_game._frameratePaused = Framerate;
if (((_game._paused) && (!((_game.stage == null))))){
_game.stage.frameRate = Framerate;
};
}
public static function follow(Target:FlxObject, Lerp:Number=1):void{
followTarget = Target;
followLerp = Lerp;
_scrollTarget.x = (((width >> 1) - followTarget.x) - (followTarget.width >> 1));
_scrollTarget.y = (((height >> 1) - followTarget.y) - (followTarget.height >> 1));
scroll.x = _scrollTarget.x;
scroll.y = _scrollTarget.y;
doFollow();
}
public static function resetInput():void{
keys.reset();
mouse.reset();
var i:uint;
var l:uint = gamepads.length;
while (i < l) {
var _temp1 = i;
i = (i + 1);
gamepads[_temp1].reset();
};
}
public static function get framerate():uint{
return (_game._framerate);
}
public static function followBounds(MinX:int=0, MinY:int=0, MaxX:int=0, MaxY:int=0, UpdateWorldBounds:Boolean=true):void{
followMin = new Point(-(MinX), -(MinY));
followMax = new Point((-(MaxX) + width), (-(MaxY) + height));
if (followMax.x > followMin.x){
followMax.x = followMin.x;
};
if (followMax.y > followMin.y){
followMax.y = followMin.y;
};
if (UpdateWorldBounds){
FlxU.setWorldBounds(MinX, MinY, (MaxX - MinX), (MaxY - MinY));
};
doFollow();
}
protected static function pauseSounds():void{
var s:FlxSound;
if (((!((music == null))) && (music.active))){
music.pause();
};
var i:uint;
var sl:uint = sounds.length;
while (i < sl) {
var _temp1 = i;
i = (i + 1);
s = (sounds[_temp1] as FlxSound);
if (((!((s == null))) && (s.active))){
s.pause();
};
};
}
static function destroySounds(ForceDestroy:Boolean=false):void{
var s:FlxSound;
if (sounds == null){
return;
};
if (((!((music == null))) && (((ForceDestroy) || (!(music.survive)))))){
music.destroy();
};
var i:uint;
var sl:uint = sounds.length;
while (i < sl) {
var _temp1 = i;
i = (i + 1);
s = (sounds[_temp1] as FlxSound);
if (((!((s == null))) && (((ForceDestroy) || (!(s.survive)))))){
s.destroy();
};
};
}
public static function set pause(Pause:Boolean):void{
var op:Boolean = _pause;
_pause = Pause;
if (_pause != op){
if (_pause){
_game.pauseGame();
pauseSounds();
} else {
_game.unpauseGame();
playSounds();
};
};
}
public static function get pause():Boolean{
return (_pause);
}
}
}//package org.flixel
Section 241
//FlxGame (org.flixel.FlxGame)
package org.flixel {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import org.flixel.data.*;
import flash.ui.*;
public class FlxGame extends Sprite {
protected var SndFlixel:Class;
var _screen:Sprite;
var _state:FlxState;
protected var SndBeep:Class;
var _console:FlxConsole;
var _gameXOffset:int;
var _frameratePaused:uint;
var _created:Boolean;
var _zoom:uint;
var _elapsed:Number;
var _total:uint;
var _soundTrayBars:Array;
var _iState:Class;
protected var junk:String;// = "FlxGame_junk"
var _zeroPoint:Point;
var _paused:Boolean;
public var useDefaultHotKeys:Boolean;
var _framerate:uint;
var _gameYOffset:int;
var _buffer:Bitmap;
var _soundTray:Sprite;
var _frame:Class;
public var pause:FlxGroup;
var _soundTrayTimer:Number;
public function FlxGame(GameSizeX:uint, GameSizeY:uint, InitialState:Class, Zoom:uint=2){
SndBeep = FlxGame_SndBeep;
SndFlixel = FlxGame_SndFlixel;
super();
Mouse.hide();
_zoom = Zoom;
FlxState.bgColor = 4278190080;
FlxG.setGameData(this, GameSizeX, GameSizeY, Zoom);
_elapsed = 0;
_total = 0;
pause = new FlxPause();
_state = null;
_iState = InitialState;
_zeroPoint = new Point();
useDefaultHotKeys = true;
_frame = null;
_gameXOffset = 0;
_gameYOffset = 0;
_paused = false;
_created = false;
addEventListener(Event.ENTER_FRAME, create);
}
function pauseGame():void{
if (((!((x == 0))) || (!((y == 0))))){
x = 0;
y = 0;
};
Mouse.show();
_paused = true;
stage.frameRate = _frameratePaused;
}
function unpauseGame():void{
FlxG.resetInput();
_paused = false;
stage.frameRate = _framerate;
}
protected function onFocus(event:Event=null):void{
if (FlxG.pause){
FlxG.pause = false;
};
}
protected function onKeyUp(event:KeyboardEvent):void{
var c:int;
var code:String;
if ((((event.keyCode == 192)) || ((event.keyCode == 220)))){
_console.toggle();
return;
};
if (((!(FlxG.mobile)) && (useDefaultHotKeys))){
c = event.keyCode;
code = String.fromCharCode(event.charCode);
switch (c){
case 48:
case 96:
FlxG.mute = !(FlxG.mute);
showSoundTray();
return;
case 109:
case 189:
FlxG.mute = false;
FlxG.volume = (FlxG.volume - 0.1);
showSoundTray();
return;
case 107:
case 187:
FlxG.mute = false;
FlxG.volume = (FlxG.volume + 0.1);
showSoundTray();
return;
case 80:
FlxG.pause = !(FlxG.pause);
default:
break;
};
};
FlxG.keys.handleKeyUp(event);
var i:uint;
var l:uint = FlxG.gamepads.length;
while (i < l) {
var _temp1 = i;
i = (i + 1);
FlxG.gamepads[_temp1].handleKeyUp(event);
};
}
protected function onKeyDown(event:KeyboardEvent):void{
FlxG.keys.handleKeyDown(event);
var i:uint;
var l:uint = FlxG.gamepads.length;
while (i < l) {
var _temp1 = i;
i = (i + 1);
FlxG.gamepads[_temp1].handleKeyDown(event);
};
}
public function switchState(State:FlxState):void{
FlxG.panel.hide();
FlxG.unfollow();
FlxG.resetInput();
FlxG.destroySounds();
FlxG.flash.stop();
FlxG.fade.stop();
FlxG.quake.stop();
_screen.x = 0;
_screen.y = 0;
_screen.addChild(State);
if (_state != null){
_state.destroy();
_screen.swapChildren(State, _state);
_screen.removeChild(_state);
};
_state = State;
_state.scaleX = (_state.scaleY = _zoom);
_state.create();
}
protected function update(event:Event):void{
var i:uint;
var soundPrefs:FlxSave;
var mark:uint = getTimer();
var ems:uint = (mark - _total);
_elapsed = (ems / 1000);
_console.mtrTotal.add(ems);
_total = mark;
FlxG.elapsed = _elapsed;
if (FlxG.elapsed > FlxG.maxElapsed){
FlxG.elapsed = FlxG.maxElapsed;
};
FlxG.elapsed = (FlxG.elapsed * FlxG.timeScale);
if (_soundTray != null){
if (_soundTrayTimer > 0){
_soundTrayTimer = (_soundTrayTimer - _elapsed);
} else {
if (_soundTray.y > -(_soundTray.height)){
_soundTray.y = (_soundTray.y - ((_elapsed * FlxG.height) * 2));
if (_soundTray.y <= -(_soundTray.height)){
_soundTray.visible = false;
soundPrefs = new FlxSave();
if (soundPrefs.bind("flixel")){
if (soundPrefs.data.sound == null){
soundPrefs.data.sound = new Object();
};
soundPrefs.data.mute = FlxG.mute;
soundPrefs.data.volume = FlxG.volume;
soundPrefs.forceSave();
};
};
};
};
};
FlxG.panel.update();
if (_console.visible){
_console.update();
};
FlxG.updateInput();
FlxG.updateSounds();
if (_paused){
pause.update();
} else {
FlxG.doFollow();
_state.update();
if (FlxG.flash.exists){
FlxG.flash.update();
};
if (FlxG.fade.exists){
FlxG.fade.update();
};
FlxG.quake.update();
_screen.x = FlxG.quake.x;
_screen.y = FlxG.quake.y;
};
var updateMark:uint = getTimer();
_console.mtrUpdate.add((updateMark - mark));
FlxG.buffer.lock();
_state.preProcess();
_state.render();
if (FlxG.flash.exists){
FlxG.flash.render();
};
if (FlxG.fade.exists){
FlxG.fade.render();
};
if (FlxG.panel.visible){
FlxG.panel.render();
};
if (FlxG.mouse.cursor != null){
if (FlxG.mouse.cursor.active){
FlxG.mouse.cursor.update();
};
if (FlxG.mouse.cursor.visible){
FlxG.mouse.cursor.render();
};
};
_state.postProcess();
if (_paused){
pause.render();
};
FlxG.buffer.unlock();
_console.mtrRender.add((getTimer() - updateMark));
FlxG.mouse.wheel = 0;
}
protected function addFrame(Frame:Class, ScreenOffsetX:uint, ScreenOffsetY:uint):FlxGame{
_frame = Frame;
_gameXOffset = ScreenOffsetX;
_gameYOffset = ScreenOffsetY;
return (this);
}
public function showSoundTray(Silent:Boolean=false):void{
if (!Silent){
FlxG.play(SndBeep);
};
_soundTrayTimer = 1;
_soundTray.y = (_gameYOffset * _zoom);
_soundTray.visible = true;
var gv:uint = Math.round((FlxG.volume * 10));
if (FlxG.mute){
gv = 0;
};
var i:uint;
while (i < _soundTrayBars.length) {
if (i < gv){
_soundTrayBars[i].alpha = 1;
} else {
_soundTrayBars[i].alpha = 0.5;
};
i++;
};
}
function create(event:Event):void{
var i:uint;
var l:uint;
var soundPrefs:FlxSave;
var text:TextField;
var bx:uint;
var by:uint;
var bmp:Bitmap;
if (root == null){
return;
};
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = _framerate;
_screen = new Sprite();
addChild(_screen);
var tmp:Bitmap = new Bitmap(new BitmapData(FlxG.width, FlxG.height, true, FlxState.bgColor));
tmp.x = _gameXOffset;
tmp.y = _gameYOffset;
tmp.scaleX = (tmp.scaleY = _zoom);
_screen.addChild(tmp);
FlxG.buffer = tmp.bitmapData;
_console = new FlxConsole(_gameXOffset, _gameYOffset, _zoom);
if (!FlxG.mobile){
addChild(_console);
};
var vstring:String = ((((FlxG.LIBRARY_NAME + " v") + FlxG.LIBRARY_MAJOR_VERSION) + ".") + FlxG.LIBRARY_MINOR_VERSION);
if (FlxG.debug){
vstring = (vstring + " [debug]");
} else {
vstring = (vstring + " [release]");
};
var underline:String = "";
i = 0;
l = (vstring.length + 32);
while (i < l) {
underline = (underline + "-");
i++;
};
FlxG.log(vstring);
FlxG.log(underline);
stage.addEventListener(MouseEvent.MOUSE_DOWN, FlxG.mouse.handleMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, FlxG.mouse.handleMouseUp);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
if (!FlxG.mobile){
stage.addEventListener(MouseEvent.MOUSE_OUT, FlxG.mouse.handleMouseOut);
stage.addEventListener(MouseEvent.MOUSE_OVER, FlxG.mouse.handleMouseOver);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, FlxG.mouse.handleMouseWheel);
stage.addEventListener(Event.DEACTIVATE, onFocusLost);
stage.addEventListener(Event.ACTIVATE, onFocus);
_soundTray = new Sprite();
_soundTray.visible = false;
_soundTray.scaleX = 2;
_soundTray.scaleY = 2;
tmp = new Bitmap(new BitmapData(80, 30, true, 2130706432));
_soundTray.x = (((_gameXOffset + (FlxG.width / 2)) * _zoom) - ((tmp.width / 2) * _soundTray.scaleX));
_soundTray.addChild(tmp);
text = new TextField();
text.width = tmp.width;
text.height = tmp.height;
text.multiline = true;
text.wordWrap = true;
text.selectable = false;
text.embedFonts = true;
text.antiAliasType = AntiAliasType.NORMAL;
text.gridFitType = GridFitType.PIXEL;
text.defaultTextFormat = new TextFormat("system", 8, 0xFFFFFF, null, null, null, null, null, "center");
_soundTray.addChild(text);
text.text = "VOLUME";
text.y = 16;
bx = 10;
by = 14;
_soundTrayBars = new Array();
i = 0;
while (i < 10) {
++i;
tmp = new Bitmap(new BitmapData(4, i, false, 0xFFFFFF));
tmp.x = bx;
tmp.y = by;
_soundTrayBars.push(_soundTray.addChild(tmp));
bx = (bx + 6);
by--;
};
addChild(_soundTray);
soundPrefs = new FlxSave();
if (((soundPrefs.bind("flixel")) && (!((soundPrefs.data.sound == null))))){
if (soundPrefs.data.volume != null){
FlxG.volume = soundPrefs.data.volume;
};
if (soundPrefs.data.mute != null){
FlxG.mute = soundPrefs.data.mute;
};
showSoundTray(true);
};
};
if (_frame != null){
bmp = new _frame();
bmp.scaleX = _zoom;
bmp.scaleY = _zoom;
addChild(bmp);
};
switchState(new _iState());
FlxState.screen.unsafeBind(FlxG.buffer);
removeEventListener(Event.ENTER_FRAME, create);
addEventListener(Event.ENTER_FRAME, update);
}
protected function onFocusLost(event:Event=null):void{
FlxG.pause = true;
}
}
}//package org.flixel
Section 242
//FlxGame_junk (org.flixel.FlxGame_junk)
package org.flixel {
import mx.core.*;
public class FlxGame_junk extends FontAsset {
}
}//package org.flixel
Section 243
//FlxGame_SndBeep (org.flixel.FlxGame_SndBeep)
package org.flixel {
import mx.core.*;
public class FlxGame_SndBeep extends SoundAsset {
}
}//package org.flixel
Section 244
//FlxGame_SndFlixel (org.flixel.FlxGame_SndFlixel)
package org.flixel {
import mx.core.*;
public class FlxGame_SndFlixel extends SoundAsset {
}
}//package org.flixel
Section 245
//FlxGroup (org.flixel.FlxGroup)
package org.flixel {
public class FlxGroup extends FlxObject {
protected var _sortOrder:int;
public var members:Array;
protected var _sortIndex:String;
protected var _last:FlxPoint;
protected var _first:Boolean;
public static const ASCENDING:int = -1;
public static const DESCENDING:int = 1;
public function FlxGroup(){
super();
_group = true;
solid = false;
members = new Array();
_last = new FlxPoint();
_first = true;
}
public function getFirstExtant():FlxObject{
var o:FlxObject;
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (((!((o == null))) && (o.exists))){
return (o);
};
};
return (null);
}
override public function destroy():void{
destroyMembers();
super.destroy();
}
protected function saveOldPosition():void{
if (_first){
_first = false;
_last.x = 0;
_last.y = 0;
return;
};
_last.x = x;
_last.y = y;
}
public function remove(Object:FlxObject, Splice:Boolean=false):FlxObject{
var index:int = members.indexOf(Object);
if ((((index < 0)) || ((index >= members.length)))){
return (null);
};
if (Splice){
members.splice(index, 1);
} else {
members[index] = null;
};
return (Object);
}
override public function update():void{
saveOldPosition();
updateMotion();
updateMembers();
updateFlickering();
}
protected function sortHandler(Obj1:FlxObject, Obj2:FlxObject):int{
if (Obj1[_sortIndex] < Obj2[_sortIndex]){
return (_sortOrder);
};
if (Obj1[_sortIndex] > Obj2[_sortIndex]){
return (-(_sortOrder));
};
return (0);
}
public function resetFirstAvail(X:Number=0, Y:Number=0):Boolean{
var o:FlxObject = getFirstAvail();
if (o == null){
return (false);
};
o.reset(X, Y);
return (true);
}
override public function reset(X:Number, Y:Number):void{
var mx:Number;
var my:Number;
var o:FlxObject;
saveOldPosition();
super.reset(X, Y);
var moved:Boolean;
if (((!((x == _last.x))) || (!((y == _last.y))))){
moved = true;
mx = (x - _last.x);
my = (y - _last.y);
};
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (((!((o == null))) && (o.exists))){
if (moved){
if (o._group){
o.reset((o.x + mx), (o.y + my));
} else {
o.x = (o.x + mx);
o.y = (o.y + my);
if (solid){
o.colHullX.width = (o.colHullX.width + ((mx)>0) ? mx : -(mx));
if (mx < 0){
o.colHullX.x = (o.colHullX.x + mx);
};
o.colHullY.x = x;
o.colHullY.height = (o.colHullY.height + ((my)>0) ? my : -(my));
if (my < 0){
o.colHullY.y = (o.colHullY.y + my);
};
o.colVector.x = (o.colVector.x + mx);
o.colVector.y = (o.colVector.y + my);
};
};
};
};
};
}
protected function updateMembers():void{
var mx:Number;
var my:Number;
var o:FlxObject;
var moved:Boolean;
if (((!((x == _last.x))) || (!((y == _last.y))))){
moved = true;
mx = (x - _last.x);
my = (y - _last.y);
};
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (((!((o == null))) && (o.exists))){
if (moved){
if (o._group){
o.reset((o.x + mx), (o.y + my));
} else {
o.x = (o.x + mx);
o.y = (o.y + my);
};
};
if (o.active){
o.update();
};
if (((moved) && (o.solid))){
o.colHullX.width = (o.colHullX.width + ((mx)>0) ? mx : -(mx));
if (mx < 0){
o.colHullX.x = (o.colHullX.x + mx);
};
o.colHullY.x = x;
o.colHullY.height = (o.colHullY.height + ((my)>0) ? my : -(my));
if (my < 0){
o.colHullY.y = (o.colHullY.y + my);
};
o.colVector.x = (o.colVector.x + mx);
o.colVector.y = (o.colVector.y + my);
};
};
};
}
public function countDead():int{
var o:FlxObject;
var count = -1;
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (o != null){
if (count < 0){
count = 0;
};
if (o.dead){
count++;
};
};
};
return (count);
}
public function getFirstAvail():FlxObject{
var o:FlxObject;
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (((!((o == null))) && (!(o.exists)))){
return (o);
};
};
return (null);
}
override public function render():void{
renderMembers();
}
public function countLiving():int{
var o:FlxObject;
var count = -1;
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (o != null){
if (count < 0){
count = 0;
};
if (((o.exists) && (!(o.dead)))){
count++;
};
};
};
return (count);
}
public function countOnScreen():int{
var o:FlxObject;
var count = -1;
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (o != null){
if (count < 0){
count = 0;
};
if (o.onScreen()){
count++;
};
};
};
return (count);
}
protected function killMembers():void{
var o:FlxObject;
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (o != null){
o.kill();
};
};
}
public function sort(Index:String="y", Order:int=-1):void{
_sortIndex = Index;
_sortOrder = Order;
members.sort(sortHandler);
}
public function add(Object:FlxObject, ShareScroll:Boolean=false):FlxObject{
if (members.indexOf(Object) < 0){
members[members.length] = Object;
};
if (ShareScroll){
Object.scrollFactor = scrollFactor;
};
return (Object);
}
protected function renderMembers():void{
var o:FlxObject;
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (((((!((o == null))) && (o.exists))) && (o.visible))){
o.render();
};
};
}
override public function kill():void{
killMembers();
super.kill();
}
public function getFirstNull():int{
var i:uint;
var ml:uint = members.length;
while (i < ml) {
if (members[i] == null){
return (i);
};
i++;
};
return (-1);
}
public function replace(OldObject:FlxObject, NewObject:FlxObject):FlxObject{
var index:int = members.indexOf(OldObject);
if ((((index < 0)) || ((index >= members.length)))){
return (null);
};
members[index] = NewObject;
return (NewObject);
}
public function getRandom():FlxObject{
var c:uint;
var o:FlxObject;
var l:uint = members.length;
var i:uint = uint((FlxU.random() * l));
while ((((o == null)) && ((c < members.length)))) {
++i;
o = (members[(i % l)] as FlxObject);
c++;
};
return (o);
}
public function getFirstAlive():FlxObject{
var o:FlxObject;
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (((((!((o == null))) && (o.exists))) && (!(o.dead)))){
return (o);
};
};
return (null);
}
public function getFirstDead():FlxObject{
var o:FlxObject;
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (((!((o == null))) && (o.dead))){
return (o);
};
};
return (null);
}
protected function destroyMembers():void{
var o:FlxObject;
var i:uint;
var ml:uint = members.length;
while (i < ml) {
var _temp1 = i;
i = (i + 1);
o = (members[_temp1] as FlxObject);
if (o != null){
o.destroy();
};
};
members.length = 0;
}
}
}//package org.flixel
Section 246
//FlxMonitor (org.flixel.FlxMonitor)
package org.flixel {
public class FlxMonitor {
protected var _size:uint;
protected var _itr:uint;
protected var _data:Array;
public function FlxMonitor(Size:uint, Default:Number=0){
super();
_size = Size;
if (_size <= 0){
_size = 1;
};
_itr = 0;
_data = new Array(_size);
var i:uint;
while (i < _size) {
var _temp1 = i;
i = (i + 1);
var _local4 = _temp1;
_data[_local4] = Default;
};
}
public function add(Data:Number):void{
var _local2 = _itr++;
_data[_local2] = Data;
if (_itr >= _size){
_itr = 0;
};
}
public function average():Number{
var sum:Number = 0;
var i:uint;
while (i < _size) {
var _temp1 = i;
i = (i + 1);
sum = (sum + _data[_temp1]);
};
return ((sum / _size));
}
}
}//package org.flixel
Section 247
//FlxObject (org.flixel.FlxObject)
package org.flixel {
import flash.geom.*;
public class FlxObject extends FlxRect {
public var acceleration:FlxPoint;
public var angularAcceleration:Number;
public var active:Boolean;
public var collideBottom:Boolean;
var _group:Boolean;
protected var _point:FlxPoint;
public var colHullX:FlxRect;
protected var _flickerTimer:Number;
public var colHullY:FlxRect;
protected var _flashPoint:Point;
public var colOffsets:Array;
protected var _solid:Boolean;
public var origin:FlxPoint;
public var drag:FlxPoint;
public var angularDrag:Number;
public var collideTop:Boolean;
protected var _flicker:Boolean;
protected var _rect:FlxRect;
public var moves:Boolean;
public var angle:Number;
public var exists:Boolean;
public var velocity:FlxPoint;
public var maxAngular:Number;
public var angularVelocity:Number;
public var maxVelocity:FlxPoint;
public var maxThrust:Number;
public var dead:Boolean;
public var collideLeft:Boolean;
public var thrust:Number;
public var onFloor:Boolean;
public var health:Number;
protected var _fixed:Boolean;
public var visible:Boolean;
public var colVector:FlxPoint;
public var scrollFactor:FlxPoint;
public var collideRight:Boolean;
protected static const _pZero:FlxPoint = new FlxPoint();
public function FlxObject(X:Number=0, Y:Number=0, Width:Number=0, Height:Number=0){
super(X, Y, Width, Height);
exists = true;
active = true;
visible = true;
_solid = true;
_fixed = false;
moves = true;
collideLeft = true;
collideRight = true;
collideTop = true;
collideBottom = true;
origin = new FlxPoint();
velocity = new FlxPoint();
acceleration = new FlxPoint();
drag = new FlxPoint();
maxVelocity = new FlxPoint(10000, 10000);
angle = 0;
angularVelocity = 0;
angularAcceleration = 0;
angularDrag = 0;
maxAngular = 10000;
thrust = 0;
scrollFactor = new FlxPoint(1, 1);
_flicker = false;
_flickerTimer = -1;
health = 1;
dead = false;
_point = new FlxPoint();
_rect = new FlxRect();
_flashPoint = new Point();
colHullX = new FlxRect();
colHullY = new FlxRect();
colVector = new FlxPoint();
colOffsets = new Array(new FlxPoint());
_group = false;
}
public function getScreenXY(Point:FlxPoint=null):FlxPoint{
if (Point == null){
Point = new FlxPoint();
};
Point.x = (FlxU.floor((x + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.x * scrollFactor.x)));
Point.y = (FlxU.floor((y + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.y * scrollFactor.y)));
return (Point);
}
public function hitSide(Contact:FlxObject, Velocity:Number):void{
if (((!(fixed)) || (((Contact.fixed) && (((!((velocity.y == 0))) || (!((velocity.x == 0))))))))){
velocity.x = Velocity;
};
}
public function onScreen():Boolean{
getScreenXY(_point);
if (((((((((_point.x + width) < 0)) || ((_point.x > FlxG.width)))) || (((_point.y + height) < 0)))) || ((_point.y > FlxG.height)))){
return (false);
};
return (true);
}
public function kill():void{
exists = false;
dead = true;
}
protected function updateFlickering():void{
if (flickering()){
if (_flickerTimer > 0){
_flickerTimer = (_flickerTimer - FlxG.elapsed);
if (_flickerTimer == 0){
_flickerTimer = -1;
};
};
if (_flickerTimer < 0){
flicker(-1);
} else {
_flicker = !(_flicker);
visible = !(_flicker);
};
};
}
public function render():void{
}
public function hitBottom(Contact:FlxObject, Velocity:Number):void{
onFloor = true;
if (((!(fixed)) || (((Contact.fixed) && (((!((velocity.y == 0))) || (!((velocity.x == 0))))))))){
velocity.y = Velocity;
};
}
public function get fixed():Boolean{
return (_fixed);
}
public function overlaps(Object:FlxObject):Boolean{
getScreenXY(_point);
var tx:Number = _point.x;
var ty:Number = _point.y;
Object.getScreenXY(_point);
if ((((((((_point.x <= (tx - Object.width))) || ((_point.x >= (tx + width))))) || ((_point.y <= (ty - Object.height))))) || ((_point.y >= (ty + height))))){
return (false);
};
return (true);
}
public function preCollide(Object:FlxObject):void{
}
public function get solid():Boolean{
return (_solid);
}
public function hurt(Damage:Number):void{
health = (health - Damage);
if (health <= 0){
kill();
};
}
public function refreshHulls():void{
colHullX.x = x;
colHullX.y = y;
colHullX.width = width;
colHullX.height = height;
colHullY.x = x;
colHullY.y = y;
colHullY.width = width;
colHullY.height = height;
}
public function hitLeft(Contact:FlxObject, Velocity:Number):void{
hitSide(Contact, Velocity);
}
public function collide(Object:FlxObject=null):Boolean{
return (FlxU.collide(this, ((Object)==null) ? this : Object));
}
public function reset(X:Number, Y:Number):void{
x = X;
y = Y;
exists = true;
dead = false;
}
public function update():void{
updateMotion();
updateFlickering();
}
public function hitTop(Contact:FlxObject, Velocity:Number):void{
if (((!(fixed)) || (((Contact.fixed) && (((!((velocity.y == 0))) || (!((velocity.x == 0))))))))){
velocity.y = Velocity;
};
}
public function set solid(Solid:Boolean):void{
_solid = Solid;
}
protected function updateMotion():void{
var vc:Number;
var thrustComponents:FlxPoint;
var maxComponents:FlxPoint;
var max:Number;
if (!moves){
return;
};
if (_solid){
refreshHulls();
};
onFloor = false;
vc = ((FlxU.computeVelocity(angularVelocity, angularAcceleration, angularDrag, maxAngular) - angularVelocity) / 2);
angularVelocity = (angularVelocity + vc);
angle = (angle + (angularVelocity * FlxG.elapsed));
angularVelocity = (angularVelocity + vc);
if (thrust != 0){
thrustComponents = FlxU.rotatePoint(-(thrust), 0, 0, 0, angle);
maxComponents = FlxU.rotatePoint(-(maxThrust), 0, 0, 0, angle);
max = ((maxComponents.x)>0) ? maxComponents.x : -(maxComponents.x);
if (max > ((maxComponents.y)>0) ? maxComponents.y : -(maxComponents.y)){
maxComponents.y = max;
} else {
max = ((maxComponents.y)>0) ? maxComponents.y : -(maxComponents.y);
};
maxVelocity.x = (maxVelocity.y = ((max)>0) ? max : -(max));
} else {
thrustComponents = _pZero;
};
vc = ((FlxU.computeVelocity(velocity.x, (acceleration.x + thrustComponents.x), drag.x, maxVelocity.x) - velocity.x) / 2);
velocity.x = (velocity.x + vc);
var xd:Number = (velocity.x * FlxG.elapsed);
velocity.x = (velocity.x + vc);
vc = ((FlxU.computeVelocity(velocity.y, (acceleration.y + thrustComponents.y), drag.y, maxVelocity.y) - velocity.y) / 2);
velocity.y = (velocity.y + vc);
var yd:Number = (velocity.y * FlxG.elapsed);
velocity.y = (velocity.y + vc);
x = (x + xd);
y = (y + yd);
if (!_solid){
return;
};
colVector.x = xd;
colVector.y = yd;
colHullX.width = (colHullX.width + ((colVector.x)>0) ? colVector.x : -(colVector.x));
if (colVector.x < 0){
colHullX.x = (colHullX.x + colVector.x);
};
colHullY.x = x;
colHullY.height = (colHullY.height + ((colVector.y)>0) ? colVector.y : -(colVector.y));
if (colVector.y < 0){
colHullY.y = (colHullY.y + colVector.y);
};
}
public function getBoundingColor():uint{
if (solid){
if (fixed){
return (2130768421);
};
return (2147418130);
//unresolved jump
};
return (2130743529);
}
public function set fixed(Fixed:Boolean):void{
_fixed = Fixed;
}
public function flickering():Boolean{
return ((_flickerTimer >= 0));
}
public function overlapsPoint(X:Number, Y:Number, PerPixel:Boolean=false):Boolean{
X = (X + FlxU.floor(FlxG.scroll.x));
Y = (Y + FlxU.floor(FlxG.scroll.y));
getScreenXY(_point);
if ((((((((X <= _point.x)) || ((X >= (_point.x + width))))) || ((Y <= _point.y)))) || ((Y >= (_point.y + height))))){
return (false);
};
return (true);
}
public function hitRight(Contact:FlxObject, Velocity:Number):void{
hitSide(Contact, Velocity);
}
public function destroy():void{
}
public function flicker(Duration:Number=1):void{
_flickerTimer = Duration;
if (_flickerTimer < 0){
_flicker = false;
visible = true;
};
}
}
}//package org.flixel
Section 248
//FlxPoint (org.flixel.FlxPoint)
package org.flixel {
public class FlxPoint {
public var x:Number;
public var y:Number;
public function FlxPoint(X:Number=0, Y:Number=0){
super();
x = X;
y = Y;
}
public function toString():String{
return (FlxU.getClassName(this, true));
}
}
}//package org.flixel
Section 249
//FlxQuadTree (org.flixel.FlxQuadTree)
package org.flixel {
import org.flixel.data.*;
public class FlxQuadTree extends FlxRect {
protected var _sw:FlxQuadTree;
protected var _mx:Number;
protected var _my:Number;
protected var _ne:FlxQuadTree;
protected var _hh:Number;
protected var _headA:FlxList;
protected var _headB:FlxList;
protected var _canSubdivide:Boolean;
protected var _l:Number;
protected var _hw:Number;
protected var _nw:FlxQuadTree;
protected var _se:FlxQuadTree;
protected var _tailA:FlxList;
protected var _r:Number;
protected var _t:Number;
protected var _tailB:FlxList;
protected var _b:Number;
public static const A_LIST:uint = 0;
public static const B_LIST:uint = 1;
protected static var _or:Number;
protected static var _ot:Number;
public static var quadTree:FlxQuadTree;
protected static var _min:uint;
public static var divisions:uint;
protected static var _o:FlxObject;
protected static var _oa:uint;
protected static var _ob:Number;
protected static var _oc:Function;
public static var bounds:FlxRect;
protected static var _ol:Number;
public function FlxQuadTree(X:Number, Y:Number, Width:Number, Height:Number, Parent:FlxQuadTree=null){
var itr:FlxList;
var ot:FlxList;
super(X, Y, Width, Height);
_headA = (_tailA = new FlxList());
_headB = (_tailB = new FlxList());
if (Parent != null){
if (Parent._headA.object != null){
itr = Parent._headA;
while (itr != null) {
if (_tailA.object != null){
ot = _tailA;
_tailA = new FlxList();
ot.next = _tailA;
};
_tailA.object = itr.object;
itr = itr.next;
};
};
if (Parent._headB.object != null){
itr = Parent._headB;
while (itr != null) {
if (_tailB.object != null){
ot = _tailB;
_tailB = new FlxList();
ot.next = _tailB;
};
_tailB.object = itr.object;
itr = itr.next;
};
};
} else {
_min = ((width + height) / (2 * divisions));
};
_canSubdivide = (((width > _min)) || ((height > _min)));
_nw = null;
_ne = null;
_se = null;
_sw = null;
_l = x;
_r = (x + width);
_hw = (width / 2);
_mx = (_l + _hw);
_t = y;
_b = (y + height);
_hh = (height / 2);
_my = (_t + _hh);
}
protected function addObject():void{
if (((!(_canSubdivide)) || ((((((((_l >= _ol)) && ((_r <= _or)))) && ((_t >= _ot)))) && ((_b <= _ob)))))){
addToList();
return;
};
if ((((_ol > _l)) && ((_or < _mx)))){
if ((((_ot > _t)) && ((_ob < _my)))){
if (_nw == null){
_nw = new FlxQuadTree(_l, _t, _hw, _hh, this);
};
_nw.addObject();
return;
};
if ((((_ot > _my)) && ((_ob < _b)))){
if (_sw == null){
_sw = new FlxQuadTree(_l, _my, _hw, _hh, this);
};
_sw.addObject();
return;
};
};
if ((((_ol > _mx)) && ((_or < _r)))){
if ((((_ot > _t)) && ((_ob < _my)))){
if (_ne == null){
_ne = new FlxQuadTree(_mx, _t, _hw, _hh, this);
};
_ne.addObject();
return;
};
if ((((_ot > _my)) && ((_ob < _b)))){
if (_se == null){
_se = new FlxQuadTree(_mx, _my, _hw, _hh, this);
};
_se.addObject();
return;
};
};
if ((((((((_or > _l)) && ((_ol < _mx)))) && ((_ob > _t)))) && ((_ot < _my)))){
if (_nw == null){
_nw = new FlxQuadTree(_l, _t, _hw, _hh, this);
};
_nw.addObject();
};
if ((((((((_or > _mx)) && ((_ol < _r)))) && ((_ob > _t)))) && ((_ot < _my)))){
if (_ne == null){
_ne = new FlxQuadTree(_mx, _t, _hw, _hh, this);
};
_ne.addObject();
};
if ((((((((_or > _mx)) && ((_ol < _r)))) && ((_ob > _my)))) && ((_ot < _b)))){
if (_se == null){
_se = new FlxQuadTree(_mx, _my, _hw, _hh, this);
};
_se.addObject();
};
if ((((((((_or > _l)) && ((_ol < _mx)))) && ((_ob > _my)))) && ((_ot < _b)))){
if (_sw == null){
_sw = new FlxQuadTree(_l, _my, _hw, _hh, this);
};
_sw.addObject();
};
}
protected function addToList():void{
var ot:FlxList;
if (_oa == A_LIST){
if (_tailA.object != null){
ot = _tailA;
_tailA = new FlxList();
ot.next = _tailA;
};
_tailA.object = _o;
} else {
if (_tailB.object != null){
ot = _tailB;
_tailB = new FlxList();
ot.next = _tailB;
};
_tailB.object = _o;
};
if (!_canSubdivide){
return;
};
if (_nw != null){
_nw.addToList();
};
if (_ne != null){
_ne.addToList();
};
if (_se != null){
_se.addToList();
};
if (_sw != null){
_sw.addToList();
};
}
public function overlap(BothLists:Boolean=true, Callback:Function=null):Boolean{
var itr:FlxList;
_oc = Callback;
var c:Boolean;
if (BothLists){
_oa = B_LIST;
if (_headA.object != null){
itr = _headA;
while (itr != null) {
_o = itr.object;
if (((((_o.exists) && (_o.solid))) && (overlapNode()))){
c = true;
};
itr = itr.next;
};
};
_oa = A_LIST;
if (_headB.object != null){
itr = _headB;
while (itr != null) {
_o = itr.object;
if (((_o.exists) && (_o.solid))){
if (((!((_nw == null))) && (_nw.overlapNode()))){
c = true;
};
if (((!((_ne == null))) && (_ne.overlapNode()))){
c = true;
};
if (((!((_se == null))) && (_se.overlapNode()))){
c = true;
};
if (((!((_sw == null))) && (_sw.overlapNode()))){
c = true;
};
};
itr = itr.next;
};
};
} else {
if (_headA.object != null){
itr = _headA;
while (itr != null) {
_o = itr.object;
if (((((_o.exists) && (_o.solid))) && (overlapNode(itr.next)))){
c = true;
};
itr = itr.next;
};
};
};
if (((!((_nw == null))) && (_nw.overlap(BothLists, _oc)))){
c = true;
};
if (((!((_ne == null))) && (_ne.overlap(BothLists, _oc)))){
c = true;
};
if (((!((_se == null))) && (_se.overlap(BothLists, _oc)))){
c = true;
};
if (((!((_sw == null))) && (_sw.overlap(BothLists, _oc)))){
c = true;
};
return (c);
}
public function add(Object:FlxObject, List:uint):void{
var i:uint;
var m:FlxObject;
var members:Array;
var l:uint;
_oa = List;
if (Object._group){
i = 0;
members = (Object as FlxGroup).members;
l = members.length;
while (i < l) {
var _temp1 = i;
i = (i + 1);
m = (members[_temp1] as FlxObject);
if (((!((m == null))) && (m.exists))){
if (m._group){
add(m, List);
} else {
if (m.solid){
_o = m;
_ol = _o.x;
_ot = _o.y;
_or = (_o.x + _o.width);
_ob = (_o.y + _o.height);
addObject();
};
};
};
};
};
if (Object.solid){
_o = Object;
_ol = _o.x;
_ot = _o.y;
_or = (_o.x + _o.width);
_ob = (_o.y + _o.height);
addObject();
};
}
protected function overlapNode(Iterator:FlxList=null):Boolean{
var co:FlxObject;
var c:Boolean;
var itr:FlxList = Iterator;
if (itr == null){
if (_oa == A_LIST){
itr = _headA;
} else {
itr = _headB;
};
};
if (itr.object != null){
while (itr != null) {
co = itr.object;
if ((((((((((((((((((_o === co)) || (!(co.exists)))) || (!(_o.exists)))) || (!(co.solid)))) || (!(_o.solid)))) || (((_o.x + _o.width) < (co.x + FlxU.roundingError))))) || (((_o.x + FlxU.roundingError) > (co.x + co.width))))) || (((_o.y + _o.height) < (co.y + FlxU.roundingError))))) || (((_o.y + FlxU.roundingError) > (co.y + co.height))))){
itr = itr.next;
} else {
if (_oc == null){
_o.kill();
co.kill();
c = true;
} else {
if (_oc(_o, co)){
c = true;
};
};
itr = itr.next;
};
};
};
return (c);
}
}
}//package org.flixel
Section 250
//FlxRect (org.flixel.FlxRect)
package org.flixel {
public class FlxRect extends FlxPoint {
public var width:Number;
public var height:Number;
public function FlxRect(X:Number=0, Y:Number=0, Width:Number=0, Height:Number=0){
super(X, Y);
width = Width;
height = Height;
}
public function get bottom():Number{
return ((y + height));
}
public function get top():Number{
return (y);
}
public function get left():Number{
return (x);
}
public function get right():Number{
return ((x + width));
}
}
}//package org.flixel
Section 251
//FlxSave (org.flixel.FlxSave)
package org.flixel {
import flash.net.*;
public class FlxSave {
protected var _so:SharedObject;
public var data:Object;
public var name:String;
public function FlxSave(){
super();
name = null;
_so = null;
data = null;
}
public function read(FieldName:String):Object{
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.read().");
return (null);
};
return (data[FieldName]);
}
public function forceSave(MinFileSize:uint=0):Boolean{
var MinFileSize = MinFileSize;
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.forceSave().");
return (false);
};
var status:Object;
status = _so.flush(MinFileSize);
//unresolved jump
var _slot1 = e;
FlxG.log("WARNING: There was a problem flushing\nthe shared object data from FlxSave.");
return (false);
return ((status == SharedObjectFlushStatus.FLUSHED));
}
public function bind(Name:String):Boolean{
var Name = Name;
name = null;
_so = null;
data = null;
name = Name;
_so = SharedObject.getLocal(name);
//unresolved jump
var _slot1 = e;
FlxG.log("WARNING: There was a problem binding to\nthe shared object data from FlxSave.");
name = null;
_so = null;
data = null;
return (false);
data = _so.data;
return (true);
}
public function erase(MinFileSize:uint=0):Boolean{
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.erase().");
return (false);
};
_so.clear();
return (forceSave(MinFileSize));
}
public function write(FieldName:String, FieldValue:Object, MinFileSize:uint=0):Boolean{
if (_so == null){
FlxG.log("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.write().");
return (false);
};
data[FieldName] = FieldValue;
return (forceSave(MinFileSize));
}
}
}//package org.flixel
Section 252
//FlxSound (org.flixel.FlxSound)
package org.flixel {
import flash.events.*;
import flash.media.*;
import flash.net.*;
public class FlxSound extends FlxObject {
public var name:String;
protected var _position:Number;
protected var _sound:Sound;
protected var _fadeOutTotal:Number;
protected var _fadeOutTimer:Number;
protected var _pauseOnFadeOut:Boolean;
public var playing:Boolean;
protected var _volumeAdjust:Number;
protected var _radius:Number;
protected var _volume:Number;
protected var _point2:FlxPoint;
protected var _fadeInTimer:Number;
public var artist:String;
protected var _channel:SoundChannel;
protected var _fadeInTotal:Number;
protected var _looped:Boolean;
protected var _pan:Boolean;
protected var _transform:SoundTransform;
protected var _init:Boolean;
public var survive:Boolean;
public var playPosition:Number;// = 0
protected var _core:FlxObject;
public function FlxSound(){
super();
_point2 = new FlxPoint();
_transform = new SoundTransform();
init();
fixed = true;
}
override public function destroy():void{
if (active){
stop();
};
}
public function loadStream(SoundURL:String, Looped:Boolean=false):FlxSound{
stop();
init();
_sound = new Sound();
_sound.addEventListener(Event.ID3, gotID3);
_sound.load(new URLRequest(SoundURL));
_looped = Looped;
updateTransform();
active = true;
return (this);
}
public function stop():void{
_position = 0;
if (_channel != null){
_channel.stop();
stopped();
};
}
protected function init():void{
_transform.pan = 0;
_sound = null;
_position = 0;
_volume = 1;
_volumeAdjust = 1;
_looped = false;
_core = null;
_radius = 0;
_pan = false;
_fadeOutTimer = 0;
_fadeOutTotal = 0;
_pauseOnFadeOut = false;
_fadeInTimer = 0;
_fadeInTotal = 0;
active = false;
visible = false;
solid = false;
playing = false;
name = null;
artist = null;
}
public function get volume():Number{
return (_volume);
}
function updateTransform():void{
_transform.volume = (((FlxG.getMuteValue() * FlxG.volume) * _volume) * _volumeAdjust);
if (_channel != null){
_channel.soundTransform = _transform;
};
}
public function getPosition():Number{
return (_position);
}
public function loadEmbedded(EmbeddedSound:Class, Looped:Boolean=false):FlxSound{
stop();
init();
_sound = new (EmbeddedSound);
_looped = Looped;
updateTransform();
active = true;
return (this);
}
public function setPosition(pos:Number):void{
_position = pos;
}
public function fadeOut(Seconds:Number, PauseInstead:Boolean=false):void{
_pauseOnFadeOut = PauseInstead;
_fadeInTimer = 0;
_fadeOutTimer = Seconds;
_fadeOutTotal = _fadeOutTimer;
}
public function play():void{
if (_position < 0){
return;
};
if (_looped){
if (_position == 0){
if (_channel == null){
_channel = _sound.play(0, 9999, _transform);
};
if (_channel == null){
active = false;
};
} else {
_channel = _sound.play(_position, 0, _transform);
if (_channel == null){
active = false;
} else {
_channel.addEventListener(Event.SOUND_COMPLETE, looped);
};
};
} else {
if (_position == 0){
if (_channel == null){
_channel = _sound.play(0, 0, _transform);
if (_channel == null){
active = false;
} else {
_channel.addEventListener(Event.SOUND_COMPLETE, stopped);
};
};
} else {
_channel = _sound.play(_position, 0, _transform);
if (_channel == null){
active = false;
};
};
};
playing = !((_channel == null));
_position = 0;
}
public function set volume(Volume:Number):void{
_volume = Volume;
if (_volume < 0){
_volume = 0;
} else {
if (_volume > 1){
_volume = 1;
};
};
updateTransform();
}
protected function looped(event:Event=null):void{
if (_channel == null){
return;
};
_channel.removeEventListener(Event.SOUND_COMPLETE, looped);
_channel = null;
play();
}
protected function updateSound():void{
var _point:FlxPoint;
var _point2:FlxPoint;
var dx:Number;
var dy:Number;
var d:Number;
if (_position != 0){
return;
};
playPosition = _channel.position;
var radial:Number = 1;
var fade:Number = 1;
if (_core != null){
_point = new FlxPoint();
_point2 = new FlxPoint();
_core.getScreenXY(_point);
getScreenXY(_point2);
dx = (_point.x - _point2.x);
dy = (_point.y - _point2.y);
radial = ((_radius - Math.sqrt(((dx * dx) + (dy * dy)))) / _radius);
if (radial < 0){
radial = 0;
};
if (radial > 1){
radial = 1;
};
if (_pan){
d = (-(dx) / _radius);
if (d < -1){
d = -1;
} else {
if (d > 1){
d = 1;
};
};
_transform.pan = d;
};
};
if (_fadeOutTimer > 0){
_fadeOutTimer = (_fadeOutTimer - FlxG.elapsed);
if (_fadeOutTimer <= 0){
if (_pauseOnFadeOut){
pause();
} else {
stop();
};
};
fade = (_fadeOutTimer / _fadeOutTotal);
if (fade < 0){
fade = 0;
};
} else {
if (_fadeInTimer > 0){
_fadeInTimer = (_fadeInTimer - FlxG.elapsed);
fade = (_fadeInTimer / _fadeInTotal);
if (fade < 0){
fade = 0;
};
fade = (1 - fade);
};
};
_volumeAdjust = (radial * fade);
updateTransform();
}
public function fadeIn(Seconds:Number):void{
_fadeOutTimer = 0;
_fadeInTimer = Seconds;
_fadeInTotal = _fadeInTimer;
play();
}
override public function update():void{
super.update();
updateSound();
}
protected function stopped(event:Event=null):void{
if (!_looped){
_channel.removeEventListener(Event.SOUND_COMPLETE, stopped);
} else {
_channel.removeEventListener(Event.SOUND_COMPLETE, looped);
};
_channel = null;
active = false;
playing = false;
}
protected function gotID3(event:Event=null):void{
FlxG.log("got ID3 info!");
if (_sound.id3.songName.length > 0){
name = _sound.id3.songName;
};
if (_sound.id3.artist.length > 0){
artist = _sound.id3.artist;
};
_sound.removeEventListener(Event.ID3, gotID3);
}
public function pause():void{
if (_channel == null){
_position = -1;
return;
};
_position = _channel.position;
_channel.stop();
if (_looped){
while (_position >= _sound.length) {
_position = (_position - _sound.length);
};
};
_channel = null;
playing = false;
}
public function proximity(X:Number, Y:Number, Core:FlxObject, Radius:Number, Pan:Boolean=true):FlxSound{
x = X;
y = Y;
_core = Core;
_radius = Radius;
_pan = Pan;
return (this);
}
}
}//package org.flixel
Section 253
//FlxSprite (org.flixel.FlxSprite)
package org.flixel {
import flash.display.*;
import flash.geom.*;
import org.flixel.data.*;
public class FlxSprite extends FlxObject {
protected var _mtx:Matrix;
protected var _caf:uint;
public var finished:Boolean;
protected var _animations:Array;
protected var _ct:ColorTransform;
public var offset:FlxPoint;
protected var _callback:Function;
public var frames:uint;
protected var _curAnim:FlxAnim;
protected var _framePixels:BitmapData;
protected var _flipped:uint;
public var scale:FlxPoint;
protected var _pixels:BitmapData;
protected var _bakedRotation:Number;
public var blend:String;
public var frameWidth:uint;
protected var _flashRect2:Rectangle;
protected var _bbb:BitmapData;
protected var _alpha:Number;
protected var _flashPointZero:Point;
protected var _curFrame:uint;
protected var _color:uint;
public var frameHeight:uint;
protected var _flashRect:Rectangle;
protected var _frameTimer:Number;
protected var _facing:uint;
public var antialiasing:Boolean;
protected var _boundsVisible:Boolean;
public static const LEFT:uint = 0;
public static const DOWN:uint = 3;
public static const UP:uint = 2;
public static const RIGHT:uint = 1;
protected static var _gfx:Graphics;
protected static var _gfxSprite:Sprite;
public function FlxSprite(X:Number=0, Y:Number=0, SimpleGraphic:Class=null){
super();
x = X;
y = Y;
_flashRect = new Rectangle();
_flashRect2 = new Rectangle();
_flashPointZero = new Point();
offset = new FlxPoint();
scale = new FlxPoint(1, 1);
_alpha = 1;
_color = 0xFFFFFF;
blend = null;
antialiasing = false;
finished = false;
_facing = RIGHT;
_animations = new Array();
_flipped = 0;
_curAnim = null;
_curFrame = 0;
_caf = 0;
_frameTimer = 0;
_mtx = new Matrix();
_callback = null;
if (_gfxSprite == null){
_gfxSprite = new Sprite();
_gfx = _gfxSprite.graphics;
};
if (SimpleGraphic == null){
createGraphic(8, 8);
} else {
loadGraphic(SimpleGraphic);
};
}
override public function set fixed(Fixed:Boolean):void{
var of:Boolean = _fixed;
_fixed = Fixed;
if (((!((of == _fixed))) && (FlxG.showBounds))){
calcFrame();
};
}
protected function renderSprite():void{
if (FlxG.showBounds != _boundsVisible){
calcFrame();
};
getScreenXY(_point);
_flashPoint.x = _point.x;
_flashPoint.y = _point.y;
if ((((((((((angle == 0)) || ((_bakedRotation > 0)))) && ((scale.x == 1)))) && ((scale.y == 1)))) && ((blend == null)))){
FlxG.buffer.copyPixels(_framePixels, _flashRect, _flashPoint, null, null, true);
return;
};
_mtx.identity();
_mtx.translate(-(origin.x), -(origin.y));
_mtx.scale(scale.x, scale.y);
if (angle != 0){
_mtx.rotate((angle * 0.017453293));
};
_mtx.translate((_point.x + origin.x), (_point.y + origin.y));
FlxG.buffer.draw(_framePixels, _mtx, null, blend, null, antialiasing);
}
public function get color():uint{
return (_color);
}
override public function getScreenXY(Point:FlxPoint=null):FlxPoint{
if (Point == null){
Point = new FlxPoint();
};
Point.x = ((FlxU.floor((x + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.x * scrollFactor.x))) - offset.x);
Point.y = ((FlxU.floor((y + FlxU.roundingError)) + FlxU.floor((FlxG.scroll.y * scrollFactor.y))) - offset.y);
return (Point);
}
public function get frame():uint{
return (_caf);
}
override public function overlapsPoint(X:Number, Y:Number, PerPixel:Boolean=false):Boolean{
X = (X + FlxU.floor(FlxG.scroll.x));
Y = (Y + FlxU.floor(FlxG.scroll.y));
getScreenXY(_point);
if (PerPixel){
return (_framePixels.hitTest(new Point(0, 0), 0xFF, new Point((X - _point.x), (Y - _point.y))));
};
if ((((((((X <= _point.x)) || ((X >= (_point.x + frameWidth))))) || ((Y <= _point.y)))) || ((Y >= (_point.y + frameHeight))))){
return (false);
};
return (true);
}
override public function render():void{
renderSprite();
}
protected function drawBounds():void{
_boundsVisible = true;
if ((((((_bbb == null)) || (!((_bbb.width == width))))) || (!((_bbb.height == height))))){
_bbb = new BitmapData(width, height);
};
var bbbc:uint = getBoundingColor();
_bbb.fillRect(_flashRect, 0);
var ofrw:uint = _flashRect.width;
var ofrh:uint = _flashRect.height;
_flashRect.width = int(width);
_flashRect.height = int(height);
_bbb.fillRect(_flashRect, bbbc);
_flashRect.width = (_flashRect.width - 2);
_flashRect.height = (_flashRect.height - 2);
_flashRect.x = 1;
_flashRect.y = 1;
_bbb.fillRect(_flashRect, 0);
_flashRect.width = ofrw;
_flashRect.height = ofrh;
_flashRect.x = (_flashRect.y = 0);
_flashPoint.x = int(offset.x);
_flashPoint.y = int(offset.y);
_framePixels.copyPixels(_bbb, _flashRect, _flashPoint, null, null, true);
}
protected function calcFrame():void{
_boundsVisible = false;
var rx:uint = (_caf * frameWidth);
var ry:uint;
var w:uint = (_flipped) ? _flipped : _pixels.width;
if (rx >= w){
ry = (uint((rx / w)) * frameHeight);
rx = (rx % w);
};
if (((_flipped) && ((_facing == LEFT)))){
rx = (((_flipped << 1) - rx) - frameWidth);
};
_flashRect.x = rx;
_flashRect.y = ry;
_framePixels.copyPixels(_pixels, _flashRect, _flashPointZero);
_flashRect.x = (_flashRect.y = 0);
if (_ct != null){
_framePixels.colorTransform(_flashRect, _ct);
};
if (FlxG.showBounds){
drawBounds();
};
if (_callback != null){
_callback(_curAnim.name, _curFrame, _caf);
};
}
public function fill(Color:uint):void{
_pixels.fillRect(_flashRect2, Color);
if (_pixels != _framePixels){
calcFrame();
};
}
public function loadGraphic(Graphic:Class, Animated:Boolean=false, Reverse:Boolean=false, Width:uint=0, Height:uint=0, Unique:Boolean=false):FlxSprite{
_bakedRotation = 0;
_pixels = FlxG.addBitmap(Graphic, Reverse, Unique);
if (Reverse){
_flipped = (_pixels.width >> 1);
} else {
_flipped = 0;
};
if (Width == 0){
if (Animated){
Width = _pixels.height;
} else {
if (_flipped > 0){
Width = (_pixels.width * 0.5);
} else {
Width = _pixels.width;
};
};
};
width = (frameWidth = Width);
if (Height == 0){
if (Animated){
Height = width;
} else {
Height = _pixels.height;
};
};
height = (frameHeight = Height);
resetHelpers();
return (this);
}
function unsafeBind(Pixels:BitmapData):void{
_pixels = (_framePixels = Pixels);
}
public function get pixels():BitmapData{
return (_pixels);
}
protected function resetHelpers():void{
_boundsVisible = false;
_flashRect.x = 0;
_flashRect.y = 0;
_flashRect.width = frameWidth;
_flashRect.height = frameHeight;
_flashRect2.x = 0;
_flashRect2.y = 0;
_flashRect2.width = _pixels.width;
_flashRect2.height = _pixels.height;
if ((((((_framePixels == null)) || (!((_framePixels.width == width))))) || (!((_framePixels.height == height))))){
_framePixels = new BitmapData(width, height);
};
if ((((((_bbb == null)) || (!((_bbb.width == width))))) || (!((_bbb.height == height))))){
_bbb = new BitmapData(width, height);
};
origin.x = (frameWidth * 0.5);
origin.y = (frameHeight * 0.5);
_framePixels.copyPixels(_pixels, _flashRect, _flashPointZero);
frames = ((_flashRect2.width / _flashRect.width) * (_flashRect2.height / _flashRect.height));
if (_ct != null){
_framePixels.colorTransform(_flashRect, _ct);
};
if (FlxG.showBounds){
drawBounds();
};
_caf = 0;
refreshHulls();
}
public function addAnimation(Name:String, Frames:Array, FrameRate:Number=0, Looped:Boolean=true):void{
_animations.push(new FlxAnim(Name, Frames, FrameRate, Looped));
}
public function set alpha(Alpha:Number):void{
if (Alpha > 1){
Alpha = 1;
};
if (Alpha < 0){
Alpha = 0;
};
if (Alpha == _alpha){
return;
};
_alpha = Alpha;
if (((!((_alpha == 1))) || (!((_color == 0xFFFFFF))))){
_ct = new ColorTransform(((_color >> 16) * 0.00392), (((_color >> 8) & 0xFF) * 0.00392), ((_color & 0xFF) * 0.00392), _alpha);
} else {
_ct = null;
};
calcFrame();
}
protected function updateAnimation():void{
var oc:uint;
var ta:int;
if (_bakedRotation){
oc = _caf;
ta = (angle % 360);
if (ta < 0){
ta = (ta + 360);
};
_caf = (ta / _bakedRotation);
if (oc != _caf){
calcFrame();
};
return;
};
if (((((!((_curAnim == null))) && ((_curAnim.delay > 0)))) && (((_curAnim.looped) || (!(finished)))))){
_frameTimer = (_frameTimer + FlxG.elapsed);
while (_frameTimer > _curAnim.delay) {
_frameTimer = (_frameTimer - _curAnim.delay);
if (_curFrame == (_curAnim.frames.length - 1)){
if (_curAnim.looped){
_curFrame = 0;
};
finished = true;
} else {
_curFrame++;
};
_caf = _curAnim.frames[_curFrame];
calcFrame();
};
};
}
public function draw(Brush:FlxSprite, X:int=0, Y:int=0):void{
var b:BitmapData = Brush._framePixels;
if ((((((((((Brush.angle == 0)) || ((Brush._bakedRotation > 0)))) && ((Brush.scale.x == 1)))) && ((Brush.scale.y == 1)))) && ((Brush.blend == null)))){
_flashPoint.x = X;
_flashPoint.y = Y;
_flashRect2.width = b.width;
_flashRect2.height = b.height;
_pixels.copyPixels(b, _flashRect2, _flashPoint, null, null, true);
_flashRect2.width = _pixels.width;
_flashRect2.height = _pixels.height;
calcFrame();
return;
};
_mtx.identity();
_mtx.translate(-(Brush.origin.x), -(Brush.origin.y));
_mtx.scale(Brush.scale.x, Brush.scale.y);
if (Brush.angle != 0){
_mtx.rotate((Brush.angle * 0.017453293));
};
_mtx.translate((X + Brush.origin.x), (Y + Brush.origin.y));
_pixels.draw(b, _mtx, null, Brush.blend, null, Brush.antialiasing);
calcFrame();
}
public function loadRotatedGraphic(Graphic:Class, Rotations:uint=16, Frame:int=-1, AntiAliasing:Boolean=false, AutoBuffer:Boolean=false):FlxSprite{
var full:BitmapData;
var rx:uint;
var ry:uint;
var fw:uint;
var r:uint;
var c:uint;
var ba:Number;
var bw2:uint;
var bh2:uint;
var gxc:uint;
var gyc:uint;
var rows:uint = Math.sqrt(Rotations);
var brush:BitmapData = FlxG.addBitmap(Graphic);
if (Frame >= 0){
full = brush;
brush = new BitmapData(full.height, full.height);
rx = (Frame * brush.width);
ry = 0;
fw = full.width;
if (rx >= fw){
ry = (uint((rx / fw)) * brush.height);
rx = (rx % fw);
};
_flashRect.x = rx;
_flashRect.y = ry;
_flashRect.width = brush.width;
_flashRect.height = brush.height;
brush.copyPixels(full, _flashRect, _flashPointZero);
};
var max:uint = brush.width;
if (brush.height > max){
max = brush.height;
};
if (AutoBuffer){
max = (max * 1.5);
};
var cols:uint = FlxU.ceil((Rotations / rows));
width = (max * cols);
height = (max * rows);
var key:String = ((((((String(Graphic) + ":") + Frame) + ":") + width) + "x") + height);
var skipGen:Boolean = FlxG.checkBitmapCache(key);
_pixels = FlxG.createBitmap(width, height, 0, true, key);
width = (frameWidth = _pixels.width);
height = (frameHeight = _pixels.height);
_bakedRotation = (360 / Rotations);
if (!skipGen){
r = 0;
ba = 0;
bw2 = (brush.width * 0.5);
bh2 = (brush.height * 0.5);
gxc = (max * 0.5);
gyc = (max * 0.5);
while (r < rows) {
c = 0;
while (c < cols) {
_mtx.identity();
_mtx.translate(-(bw2), -(bh2));
_mtx.rotate((ba * 0.017453293));
_mtx.translate(((max * c) + gxc), gyc);
ba = (ba + _bakedRotation);
_pixels.draw(brush, _mtx, null, null, null, AntiAliasing);
c++;
};
gyc = (gyc + max);
r++;
};
};
frameWidth = (frameHeight = (width = (height = max)));
resetHelpers();
return (this);
}
override public function update():void{
updateMotion();
updateAnimation();
updateFlickering();
}
public function set color(Color:uint):void{
Color = (Color & 0xFFFFFF);
if (_color == Color){
return;
};
_color = Color;
if (((!((_alpha == 1))) || (!((_color == 0xFFFFFF))))){
_ct = new ColorTransform(((_color >> 16) * 0.00392), (((_color >> 8) & 0xFF) * 0.00392), ((_color & 0xFF) * 0.00392), _alpha);
} else {
_ct = null;
};
calcFrame();
}
public function onEmit():void{
}
override public function set solid(Solid:Boolean):void{
var os:Boolean = _solid;
_solid = Solid;
if (((!((os == _solid))) && (FlxG.showBounds))){
calcFrame();
};
}
public function addAnimationCallback(AnimationCallback:Function):void{
_callback = AnimationCallback;
}
public function set pixels(Pixels:BitmapData):void{
_pixels = Pixels;
width = (frameWidth = _pixels.width);
height = (frameHeight = _pixels.height);
resetHelpers();
}
public function createGraphic(Width:uint, Height:uint, Color:uint=4294967295, Unique:Boolean=false, Key:String=null):FlxSprite{
_bakedRotation = 0;
_pixels = FlxG.createBitmap(Width, Height, Color, Unique, Key);
width = (frameWidth = _pixels.width);
height = (frameHeight = _pixels.height);
resetHelpers();
return (this);
}
public function get alpha():Number{
return (_alpha);
}
public function get facing():uint{
return (_facing);
}
public function set frame(Frame:uint):void{
_curAnim = null;
_caf = Frame;
calcFrame();
}
public function set facing(Direction:uint):void{
var c = !((_facing == Direction));
_facing = Direction;
if (c){
calcFrame();
};
}
public function drawLine(StartX:Number, StartY:Number, EndX:Number, EndY:Number, Color:uint, Thickness:uint=1):void{
_gfx.clear();
_gfx.moveTo(StartX, StartY);
_gfx.lineStyle(Thickness, Color);
_gfx.lineTo(EndX, EndY);
_pixels.draw(_gfxSprite);
calcFrame();
}
public function randomFrame():void{
_curAnim = null;
_caf = int((FlxU.random() * (_pixels.width / frameWidth)));
calcFrame();
}
public function play(AnimName:String, Force:Boolean=false):void{
if (((((((!(Force)) && (!((_curAnim == null))))) && ((AnimName == _curAnim.name)))) && (((_curAnim.looped) || (!(finished)))))){
return;
};
_curFrame = 0;
_caf = 0;
_frameTimer = 0;
var i:uint;
var al:uint = _animations.length;
while (i < al) {
if (_animations[i].name == AnimName){
_curAnim = _animations[i];
if (_curAnim.delay <= 0){
finished = true;
} else {
finished = false;
};
_caf = _curAnim.frames[_curFrame];
calcFrame();
return;
};
i++;
};
}
}
}//package org.flixel
Section 254
//FlxState (org.flixel.FlxState)
package org.flixel {
import flash.display.*;
public class FlxState extends Sprite {
public var defaultGroup:FlxGroup;
public static var screen:FlxSprite;
public static var bgColor:uint;
public function FlxState(){
super();
defaultGroup = new FlxGroup();
if (screen == null){
screen = new FlxSprite();
screen.createGraphic(FlxG.width, FlxG.height, 0, true);
screen.origin.x = (screen.origin.y = 0);
screen.antialiasing = true;
screen.exists = false;
screen.solid = false;
screen.fixed = true;
};
}
public function add(Core:FlxObject):FlxObject{
return (defaultGroup.add(Core));
}
public function preProcess():void{
screen.fill(bgColor);
}
public function collide():void{
FlxU.collide(defaultGroup, defaultGroup);
}
public function render():void{
defaultGroup.render();
}
public function update():void{
defaultGroup.update();
}
public function destroy():void{
defaultGroup.destroy();
}
public function create():void{
}
public function postProcess():void{
}
}
}//package org.flixel
Section 255
//FlxText (org.flixel.FlxText)
package org.flixel {
import flash.display.*;
import flash.text.*;
public class FlxText extends FlxSprite {
protected var _tf:TextField;
protected var _regen:Boolean;
protected var _shadow:uint;
public function FlxText(X:Number, Y:Number, Width:uint, Text:String=null, EmbeddedFont:Boolean=true){
super(X, Y);
createGraphic(Width, 1, 0);
if (Text == null){
Text = "";
};
_tf = new TextField();
_tf.width = Width;
_tf.embedFonts = EmbeddedFont;
_tf.selectable = false;
_tf.sharpness = 100;
_tf.multiline = true;
_tf.wordWrap = true;
_tf.text = Text;
var tf:TextFormat = new TextFormat("system", 8, 0xFFFFFF);
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
if (Text.length <= 0){
_tf.height = 1;
} else {
_tf.height = 10;
};
_regen = true;
_shadow = 0;
solid = false;
calcFrame();
}
public function get shadow():uint{
return (_shadow);
}
public function get size():Number{
return ((_tf.defaultTextFormat.size as Number));
}
override public function get color():uint{
return ((_tf.defaultTextFormat.color as uint));
}
override public function set color(Color:uint):void{
var tf:TextFormat = dtfCopy();
tf.color = Color;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
_regen = true;
calcFrame();
}
public function set shadow(Color:uint):void{
_shadow = Color;
calcFrame();
}
public function set size(Size:Number):void{
var tf:TextFormat = dtfCopy();
tf.size = Size;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
_regen = true;
calcFrame();
}
public function get alignment():String{
return (_tf.defaultTextFormat.align);
}
protected function dtfCopy():TextFormat{
var dtf:TextFormat = _tf.defaultTextFormat;
return (new TextFormat(dtf.font, dtf.size, dtf.color, dtf.bold, dtf.italic, dtf.underline, dtf.url, dtf.target, dtf.align));
}
public function get text():String{
return (_tf.text);
}
public function get font():String{
return (_tf.defaultTextFormat.font);
}
public function set alignment(Alignment:String):void{
var tf:TextFormat = dtfCopy();
tf.align = Alignment;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
calcFrame();
}
public function set font(Font:String):void{
var tf:TextFormat = dtfCopy();
tf.font = Font;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
_regen = true;
calcFrame();
}
override protected function calcFrame():void{
var i:uint;
var nl:uint;
var tf:TextFormat;
var tfa:TextFormat;
if (_regen){
i = 0;
nl = _tf.numLines;
height = 0;
while (i < nl) {
var _temp1 = i;
i = (i + 1);
height = (height + _tf.getLineMetrics(_temp1).height);
};
height = (height + 4);
_pixels = new BitmapData(width, height, true, 0);
_bbb = new BitmapData(width, height, true, 0);
frameHeight = height;
_tf.height = (height * 1.2);
_flashRect.x = 0;
_flashRect.y = 0;
_flashRect.width = width;
_flashRect.height = height;
_regen = false;
} else {
_pixels.fillRect(_flashRect, 0);
};
if (((((!((_tf == null))) && (!((_tf.text == null))))) && ((_tf.text.length > 0)))){
tf = _tf.defaultTextFormat;
tfa = tf;
_mtx.identity();
if ((((tf.align == "center")) && ((_tf.numLines == 1)))){
tfa = new TextFormat(tf.font, tf.size, tf.color, null, null, null, null, null, "left");
_tf.setTextFormat(tfa);
_mtx.translate(Math.floor(((width - _tf.getLineMetrics(0).width) / 2)), 0);
};
if (_shadow > 0){
_tf.setTextFormat(new TextFormat(tfa.font, tfa.size, _shadow, null, null, null, null, null, tfa.align));
_mtx.translate(1, 1);
_pixels.draw(_tf, _mtx, _ct);
_mtx.translate(-1, -1);
_tf.setTextFormat(new TextFormat(tfa.font, tfa.size, tfa.color, null, null, null, null, null, tfa.align));
};
_pixels.draw(_tf, _mtx, _ct);
_tf.setTextFormat(new TextFormat(tf.font, tf.size, tf.color, null, null, null, null, null, tf.align));
};
if ((((((_framePixels == null)) || (!((_framePixels.width == _pixels.width))))) || (!((_framePixels.height == _pixels.height))))){
_framePixels = new BitmapData(_pixels.width, _pixels.height, true, 0);
};
_framePixels.copyPixels(_pixels, _flashRect, _flashPointZero);
if (FlxG.showBounds){
drawBounds();
};
if (solid){
refreshHulls();
};
}
public function setFormat(Font:String=null, Size:Number=8, Color:uint=0xFFFFFF, Alignment:String=null, ShadowColor:uint=0):FlxText{
if (Font == null){
Font = "";
};
var tf:TextFormat = dtfCopy();
tf.font = Font;
tf.size = Size;
tf.color = Color;
tf.align = Alignment;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
_shadow = ShadowColor;
_regen = true;
calcFrame();
return (this);
}
public function set text(Text:String):void{
var ot:String = _tf.text;
_tf.text = Text;
if (_tf.text != ot){
_regen = true;
calcFrame();
};
}
}
}//package org.flixel
Section 256
//FlxTilemap (org.flixel.FlxTilemap)
package org.flixel {
import flash.display.*;
import flash.geom.*;
public class FlxTilemap extends FlxObject {
protected var _bbKey:String;
public var startingIndex:uint;
protected var _screenRows:uint;
protected var _data:Array;
protected var _block:FlxObject;
protected var _rects:Array;
protected var _tileHeight:uint;
public var totalTiles:uint;
protected var _screenCols:uint;
public var auto:uint;
public var collideIndex:uint;
public var heightInTiles:uint;
public var widthInTiles:uint;
protected var _tileWidth:uint;
protected var _pixels:BitmapData;
protected var _callbacks:Array;
public var refresh:Boolean;
protected var _flashRect2:Rectangle;
protected var _buffer:BitmapData;
protected var _bufferLoc:FlxPoint;
protected var _bbPixels:BitmapData;
public var drawIndex:uint;
protected var _flashRect:Rectangle;
protected var _boundsVisible:Boolean;
public static const RAND:uint = 3;
public static const ALT:uint = 2;
public static const AUTO:uint = 1;
public static const BW:uint = 3;
public static const OFF:uint = 0;
public static var ImgAutoAlt:Class = FlxTilemap_ImgAutoAlt;
public static var ImgAuto:Class = FlxTilemap_ImgAuto;
public function FlxTilemap(){
super();
auto = OFF;
collideIndex = 1;
startingIndex = 0;
drawIndex = 1;
widthInTiles = 0;
heightInTiles = 0;
totalTiles = 0;
_buffer = null;
_bufferLoc = new FlxPoint();
_flashRect2 = new Rectangle();
_flashRect = _flashRect2;
_data = null;
_tileWidth = 0;
_tileHeight = 0;
_rects = null;
_pixels = null;
_block = new FlxObject();
_block.width = (_block.height = 0);
_block.fixed = true;
_callbacks = new Array();
fixed = true;
}
override public function overlaps(Core:FlxObject):Boolean{
var d:uint;
var dd:uint;
var c:uint;
var blocks:Array = new Array();
var ix:uint = Math.floor(((Core.x - x) / _tileWidth));
var iy:uint = Math.floor(((Core.y - y) / _tileHeight));
var iw:uint = (Math.ceil((Core.width / _tileWidth)) + 1);
var ih:uint = (Math.ceil((Core.height / _tileHeight)) + 1);
var r:uint;
while (r < ih) {
if (r >= heightInTiles){
break;
};
d = (((iy + r) * widthInTiles) + ix);
c = 0;
while (c < iw) {
if (c >= widthInTiles){
break;
};
dd = (_data[(d + c)] as uint);
if (dd >= collideIndex){
blocks.push({x:(x + ((ix + c) * _tileWidth)), y:(y + ((iy + r) * _tileHeight)), data:dd});
};
c++;
};
r++;
};
var bl:uint = blocks.length;
var hx:Boolean;
var i:uint;
while (i < bl) {
_block.x = blocks[i].x;
var _temp1 = i;
i = (i + 1);
_block.y = blocks[_temp1].y;
if (_block.overlaps(Core)){
return (true);
};
};
return (false);
}
public function loadMap(MapData:String, TileGraphic:Class, TileWidth:uint=0, TileHeight:uint=0):FlxTilemap{
var cols:Array;
var c:uint;
var i:uint;
refresh = true;
var rows:Array = MapData.split("\n");
heightInTiles = rows.length;
_data = new Array();
var r:uint;
while (r < heightInTiles) {
var _temp1 = r;
r = (r + 1);
cols = rows[_temp1].split(",");
if (cols.length <= 1){
heightInTiles = (heightInTiles - 1);
} else {
if (widthInTiles == 0){
widthInTiles = cols.length;
};
c = 0;
while (c < widthInTiles) {
var _temp2 = c;
c = (c + 1);
_data.push(uint(cols[_temp2]));
};
};
};
totalTiles = (widthInTiles * heightInTiles);
if (auto > OFF){
collideIndex = (startingIndex = (drawIndex = 1));
i = 0;
while (i < totalTiles) {
var _temp3 = i;
i = (i + 1);
autoTile(_temp3);
};
};
_pixels = FlxG.addBitmap(TileGraphic);
_tileWidth = TileWidth;
if (_tileWidth == 0){
_tileWidth = _pixels.height;
};
_tileHeight = TileHeight;
if (_tileHeight == 0){
_tileHeight = _tileWidth;
};
_block.width = _tileWidth;
_block.height = _tileHeight;
width = (widthInTiles * _tileWidth);
height = (heightInTiles * _tileHeight);
_rects = new Array(totalTiles);
i = 0;
while (i < totalTiles) {
var _temp4 = i;
i = (i + 1);
updateTile(_temp4);
};
var bw:uint = ((FlxU.ceil((FlxG.width / _tileWidth)) + 1) * _tileWidth);
var bh:uint = ((FlxU.ceil((FlxG.height / _tileHeight)) + 1) * _tileHeight);
_buffer = new BitmapData(bw, bh, true, 0);
_screenRows = (Math.ceil((FlxG.height / _tileHeight)) + 1);
if (_screenRows > heightInTiles){
_screenRows = heightInTiles;
};
_screenCols = (Math.ceil((FlxG.width / _tileWidth)) + 1);
if (_screenCols > widthInTiles){
_screenCols = widthInTiles;
};
_bbKey = String(TileGraphic);
generateBoundingTiles();
refreshHulls();
_flashRect.x = 0;
_flashRect.y = 0;
_flashRect.width = _buffer.width;
_flashRect.height = _buffer.height;
return (this);
}
protected function updateTile(Index:uint):void{
if (_data[Index] < drawIndex){
_rects[Index] = null;
return;
};
var rx:uint = ((_data[Index] - startingIndex) * _tileWidth);
var ry:uint;
if (rx >= _pixels.width){
ry = (uint((rx / _pixels.width)) * _tileHeight);
rx = (rx % _pixels.width);
};
_rects[Index] = new Rectangle(rx, ry, _tileWidth, _tileHeight);
}
override public function preCollide(Object:FlxObject):void{
var r:uint;
var c:uint;
var rs:uint;
colHullX.x = 0;
colHullX.y = 0;
colHullY.x = 0;
colHullY.y = 0;
var col:uint;
var ix:int = FlxU.floor(((Object.x - x) / _tileWidth));
var iy:int = FlxU.floor(((Object.y - y) / _tileHeight));
var iw:uint = ((ix + FlxU.ceil((Object.width / _tileWidth))) + 1);
var ih:uint = ((iy + FlxU.ceil((Object.height / _tileHeight))) + 1);
if (ix < 0){
ix = 0;
};
if (iy < 0){
iy = 0;
};
if (iw > widthInTiles){
iw = widthInTiles;
};
if (ih > heightInTiles){
ih = heightInTiles;
};
rs = (iy * widthInTiles);
r = iy;
while (r < ih) {
c = ix;
while (c < iw) {
if ((_data[(rs + c)] as uint) >= collideIndex){
var _temp1 = col;
col = (col + 1);
var _local10 = _temp1;
colOffsets[_local10] = new FlxPoint((x + (c * _tileWidth)), (y + (r * _tileHeight)));
};
c++;
};
rs = (rs + widthInTiles);
r++;
};
if (colOffsets.length != col){
colOffsets.length = col;
};
}
override public function render():void{
if (FlxG.showBounds != _boundsVisible){
refresh = true;
};
if (refresh){
renderTilemap();
refresh = false;
};
getScreenXY(_point);
_flashPoint.x = (_point.x + _bufferLoc.x);
_flashPoint.y = (_point.y + _bufferLoc.y);
FlxG.buffer.copyPixels(_buffer, _flashRect, _flashPoint, null, null, true);
}
public function getTile(X:uint, Y:uint):uint{
return (getTileByIndex(((Y * widthInTiles) + X)));
}
public function ray(StartX:Number, StartY:Number, EndX:Number, EndY:Number, Result:FlxPoint, Resolution:Number=1):Boolean{
var tx:uint;
var ty:uint;
var rx:Number;
var ry:Number;
var q:Number;
var lx:Number;
var ly:Number;
var step:Number = _tileWidth;
if (_tileHeight < _tileWidth){
step = _tileHeight;
};
step = (step / Resolution);
var dx:Number = (EndX - StartX);
var dy:Number = (EndY - StartY);
var distance:Number = Math.sqrt(((dx * dx) + (dy * dy)));
var steps:uint = Math.ceil((distance / step));
var stepX:Number = (dx / steps);
var stepY:Number = (dy / steps);
var curX:Number = (StartX - stepX);
var curY:Number = (StartY - stepY);
var i:uint;
while (i < steps) {
curX = (curX + stepX);
curY = (curY + stepY);
if ((((((((curX < 0)) || ((curX > width)))) || ((curY < 0)))) || ((curY > height)))){
i++;
} else {
tx = (curX / _tileWidth);
ty = (curY / _tileHeight);
if ((_data[((ty * widthInTiles) + tx)] as uint) >= collideIndex){
tx = (tx * _tileWidth);
ty = (ty * _tileHeight);
rx = 0;
ry = 0;
lx = (curX - stepX);
ly = (curY - stepY);
q = tx;
if (dx < 0){
q = (q + _tileWidth);
};
rx = q;
ry = (ly + (stepY * ((q - lx) / stepX)));
if ((((ry > ty)) && ((ry < (ty + _tileHeight))))){
if (Result == null){
Result = new FlxPoint();
};
Result.x = rx;
Result.y = ry;
return (true);
};
q = ty;
if (dy < 0){
q = (q + _tileHeight);
};
rx = (lx + (stepX * ((q - ly) / stepY)));
ry = q;
if ((((rx > tx)) && ((rx < (tx + _tileWidth))))){
if (Result == null){
Result = new FlxPoint();
};
Result.x = rx;
Result.y = ry;
return (true);
};
return (false);
};
i++;
};
};
return (false);
}
override public function refreshHulls():void{
colHullX.x = 0;
colHullX.y = 0;
colHullX.width = _tileWidth;
colHullX.height = _tileHeight;
colHullY.x = 0;
colHullY.y = 0;
colHullY.width = _tileWidth;
colHullY.height = _tileHeight;
}
public function setTile(X:uint, Y:uint, Tile:uint, UpdateGraphics:Boolean=true):Boolean{
if ((((X >= widthInTiles)) || ((Y >= heightInTiles)))){
return (false);
};
return (setTileByIndex(((Y * widthInTiles) + X), Tile, UpdateGraphics));
}
public function follow(Border:int=0):void{
FlxG.followBounds((x + (Border * _tileWidth)), (y + (Border * _tileHeight)), (width - (Border * _tileWidth)), (height - (Border * _tileHeight)));
}
public function setCallback(Tile:uint, Callback:Function, Range:uint=1):void{
FlxG.log("WARNING: FlxTilemap.setCallback()\nhas been temporarily deprecated.");
}
override public function update():void{
super.update();
getScreenXY(_point);
_point.x = (_point.x + _bufferLoc.x);
_point.y = (_point.y + _bufferLoc.y);
if ((((((((_point.x > 0)) || ((_point.y > 0)))) || (((_point.x + _buffer.width) < FlxG.width)))) || (((_point.y + _buffer.height) < FlxG.height)))){
refresh = true;
};
}
protected function generateBoundingTiles():void{
var ov:Boolean;
var stamp1:BitmapData;
var stamp2:BitmapData;
var r:uint;
var c:uint;
var i:uint;
refresh = true;
if ((((_bbKey == null)) || ((_bbKey.length <= 0)))){
return;
};
var bbc:uint = getBoundingColor();
var key:String = ((_bbKey + ":BBTILES") + bbc);
var skipGen:Boolean = FlxG.checkBitmapCache(key);
_bbPixels = FlxG.createBitmap(_pixels.width, _pixels.height, 0, true, key);
if (!skipGen){
_flashRect.width = _pixels.width;
_flashRect.height = _pixels.height;
_flashPoint.x = 0;
_flashPoint.y = 0;
_bbPixels.copyPixels(_pixels, _flashRect, _flashPoint);
_flashRect.width = _tileWidth;
_flashRect.height = _tileHeight;
ov = _solid;
_solid = false;
bbc = getBoundingColor();
key = (((("BBTILESTAMP" + _tileWidth) + "X") + _tileHeight) + bbc);
skipGen = FlxG.checkBitmapCache(key);
stamp1 = FlxG.createBitmap(_tileWidth, _tileHeight, 0, true, key);
if (!skipGen){
stamp1.fillRect(_flashRect, bbc);
_flashRect.x = (_flashRect.y = 1);
_flashRect.width = (_flashRect.width - 2);
_flashRect.height = (_flashRect.height - 2);
stamp1.fillRect(_flashRect, 0);
_flashRect.x = (_flashRect.y = 0);
_flashRect.width = _tileWidth;
_flashRect.height = _tileHeight;
};
_solid = ov;
bbc = getBoundingColor();
key = (((("BBTILESTAMP" + _tileWidth) + "X") + _tileHeight) + bbc);
skipGen = FlxG.checkBitmapCache(key);
stamp2 = FlxG.createBitmap(_tileWidth, _tileHeight, 0, true, key);
if (!skipGen){
stamp2.fillRect(_flashRect, bbc);
_flashRect.x = (_flashRect.y = 1);
_flashRect.width = (_flashRect.width - 2);
_flashRect.height = (_flashRect.height - 2);
stamp2.fillRect(_flashRect, 0);
_flashRect.x = (_flashRect.y = 0);
_flashRect.width = _tileWidth;
_flashRect.height = _tileHeight;
};
r = 0;
i = 0;
while (r < _bbPixels.height) {
c = 0;
while (c < _bbPixels.width) {
_flashPoint.x = c;
_flashPoint.y = r;
var _temp1 = i;
i = (i + 1);
if (_temp1 < collideIndex){
_bbPixels.copyPixels(stamp1, _flashRect, _flashPoint, null, null, true);
} else {
_bbPixels.copyPixels(stamp2, _flashRect, _flashPoint, null, null, true);
};
c = (c + _tileWidth);
};
r = (r + _tileHeight);
};
_flashRect.x = 0;
_flashRect.y = 0;
_flashRect.width = _buffer.width;
_flashRect.height = _buffer.height;
};
}
override public function set solid(Solid:Boolean):void{
var os:Boolean = _solid;
_solid = Solid;
if (os != _solid){
generateBoundingTiles();
};
}
override public function overlapsPoint(X:Number, Y:Number, PerPixel:Boolean=false):Boolean{
return ((getTile(uint(((X - x) / _tileWidth)), uint(((Y - y) / _tileHeight))) >= this.collideIndex));
}
override public function set fixed(Fixed:Boolean):void{
var of:Boolean = _fixed;
_fixed = Fixed;
if (of != _fixed){
generateBoundingTiles();
};
}
public function getTileByIndex(Index:uint):uint{
return ((_data[Index] as uint));
}
protected function renderTilemap():void{
var tileBitmap:BitmapData;
var c:uint;
var cri:uint;
_buffer.fillRect(_flashRect, 0);
if (FlxG.showBounds){
tileBitmap = _bbPixels;
_boundsVisible = true;
} else {
tileBitmap = _pixels;
_boundsVisible = false;
};
getScreenXY(_point);
_flashPoint.x = _point.x;
_flashPoint.y = _point.y;
var tx:int = Math.floor((-(_flashPoint.x) / _tileWidth));
var ty:int = Math.floor((-(_flashPoint.y) / _tileHeight));
if (tx < 0){
tx = 0;
};
if (tx > (widthInTiles - _screenCols)){
tx = (widthInTiles - _screenCols);
};
if (ty < 0){
ty = 0;
};
if (ty > (heightInTiles - _screenRows)){
ty = (heightInTiles - _screenRows);
};
var ri:int = ((ty * widthInTiles) + tx);
_flashPoint.y = 0;
var r:uint;
while (r < _screenRows) {
cri = ri;
c = 0;
_flashPoint.x = 0;
while (c < _screenCols) {
var _temp1 = cri;
cri = (cri + 1);
_flashRect = (_rects[_temp1] as Rectangle);
if (_flashRect != null){
_buffer.copyPixels(tileBitmap, _flashRect, _flashPoint, null, null, true);
};
_flashPoint.x = (_flashPoint.x + _tileWidth);
c++;
};
ri = (ri + widthInTiles);
_flashPoint.y = (_flashPoint.y + _tileHeight);
r++;
};
_flashRect = _flashRect2;
_bufferLoc.x = (tx * _tileWidth);
_bufferLoc.y = (ty * _tileHeight);
}
public function setTileByIndex(Index:uint, Tile:uint, UpdateGraphics:Boolean=true):Boolean{
var i:uint;
if (Index >= _data.length){
return (false);
};
var ok:Boolean;
_data[Index] = Tile;
if (!UpdateGraphics){
return (ok);
};
refresh = true;
if (auto == OFF){
updateTile(Index);
return (ok);
};
var r:int = (int((Index / widthInTiles)) - 1);
var rl:int = (r + 3);
var c:int = ((Index % widthInTiles) - 1);
var cl:int = (c + 3);
while (r < rl) {
c = (cl - 3);
while (c < cl) {
if ((((((((r >= 0)) && ((r < heightInTiles)))) && ((c >= 0)))) && ((c < widthInTiles)))){
i = ((r * widthInTiles) + c);
autoTile(i);
updateTile(i);
};
c++;
};
r++;
};
return (ok);
}
protected function autoTile(Index:uint):void{
var yVal:int;
var side:int;
if (_data[Index] == 0){
return;
};
_data[Index] = 0;
if (((((Index - widthInTiles) < 0)) || ((_data[(Index - widthInTiles)] > 0)))){
_data[Index] = (_data[Index] + 1);
};
if (((((Index % widthInTiles) >= (widthInTiles - 1))) || ((_data[(Index + 1)] > 0)))){
_data[Index] = (_data[Index] + 2);
};
if (((((Index + widthInTiles) >= totalTiles)) || ((_data[(Index + widthInTiles)] > 0)))){
_data[Index] = (_data[Index] + 4);
};
if (((((Index % widthInTiles) <= 0)) || ((_data[(Index - 1)] > 0)))){
_data[Index] = (_data[Index] + 8);
};
if ((((auto == ALT)) && ((_data[Index] == 15)))){
if (((((((Index % widthInTiles) > 0)) && (((Index + widthInTiles) < totalTiles)))) && ((_data[((Index + widthInTiles) - 1)] <= 0)))){
_data[Index] = 1;
};
if (((((((Index % widthInTiles) > 0)) && (((Index - widthInTiles) >= 0)))) && ((_data[((Index - widthInTiles) - 1)] <= 0)))){
_data[Index] = 2;
};
if (((((((Index % widthInTiles) < (widthInTiles - 1))) && (((Index - widthInTiles) >= 0)))) && ((_data[((Index - widthInTiles) + 1)] <= 0)))){
_data[Index] = 4;
};
if (((((((Index % widthInTiles) < (widthInTiles - 1))) && (((Index + widthInTiles) < totalTiles)))) && ((_data[((Index + widthInTiles) + 1)] <= 0)))){
_data[Index] = 8;
};
};
if (auto == RAND){
_data[Index] = (int(Math.pow((Math.random() * 15), 4)) % 15);
};
if (auto == BW){
yVal = (int((Index / widthInTiles)) * 32);
side = PlayState.getSide(yVal);
if (side < 0){
_data[Index] = 0;
} else {
_data[Index] = 1;
};
};
_data[Index] = (_data[Index] + 1);
}
public static function arrayToCSV(Data:Array, Width:int):String{
var c:uint;
var csv:String;
var r:uint;
var Height:int = (Data.length / Width);
while (r < Height) {
c = 0;
while (c < Width) {
if (c == 0){
if (r == 0){
csv = (csv + Data[0]);
} else {
csv = (csv + ("\n" + Data[(r * Width)]));
};
} else {
csv = (csv + (", " + Data[((r * Width) + c)]));
};
c++;
};
r++;
};
return (csv);
}
public static function imageToCSV(ImageFile:Class, Invert:Boolean=false, Scale:uint=1):String{
return (bitmapToCSV(new (ImageFile).bitmapData, Invert, Scale));
}
public static function bitmapToCSV(bitmapData:BitmapData, Invert:Boolean=false, Scale:uint=1):String{
var c:uint;
var p:uint;
var csv:String;
var bd:BitmapData;
var mtx:Matrix;
if (Scale > 1){
bd = bitmapData;
bitmapData = new BitmapData((bitmapData.width * Scale), (bitmapData.height * Scale));
mtx = new Matrix();
mtx.scale(Scale, Scale);
bitmapData.draw(bd, mtx);
};
var r:uint;
var w:uint = bitmapData.width;
var h:uint = bitmapData.height;
while (r < h) {
c = 0;
while (c < w) {
p = bitmapData.getPixel(c, r);
if (((((Invert) && ((p > 0)))) || (((!(Invert)) && ((p == 0)))))){
p = 1;
} else {
p = 0;
};
if (c == 0){
if (r == 0){
csv = (csv + p);
} else {
csv = (csv + ("\n" + p));
};
} else {
csv = (csv + (", " + p));
};
c++;
};
r++;
};
return (csv);
}
}
}//package org.flixel
Section 257
//FlxTilemap_ImgAuto (org.flixel.FlxTilemap_ImgAuto)
package org.flixel {
import mx.core.*;
public class FlxTilemap_ImgAuto extends BitmapAsset {
}
}//package org.flixel
Section 258
//FlxTilemap_ImgAutoAlt (org.flixel.FlxTilemap_ImgAutoAlt)
package org.flixel {
import mx.core.*;
public class FlxTilemap_ImgAutoAlt extends BitmapAsset {
}
}//package org.flixel
Section 259
//FlxU (org.flixel.FlxU)
package org.flixel {
import flash.utils.*;
import flash.net.*;
public class FlxU {
public static var quadTree:FlxQuadTree;
static var roundingError:Number = 1E-7;
public function FlxU(){
super();
}
public static function getHSB(Color:uint, Results:Array=null):Array{
if (Results == null){
Results = new Array();
};
var red:Number = (Number(((Color >> 16) & 0xFF)) / 0xFF);
var green:Number = (Number(((Color >> 8) & 0xFF)) / 0xFF);
var blue:Number = (Number((Color & 0xFF)) / 0xFF);
var m:Number = ((red)>green) ? red : green;
var dmax:Number = ((m)>blue) ? m : blue;
m = ((red)>green) ? green : red;
var dmin:Number = ((m)>blue) ? blue : m;
var range:Number = (dmax - dmin);
Results[2] = dmax;
Results[1] = 0;
Results[0] = 0;
if (dmax != 0){
Results[1] = (range / dmax);
};
if (Results[1] != 0){
if (red == dmax){
Results[0] = ((green - blue) / range);
} else {
if (green == dmax){
Results[0] = (2 + ((blue - red) / range));
} else {
if (blue == dmax){
Results[0] = (4 + ((red - green) / range));
};
};
};
Results[0] = (Results[0] * 60);
if (Results[0] < 0){
Results[0] = (Results[0] + 360);
};
};
Results[3] = (Number(((Color >> 24) & 0xFF)) / 0xFF);
return (Results);
}
public static function getClass(Name:String):Class{
return ((getDefinitionByName(Name) as Class));
}
public static function random(Seed:Number=NaN):Number{
if (isNaN(Seed)){
return (Math.random());
};
if (Seed == 0){
Seed = Number.MIN_VALUE;
};
if (Seed >= 1){
if ((Seed % 1) == 0){
Seed = (Seed / Math.PI);
};
Seed = (Seed % 1);
} else {
if (Seed < 0){
Seed = ((Seed % 1) + 1);
};
};
return ((((69621 * int((Seed * 2147483647))) % 2147483647) / 2147483647));
}
public static function overlap(Object1:FlxObject, Object2:FlxObject, Callback:Function=null):Boolean{
if ((((((((Object1 == null)) || (!(Object1.exists)))) || ((Object2 == null)))) || (!(Object2.exists)))){
return (false);
};
quadTree = new FlxQuadTree(FlxQuadTree.bounds.x, FlxQuadTree.bounds.y, FlxQuadTree.bounds.width, FlxQuadTree.bounds.height);
quadTree.add(Object1, FlxQuadTree.A_LIST);
if (Object1 === Object2){
return (quadTree.overlap(false, Callback));
};
quadTree.add(Object2, FlxQuadTree.B_LIST);
return (quadTree.overlap(true, Callback));
}
public static function ceil(N:Number):Number{
var n:Number = int(N);
return (((N)>0) ? ((n)!=N) ? (n + 1) : n : n);
}
public static function endProfile(Start:uint, Name:String="Profiler", Log:Boolean=true):uint{
var t:uint = getTimer();
if (Log){
FlxG.log((((Name + ": ") + ((t - Start) / 1000)) + "s"));
};
return (t);
}
public static function getColorHSB(Hue:Number, Saturation:Number, Brightness:Number, Alpha:Number=1):uint{
var red:Number;
var green:Number;
var blue:Number;
var slice:int;
var hf:Number;
var aa:Number;
var bb:Number;
var cc:Number;
if (Saturation == 0){
red = Brightness;
green = Brightness;
blue = Brightness;
} else {
if (Hue == 360){
Hue = 0;
};
slice = (Hue / 60);
hf = ((Hue / 60) - slice);
aa = (Brightness * (1 - Saturation));
bb = (Brightness * (1 - (Saturation * hf)));
cc = (Brightness * (1 - (Saturation * (1 - hf))));
switch (slice){
case 0:
red = Brightness;
green = cc;
blue = aa;
break;
case 1:
red = bb;
green = Brightness;
blue = aa;
break;
case 2:
red = aa;
green = Brightness;
blue = cc;
break;
case 3:
red = aa;
green = bb;
blue = Brightness;
break;
case 4:
red = cc;
green = aa;
blue = Brightness;
break;
case 5:
red = Brightness;
green = aa;
blue = bb;
break;
default:
red = 0;
green = 0;
blue = 0;
break;
};
};
return ((((((((Alpha)>1) ? Alpha : (Alpha * 0xFF) & 0xFF) << 24) | (uint((red * 0xFF)) << 16)) | (uint((green * 0xFF)) << 8)) | uint((blue * 0xFF))));
}
public static function min(N1:Number, N2:Number):Number{
return (((N1)<=N2) ? N1 : N2);
}
public static function floor(N:Number):Number{
var n:Number = int(N);
return (((N)>0) ? n : ((n)!=N) ? (n - 1) : n);
}
public static function solveYCollision(Object1:FlxObject, Object2:FlxObject):Boolean{
var f1:Boolean;
var f2:Boolean;
var overlap:Number;
var p1hn2:Boolean;
var i1:uint;
var i2:uint;
var ox1:Number;
var oy1:Number;
var ox2:Number;
var oy2:Number;
var r1:Number;
var r2:Number;
var sv1:Number;
var sv2:Number;
var o1:Number = Object1.colVector.y;
var o2:Number = Object2.colVector.y;
if (o1 == o2){
return (false);
};
Object1.preCollide(Object2);
Object2.preCollide(Object1);
var hit:Boolean;
var obj1Stopped = (o1 == 0);
var obj1MoveNeg = (o1 < 0);
var obj1MovePos = (o1 > 0);
var obj2Stopped = (o2 == 0);
var obj2MoveNeg = (o2 < 0);
var obj2MovePos = (o2 > 0);
var obj1Hull:FlxRect = Object1.colHullY;
var obj2Hull:FlxRect = Object2.colHullY;
var co1:Array = Object1.colOffsets;
var co2:Array = Object2.colOffsets;
var l1:uint = co1.length;
var l2:uint = co2.length;
p1hn2 = ((((((((((obj1Stopped) && (obj2MoveNeg))) || (((obj1MovePos) && (obj2Stopped))))) || (((obj1MovePos) && (obj2MoveNeg))))) || (((((obj1MoveNeg) && (obj2MoveNeg))) && ((((o1)>0) ? o1 : -(o1) < ((o2)>0) ? o2 : -(o2))))))) || (((((obj1MovePos) && (obj2MovePos))) && ((((o1)>0) ? o1 : -(o1) > ((o2)>0) ? o2 : -(o2))))));
if ((p1hn2) ? ((!(Object1.collideBottom)) || (!(Object2.collideTop))) : ((!(Object1.collideTop)) || (!(Object2.collideBottom)))){
return (false);
};
i1 = 0;
while (i1 < l1) {
ox1 = co1[i1].x;
oy1 = co1[i1].y;
obj1Hull.x = (obj1Hull.x + ox1);
obj1Hull.y = (obj1Hull.y + oy1);
i2 = 0;
while (i2 < l2) {
ox2 = co2[i2].x;
oy2 = co2[i2].y;
obj2Hull.x = (obj2Hull.x + ox2);
obj2Hull.y = (obj2Hull.y + oy2);
if (((((((((obj1Hull.x + obj1Hull.width) < (obj2Hull.x + roundingError))) || (((obj1Hull.x + roundingError) > (obj2Hull.x + obj2Hull.width))))) || (((obj1Hull.y + obj1Hull.height) < (obj2Hull.y + roundingError))))) || (((obj1Hull.y + roundingError) > (obj2Hull.y + obj2Hull.height))))){
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
i2++;
} else {
if (p1hn2){
if (obj1MoveNeg){
r1 = (obj1Hull.y + Object1.colHullX.height);
} else {
r1 = (obj1Hull.y + obj1Hull.height);
};
if (obj2MoveNeg){
r2 = obj2Hull.y;
} else {
r2 = ((obj2Hull.y + obj2Hull.height) - Object2.colHullX.height);
};
} else {
if (obj2MoveNeg){
r1 = (-(obj2Hull.y) - Object2.colHullX.height);
} else {
r1 = (-(obj2Hull.y) - obj2Hull.height);
};
if (obj1MoveNeg){
r2 = -(obj1Hull.y);
} else {
r2 = ((-(obj1Hull.y) - obj1Hull.height) + Object1.colHullX.height);
};
};
overlap = (r1 - r2);
f1 = Object1.fixed;
f2 = Object2.fixed;
if (((f1) && (f2))){
f1 = ((f1) && ((((Object1.colVector.x == 0)) && ((o1 == 0)))));
f2 = ((f2) && ((((Object2.colVector.x == 0)) && ((o2 == 0)))));
};
if ((((((overlap == 0)) || (((!(f1)) && ((((overlap)>0) ? overlap : -(overlap) > (obj1Hull.height * 0.8))))))) || (((!(f2)) && ((((overlap)>0) ? overlap : -(overlap) > (obj2Hull.height * 0.8))))))){
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
i2++;
} else {
hit = true;
sv1 = Object2.velocity.y;
sv2 = Object1.velocity.y;
if (((!(f1)) && (f2))){
if (Object1._group){
Object1.reset(Object1.x, (Object1.y - overlap));
} else {
Object1.y = (Object1.y - overlap);
};
} else {
if (((f1) && (!(f2)))){
if (Object2._group){
Object2.reset(Object2.x, (Object2.y + overlap));
} else {
Object2.y = (Object2.y + overlap);
};
} else {
if (((!(f1)) && (!(f2)))){
overlap = (overlap / 2);
if (Object1._group){
Object1.reset(Object1.x, (Object1.y - overlap));
} else {
Object1.y = (Object1.y - overlap);
};
if (Object2._group){
Object2.reset(Object2.x, (Object2.y + overlap));
} else {
Object2.y = (Object2.y + overlap);
};
sv1 = (sv1 * 0.5);
sv2 = (sv2 * 0.5);
};
};
};
if (p1hn2){
Object1.hitBottom(Object2, sv1);
Object2.hitTop(Object1, sv2);
} else {
Object1.hitTop(Object2, sv1);
Object2.hitBottom(Object1, sv2);
};
if (((!(f1)) && (!((overlap == 0))))){
if (p1hn2){
obj1Hull.y = (obj1Hull.y - overlap);
if (((f2) && (Object2.moves))){
sv1 = Object2.colVector.x;
Object1.x = (Object1.x + sv1);
obj1Hull.x = (obj1Hull.x + sv1);
Object1.colHullX.x = (Object1.colHullX.x + sv1);
};
} else {
obj1Hull.y = (obj1Hull.y - overlap);
obj1Hull.height = (obj1Hull.height + overlap);
};
};
if (((!(f2)) && (!((overlap == 0))))){
if (p1hn2){
obj2Hull.y = (obj2Hull.y + overlap);
obj2Hull.height = (obj2Hull.height - overlap);
} else {
obj2Hull.height = (obj2Hull.height + overlap);
if (((f1) && (Object1.moves))){
sv2 = Object1.colVector.x;
Object2.x = (Object2.x + sv2);
obj2Hull.x = (obj2Hull.x + sv2);
Object2.colHullX.x = (Object2.colHullX.x + sv2);
};
};
};
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
i2++;
};
};
};
obj1Hull.x = (obj1Hull.x - ox1);
obj1Hull.y = (obj1Hull.y - oy1);
i1++;
};
return (hit);
}
public static function getRGBA(Color:uint, Results:Array=null):Array{
if (Results == null){
Results = new Array();
};
Results[0] = ((Color >> 16) & 0xFF);
Results[1] = ((Color >> 8) & 0xFF);
Results[2] = (Color & 0xFF);
Results[3] = (Number(((Color >> 24) & 0xFF)) / 0xFF);
return (Results);
}
public static function openURL(URL:String):void{
navigateToURL(new URLRequest(URL), "_blank");
}
public static function max(N1:Number, N2:Number):Number{
return (((N1)>=N2) ? N1 : N2);
}
public static function setWorldBounds(X:Number=0, Y:Number=0, Width:Number=0, Height:Number=0, Divisions:uint=3):void{
trace(X, Y, Width, Height);
if (FlxQuadTree.bounds == null){
FlxQuadTree.bounds = new FlxRect();
};
FlxQuadTree.bounds.x = X;
FlxQuadTree.bounds.y = Y;
if (Width > 0){
FlxQuadTree.bounds.width = Width;
};
if (Height > 0){
FlxQuadTree.bounds.height = Height;
};
if (Divisions > 0){
FlxQuadTree.divisions = Divisions;
};
}
public static function startProfile():uint{
return (getTimer());
}
public static function getAngle(X:Number, Y:Number):Number{
var c1:Number = (3.14159265 / 4);
var c2:Number = (3 * c1);
var ay:Number = ((Y)<0) ? -(Y) : Y;
var angle:Number = 0;
if (X >= 0){
angle = (c1 - (c1 * ((X - ay) / (X + ay))));
} else {
angle = (c2 - (c1 * ((X + ay) / (ay - X))));
};
return ((((Y)<0) ? -(angle) : angle * 57.2957796));
}
public static function getColor(Red:uint, Green:uint, Blue:uint, Alpha:Number=1):uint{
return ((((((((Alpha)>1) ? Alpha : (Alpha * 0xFF) & 0xFF) << 24) | ((Red & 0xFF) << 16)) | ((Green & 0xFF) << 8)) | (Blue & 0xFF)));
}
public static function abs(N:Number):Number{
return (((N)>0) ? N : -(N));
}
public static function getClassName(Obj:Object, Simple:Boolean=false):String{
var s:String = getQualifiedClassName(Obj);
s = s.replace("::", ".");
if (Simple){
s = s.substr((s.lastIndexOf(".") + 1));
};
return (s);
}
public static function rotatePoint(X:Number, Y:Number, PivotX:Number, PivotY:Number, Angle:Number, P:FlxPoint=null):FlxPoint{
var sin:Number = 0;
var cos:Number = 0;
var radians:Number = (Angle * -0.017453293);
while (radians < -3.14159265) {
radians = (radians + 6.28318531);
};
while (radians > 3.14159265) {
radians = (radians - 6.28318531);
};
if (radians < 0){
sin = ((1.27323954 * radians) + ((0.405284735 * radians) * radians));
if (sin < 0){
sin = ((0.225 * ((sin * -(sin)) - sin)) + sin);
} else {
sin = ((0.225 * ((sin * sin) - sin)) + sin);
};
} else {
sin = ((1.27323954 * radians) - ((0.405284735 * radians) * radians));
if (sin < 0){
sin = ((0.225 * ((sin * -(sin)) - sin)) + sin);
} else {
sin = ((0.225 * ((sin * sin) - sin)) + sin);
};
};
radians = (radians + 1.57079632);
if (radians > 3.14159265){
radians = (radians - 6.28318531);
};
if (radians < 0){
cos = ((1.27323954 * radians) + ((0.405284735 * radians) * radians));
if (cos < 0){
cos = ((0.225 * ((cos * -(cos)) - cos)) + cos);
} else {
cos = ((0.225 * ((cos * cos) - cos)) + cos);
};
} else {
cos = ((1.27323954 * radians) - ((0.405284735 * radians) * radians));
if (cos < 0){
cos = ((0.225 * ((cos * -(cos)) - cos)) + cos);
} else {
cos = ((0.225 * ((cos * cos) - cos)) + cos);
};
};
var dx:Number = (X - PivotX);
var dy:Number = (PivotY - Y);
if (P == null){
P = new FlxPoint();
};
P.x = ((PivotX + (cos * dx)) - (sin * dy));
P.y = ((PivotY - (sin * dx)) - (cos * dy));
return (P);
}
public static function solveXCollision(Object1:FlxObject, Object2:FlxObject):Boolean{
var f1:Boolean;
var f2:Boolean;
var overlap:Number;
var p1hn2:Boolean;
var i1:uint;
var i2:uint;
var ox1:Number;
var oy1:Number;
var ox2:Number;
var oy2:Number;
var r1:Number;
var r2:Number;
var sv1:Number;
var sv2:Number;
var o1:Number = Object1.colVector.x;
var o2:Number = Object2.colVector.x;
if (o1 == o2){
return (false);
};
Object1.preCollide(Object2);
Object2.preCollide(Object1);
var hit:Boolean;
var obj1Stopped = (o1 == 0);
var obj1MoveNeg = (o1 < 0);
var obj1MovePos = (o1 > 0);
var obj2Stopped = (o2 == 0);
var obj2MoveNeg = (o2 < 0);
var obj2MovePos = (o2 > 0);
var obj1Hull:FlxRect = Object1.colHullX;
var obj2Hull:FlxRect = Object2.colHullX;
var co1:Array = Object1.colOffsets;
var co2:Array = Object2.colOffsets;
var l1:uint = co1.length;
var l2:uint = co2.length;
p1hn2 = ((((((((((obj1Stopped) && (obj2MoveNeg))) || (((obj1MovePos) && (obj2Stopped))))) || (((obj1MovePos) && (obj2MoveNeg))))) || (((((obj1MoveNeg) && (obj2MoveNeg))) && ((((o1)>0) ? o1 : -(o1) < ((o2)>0) ? o2 : -(o2))))))) || (((((obj1MovePos) && (obj2MovePos))) && ((((o1)>0) ? o1 : -(o1) > ((o2)>0) ? o2 : -(o2))))));
if ((p1hn2) ? ((!(Object1.collideRight)) || (!(Object2.collideLeft))) : ((!(Object1.collideLeft)) || (!(Object2.collideRight)))){
return (false);
};
i1 = 0;
while (i1 < l1) {
ox1 = co1[i1].x;
oy1 = co1[i1].y;
obj1Hull.x = (obj1Hull.x + ox1);
obj1Hull.y = (obj1Hull.y + oy1);
i2 = 0;
while (i2 < l2) {
ox2 = co2[i2].x;
oy2 = co2[i2].y;
obj2Hull.x = (obj2Hull.x + ox2);
obj2Hull.y = (obj2Hull.y + oy2);
if (((((((((obj1Hull.x + obj1Hull.width) < (obj2Hull.x + roundingError))) || (((obj1Hull.x + roundingError) > (obj2Hull.x + obj2Hull.width))))) || (((obj1Hull.y + obj1Hull.height) < (obj2Hull.y + roundingError))))) || (((obj1Hull.y + roundingError) > (obj2Hull.y + obj2Hull.height))))){
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
i2++;
} else {
if (p1hn2){
if (obj1MoveNeg){
r1 = (obj1Hull.x + Object1.colHullY.width);
} else {
r1 = (obj1Hull.x + obj1Hull.width);
};
if (obj2MoveNeg){
r2 = obj2Hull.x;
} else {
r2 = ((obj2Hull.x + obj2Hull.width) - Object2.colHullY.width);
};
} else {
if (obj2MoveNeg){
r1 = (-(obj2Hull.x) - Object2.colHullY.width);
} else {
r1 = (-(obj2Hull.x) - obj2Hull.width);
};
if (obj1MoveNeg){
r2 = -(obj1Hull.x);
} else {
r2 = ((-(obj1Hull.x) - obj1Hull.width) + Object1.colHullY.width);
};
};
overlap = (r1 - r2);
f1 = Object1.fixed;
f2 = Object2.fixed;
if (((f1) && (f2))){
f1 = ((f1) && ((((Object1.colVector.x == 0)) && ((o1 == 0)))));
f2 = ((f2) && ((((Object2.colVector.x == 0)) && ((o2 == 0)))));
};
if ((((((overlap == 0)) || (((!(f1)) && ((((overlap)>0) ? overlap : -(overlap) > (obj1Hull.width * 0.8))))))) || (((!(f2)) && ((((overlap)>0) ? overlap : -(overlap) > (obj2Hull.width * 0.8))))))){
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
i2++;
} else {
hit = true;
sv1 = Object2.velocity.x;
sv2 = Object1.velocity.x;
if (((!(f1)) && (f2))){
if (Object1._group){
Object1.reset((Object1.x - overlap), Object1.y);
} else {
Object1.x = (Object1.x - overlap);
};
} else {
if (((f1) && (!(f2)))){
if (Object2._group){
Object2.reset((Object2.x + overlap), Object2.y);
} else {
Object2.x = (Object2.x + overlap);
};
} else {
if (((!(f1)) && (!(f2)))){
overlap = (overlap / 2);
if (Object1._group){
Object1.reset((Object1.x - overlap), Object1.y);
} else {
Object1.x = (Object1.x - overlap);
};
if (Object2._group){
Object2.reset((Object2.x + overlap), Object2.y);
} else {
Object2.x = (Object2.x + overlap);
};
sv1 = (sv1 * 0.5);
sv2 = (sv2 * 0.5);
};
};
};
if (p1hn2){
Object1.hitRight(Object2, sv1);
Object2.hitLeft(Object1, sv2);
} else {
Object1.hitLeft(Object2, sv1);
Object2.hitRight(Object1, sv2);
};
if (((!(f1)) && (!((overlap == 0))))){
if (p1hn2){
obj1Hull.width = (obj1Hull.width - overlap);
} else {
obj1Hull.x = (obj1Hull.x - overlap);
obj1Hull.width = (obj1Hull.width + overlap);
};
Object1.colHullY.x = (Object1.colHullY.x - overlap);
};
if (((!(f2)) && (!((overlap == 0))))){
if (p1hn2){
obj2Hull.x = (obj2Hull.x + overlap);
obj2Hull.width = (obj2Hull.width - overlap);
} else {
obj2Hull.width = (obj2Hull.width + overlap);
};
Object2.colHullY.x = (Object2.colHullY.x + overlap);
};
obj2Hull.x = (obj2Hull.x - ox2);
obj2Hull.y = (obj2Hull.y - oy2);
i2++;
};
};
};
obj1Hull.x = (obj1Hull.x - ox1);
obj1Hull.y = (obj1Hull.y - oy1);
i1++;
};
return (hit);
}
public static function computeVelocity(Velocity:Number, Acceleration:Number=0, Drag:Number=0, Max:Number=10000):Number{
var d:Number;
if (Acceleration != 0){
Velocity = (Velocity + (Acceleration * FlxG.elapsed));
} else {
if (Drag != 0){
d = (Drag * FlxG.elapsed);
if ((Velocity - d) > 0){
Velocity = (Velocity - d);
} else {
if ((Velocity + d) < 0){
Velocity = (Velocity + d);
} else {
Velocity = 0;
};
};
};
};
if (((!((Velocity == 0))) && (!((Max == 10000))))){
if (Velocity > Max){
Velocity = Max;
} else {
if (Velocity < -(Max)){
Velocity = -(Max);
};
};
};
return (Velocity);
}
public static function collide(Object1:FlxObject, Object2:FlxObject):Boolean{
if ((((((((Object1 == null)) || (!(Object1.exists)))) || ((Object2 == null)))) || (!(Object2.exists)))){
return (false);
};
quadTree = new FlxQuadTree(FlxQuadTree.bounds.x, FlxQuadTree.bounds.y, FlxQuadTree.bounds.width, FlxQuadTree.bounds.height);
quadTree.add(Object1, FlxQuadTree.A_LIST);
var match = (Object1 === Object2);
if (!match){
quadTree.add(Object2, FlxQuadTree.B_LIST);
};
var cx:Boolean = quadTree.overlap(!(match), solveXCollision);
var cy:Boolean = quadTree.overlap(!(match), solveYCollision);
return (((cx) || (cy)));
}
}
}//package org.flixel
Section 260
//_activeButtonStyleStyle (_activeButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeButtonStyleStyle {
public static function init(_activeButtonStyleStyle:IFlexModuleFactory):void{
var fbs = _activeButtonStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 261
//_activeTabStyleStyle (_activeTabStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeTabStyleStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeTabStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeTabStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 262
//_alertButtonStyleStyle (_alertButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _alertButtonStyleStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".alertButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".alertButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 734012;
};
};
}
}
}//package
Section 263
//_ButtonStyle (_ButtonStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _ButtonStyle {
public static function init(verticalGap:IFlexModuleFactory):void{
var fbs = verticalGap;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Button");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("Button", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.paddingTop = 2;
this.cornerRadius = 4;
this.textAlign = "center";
this.verticalGap = 2;
this.horizontalGap = 2;
this.skin = ButtonSkin;
this.paddingLeft = 10;
this.paddingBottom = 2;
this.paddingRight = 10;
};
};
}
}
}//package
Section 264
//_comboDropdownStyle (_comboDropdownStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _comboDropdownStyle {
public static function init(leading:IFlexModuleFactory):void{
var fbs = leading;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".comboDropdown");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".comboDropdown", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.shadowDirection = "center";
this.fontWeight = "normal";
this.dropShadowEnabled = true;
this.leading = 0;
this.backgroundColor = 0xFFFFFF;
this.shadowDistance = 1;
this.cornerRadius = 0;
this.borderThickness = 0;
this.paddingLeft = 5;
this.paddingRight = 5;
};
};
}
}
}//package
Section 265
//_dataGridStylesStyle (_dataGridStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dataGridStylesStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dataGridStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dataGridStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 266
//_dateFieldPopupStyle (_dateFieldPopupStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dateFieldPopupStyle {
public static function init(_dateFieldPopupStyle.as$3:IFlexModuleFactory):void{
var fbs = _dateFieldPopupStyle.as$3;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dateFieldPopup");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dateFieldPopup", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.dropShadowEnabled = true;
this.backgroundColor = 0xFFFFFF;
this.borderThickness = 0;
};
};
}
}
}//package
Section 267
//_errorTipStyle (_errorTipStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _errorTipStyle {
public static function init(borderColor:IFlexModuleFactory):void{
var fbs = borderColor;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".errorTip");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".errorTip", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.borderStyle = "errorTipRight";
this.paddingTop = 4;
this.borderColor = 13510953;
this.color = 0xFFFFFF;
this.fontSize = 9;
this.shadowColor = 0;
this.paddingLeft = 4;
this.paddingBottom = 4;
this.paddingRight = 4;
};
};
}
}
}//package
Section 268
//_globalStyle (_globalStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _globalStyle {
public static function init(horizontalGridLines:IFlexModuleFactory):void{
var fbs = horizontalGridLines;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("global");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("global", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fillColor = 0xFFFFFF;
this.kerning = false;
this.iconColor = 0x111111;
this.textRollOverColor = 2831164;
this.horizontalAlign = "left";
this.shadowCapColor = 14015965;
this.backgroundAlpha = 1;
this.filled = true;
this.textDecoration = "none";
this.roundedBottomCorners = true;
this.fontThickness = 0;
this.focusBlendMode = "normal";
this.fillColors = [0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE];
this.horizontalGap = 8;
this.borderCapColor = 9542041;
this.buttonColor = 7305079;
this.indentation = 17;
this.selectionDisabledColor = 0xDDDDDD;
this.closeDuration = 250;
this.embedFonts = false;
this.paddingTop = 0;
this.letterSpacing = 0;
this.focusAlpha = 0.4;
this.bevel = true;
this.fontSize = 10;
this.shadowColor = 0xEEEEEE;
this.borderAlpha = 1;
this.paddingLeft = 0;
this.fontWeight = "normal";
this.indicatorGap = 14;
this.focusSkin = HaloFocusRect;
this.dropShadowEnabled = false;
this.leading = 2;
this.borderSkin = HaloBorder;
this.fontSharpness = 0;
this.modalTransparencyDuration = 100;
this.borderThickness = 1;
this.backgroundSize = "auto";
this.borderStyle = "inset";
this.borderColor = 12040892;
this.fontAntiAliasType = "advanced";
this.errorColor = 0xFF0000;
this.shadowDistance = 2;
this.horizontalGridLineColor = 0xF7F7F7;
this.stroked = false;
this.modalTransparencyColor = 0xDDDDDD;
this.cornerRadius = 0;
this.verticalAlign = "top";
this.textIndent = 0;
this.fillAlphas = [0.6, 0.4, 0.75, 0.65];
this.verticalGridLineColor = 14015965;
this.themeColor = 40447;
this.version = "3.0.0";
this.shadowDirection = "center";
this.modalTransparency = 0.5;
this.repeatInterval = 35;
this.openDuration = 250;
this.textAlign = "left";
this.fontFamily = "Verdana";
this.textSelectedColor = 2831164;
this.paddingBottom = 0;
this.strokeWidth = 1;
this.fontGridFitType = "pixel";
this.horizontalGridLines = false;
this.useRollOver = true;
this.verticalGridLines = true;
this.repeatDelay = 500;
this.fontStyle = "normal";
this.dropShadowColor = 0;
this.focusThickness = 2;
this.verticalGap = 6;
this.disabledColor = 11187123;
this.paddingRight = 0;
this.focusRoundedCorners = "tl tr bl br";
this.borderSides = "left top right bottom";
this.disabledIconColor = 0x999999;
this.modalTransparencyBlur = 3;
this.color = 734012;
this.selectionDuration = 250;
this.highlightAlphas = [0.3, 0];
};
};
}
}
}//package
Section 269
//_headerDateTextStyle (_headerDateTextStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDateTextStyle {
public static function init(bold:IFlexModuleFactory):void{
var fbs = bold;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDateText");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDateText", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.textAlign = "center";
};
};
}
}
}//package
Section 270
//_headerDragProxyStyleStyle (_headerDragProxyStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDragProxyStyleStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDragProxyStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDragProxyStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 271
//_linkButtonStyleStyle (_linkButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _linkButtonStyleStyle {
public static function init(http://adobe.com/AS3/2006/builtin:IFlexModuleFactory):void{
var fbs = http://adobe.com/AS3/2006/builtin;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".linkButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".linkButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.paddingLeft = 2;
this.paddingBottom = 2;
this.paddingRight = 2;
};
};
}
}
}//package
Section 272
//_opaquePanelStyle (_opaquePanelStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _opaquePanelStyle {
public static function init(Object:IFlexModuleFactory):void{
var fbs = Object;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".opaquePanel");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".opaquePanel", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderColor = 0xFFFFFF;
this.backgroundColor = 0xFFFFFF;
this.headerColors = [0xE7E7E7, 0xD9D9D9];
this.footerColors = [0xE7E7E7, 0xC7C7C7];
this.borderAlpha = 1;
};
};
}
}
}//package
Section 273
//_plainStyle (_plainStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _plainStyle {
public static function init(backgroundImage:IFlexModuleFactory):void{
var fbs = backgroundImage;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".plain");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".plain", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 0;
this.backgroundColor = 0xFFFFFF;
this.backgroundImage = "";
this.horizontalAlign = "left";
this.paddingLeft = 0;
this.paddingBottom = 0;
this.paddingRight = 0;
};
};
}
}
}//package
Section 274
//_popUpMenuStyle (_popUpMenuStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _popUpMenuStyle {
public static function init(normal:IFlexModuleFactory):void{
var fbs = normal;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".popUpMenu");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".popUpMenu", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "normal";
this.textAlign = "left";
};
};
}
}
}//package
Section 275
//_richTextEditorTextAreaStyleStyle (_richTextEditorTextAreaStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _richTextEditorTextAreaStyleStyle {
public static function init(_richTextEditorTextAreaStyleStyle:IFlexModuleFactory):void{
var fbs = _richTextEditorTextAreaStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".richTextEditorTextAreaStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".richTextEditorTextAreaStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 276
//_swatchPanelTextFieldStyle (_swatchPanelTextFieldStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _swatchPanelTextFieldStyle {
public static function init(shadowCapColor:IFlexModuleFactory):void{
var fbs = shadowCapColor;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".swatchPanelTextField");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".swatchPanelTextField", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderStyle = "inset";
this.borderColor = 14015965;
this.highlightColor = 12897484;
this.backgroundColor = 0xFFFFFF;
this.shadowCapColor = 14015965;
this.shadowColor = 14015965;
this.paddingLeft = 5;
this.buttonColor = 7305079;
this.borderCapColor = 9542041;
this.paddingRight = 5;
};
};
}
}
}//package
Section 277
//_textAreaHScrollBarStyleStyle (_textAreaHScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaHScrollBarStyleStyle {
public static function init(_textAreaHScrollBarStyleStyle:IFlexModuleFactory):void{
var fbs = _textAreaHScrollBarStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaHScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaHScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 278
//_textAreaVScrollBarStyleStyle (_textAreaVScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaVScrollBarStyleStyle {
public static function init(_textAreaVScrollBarStyleStyle:IFlexModuleFactory):void{
var fbs = _textAreaVScrollBarStyleStyle;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaVScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaVScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 279
//_todayStyleStyle (_todayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _todayStyleStyle {
public static function init(color:IFlexModuleFactory):void{
var fbs = color;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".todayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".todayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 0xFFFFFF;
this.textAlign = "center";
};
};
}
}
}//package
Section 280
//_weekDayStyleStyle (_weekDayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _weekDayStyleStyle {
public static function init(bold:IFlexModuleFactory):void{
var fbs = bold;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".weekDayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".weekDayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.textAlign = "center";
};
};
}
}
}//package
Section 281
//_windowStatusStyle (_windowStatusStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStatusStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStatus");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStatus", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 0x666666;
};
};
}
}
}//package
Section 282
//_windowStylesStyle (_windowStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStylesStyle {
public static function init(:IFlexModuleFactory):void{
var fbs = ;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 283
//ArrowBlock (ArrowBlock)
package {
import org.flixel.*;
public class ArrowBlock extends PortalBlock {
public var Sprite:Class;
public var direction:String;// = ""
public function ArrowBlock(X:Number, Y:Number, dir:String){
Sprite = ArrowBlock_Sprite;
super(X, Y);
visible = true;
direction = dir;
loadGraphic(Sprite, true, false, 32, 32);
addAnimation("up", [0]);
addAnimation("down", [1]);
addAnimation("left", [2]);
addAnimation("right", [3]);
play(direction);
}
override public function findEnd(dx:int, dy:int):PortalBlock{
var playState:PlayState;
var block:PortalBlock;
var test:FlxPoint;
playState = PlayState(FlxG.state);
var blocks:FlxGroup = PlayState(FlxG.state).portalBlocks;
startBlink();
switch (direction){
case "up":
if (dy == 1){
return (null);
};
dx = 0;
dy = -1;
break;
case "down":
if (dy == -1){
return (null);
};
dx = 0;
dy = 1;
break;
case "left":
if (dx == 1){
return (null);
};
dx = -1;
dy = 0;
break;
case "right":
if (dx == -1){
return (null);
};
dx = 1;
dy = 0;
break;
};
for each (block in blocks.members) {
if ((((block.x == (x + (32 * dx)))) && ((block.y == (y + (32 * dy)))))){
block.tempDX = dx;
block.tempDY = dy;
return (block.findEnd(dx, dy));
};
};
test = new FlxPoint(((x + (width / 2)) + (36 * dx)), ((y + (height / 2)) + (36 * dy)));
tempDX = dx;
tempDY = dy;
if (playState.solidTerrain.overlapsPoint(test.x, test.y)){
return (null);
};
return (this);
}
}
}//package
Section 284
//ArrowBlock_Sprite (ArrowBlock_Sprite)
package {
import mx.core.*;
public class ArrowBlock_Sprite extends BitmapAsset {
}
}//package
Section 285
//Button (Button)
package {
import org.flixel.*;
public class Button extends FlxSprite {
public var BSprite:Class;
public var block:ButtonBlock;
public function Button(X:Number, Y:Number){
BSprite = Button_BSprite;
super(X, Y);
loadGraphic(BSprite, true);
addAnimation("off", [0]);
addAnimation("on", [1]);
play("off");
associate();
if (PlayState.getSide(Y) > 0){
angle = 180;
};
}
override public function update():void{
var player:Player = PlayState.player;
var piggy:Piggy = PlayState(FlxG.state).piggy;
var trigger:Boolean;
if (((player.overlaps(this)) || (piggy.overlaps(this)))){
trigger = true;
};
if (block != null){
if (trigger){
if (!block.activated){
block.setActivate(true);
};
play("on");
} else {
if (block.activated){
block.setActivate(false);
};
play("off");
};
};
}
public function associate():void{
var bl:PortalBlock;
var playState:PlayState = PlayState(FlxG.state);
for each (bl in playState.portalBlocks.members) {
if ((bl is ButtonBlock)){
if (block == null){
block = ButtonBlock(bl);
} else {
if (PlayState.getDistance(bl.x, bl.y, x, y) < PlayState.getDistance(block.x, block.y, x, y)){
block = ButtonBlock(bl);
};
};
};
};
if (block == null){
trace("NOOO");
};
}
}
}//package
Section 286
//Button_BSprite (Button_BSprite)
package {
import mx.core.*;
public class Button_BSprite extends BitmapAsset {
}
}//package
Section 287
//ButtonBlock (ButtonBlock)
package {
import org.flixel.*;
public class ButtonBlock extends PortalBlock {
public var activated:Boolean;// = false
public var BSprite:Class;
public function ButtonBlock(X:Number, Y:Number){
BSprite = ButtonBlock_BSprite;
super(X, Y);
visible = true;
loadGraphic(BSprite, true);
addAnimation("off", [0]);
addAnimation("on", [1]);
play("off");
}
public function setActivate(bool:Boolean):void{
activated = bool;
if (bool){
play("on");
} else {
play("off");
};
}
override public function findEnd(dx:int, dy:int):PortalBlock{
var playState:PlayState;
var block:PortalBlock;
var test:FlxPoint;
playState = PlayState(FlxG.state);
var blocks:FlxGroup = PlayState(FlxG.state).portalBlocks;
if (!activated){
return (null);
};
startBlink();
for each (block in blocks.members) {
if ((((block.x == (x + (32 * dx)))) && ((block.y == (y + (32 * dy)))))){
block.tempDX = dx;
block.tempDY = dy;
return (block.findEnd(dx, dy));
};
};
test = new FlxPoint(((x + (width / 2)) + (36 * dx)), ((y + (height / 2)) + (36 * dy)));
tempDX = dx;
tempDY = dy;
if (playState.solidTerrain.overlapsPoint(test.x, test.y)){
return (null);
};
return (this);
}
}
}//package
Section 288
//ButtonBlock_BSprite (ButtonBlock_BSprite)
package {
import mx.core.*;
public class ButtonBlock_BSprite extends BitmapAsset {
}
}//package
Section 289
//CreditsState (CreditsState)
package {
import org.flixel.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
public class CreditsState extends FlxState {
public var BlackWhiteAuto:Class;
public var Collect:Class;
public var BBlock:Class;
public var BlackTile:Class;
public var SpriteS:Class;
public var Chamber0:Class;
public var playState:PlayState;
public var backTiles:FlxTilemap;
public function CreditsState():void{
var spr5:FlxSprite;
Collect = CreditsState_Collect;
Chamber0 = CreditsState_Chamber0;
BlackWhiteAuto = CreditsState_BlackWhiteAuto;
SpriteS = CreditsState_SpriteS;
BlackTile = CreditsState_BlackTile;
BBlock = CreditsState_BBlock;
super();
PlayState.saveData.bind("data");
bgColor = 4278190080;
var file:ByteArray = ByteArray(new Chamber0());
file.position = 0;
var str:String = file.readUTFBytes(file.length);
var mapXML:XML = new XML(str);
backTiles = new FlxTilemap();
backTiles.auto = FlxTilemap.BW;
backTiles.loadMap(mapXML.layer[0], BlackWhiteAuto, 32, 32);
backTiles.y = (-11 * 32);
add(backTiles);
var title:FlxText = new FlxText(0, 10, FlxG.width, "credits");
title.setFormat(null, 24, 4278190080, "center");
add(title);
playState = new PlayState();
playState.createMaps();
var back:FlxButton = new FlxButton(30, 30, toMenu);
var spr3:FlxSprite = new FlxSprite(0, 0);
spr3.loadGraphic(BlackTile);
spr3.origin = new FlxPoint(0, 0);
spr3.scale = new FlxPoint(2, 2);
var spr4:FlxSprite = new FlxSprite(0, 0);
spr4.loadGraphic(BlackTile);
spr4.origin = new FlxPoint(0, 0);
spr4.scale = new FlxPoint(2, 2);
spr4.alpha = 0.7;
back.loadGraphic(spr3, spr4);
back.width = (back.width * 2);
back.height = (back.height * 2);
var txt2:FlxText = new FlxText(0, 20, back.width, "back");
txt2.setFormat(null, 12, 0xFFFFFF, "center");
back.loadText(txt2);
add(back);
var k:int;
while (k < 20) {
spr5 = new FlxSprite((k * 32), (5 * 32));
spr5.loadGraphic(BlackTile, true, false, 32, 32);
add(spr5);
k++;
};
var pt:FlxPoint = new FlxPoint(150, 80);
var spr:FlxSprite = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(BlackTile);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
var txt:FlxText = new FlxText(pt.x, (pt.y + 15), 64, "zillix");
txt.setFormat(null, 12, 0xFFFFFF, "center");
add(spr);
add(txt);
pt = new FlxPoint(250, 80);
spr = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(SpriteS);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
txt = new FlxText(pt.x, (pt.y + 15), 64, "coding");
txt.setFormat(null, 12, 0xFFFFFF, "center");
add(spr);
add(txt);
pt = new FlxPoint((250 + 80), 80);
spr = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(SpriteS);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
txt = new FlxText(pt.x, (pt.y + 15), 64, "art");
txt.setFormat(null, 12, 0xFFFFFF, "center");
add(spr);
add(txt);
pt = new FlxPoint((250 + 160), 80);
spr = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(SpriteS);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
txt = new FlxText(pt.x, (pt.y + 15), 64, "design");
txt.setFormat(null, 12, 0xFFFFFF, "center");
add(spr);
add(txt);
pt = new FlxPoint(((250 + 160) + 80), 80);
var button:FlxButton = new FlxButton(pt.x, pt.y, goToMyURL);
spr = new FlxSprite(0, 0);
var spr2:FlxSprite = new FlxSprite(0, 0);
spr.loadGraphic(BBlock, true, false, 32, 32);
spr2.loadGraphic(BBlock, true, false, 32, 32);
spr2.origin = new FlxPoint(0, 0);
spr2.scale = new FlxPoint(2, 2);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
spr2.alpha = 0.7;
button.loadGraphic(spr, spr2);
button.height = (button.height * 2);
button.width = (button.width * 2);
txt = new FlxText(0, 20, 64, "zillix.net");
txt.setFormat(null, 10, 0xFFFFFF, "center");
button.loadText(txt);
add(button);
pt = new FlxPoint(150, (300 - 80));
spr = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(BlackTile);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
txt = new FlxText(pt.x, (pt.y + 10), 64, "jim peterman");
txt.setFormat(null, 10, 0xFFFFFF, "center");
add(spr);
add(txt);
pt = new FlxPoint(250, (300 - 80));
spr = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(SpriteS);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
txt = new FlxText(pt.x, (pt.y + 15), 64, "music");
txt.setFormat(null, 12, 0xFFFFFF, "center");
add(spr);
add(txt);
pt = new FlxPoint(150, 300);
spr = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(BlackTile);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
txt = new FlxText(pt.x, (pt.y + 10), 64, "piggy");
txt.setFormat(null, 12, 0xFFFFFF, "center");
add(spr);
add(txt);
pt = new FlxPoint(250, 300);
spr = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(SpriteS);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
txt = new FlxText(pt.x, (pt.y + 15), 64, "bkgrnd tiles");
txt.setFormat(null, 10, 0xFFFFFF, "center");
add(spr);
add(txt);
pt = new FlxPoint((250 + 80), 300);
spr = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(SpriteS);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
txt = new FlxText(pt.x, (pt.y + 15), 64, "art asst");
txt.setFormat(null, 12, 0xFFFFFF, "center");
add(spr);
add(txt);
pt = new FlxPoint(150, 380);
spr = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(BlackTile);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
txt = new FlxText(pt.x, (pt.y + 15), 64, "moozh");
txt.setFormat(null, 12, 0xFFFFFF, "center");
add(spr);
add(txt);
pt = new FlxPoint(250, 380);
spr = new FlxSprite(pt.x, pt.y);
spr.loadGraphic(SpriteS);
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
txt = new FlxText(pt.x, (pt.y + 15), 64, "testing");
txt.setFormat(null, 12, 0xFFFFFF, "center");
add(spr);
add(txt);
}
private function goToMyURL(event:MouseEvent=null):void{
navigateToURL(new URLRequest("http://www.zillix.net"));
}
public function toMenu():void{
FlxG.state = new MenuState();
}
override public function create():void{
Mouse.show();
super.create();
}
public function startGame(param:int=0):void{
FlxG.state = new PlayState(param);
}
}
}//package
Section 290
//CreditsState_BBlock (CreditsState_BBlock)
package {
import mx.core.*;
public class CreditsState_BBlock extends BitmapAsset {
}
}//package
Section 291
//CreditsState_BlackTile (CreditsState_BlackTile)
package {
import mx.core.*;
public class CreditsState_BlackTile extends BitmapAsset {
}
}//package
Section 292
//CreditsState_BlackWhiteAuto (CreditsState_BlackWhiteAuto)
package {
import mx.core.*;
public class CreditsState_BlackWhiteAuto extends BitmapAsset {
}
}//package
Section 293
//CreditsState_Chamber0 (CreditsState_Chamber0)
package {
import mx.core.*;
public class CreditsState_Chamber0 extends ByteArrayAsset {
}
}//package
Section 294
//CreditsState_Collect (CreditsState_Collect)
package {
import mx.core.*;
public class CreditsState_Collect extends SoundAsset {
}
}//package
Section 295
//CreditsState_SpriteS (CreditsState_SpriteS)
package {
import mx.core.*;
public class CreditsState_SpriteS extends BitmapAsset {
}
}//package
Section 296
//en_US$core_properties (en_US$core_properties)
package {
import mx.resources.*;
public class en_US$core_properties extends ResourceBundle {
public function en_US$core_properties(){
super("en_US", "core");
}
override protected function getContent():Object{
var _local1:Object = {multipleChildSets_ClassAndInstance:"Multiple sets of visual children have been specified for this component (component definition and component instance).", truncationIndicator:"...", notExecuting:"Repeater is not executing.", versionAlreadyRead:"Compatibility version has already been read.", multipleChildSets_ClassAndSubclass:"Multiple sets of visual children have been specified for this component (base component definition and derived component definition).", viewSource:"View Source", badFile:"File does not exist.", stateUndefined:"Undefined state '{0}'.", versionAlreadySet:"Compatibility version has already been set."};
return (_local1);
}
}
}//package
Section 297
//en_US$effects_properties (en_US$effects_properties)
package {
import mx.resources.*;
public class en_US$effects_properties extends ResourceBundle {
public function en_US$effects_properties(){
super("en_US", "effects");
}
override protected function getContent():Object{
var _local1:Object = {incorrectTrigger:"The Zoom effect can not be triggered by a moveEffect trigger.", incorrectSource:"Source property must be a Class or String."};
return (_local1);
}
}
}//package
Section 298
//en_US$skins_properties (en_US$skins_properties)
package {
import mx.resources.*;
public class en_US$skins_properties extends ResourceBundle {
public function en_US$skins_properties(){
super("en_US", "skins");
}
override protected function getContent():Object{
var _local1:Object = {notLoaded:"Unable to load '{0}'."};
return (_local1);
}
}
}//package
Section 299
//en_US$styles_properties (en_US$styles_properties)
package {
import mx.resources.*;
public class en_US$styles_properties extends ResourceBundle {
public function en_US$styles_properties(){
super("en_US", "styles");
}
override protected function getContent():Object{
var _local1:Object = {unableToLoad:"Unable to load style({0}): {1}."};
return (_local1);
}
}
}//package
Section 300
//FlxLoaderBar (FlxLoaderBar)
package {
import flash.display.*;
public dynamic class FlxLoaderBar extends BitmapData {
public function FlxLoaderBar(w:int=304, h:int=70){
super(w, h);
}
}
}//package
Section 301
//FlxLoaderFrame (FlxLoaderFrame)
package {
import flash.display.*;
public dynamic class FlxLoaderFrame extends BitmapData {
public function FlxLoaderFrame(w:int=304, h:int=70){
super(w, h);
}
}
}//package
Section 302
//FlxLoaderPlay (FlxLoaderPlay)
package {
import flash.display.*;
public dynamic class FlxLoaderPlay extends BitmapData {
public function FlxLoaderPlay(w:int=304, h:int=70){
super(w, h);
}
}
}//package
Section 303
//GlassBlock (GlassBlock)
package {
import org.flixel.*;
public class GlassBlock extends PortalBlock {
public function GlassBlock(X:Number, Y:Number){
super(X, Y);
visible = true;
createGraphic(32, 32, 4278203391);
alpha = 0.5;
}
override public function hitSide(Contact:FlxObject, Velocity:Number):void{
super.hitSide(Contact, Velocity);
}
override public function preCollide(Contact:FlxObject):void{
collideBottom = true;
collideTop = true;
collideLeft = true;
collideRight = true;
if ((Contact is PortalBall)){
collideTop = false;
collideBottom = false;
collideLeft = false;
collideRight = false;
};
}
override public function hitTop(Contact:FlxObject, Velocity:Number):void{
super.hitTop(Contact, Velocity);
}
override public function hitBottom(Contact:FlxObject, Velocity:Number):void{
super.hitBottom(Contact, Velocity);
}
}
}//package
Section 304
//LevelSelectButton (LevelSelectButton)
package {
import org.flixel.*;
import flash.events.*;
public class LevelSelectButton extends FlxButton {
public var parameter:int;// = 0
public var disabled:Boolean;// = false
public function LevelSelectButton(X:int, Y:int, Callback:Function, param:int){
super(X, Y, Callback);
parameter = param;
}
override protected function onMouseUp(event:MouseEvent):void{
if (((((((((((((disabled) || (!(exists)))) || (!(visible)))) || (!(active)))) || (!(FlxG.mouse.justReleased())))) || (((FlxG.pause) && (!(pauseProof)))))) || ((_callback == null)))){
return;
};
if (overlapsPoint(FlxG.mouse.x, FlxG.mouse.y)){
_callback(parameter);
};
}
}
}//package
Section 305
//Line (Line)
package {
import org.flixel.*;
public class Line extends FlxSprite {
public var Sprite:Class;
public function Line(X:Number, Y:Number){
Sprite = Line_Sprite;
super(x, y, Sprite);
origin = new FlxPoint(0, 1);
}
public function orientate(X:Number, Y:Number, X2:Number, Y2:Number):void{
x = X;
y = Y;
var ang:Number = FlxU.getAngle((X2 - X), (Y2 - Y));
angle = ang;
var dist:Number = Math.sqrt((Math.pow((X - X2), 2) + Math.pow((Y - Y2), 2)));
scale.x = (dist / 100);
}
}
}//package
Section 306
//Line_Sprite (Line_Sprite)
package {
import mx.core.*;
public class Line_Sprite extends BitmapAsset {
}
}//package
Section 307
//Main (Main)
package {
import org.flixel.*;
public class Main extends FlxGame {
public function Main():void{
super(640, 480, MenuState, 1);
}
}
}//package
Section 308
//Map (Map)
package {
import flash.utils.*;
public class Map {
public var tileData:Class;
public var name:String;
public var mapData:ByteArray;
public function Map(nm:String, map:ByteArray, tiles:Class){
super();
name = nm;
mapData = map;
tileData = tiles;
}
}
}//package
Section 309
//MenuState (MenuState)
package {
import org.flixel.*;
import flash.utils.*;
import flash.ui.*;
public class MenuState extends FlxState {
public var Sprite2:Class;
public var Collect:Class;
public var TitleMusic:Class;
public var Chamber0:Class;
public var BlackWhiteAuto:Class;
public var initialized:Boolean;// = false
public var backTiles:FlxTilemap;
public function MenuState():void{
TitleMusic = MenuState_TitleMusic;
Sprite2 = MenuState_Sprite2;
Collect = MenuState_Collect;
Chamber0 = MenuState_Chamber0;
BlackWhiteAuto = MenuState_BlackWhiteAuto;
super();
FlxG.playMusic(TitleMusic);
bgColor = 4278190080;
var file:ByteArray = ByteArray(new Chamber0());
file.position = 0;
var str:String = file.readUTFBytes(file.length);
var mapXML:XML = new XML(str);
backTiles = new FlxTilemap();
backTiles.auto = FlxTilemap.BW;
backTiles.loadMap(mapXML.layer[0], BlackWhiteAuto, 32, 32);
backTiles.y = (-7 * 32);
add(backTiles);
var scr:FlxSprite = new FlxSprite(0, 0, Sprite2);
add(scr);
var textDisplay:FlxText = new FlxText(50, 70, FlxG.width, "p.i.g");
textDisplay.setFormat(null, 64, 4278190080);
add(textDisplay);
textDisplay = new FlxText(60, 180, FlxG.width, "press [x] to play story");
textDisplay.setFormat(null, 24, 4278190080);
add(textDisplay);
textDisplay = new FlxText(60, 210, FlxG.width, "[s] to select a chamber");
textDisplay.setFormat(null, 24, 4278190080);
add(textDisplay);
textDisplay = new FlxText(60, 240, FlxG.width, "bonus chambers unlocked!");
textDisplay.setFormat(null, 12, 4278190080);
PlayState.saveData.bind("data");
var completed:int = (PlayState.saveData.read("levelCompleted") as int);
if (completed >= 6){
add(textDisplay);
};
textDisplay = new FlxText(400, 390, FlxG.width, "made by zillix");
textDisplay.setFormat(null, 12, 4294967295);
add(textDisplay);
textDisplay = new FlxText(400, 410, FlxG.width, "ludum dare 20");
textDisplay.setFormat(null, 12, 4294967295);
add(textDisplay);
textDisplay = new FlxText(400, 430, FlxG.width, "press [c] for credits");
textDisplay.setFormat(null, 12, 4294967295);
add(textDisplay);
}
public function onFade():void{
FlxG.state = new PlayState();
PlayState.playingStory = true;
PlayState.totalTime = 0;
}
override public function create():void{
Mouse.show();
super.create();
}
override public function update():void{
super.update();
if (FlxG.keys.justPressed("X")){
FlxG.play(Collect, 0.4);
FlxG.flash.start(4294967295, 0.75);
FlxG.fade.start(4278190080, 1, onFade);
};
if (FlxG.keys.justPressed("S")){
FlxG.play(Collect, 0.4);
FlxG.flash.start(4294967295, 0.75);
FlxG.fade.start(4278190080, 1, onFade2);
};
if (FlxG.keys.justPressed("C")){
FlxG.play(Collect, 0.4);
FlxG.flash.start(4294967295, 0.75);
FlxG.fade.start(4278190080, 1, onFade3);
};
}
public function onFade2():void{
FlxG.state = new SelectState();
}
public function onFade3():void{
FlxG.state = new CreditsState();
}
}
}//package
Section 310
//MenuState_BlackWhiteAuto (MenuState_BlackWhiteAuto)
package {
import mx.core.*;
public class MenuState_BlackWhiteAuto extends BitmapAsset {
}
}//package
Section 311
//MenuState_Chamber0 (MenuState_Chamber0)
package {
import mx.core.*;
public class MenuState_Chamber0 extends ByteArrayAsset {
}
}//package
Section 312
//MenuState_Collect (MenuState_Collect)
package {
import mx.core.*;
public class MenuState_Collect extends SoundAsset {
}
}//package
Section 313
//MenuState_Sprite2 (MenuState_Sprite2)
package {
import mx.core.*;
public class MenuState_Sprite2 extends BitmapAsset {
}
}//package
Section 314
//MenuState_TitleMusic (MenuState_TitleMusic)
package {
import mx.core.*;
public class MenuState_TitleMusic extends SoundAsset {
}
}//package
Section 315
//Piggy (Piggy)
package {
import org.flixel.*;
public class Piggy extends Player {
public var PigSprites:Class;
public var HAPPY_JUMP_VEL:int;// = 100
public var approachDist:int;// = 32
public var isActive:Boolean;// = false
public var target:Player;
public var jumpDist:int;// = 40
public var canJump:Boolean;// = true
public function Piggy(X:Number, Y:Number){
PigSprites = Piggy_PigSprites;
super(X, Y);
walkSpeed = 100;
fallSpeed = 450;
FLIP_Y_BOOST = 80;
FLIP_LOSS = 70;
setSide(PlayState.getSide(Y));
loadGraphic(PigSprites, true, true, 24, 20);
addAnimation("idle", [0]);
play("idle");
addAnimation("walk", [0, 1], 3);
addAnimation("jump", [2]);
IS_PLAYER = false;
target = PlayState.player;
height = 20;
width = 20;
offset.x = 2;
this.acceleration.y = fallSpeed;
visible = false;
}
override public function hitBottom(Contact:FlxObject, Velocity:Number):void{
drag.x = groundDrag;
canJump = true;
super.hitBottom(Contact, Velocity);
}
override public function update():void{
if (!isActive){
super.update();
return;
};
var playState:PlayState = PlayState(FlxG.state);
var player:Player = target;
center = new FlxPoint((x + (width / 2)), (y + (height / 2)));
if (x < (player.x - approachDist)){
velocity.x = walkSpeed;
if (getSide() < 1){
facing = RIGHT;
} else {
facing = LEFT;
};
};
if (x > (player.x + approachDist)){
velocity.x = -(walkSpeed);
if (getSide() < 1){
facing = LEFT;
} else {
facing = RIGHT;
};
};
if (Math.abs((x - player.x)) < approachDist){
velocity.x = 0;
};
if (velocity.x == 0){
play("idle");
} else {
play("walk");
};
if ((((velocity.y == 0)) && (canJump))){
canJump = false;
if ((((y > (player.y + jumpDist))) && ((getSide() < 0)))){
velocity.y = -(JUMP_VEL);
};
if ((((y < (player.y - jumpDist))) && ((getSide() > 0)))){
velocity.y = JUMP_VEL;
};
};
if (velocity.x != 0){
if (velocity.y == 0){
if (Math.random() < 0.04){
if (getSide() < 0){
jump(HAPPY_JUMP_VEL);
} else {
jump(-(HAPPY_JUMP_VEL));
};
};
};
};
if (velocity.y != 0){
play("jump", true);
};
super.update();
}
override public function collide(Object:FlxObject=null):Boolean{
return (FlxU.collide(this, ((Object)==null) ? this : Object));
}
override public function setSide(dif:Number):void{
if (dif < 0){
acceleration.y = fallSpeed;
if (angle != 0){
y = (y - height);
};
angle = 0;
} else {
if (dif > 0){
acceleration.y = -(fallSpeed);
if (y != 180){
y = (y + height);
};
angle = 180;
};
};
}
}
}//package
Section 316
//Piggy_PigSprites (Piggy_PigSprites)
package {
import mx.core.*;
public class Piggy_PigSprites extends BitmapAsset {
}
}//package
Section 317
//Pigita (Pigita)
package {
import org.flixel.*;
public class Pigita extends Piggy {
public var PigitaSprites:Class;
public function Pigita(X:Number, Y:Number){
PigitaSprites = Pigita_PigitaSprites;
super(X, Y);
loadGraphic(PigitaSprites, true, true, 24, 20);
addAnimation("idle", [0]);
play("idle");
addAnimation("walk", [0, 1], 3);
addAnimation("jump", [2]);
approachDist = 12;
target = PlayState(FlxG.state).piggy;
}
}
}//package
Section 318
//Pigita_PigitaSprites (Pigita_PigitaSprites)
package {
import mx.core.*;
public class Pigita_PigitaSprites extends BitmapAsset {
}
}//package
Section 319
//Player (Player)
package {
import org.flixel.*;
public class Player extends FlxSprite {
public var walkSpeed:int;// = 160
public var immobile:Boolean;// = false
public var FUNNEL_RATE:Number;// = 64
public var Land:Class;
public var fallSpeed:int;// = 500
public var Jump:Class;
public var hasPIG:Boolean;// = false
public var center:FlxPoint;
public var IS_PLAYER:Boolean;// = true
public var groundDrag:int;// = 1000
public var airDrag:int;// = 100
public var Sprites:Class;
public var realignRate:Number;// = 16
public var DEFAULT_RATE:Number;// = 16
public static var FLIP_Y_BOOST:int = 60;
public static var JUMP_VEL:int = 200;
public static var FLIP_LOSS:int = 80;
public static var X_BOOST:int = 80;
public static var Y_BOOST:int = 200;
public static var SAME_DIR_BOOST:int = 200;
public function Player(X:Number, Y:Number){
Sprites = Player_Sprites;
Jump = Player_Jump;
Land = Player_Land;
super(X, Y);
setSide(PlayState.getSide(Y));
loadGraphic(Sprites, true, true, 20, 28);
addAnimation("black_idle", [0]);
addAnimation("black_walk", [1, 2], 6);
addAnimation("black_jump", [3]);
addAnimation("white_idle", [4]);
addAnimation("white_walk", [5, 6], 6);
addAnimation("white_jump", [7]);
play("black_idle");
drag.x = airDrag;
height = 28;
width = 20;
this.acceleration.y = fallSpeed;
}
override public function hitTop(Contact:FlxObject, Velocity:Number):void{
super.hitBottom(Contact, Velocity);
}
public function getSide():int{
return (PlayState.getSide(y));
}
override public function update():void{
var off:int;
var portal:Portal;
var newOff:int;
var playState:PlayState = PlayState(FlxG.state);
center = new FlxPoint((x + (width / 2)), (y + (height / 2)));
if (IS_PLAYER){
setAnim();
};
if (immobile){
velocity.x = 0;
velocity.y = 0;
acceleration.y = 0;
};
if (((IS_PLAYER) && (!(immobile)))){
if (((FlxG.keys.A) || (FlxG.keys.LEFT))){
velocity.x = Math.min(velocity.x, -(walkSpeed));
if (getSide() < 1){
facing = LEFT;
} else {
facing = RIGHT;
};
} else {
if (((FlxG.keys.D) || (FlxG.keys.RIGHT))){
velocity.x = Math.max(velocity.x, walkSpeed);
if (getSide() < 1){
facing = RIGHT;
} else {
facing = LEFT;
};
} else {
if (velocity.x <= walkSpeed){
velocity.x = 0;
};
acceleration.x = 0;
};
};
if (((FlxG.keys.justPressed("W")) || (FlxG.keys.justPressed("UP")))){
if (velocity.y == 0){
jump(((Math.abs(acceleration.y) / acceleration.y) * JUMP_VEL));
};
};
};
if ((((((velocity.x == 0)) && (!((velocity.y == 0))))) && (!((this is Piggy))))){
off = (center.x - ((int((center.x / 32)) * 32) + 16));
realignRate = DEFAULT_RATE;
for each (portal in playState.portals.members) {
if ((((((Math.abs(((center.x - portal.x) - (portal.width / 2))) < (32 + 16))) && ((PlayState.getSide(portal.y) == getSide())))) && ((((((getSide() < 0)) && ((portal.direction == "top")))) || ((((getSide() > 0)) && ((portal.direction == "bottom")))))))){
newOff = (center.x - (portal.x + (portal.width / 2)));
if (((!((realignRate == FUNNEL_RATE))) || ((((realignRate == FUNNEL_RATE)) && ((Math.abs(newOff) < Math.abs(off))))))){
off = newOff;
};
realignRate = FUNNEL_RATE;
};
};
if (Math.abs(off) < (realignRate * FlxG.elapsed)){
x = (x - off);
} else {
if (off < 0){
x = (x + (realignRate * FlxG.elapsed));
} else {
if (off > 0){
x = (x - (realignRate * FlxG.elapsed));
};
};
};
};
super.update();
drag.x = airDrag;
}
public function setSide(dif:Number):void{
if (dif < 0){
acceleration.y = fallSpeed;
if (angle != 0){
y = (y - height);
};
angle = 0;
} else {
if (dif > 0){
acceleration.y = -(fallSpeed);
if (y != 180){
y = (y + height);
};
angle = 180;
};
};
}
public function setAnim():void{
var side:int = getSide();
if (velocity.x == 0){
if (side < 0){
play("black_idle", true);
} else {
play("white_idle", true);
};
};
if (velocity.x != 0){
if (side < 0){
play("black_walk");
} else {
play("white_walk");
};
};
if (velocity.y != 0){
if (side < 0){
play("black_jump", true);
} else {
play("white_jump", true);
};
};
}
override public function collide(Object:FlxObject=null):Boolean{
return (FlxU.collide(this, ((Object)==null) ? this : Object));
}
override public function hitBottom(Contact:FlxObject, Velocity:Number):void{
drag.x = groundDrag;
super.hitBottom(Contact, Velocity);
}
public function jump(vel:Number):void{
if (velocity.y == 0){
velocity.y = -(vel);
};
FlxG.play(Jump);
}
}
}//package
Section 320
//Player_Jump (Player_Jump)
package {
import mx.core.*;
public class Player_Jump extends SoundAsset {
}
}//package
Section 321
//Player_Land (Player_Land)
package {
import mx.core.*;
public class Player_Land extends SoundAsset {
}
}//package
Section 322
//Player_Sprites (Player_Sprites)
package {
import mx.core.*;
public class Player_Sprites extends BitmapAsset {
}
}//package
Section 323
//PlayState (PlayState)
package {
import org.flixel.*;
import flash.utils.*;
import flash.ui.*;
import com.newgrounds.*;
public class PlayState extends FlxState {
public var piggy:Piggy;
public var Chamber0:Class;
public var Collect:Class;
public var MapAuto:Class;
public var portals:FlxGroup;
public var solidTerrain:FlxTilemap;
public var portalBlocks:FlxGroup;
public var objects:FlxGroup;
public var levelsCompleted:int;// = 0
public var BONUS_MAPS:int;// = 3
public var maps:Array;
public var startIndex:int;// = 0
public var offscreen:Boolean;// = false
public var ending:Boolean;// = false
public var Chamber2_5:Class;
public var Chamber4_5:Class;
public var currentMap:Map;
public var details:FlxGroup;
public var pigita:Pigita;
public var portalBalls:FlxGroup;
public var NUM_MAPS:int;// = 7
public var PigMusic:Class;
public var BlackWhiteAuto:Class;
public var PortalAuto:Class;
public var mapIndex:int;// = 0
public var backTiles:FlxTilemap;
public var spawnPt:FlxPoint;
public var Chamber1_5:Class;
public var Chamber3_5:Class;
public var PortalShoot:Class;
public var Chamber2:Class;
public var Chamber4:Class;
public var Chamber5:Class;
public var portalTiles:FlxTilemap;
public var Chamber1:Class;
public var line:Line;
public var Chamber3:Class;
public var BackgroundMusic:Class;
public static var player:Player;
public static var saveData:FlxSave = new FlxSave();
public static var totalTime:Number = 0;
public static var DIVIDE_Y:int = 496;
public static var playingStory:Boolean = false;
public function PlayState(si:int=0){
Chamber0 = PlayState_Chamber0;
Chamber1 = PlayState_Chamber1;
Chamber1_5 = PlayState_Chamber1_5;
Chamber2 = PlayState_Chamber2;
Chamber2_5 = PlayState_Chamber2_5;
Chamber3 = PlayState_Chamber3;
Chamber3_5 = PlayState_Chamber3_5;
Chamber4 = PlayState_Chamber4;
Chamber4_5 = PlayState_Chamber4_5;
Chamber5 = PlayState_Chamber5;
MapAuto = PlayState_MapAuto;
PortalAuto = PlayState_PortalAuto;
BlackWhiteAuto = PlayState_BlackWhiteAuto;
PortalShoot = PlayState_PortalShoot;
Collect = PlayState_Collect;
BackgroundMusic = PlayState_BackgroundMusic;
PigMusic = PlayState_PigMusic;
super();
startIndex = si;
}
override public function create():void{
PlayState.saveData.bind("data");
levelsCompleted = (PlayState.saveData.read("levelCompleted") as int);
FlxG.playMusic(BackgroundMusic, 0.3);
bgColor = 4294967295;
player = new Player((7 * 32), (4 * 32));
if (startIndex > 0){
player.x = 10;
};
spawnPt = new FlxPoint(player.x, player.y);
piggy = new Piggy(0, 0);
pigita = new Pigita(0, 0);
line = new Line(player.x, player.y);
createMaps();
loadMap(startIndex);
if (startIndex > 0){
player.hasPIG = true;
};
Mouse.show();
super.create();
}
public function endGame():void{
if (!ending){
if (playingStory){
if (int((totalTime <= 180))){
API.unlockMedal("p.i.g, easy as 1,2,3");
};
};
if (mapIndex == (NUM_MAPS - 1)){
API.unlockMedal("the pig is not a lie");
} else {
if (mapIndex == ((NUM_MAPS + BONUS_MAPS) - 1)){
API.unlockMedal("notorious p.i.g");
};
};
FlxG.flash.start(4294967295, 2);
FlxG.fade.start(4293572058, 3, allDone);
ending = true;
};
}
public function clearPortals(delay:Number=0):void{
var portal:Portal;
var block:PortalBlock;
for each (portal in portals.members) {
if (delay == -1){
portal.kill();
};
if (delay == 0){
portal.beginClose();
} else {
portal.close(delay);
};
};
if (delay == 0){
for each (block in portalBlocks.members) {
block.portals = new FlxGroup();
if (player.overlaps(block)){
block.ejectPlayer(player);
};
};
};
}
public function shootPortal():void{
var angle:Number = FlxU.getAngle((FlxG.mouse.x - player.center.x), (FlxG.mouse.y - player.center.y));
var portalBall:PortalBall = new PortalBall(player.center.x, player.center.y);
portalBall.angle = angle;
portalBall.velocity.x = (PortalBall.SPEED * Math.cos(PlayState.toRadians(angle)));
portalBall.velocity.y = (PortalBall.SPEED * Math.sin(PlayState.toRadians(angle)));
portalBalls.add(portalBall);
}
public function loadMap(index:int):void{
var en:FlxGroup;
var item:*;
var o:XML;
mapIndex = index;
clearMap();
if (index == (NUM_MAPS - 1)){
FlxG.playMusic(PigMusic);
};
var map:Map = maps[index];
currentMap = map;
var file:ByteArray = map.mapData;
file.position = 0;
var str:String = file.readUTFBytes(file.length);
var mapXML:XML = new XML(str);
backTiles.auto = FlxTilemap.BW;
backTiles.loadMap(mapXML.layer[0], BlackWhiteAuto, 32, 32);
solidTerrain.auto = FlxTilemap.AUTO;
solidTerrain.loadMap(mapXML.layer[1], MapAuto, 32, 32);
portalTiles.auto = FlxTilemap.AUTO;
portalTiles.loadMap(mapXML.layer[2], PortalAuto, 32, 32);
var list:XML = mapXML.objects[0];
for each (o in list.OBJ1) {
portalBlocks.add(new PortalBlock((32 * o.@x), (32 * o.@y)));
};
for each (o in list.OBJ2) {
portalBlocks.add(new ArrowBlock((32 * o.@x), (32 * o.@y), "up"));
};
for each (o in list.OBJ3) {
portalBlocks.add(new ArrowBlock((32 * o.@x), (32 * o.@y), "down"));
};
for each (o in list.OBJ4) {
portalBlocks.add(new ArrowBlock((32 * o.@x), (32 * o.@y), "left"));
};
for each (o in list.OBJ5) {
portalBlocks.add(new ArrowBlock((32 * o.@x), (32 * o.@y), "right"));
};
for each (o in list.OBJ6) {
objects.add(new Screen((32 * o.@x), (32 * o.@y)));
};
for each (o in list.OBJ7) {
objects.add(new PortalGun((32 * o.@x), (32 * o.@y)));
};
for each (o in list.OBJ8) {
piggy.x = (32 * o.@x);
piggy.y = (32 * o.@y);
piggy.visible = true;
piggy.isActive = true;
piggy.setSide(piggy.getSide());
};
for each (o in list.OBJ10) {
portalBlocks.add(new ButtonBlock((32 * o.@x), (32 * o.@y)));
};
for each (o in list.OBJ9) {
objects.add(new Button((32 * o.@x), (32 * o.@y)));
};
for each (o in list.OBJ11) {
pigita.x = (32 * o.@x);
pigita.y = (32 * o.@y);
pigita.visible = true;
pigita.isActive = true;
pigita.setSide(pigita.getSide());
};
for each (o in list.OBJ12) {
portalBlocks.add(new GlassBlock((32 * o.@x), (32 * o.@y)));
};
nameScreens();
FlxG.unfollow();
FlxG.follow(player, 10);
FlxG.followBounds(0, 0, (solidTerrain.widthInTiles * 32), (solidTerrain.heightInTiles * 32), true);
}
public function getMap(str:String):Map{
var i:int;
while (i < maps.length) {
if (maps[i].name == str){
return (maps[i]);
};
i++;
};
trace("map not found", str);
return (maps[0]);
}
public function nameScreens():void{
switch (currentMap.name){
case "p.i.g":
getScreenNear((3 * 32), (1 * 32)).setName("move");
getScreenNear((4 * 32), (8 * 32)).setName("escape");
getScreenNear((16 * 32), (8 * 32)).setName("takeThis");
getScreenNear((28 * 32), (7 * 32)).setName("PIG");
getScreenNear((48 * 32), (6 * 32)).setName("arrows");
getScreenNear((71 * 32), (8 * 32)).setName("end");
break;
case "intro":
getScreenNear((1 * 32), (9 * 32)).setName("oops");
getScreenNear((12 * 32), (8 * 32)).setName("controls");
getScreenNear((30 * 32), (5 * 32)).setName("might");
getScreenNear((53 * 32), (8 * 32)).setName("avoid");
break;
case "maze":
getScreenNear((1 * 32), (9 * 32)).setName("maze");
getScreenNear((11 * 32), (9 * 32)).setName("house");
getScreenNear((41 * 32), (9 * 32)).setName("out");
break;
case "jump":
getScreenNear((1 * 32), (9 * 32)).setName("high");
getScreenNear((18 * 32), (9 * 32)).setName("tougher");
getScreenNear((27 * 32), (9 * 32)).setName("align");
getScreenNear((42 * 32), (9 * 32)).setName("next");
break;
case "jump+":
getScreenNear((2 * 32), (9 * 32)).setName("boost");
getScreenNear((17 * 32), (9 * 32)).setName("loop");
getScreenNear((35 * 32), (9 * 32)).setName("bounce");
getScreenNear((58 * 32), (9 * 32)).setName("gettingThere");
break;
case "pig":
getScreenNear((1 * 32), (7 * 32)).setName("need");
getScreenNear((15 * 32), (6 * 32)).setName("precious");
getScreenNear((28 * 32), (7 * 32)).setName("useful");
getScreenNear((47 * 32), (7 * 32)).setName("almost");
break;
case "fin":
getScreenNear((5 * 32), (9 * 32)).setName("oliver!");
getScreenNear((18 * 32), (9 * 32)).setName("thankyou");
getScreenNear((32 * 32), (9 * 32)).setName("fun?");
break;
case "maze+":
getScreenNear((3 * 32), (9 * 32)).setName("tower");
getScreenNear((22 * 32), (9 * 32)).setName("box");
break;
case "glass":
getScreenNear((2 * 32), (10 * 32)).setName("glass");
getScreenNear((19 * 32), (6 * 32)).setName("wiper");
getScreenNear((31 * 32), (8 * 32)).setName("there");
break;
case "pig+":
getScreenNear((3 * 32), (9 * 32)).setName("typing");
getScreenNear((26 * 32), (7 * 32)).setName("multiple");
getScreenNear((61 * 32), (9 * 32)).setName("thanks");
break;
};
}
public function checkWarp(pl:Player, obj:PortalBlock):void{
obj.checkWarp(pl);
}
public function getScreenNear(X:Number, Y:Number):Screen{
var obj:FlxObject;
var dist:Number;
for each (obj in objects.members) {
if (!(obj is Screen)){
} else {
dist = PlayState.getDistance(obj.x, obj.y, X, Y);
if (dist < 34){
return (Screen(obj));
};
};
};
trace(((("object not found at " + X) + " ") + Y));
return (new Screen(0, 0));
}
public function killGroup(gr:FlxGroup):void{
var obj:FlxObject;
if (((!((gr == null))) && ((gr.members.length > 0)))){
for each (obj in gr.members) {
obj.kill();
obj.exists = false;
};
};
}
public function allDone():void{
FlxG.state = new MenuState();
}
override public function update():void{
if (!FlxG.pause){
totalTime = (totalTime + FlxG.elapsed);
if (((FlxG.mouse.justPressed()) && (player.hasPIG))){
shootPortal();
};
};
super.update();
if (FlxG.keys.justPressed("Q")){
FlxG.state = new MenuState();
};
if (FlxG.keys.justPressed("R")){
loadMap(mapIndex);
player.x = spawnPt.x;
player.y = spawnPt.y;
piggy.x = spawnPt.x;
piggy.y = spawnPt.y;
player.setSide(player.getSide());
piggy.setSide(piggy.getSide());
};
if (player.right > solidTerrain.width){
if (((!((mapIndex == (NUM_MAPS - 1)))) && (!((mapIndex == ((NUM_MAPS + BONUS_MAPS) - 1)))))){
player.x = 10;
piggy.x = 10;
spawnPt = new FlxPoint(player.x, player.y);
loadMap((mapIndex + 1));
saveData.bind("data");
levelsCompleted = Math.max(levelsCompleted, mapIndex);
saveData.write("levelCompleted", levelsCompleted);
} else {
if (player.left > solidTerrain.width){
player.immobile = true;
endGame();
saveData.bind("data");
levelsCompleted = Math.max(levelsCompleted, (mapIndex + 1));
saveData.write("levelCompleted", levelsCompleted);
};
};
player.velocity.x = 0;
};
if (player.x < 0){
player.velocity.x = 0;
player.x = 0;
};
if (player.hasPIG){
line.visible = true;
line.orientate(player.center.x, player.center.y, FlxG.mouse.x, FlxG.mouse.y);
} else {
line.visible = false;
};
var players:FlxGroup = new FlxGroup();
players.add(player);
players.add(piggy);
players.add(pigita);
players.collide(solidTerrain);
players.collide(portalBlocks);
portalBalls.collide(solidTerrain);
portalBalls.collide(portalBlocks);
objects.collide(solidTerrain);
objects.collide(portalBlocks);
FlxU.overlap(players, portalBlocks, checkWarp);
cleanGroup(portalBalls);
cleanGroup(objects);
cleanGroup(portals);
if ((((player.y < 0)) || ((player.y > backTiles.height)))){
if (!offscreen){
API.unlockMedal("when p.i.gs fly");
offscreen = true;
};
};
FlxU.overlap(player, objects, touchObject);
}
public function createMaps():void{
maps = new Array();
maps.push(new Map("p.i.g", ByteArray(new Chamber0()), MapAuto));
maps.push(new Map("intro", ByteArray(new Chamber1()), MapAuto));
maps.push(new Map("maze", ByteArray(new Chamber2()), MapAuto));
maps.push(new Map("jump", ByteArray(new Chamber3()), MapAuto));
maps.push(new Map("jump+", ByteArray(new Chamber3_5()), MapAuto));
maps.push(new Map("pig", ByteArray(new Chamber4()), MapAuto));
maps.push(new Map("fin", ByteArray(new Chamber5()), MapAuto));
maps.push(new Map("maze+", ByteArray(new Chamber1_5()), MapAuto));
maps.push(new Map("glass", ByteArray(new Chamber2_5()), MapAuto));
maps.push(new Map("pig+", ByteArray(new Chamber4_5()), MapAuto));
}
public function cleanGroup(gr:FlxGroup):void{
var i:int;
var obj:FlxObject;
if (((!((gr == null))) && ((gr.members.length > 0)))){
i = (gr.members.length - 1);
while (i >= 0) {
obj = gr.members[i];
if (obj.dead){
gr.members.splice(i, 1);
};
i--;
};
};
}
public function touchObject(pl:FlxSprite, obj:FlxSprite):void{
if ((obj is PortalGun)){
player.hasPIG = true;
FlxG.play(Collect, 0.4);
obj.kill();
};
}
public function clearMap():void{
defaultGroup.remove(player, true);
defaultGroup.remove(piggy, true);
defaultGroup.remove(pigita, true);
defaultGroup.remove(solidTerrain, true);
defaultGroup.remove(portalTiles, true);
defaultGroup.remove(line, true);
defaultGroup.remove(backTiles, true);
defaultGroup.remove(portalBalls, true);
defaultGroup.remove(objects, true);
defaultGroup.remove(portals, true);
defaultGroup.remove(portalBlocks, true);
killGroup(objects);
killGroup(portals);
killGroup(portalBlocks);
killGroup(portalBalls);
portalBlocks = new FlxGroup();
portalBalls = new FlxGroup();
portals = new FlxGroup();
details = new FlxGroup();
objects = new FlxGroup();
solidTerrain = new FlxTilemap();
portalTiles = new FlxTilemap();
backTiles = new FlxTilemap();
add(backTiles);
add(portalBalls);
add(objects);
add(line);
add(player);
add(piggy);
add(pigita);
add(solidTerrain);
add(portalBlocks);
add(portals);
}
public static function rgbToHex(r:int, g:int, b:int):uint{
return ((((r << 16) | (g << 8)) | b));
}
public static function getDistance(X:Number, Y:Number, A:Number, B:Number):Number{
return (Math.sqrt((Math.pow((X - A), 2) + Math.pow((Y - B), 2))));
}
public static function getSide(Y:Number):int{
if (Y < DIVIDE_Y){
return (-1);
};
return (1);
}
public static function toRadians(ang:Number):Number{
return (((Math.PI * ang) / 180));
}
public static function angleAbs(ang1:Number, ang2:Number):Number{
var a1:Number = ang1;
var a2:Number = ang2;
var a3:Number = 0;
while (a1 < 0) {
a1 = (a1 + 360);
};
while (a1 >= 360) {
a1 = (a1 - 360);
};
while (a2 < 0) {
a2 = (a2 + 360);
};
while (a2 >= 360) {
a2 = (a2 - 360);
};
a3 = Math.abs((ang1 - ang2));
while (a3 < 0) {
a3 = (a3 + 360);
};
while (a3 >= 360) {
a3 = (a3 - 360);
};
if (a3 > 180){
a3 = (360 - a3);
};
return (a3);
}
}
}//package
Section 324
//PlayState_BackgroundMusic (PlayState_BackgroundMusic)
package {
import mx.core.*;
public class PlayState_BackgroundMusic extends SoundAsset {
}
}//package
Section 325
//PlayState_BlackWhiteAuto (PlayState_BlackWhiteAuto)
package {
import mx.core.*;
public class PlayState_BlackWhiteAuto extends BitmapAsset {
}
}//package
Section 326
//PlayState_Chamber0 (PlayState_Chamber0)
package {
import mx.core.*;
public class PlayState_Chamber0 extends ByteArrayAsset {
}
}//package
Section 327
//PlayState_Chamber1 (PlayState_Chamber1)
package {
import mx.core.*;
public class PlayState_Chamber1 extends ByteArrayAsset {
}
}//package
Section 328
//PlayState_Chamber1_5 (PlayState_Chamber1_5)
package {
import mx.core.*;
public class PlayState_Chamber1_5 extends ByteArrayAsset {
}
}//package
Section 329
//PlayState_Chamber2 (PlayState_Chamber2)
package {
import mx.core.*;
public class PlayState_Chamber2 extends ByteArrayAsset {
}
}//package
Section 330
//PlayState_Chamber2_5 (PlayState_Chamber2_5)
package {
import mx.core.*;
public class PlayState_Chamber2_5 extends ByteArrayAsset {
}
}//package
Section 331
//PlayState_Chamber3 (PlayState_Chamber3)
package {
import mx.core.*;
public class PlayState_Chamber3 extends ByteArrayAsset {
}
}//package
Section 332
//PlayState_Chamber3_5 (PlayState_Chamber3_5)
package {
import mx.core.*;
public class PlayState_Chamber3_5 extends ByteArrayAsset {
}
}//package
Section 333
//PlayState_Chamber4 (PlayState_Chamber4)
package {
import mx.core.*;
public class PlayState_Chamber4 extends ByteArrayAsset {
}
}//package
Section 334
//PlayState_Chamber4_5 (PlayState_Chamber4_5)
package {
import mx.core.*;
public class PlayState_Chamber4_5 extends ByteArrayAsset {
}
}//package
Section 335
//PlayState_Chamber5 (PlayState_Chamber5)
package {
import mx.core.*;
public class PlayState_Chamber5 extends ByteArrayAsset {
}
}//package
Section 336
//PlayState_Collect (PlayState_Collect)
package {
import mx.core.*;
public class PlayState_Collect extends SoundAsset {
}
}//package
Section 337
//PlayState_MapAuto (PlayState_MapAuto)
package {
import mx.core.*;
public class PlayState_MapAuto extends BitmapAsset {
}
}//package
Section 338
//PlayState_PigMusic (PlayState_PigMusic)
package {
import mx.core.*;
public class PlayState_PigMusic extends SoundAsset {
}
}//package
Section 339
//PlayState_PortalAuto (PlayState_PortalAuto)
package {
import mx.core.*;
public class PlayState_PortalAuto extends BitmapAsset {
}
}//package
Section 340
//PlayState_PortalShoot (PlayState_PortalShoot)
package {
import mx.core.*;
public class PlayState_PortalShoot extends SoundAsset {
}
}//package
Section 341
//Portal (Portal)
package {
import org.flixel.*;
public class Portal extends FlxSprite {
public var brother:Portal;
public var startDying:Boolean;// = false
public var dying:Boolean;// = false
public var PortalSprite:Class;
public var closeTimer:Number;// = 0.5
public var direction:String;// = ""
public function Portal(X:Number, Y:Number, dir:String){
PortalSprite = Portal_PortalSprite;
super(X, Y);
direction = dir;
loadGraphic(PortalSprite, true, true, 32, 32);
addAnimation("open_black", [2, 1, 0], 20, false);
addAnimation("idle_black", [0]);
addAnimation("die_black", [0, 1, 2], 20, false);
addAnimation("open_white", [5, 4, 3], 20, false);
addAnimation("idle_white", [0]);
addAnimation("die_white", [3, 4, 5], 20, false);
if (PlayState.getSide(y) < 0){
play("open_black");
} else {
play("open_white");
};
switch (direction){
case "top":
angle = 0;
break;
case "bottom":
angle = 180;
break;
case "left":
angle = -90;
break;
case "right":
angle = 90;
break;
};
}
override public function hitTop(Contact:FlxObject, Velocity:Number):void{
if ((Contact is FlxTilemap)){
kill();
};
super.hitSide(Contact, Velocity);
}
override public function hitBottom(Contact:FlxObject, Velocity:Number):void{
if ((Contact is FlxTilemap)){
kill();
};
super.hitSide(Contact, Velocity);
}
override public function update():void{
var block:PortalBlock;
var portal:Portal;
var playState:PlayState = PlayState(FlxG.state);
super.update();
if (((dying) && (this.finished))){
kill();
};
if (startDying){
closeTimer = (closeTimer - FlxG.elapsed);
if (closeTimer <= 0){
beginClose();
for each (block in playState.portalBlocks.members) {
for each (portal in block.portals.members) {
if (this == portal){
block.portals = new FlxGroup();
};
};
if (PlayState.player.overlaps(block)){
block.ejectPlayer(PlayState.player);
};
};
};
};
}
override public function hitSide(Contact:FlxObject, Velocity:Number):void{
if ((Contact is FlxTilemap)){
kill();
};
super.hitSide(Contact, Velocity);
}
public function beginClose():void{
dying = true;
if (PlayState.getSide(y) < 0){
play("die_black");
} else {
play("die_white");
};
}
public function close(delay:Number=0.5):void{
if (!startDying){
startDying = true;
closeTimer = delay;
};
}
public function getOut():FlxPoint{
var side:int = PlayState.getSide(y);
var pt:FlxPoint = new FlxPoint();
switch (direction){
case "top":
if (side > 0){
pt.y = top;
} else {
pt.y = bottom;
};
pt.x = (left + (width / 2));
break;
case "bottom":
pt.y = top;
pt.x = (left + (width / 2));
break;
case "left":
pt.x = right;
pt.y = (top + (height / 2));
break;
case "right":
pt.x = left;
pt.y = (top + (height / 2));
break;
};
return (pt);
}
}
}//package
Section 342
//Portal_PortalSprite (Portal_PortalSprite)
package {
import mx.core.*;
public class Portal_PortalSprite extends BitmapAsset {
}
}//package
Section 343
//PortalBall (PortalBall)
package {
import org.flixel.*;
public class PortalBall extends FlxSprite {
public var gibs:Class;
public var PBall:Class;
public var lifetime:Number;// = 1
public var PortalBreak:Class;
public var vel:FlxPoint;
public static var SPEED:int = 600;
public function PortalBall(X:Number, Y:Number){
gibs = PortalBall_gibs;
PortalBreak = PortalBall_PortalBreak;
PBall = PortalBall_PBall;
vel = new FlxPoint();
super(X, Y, PBall);
}
public function explode():void{
var emit:FlxEmitter = new FlxEmitter(x, y);
emit.createSprites(gibs, 5, 16, false, 0.5, 0);
emit.particleDrag = new FlxPoint(10, 10);
if (PlayState.getSide(y) < 1){
emit.gravity = 300;
} else {
emit.gravity = -300;
};
emit.setXSpeed(-60, 60);
emit.setYSpeed(-60, 60);
var playState:PlayState = PlayState(FlxG.state);
playState.objects.add(emit);
emit.start(true);
dead = true;
FlxG.play(PortalBreak, 0.3);
kill();
}
override public function hitBottom(Contact:FlxObject, Velocity:Number):void{
if ((Contact is FlxTilemap)){
explode();
};
super.hitBottom(Contact, Velocity);
}
override public function update():void{
super.update();
vel = velocity;
lifetime = (lifetime - FlxG.elapsed);
if (lifetime <= 0){
kill();
};
}
override public function hitSide(Contact:FlxObject, Velocity:Number):void{
if ((Contact is FlxTilemap)){
explode();
};
super.hitSide(Contact, Velocity);
}
override public function hitTop(Contact:FlxObject, Velocity:Number):void{
if ((Contact is FlxTilemap)){
explode();
};
super.hitTop(Contact, Velocity);
}
}
}//package
Section 344
//PortalBall_gibs (PortalBall_gibs)
package {
import mx.core.*;
public class PortalBall_gibs extends BitmapAsset {
}
}//package
Section 345
//PortalBall_PBall (PortalBall_PBall)
package {
import mx.core.*;
public class PortalBall_PBall extends BitmapAsset {
}
}//package
Section 346
//PortalBall_PortalBreak (PortalBall_PortalBreak)
package {
import mx.core.*;
public class PortalBall_PortalBreak extends SoundAsset {
}
}//package
Section 347
//PortalBlock (PortalBlock)
package {
import org.flixel.*;
public class PortalBlock extends FlxSprite {
public var flashing:Boolean;// = false
public var portals:FlxGroup;
public var flashColor:int;// = 240
public var SpriteS:Class;
public var baseColor:int;// = 200
public var b:int;// = 200
public var PortalSound:Class;
public var g:int;// = 200
public var tempDX:int;// = 0
public var tempDY:int;// = 0
public var colorDrop:Number;
public var flashTimer:Number;// = 1
public var PortalOpen:Class;
public var r:int;// = 200
public var flashTimerCap:Number;// = 1
public static var PORTAL_CLOSE_DELAY:Number = 0.3;
public function PortalBlock(X:Number, Y:Number){
SpriteS = PortalBlock_SpriteS;
PortalSound = PortalBlock_PortalSound;
PortalOpen = PortalBlock_PortalOpen;
super(X, Y, SpriteS);
fixed = true;
portals = new FlxGroup();
}
override public function update():void{
super.update();
}
override public function hitSide(Contact:FlxObject, Velocity:Number):void{
var ball:PortalBall;
var ang:Number;
var dx:Number;
var dir:int;
if ((Contact is PortalBall)){
ball = PortalBall(Contact);
ang = ball.angle;
dx = Math.cos(PlayState.toRadians(ang));
dir = (Math.abs(dx) / dx);
if (!createTunnel(dir, 0)){
ball.explode();
} else {
ball.kill();
};
};
super.hitSide(Contact, Velocity);
}
public function createTunnel(dx:int, dy:int):Boolean{
var block:PortalBlock;
var p1:Portal;
var p2:Portal;
if ((((((dx == 0)) && ((dy == 0)))) || (((!((dx == 0))) && (!((dy == 0))))))){
return (false);
};
var end:PortalBlock = findEnd(dx, dy);
if (end == null){
return (false);
};
var playState:PlayState = PlayState(FlxG.state);
playState.clearPortals();
var t1:Portal = getTestPortal(-(dx), -(dy));
for each (block in playState.portalBlocks.members) {
if (block.overlaps(t1)){
return (false);
};
};
p1 = addPortal(-(dx), -(dy));
p2 = end.addPortal(end.tempDX, end.tempDY);
p1.brother = p2;
p2.brother = p1;
FlxG.play(PortalOpen);
return (true);
}
public function getPortal(dir:String):Portal{
var portal:Portal;
for each (portal in portals.members) {
if (portal.direction == dir){
return (portal);
};
};
return (null);
}
override public function hitTop(Contact:FlxObject, Velocity:Number):void{
var ball:PortalBall;
if ((Contact is PortalBall)){
ball = PortalBall(Contact);
if (!createTunnel(0, 1)){
ball.explode();
} else {
ball.kill();
};
};
super.hitTop(Contact, Velocity);
}
public function getTestPortal(dx:int, dy:int):Portal{
var portal:Portal;
var dir:String = "";
if (dx == 1){
dir = "right";
} else {
if (dx == -1){
dir = "left";
} else {
if (dy == 1){
dir = "bottom";
} else {
if (dy == -1){
dir = "top";
};
};
};
};
portal = new Portal((x + (dx * 32)), (y + (dy * 32)), dir);
return (portal);
}
public function startBlink():void{
flicker(0.1);
}
override public function preCollide(Contact:FlxObject):void{
collideBottom = true;
collideTop = true;
collideLeft = true;
collideRight = true;
if ((Contact is Player)){
if (hasPortal("top")){
collideTop = false;
};
if (hasPortal("bottom")){
collideBottom = false;
};
if (hasPortal("left")){
collideLeft = false;
};
if (hasPortal("right")){
collideRight = false;
};
};
}
override public function hitBottom(Contact:FlxObject, Velocity:Number):void{
var ball:PortalBall;
if ((Contact is PortalBall)){
ball = PortalBall(Contact);
if (!createTunnel(0, -1)){
ball.explode();
} else {
ball.kill();
};
};
super.hitBottom(Contact, Velocity);
}
public function ejectPlayer(player:Player):void{
}
public function addPortal(dx:int, dy:int):Portal{
var portal:Portal;
var dir:String = "";
if (dx == 1){
dir = "right";
} else {
if (dx == -1){
dir = "left";
} else {
if (dy == 1){
dir = "bottom";
} else {
if (dy == -1){
dir = "top";
};
};
};
};
portal = new Portal((x + (dx * 32)), (y + (dy * 32)), dir);
portals.add(portal);
var playState:PlayState = PlayState(FlxG.state);
playState.portals.add(portal);
return (portal);
}
public function checkWarp(player:Player):void{
var playState:PlayState = PlayState(FlxG.state);
var px:Number = player.center.x;
var py:Number = player.center.y;
var velX:Number = player.velocity.x;
var velY:Number = player.velocity.y;
var dx:int = (Math.abs(velX) / velX);
var dy:int = (Math.abs(velY) / velY);
var ang:Number = FlxU.getAngle(((x + (width / 2)) - px), ((y + (height / 2)) - py));
var cos:Number = Math.cos(PlayState.toRadians(ang));
var sin:Number = Math.sin(PlayState.toRadians(ang));
if (Math.abs(cos) > Math.abs(sin)){
dy = 0;
};
if (Math.abs(cos) < Math.abs(sin)){
dx = 0;
};
var dir:String = "";
if (dx == 1){
dir = "left";
} else {
if (dx == -1){
dir = "right";
} else {
if (dy == 1){
dir = "top";
} else {
if (dy == -1){
dir = "bottom";
};
};
};
};
if (!hasPortal(dir)){
return;
};
var portal:Portal = getPortal(dir);
var trigger:Boolean;
switch (dir){
case "top":
trigger = (((player.bottom >= top)) && ((player.center.y < (top + (height / 2)))));
break;
case "bottom":
trigger = (((player.top < bottom)) && ((player.center.y > (top + (height / 2)))));
break;
case "left":
trigger = (((px > left)) && ((px < (left + (width / 2)))));
break;
case "right":
trigger = (((px < right)) && ((px > (left + (width / 2)))));
break;
};
if (!trigger){
return;
};
var outX:Number = px;
var outY:Number = py;
var out:FlxPoint = portal.brother.getOut();
outX = out.x;
outY = out.y;
player.x = (outX - (player.width / 2));
player.y = (outY - (player.height / 2));
switch (portal.direction){
case "top":
switch (portal.brother.direction){
case "right":
player.velocity.x = player.velocity.y;
player.velocity.y = 0;
break;
case "left":
player.velocity.x = -(player.velocity.y);
player.velocity.y = 0;
break;
};
break;
case "bottom":
switch (portal.brother.direction){
case "right":
player.velocity.x = -(player.velocity.y);
player.velocity.y = 0;
break;
case "left":
player.velocity.x = player.velocity.y;
player.velocity.y = 0;
break;
};
break;
};
if (((!((PlayState.getSide(portal.brother.y) == PlayState.getSide(portal.y)))) && ((((((PlayState.getSide(portal.brother.y) == 1)) && ((portal.brother.direction == "top")))) || ((((PlayState.getSide(portal.brother.y) == -1)) && ((portal.brother.direction == "bottom")))))))){
player.setSide(PlayState.getSide(player.y));
if (PlayState.getSide(player.y) < 0){
player.velocity.y = Math.max(Player.FLIP_Y_BOOST, (player.velocity.y - Player.FLIP_LOSS));
} else {
player.velocity.y = Math.min(-(Player.FLIP_Y_BOOST), (player.velocity.y + Player.FLIP_LOSS));
};
} else {
if (PlayState.getSide(portal.brother.y) != PlayState.getSide(portal.y)){
player.setSide(PlayState.getSide(player.y));
if (PlayState.getSide(player.y) > 0){
player.velocity.y = Math.max(Player.FLIP_Y_BOOST, (player.velocity.y - Player.FLIP_LOSS));
} else {
player.velocity.y = Math.min(-(Player.FLIP_Y_BOOST), (player.velocity.y + Player.FLIP_LOSS));
};
} else {
if ((((((PlayState.getSide(portal.brother.y) == 1)) && ((portal.brother.direction == "bottom")))) || ((((PlayState.getSide(portal.brother.y) == -1)) && ((portal.brother.direction == "top")))))){
if (PlayState.getSide(player.y) > 0){
player.velocity.y = Math.max(Math.max(player.velocity.y, -(player.velocity.y)), Player.Y_BOOST);
} else {
player.velocity.y = Math.min(Math.min(player.velocity.y, -(player.velocity.y)), -(Player.Y_BOOST));
};
};
};
};
playState.clearPortals(PORTAL_CLOSE_DELAY);
FlxG.play(PortalSound, 0.6);
}
public function findEnd(dx:int, dy:int):PortalBlock{
var block:PortalBlock;
var test:FlxPoint;
var playState:PlayState = PlayState(FlxG.state);
var blocks:FlxGroup = PlayState(FlxG.state).portalBlocks;
startBlink();
for each (block in blocks.members) {
if ((((block.x == (x + (32 * dx)))) && ((block.y == (y + (32 * dy)))))){
return (block.findEnd(dx, dy));
};
};
test = new FlxPoint(((x + (width / 2)) + (36 * dx)), ((y + (height / 2)) + (36 * dy)));
tempDX = dx;
tempDY = dy;
if (playState.solidTerrain.overlapsPoint(test.x, test.y)){
return (null);
};
return (this);
}
public function hasPortal(dir:String):Boolean{
var portal:Portal;
for each (portal in portals.members) {
if (portal.direction == dir){
return (true);
};
};
return (false);
}
}
}//package
Section 348
//PortalBlock_PortalOpen (PortalBlock_PortalOpen)
package {
import mx.core.*;
public class PortalBlock_PortalOpen extends SoundAsset {
}
}//package
Section 349
//PortalBlock_PortalSound (PortalBlock_PortalSound)
package {
import mx.core.*;
public class PortalBlock_PortalSound extends SoundAsset {
}
}//package
Section 350
//PortalBlock_SpriteS (PortalBlock_SpriteS)
package {
import mx.core.*;
public class PortalBlock_SpriteS extends BitmapAsset {
}
}//package
Section 351
//PortalGun (PortalGun)
package {
import org.flixel.*;
public class PortalGun extends FlxSprite {
public var Sprite:Class;
public function PortalGun(X:Number, Y:Number){
Sprite = PortalGun_Sprite;
super(X, Y, Sprite);
}
}
}//package
Section 352
//PortalGun_Sprite (PortalGun_Sprite)
package {
import mx.core.*;
public class PortalGun_Sprite extends BitmapAsset {
}
}//package
Section 353
//Preloader (Preloader)
package {
import com.newgrounds.components.*;
public class Preloader extends FlxNGPreloader {
public function Preloader(){
super();
className = "Main";
NewgroundsAPIId = "18398:PNXiOY0F";
NewgroundsAPIEncryptionKey = "PdiHtAjqXGJ2RaPfbbs01Q7Pm22iUq5h";
NewgroundsAPIShowAds = true;
createMedalPopup(10, 20);
}
}
}//package
Section 354
//Screen (Screen)
package {
import org.flixel.*;
public class Screen extends FlxGroup {
public var playerNear:Boolean;// = false
public var name:String;
public var screen:FlxSprite;
public var text:FlxText;
public var ScreenSprite:Class;
public var triggerDist:int;// = 200
public function Screen(X:Number, Y:Number){
ScreenSprite = Screen_ScreenSprite;
super();
x = X;
y = Y;
screen = new FlxSprite(0, 0, ScreenSprite);
text = new FlxText(15, 15, (screen.width - 30));
text.size = 8;
width = screen.width;
height = screen.height;
add(screen, true);
add(text, true);
text.visible = false;
}
public function getText(name:String):String{
var output:String = "";
switch (name){
case "move":
output = (output + "welcome to your cell!\n\n");
output = (output + "use A and D to move\n");
output = (output + "W to jump.\n");
output = (output + "you can also use the arrow keys");
break;
case "escape":
output = (output + "trying to escape, are you?\n\n");
output = (output + "you're not going to get very far on your own");
triggerDist = 150;
break;
case "takeThis":
output = (output + "it's not safe up ahead...\n\n");
output = (output + "you're going to want a p.i.g");
break;
case "PIG":
output = (output + "P ortal\n");
output = (output + "I nducing\n");
output = (output + "G un\n\n");
output = (output + "aim with the mouse, click to shoot\n");
output = (output + "you'll figure it out");
break;
case "arrows":
output = (output + "what a challenge!\n");
output = (output + "i'm so proud of you\n\n");
output = (output + "now for something a little trickier...\n");
break;
case "end":
output = (output + "well, i guess that's the end...\n\n");
output = (output + "great job!\n");
output = (output + "hope you had fun!\n");
break;
case "oops":
output = (output + "oh, i was wrong...\n\n");
output = (output + "looks like it keeps going\n");
output = (output + "are you up for it?");
break;
case "controls":
output = (output + "press R to restart a level if you get stuck\n\n");
output = (output + "press Q to return to the main menu");
break;
case "might":
output = (output + "you're not doing so badly after all.\n\n");
output = (output + "you just might make it, yet.");
break;
case "avoid":
output = (output + "you really, really, really, really\n");
output = (output + "want to avoid this arrow.\n\n");
output = (output + "i mean it.");
break;
case "maze":
output = (output + "nothing like a fistful of arrows, eh?\n\n");
output = (output + "would you hurry up already?\n");
break;
case "house":
output = (output + "this house is tricky\n");
output = (output + "but do not be alarmed!\n");
output = (output + "i'm pretty sure there might be a solution.");
output = (output + "\n\nmaybe.");
break;
case "out":
output = (output + "HINT: you have to jump and portal.\n\n");
output = (output + "oh, i'm a little late, aren't i?\n");
output = (output + "sorry about that\n");
break;
case "high":
output = (output + "are you ready to get high\n\n");
output = (output + "...in the air to solve this puzzle?\n");
break;
case "tougher":
output = (output + "the next one is a bit tougher.\n\n");
output = (output + "make sure you've got a quick trigger finger!\n");
break;
case "align":
output = (output + "HINT: if you're having trouble falling into portals, ");
output = (output + "stop fidgeting while you fall and i think things ");
output = (output + "will align up naturally.\n");
break;
case "next":
output = (output + "wow, you made it!\n\n");
output = (output + "wow, ok\n");
output = (output + "onwards and forwards!\n");
break;
case "boost":
output = (output + "ah, the old one-two.\n\n");
output = (output + "good times, good times...\n");
break;
case "loop":
output = (output + "stuck? stop thinking in loops.\n");
output = (output + "\nscratch that-\n");
output = (output + "START thinking in loops\n");
break;
case "bounce":
output = (output + "you ready to BOUNCE?!\n\n");
output = (output + "i love this part\n");
output = (output + "BOING BOING BOING\n");
break;
case "gettingThere":
output = (output + "you made it!\n");
output = (output + "we're getting there!\n");
output = (output + "well, YOU'RE getting there...\n\n");
output = (output + "I'M already here");
break;
case "need":
output = (output + "it's dangerous to go alone!\n\n");
output = (output + "take this PIG");
break;
case "precious":
output = (output + "don't leave him behind!\n\n");
output = (output + "him just wants to play!");
break;
case "useful":
output = (output + "pigs can be very useful\n\n");
output = (output + "i TOLD you you'd need him!");
break;
case "almost":
output = (output + "you know, you two make a great team.\n\n");
output = (output + "you're not so different from each other, i think");
break;
case "oliver!":
output = (output + "you brought oliver!\n\n");
output = (output + "i've missed him so much!\n\n");
output = (output + "*oink* *oink* *oink*");
break;
case "thankyou":
output = (output + "thankyouthankyou\n");
output = (output + "thankyouthankyou\n");
output = (output + "thankyouthankyou\n");
output = (output + "thankyouthankyou\n");
output = (output + "thankyouthankyou\n");
break;
case "fun?":
output = (output + "hope you had fun!\n\n");
output = (output + "it's dangerous to go alone!\n\n");
output = (output + "can we come, too?");
break;
case "tower":
output = (output + "ascend the bigravital tower!\n\n\n");
output = (output + "or is it descend?");
break;
case "box":
output = (output + "break into pandora's box!\n\n");
output = (output + "i think that's a really good idea.");
break;
case "glass":
output = (output + "i don't think i have to tell you how glass works\n\n");
break;
case "wiper":
output = (output + "i call this one 'the window wiper'\n\n");
output = (output + "...though i'm not really sure why. they aren't really windows.");
break;
case "there":
output = (output + "\n\n\n almost there!");
break;
case "typing":
output = (output + "now there's two pigs!\n\n");
output = (output + "...but then who's typing?");
break;
case "multiple":
output = (output + "sometimes, there's more than one way");
output = (output + " to solve a puzzle");
break;
case "thanks":
output = (output + "thanks for playing!\n\n");
output = (output + "<3 zillix");
break;
};
return (output);
}
override public function update():void{
var playState:PlayState = PlayState(FlxG.state);
var player:Player = PlayState.player;
if ((((player == null)) || ((player.center == null)))){
super.update();
return;
};
var dist:Number = PlayState.getDistance((x + (width / 2)), (y + (height / 2)), player.center.x, player.center.y);
if (dist < triggerDist){
if (!playerNear){
text.visible = true;
text.flicker(0.3);
};
playerNear = true;
} else {
playerNear = false;
text.visible = false;
};
super.update();
}
public function setName(n:String):void{
name = n;
var str:String = getText(name);
text.text = str;
}
}
}//package
Section 355
//Screen_ScreenSprite (Screen_ScreenSprite)
package {
import mx.core.*;
public class Screen_ScreenSprite extends BitmapAsset {
}
}//package
Section 356
//SelectState (SelectState)
package {
import org.flixel.*;
import flash.utils.*;
import flash.ui.*;
public class SelectState extends FlxState {
public var BlackWhiteAuto:Class;
public var Collect:Class;
public var BlackTile:Class;
public var SpriteS:Class;
public var Chamber0:Class;
public var playState:PlayState;
public var backTiles:FlxTilemap;
public function SelectState():void{
var spr5:FlxSprite;
var but:LevelSelectButton;
var spr:FlxSprite;
var spr2:FlxSprite;
var txt:FlxText;
Collect = SelectState_Collect;
Chamber0 = SelectState_Chamber0;
BlackWhiteAuto = SelectState_BlackWhiteAuto;
SpriteS = SelectState_SpriteS;
BlackTile = SelectState_BlackTile;
super();
PlayState.saveData.bind("data");
var completed:int = (PlayState.saveData.read("levelCompleted") as int);
trace(completed);
bgColor = 4278190080;
var file:ByteArray = ByteArray(new Chamber0());
file.position = 0;
var str:String = file.readUTFBytes(file.length);
var mapXML:XML = new XML(str);
backTiles = new FlxTilemap();
backTiles.auto = FlxTilemap.BW;
backTiles.loadMap(mapXML.layer[0], BlackWhiteAuto, 32, 32);
backTiles.y = (-8 * 32);
add(backTiles);
var title:FlxText = new FlxText(0, 0, FlxG.width, "story chambers");
title.setFormat(null, 24, 4278190080, "center");
add(title);
title = new FlxText(0, 295, FlxG.width, "bonus chambers");
title.setFormat(null, 24, 4294967295, "center");
add(title);
playState = new PlayState();
playState.createMaps();
var back:FlxButton = new FlxButton(30, 30, toMenu);
var spr3:FlxSprite = new FlxSprite(0, 0);
spr3.loadGraphic(BlackTile);
spr3.origin = new FlxPoint(0, 0);
spr3.scale = new FlxPoint(2, 2);
var spr4:FlxSprite = new FlxSprite(0, 0);
spr4.loadGraphic(BlackTile);
spr4.origin = new FlxPoint(0, 0);
spr4.scale = new FlxPoint(2, 2);
spr4.alpha = 0.7;
back.loadGraphic(spr3, spr4);
back.width = (back.width * 2);
back.height = (back.height * 2);
var txt2:FlxText = new FlxText(0, 20, back.width, "back");
txt2.setFormat(null, 12, 0xFFFFFF, "center");
back.loadText(txt2);
add(back);
var k:int;
while (k < 20) {
spr5 = new FlxSprite((k * 32), (8 * 32));
spr5.loadGraphic(BlackTile, true, false, 32, 32);
add(spr5);
k++;
};
var i:int;
while (i < 10) {
but = new LevelSelectButton(30, 30, startGame, i);
spr = new FlxSprite(0, 0);
spr2 = new FlxSprite(0, 0);
if (completed < i){
spr.loadGraphic(BlackTile);
spr2.loadGraphic(BlackTile);
but.disabled = true;
} else {
spr.loadGraphic(SpriteS);
spr2.loadGraphic(SpriteS);
};
spr.origin = new FlxPoint(0, 0);
spr.scale = new FlxPoint(2, 2);
spr2.origin = new FlxPoint(0, 0);
spr2.scale = new FlxPoint(2, 2);
spr2.alpha = 0.7;
but.loadGraphic(spr, spr2);
but.width = (but.width * 2);
but.height = (but.height * 2);
txt = new FlxText(0, 20, but.width, playState.maps[i].name);
if (completed < i){
txt.text = "[locked]";
};
txt.setFormat(null, 12, 0xFFFFFF, "center");
but.loadText(txt);
if (i < 7){
but.x = (150 + (100 * (i % 4)));
but.y = (80 + (Math.floor((i / 4)) * 70));
} else {
but.x = (150 + (100 * ((i - 7) % 4)));
but.y = (340 + (Math.floor(((i - 7) / 4)) * 70));
};
add(but);
i++;
};
}
public function toMenu():void{
FlxG.state = new MenuState();
}
override public function create():void{
Mouse.show();
super.create();
}
public function startGame(param:int=0):void{
FlxG.state = new PlayState(param);
PlayState.playingStory = false;
if (param == 0){
PlayState.playingStory = true;
PlayState.totalTime = 0;
};
}
}
}//package
Section 357
//SelectState_BlackTile (SelectState_BlackTile)
package {
import mx.core.*;
public class SelectState_BlackTile extends BitmapAsset {
}
}//package
Section 358
//SelectState_BlackWhiteAuto (SelectState_BlackWhiteAuto)
package {
import mx.core.*;
public class SelectState_BlackWhiteAuto extends BitmapAsset {
}
}//package
Section 359
//SelectState_Chamber0 (SelectState_Chamber0)
package {
import mx.core.*;
public class SelectState_Chamber0 extends ByteArrayAsset {
}
}//package
Section 360
//SelectState_Collect (SelectState_Collect)
package {
import mx.core.*;
public class SelectState_Collect extends SoundAsset {
}
}//package
Section 361
//SelectState_SpriteS (SelectState_SpriteS)
package {
import mx.core.*;
public class SelectState_SpriteS extends BitmapAsset {
}
}//package