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;
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int;
_local9 = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function hash(_arg1:String):String{
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
private static function createBlocks(_arg1:ByteArray):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = new Array();
_local3 = (_arg1.length * 8);
_local4 = 0xFF;
_local5 = 0;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
public static function hashBinary(_arg1:ByteArray):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
_local2 = 1732584193;
_local3 = -271733879;
_local4 = -1732584194;
_local5 = 271733878;
_local10 = createBlocks(_arg1);
_local11 = _local10.length;
_local12 = 0;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
digest = new ByteArray();
digest.writeInt(_local2);
digest.writeInt(_local3);
digest.writeInt(_local4);
digest.writeInt(_local5);
digest.position = 0;
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function hashBytes(_arg1:ByteArray):String{
return (hashBinary(_arg1));
}
}
}//package com.adobe.crypto
Section 2
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
var _local4:int;
var _local5:int;
_local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int;
_local3 = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package com.adobe.utils
Section 3
//CDK (com.coreyoneil.collision.CDK)
package com.coreyoneil.collision {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
import flash.errors.*;
public class CDK {
private var colorTransform1:ColorTransform;
private var colorTransform2:ColorTransform;
private var _returnAngleType:String;
private var pixels1:ByteArray;
private var pixels2:ByteArray;
private var bmdResample:BitmapData;
private var _returnAngle:Boolean;
private var transMatrix2:Matrix;
private var rect1:Rectangle;
private var rect2:Rectangle;
private var transMatrix1:Matrix;
protected var objectCheckArray:Array;
private var _alphaThreshold:Number;
private var item1Registration:Point;
private var bmd1:BitmapData;
private var bmd2:BitmapData;
protected var objectArray:Array;
private var item2Registration:Point;
protected var objectCollisionArray:Array;
private var _numChildren:uint;
private var colorExclusionArray:Array;
public function CDK():void{
if (getQualifiedClassName(this) == "com.coreyoneil.collision::CDK"){
throw (new Error("CDK is an abstract class and is not meant for instantiation - use CollisionGroup or CollisionList"));
};
init();
}
public function get returnAngle():Boolean{
return (_returnAngle);
}
public function set returnAngle(_arg1:Boolean):void{
_returnAngle = _arg1;
}
private function init():void{
objectCheckArray = [];
objectCollisionArray = [];
objectArray = [];
colorExclusionArray = [];
_alphaThreshold = 0;
_returnAngle = true;
_returnAngleType = "RADIANS";
}
protected function findCollisions(_arg1, _arg2):void{
var item1_isText:Boolean;
var item2_isText:Boolean;
var item1xDiff:Number;
var item1yDiff:Number;
var currentObj:*;
var k:uint;
var value1:uint;
var value2:uint;
var collisionPoint:Number;
var overlap:Boolean;
var overlapping:Array;
var locY:Number;
var locX:Number;
var locStage:Point;
var hasColors:int;
var pixelLength:int;
var alpha1:uint;
var alpha2:uint;
var colorFlag:Boolean;
var red1:uint;
var red2:uint;
var green1:uint;
var green2:uint;
var blue1:uint;
var blue2:uint;
var colorObj:Object;
var aPlus:uint;
var aMinus:uint;
var rPlus:uint;
var rMinus:uint;
var gPlus:uint;
var gMinus:uint;
var bPlus:uint;
var bMinus:uint;
var item1Flags:uint;
var item2Flags:uint;
var n:uint;
var angle:Number;
var recordedCollision:Object;
var item1 = _arg1;
var item2 = _arg2;
item1_isText = false;
item2_isText = false;
if ((item1 is TextField)){
item1_isText = ((item1.antiAliasType)=="advanced") ? true : false;
item1.antiAliasType = ((item1.antiAliasType)=="advanced") ? "normal" : item1.antiAliasType;
};
if ((item2 is TextField)){
item2_isText = ((item2.antiAliasType)=="advanced") ? true : false;
item2.antiAliasType = ((item2.antiAliasType)=="advanced") ? "normal" : item2.antiAliasType;
};
colorTransform1 = item1.transform.colorTransform;
colorTransform2 = item2.transform.colorTransform;
item1Registration = new Point();
item2Registration = new Point();
item1Registration = item1.localToGlobal(item1Registration);
item2Registration = item2.localToGlobal(item2Registration);
bmd1 = new BitmapData(item1.width, item1.height, true, 0xFFFFFF);
bmd2 = new BitmapData(item1.width, item1.height, true, 0xFFFFFF);
transMatrix1 = item1.transform.matrix;
currentObj = item1;
while (currentObj.parent != null) {
transMatrix1.concat(currentObj.parent.transform.matrix);
currentObj = currentObj.parent;
};
rect1 = item1.getBounds(currentObj);
if (item1 != currentObj){
rect1.x = (rect1.x + currentObj.x);
rect1.y = (rect1.y + currentObj.y);
};
var _local4 = (item1Registration.x - rect1.left);
item1xDiff = _local4;
transMatrix1.tx = _local4;
_local4 = (item1Registration.y - rect1.top);
item1yDiff = _local4;
transMatrix1.ty = _local4;
transMatrix2 = item2.transform.matrix;
currentObj = item2;
while (currentObj.parent != null) {
transMatrix2.concat(currentObj.parent.transform.matrix);
currentObj = currentObj.parent;
};
transMatrix2.tx = (item2Registration.x - rect1.left);
transMatrix2.ty = (item2Registration.y - rect1.top);
bmd1.draw(item1, transMatrix1, colorTransform1, null, null, true);
bmd2.draw(item2, transMatrix2, colorTransform2, null, null, true);
pixels1 = bmd1.getPixels(new Rectangle(0, 0, bmd1.width, bmd1.height));
pixels2 = bmd2.getPixels(new Rectangle(0, 0, bmd1.width, bmd1.height));
k = 0;
value1 = 0;
value2 = 0;
collisionPoint = -1;
overlap = false;
overlapping = [];
hasColors = colorExclusionArray.length;
pixels1.position = 0;
pixels2.position = 0;
pixelLength = pixels1.length;
while (k < pixelLength) {
k = pixels1.position;
try {
value1 = pixels1.readUnsignedInt();
value2 = pixels2.readUnsignedInt();
} catch(e:EOFError) {
break;
};
alpha1 = ((value1 >> 24) & 0xFF);
alpha2 = ((value2 >> 24) & 0xFF);
if ((((alpha1 > _alphaThreshold)) && ((alpha2 > _alphaThreshold)))){
colorFlag = false;
if (hasColors){
red1 = ((value1 >> 16) & 0xFF);
red2 = ((value2 >> 16) & 0xFF);
green1 = ((value1 >> 8) & 0xFF);
green2 = ((value2 >> 8) & 0xFF);
blue1 = (value1 & 0xFF);
blue2 = (value2 & 0xFF);
n = 0;
while (n < hasColors) {
colorObj = Object(colorExclusionArray[n]);
item1Flags = 0;
item2Flags = 0;
if ((((blue1 >= colorObj.bMinus)) && ((blue1 <= colorObj.bPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((blue2 >= colorObj.bMinus)) && ((blue2 <= colorObj.bPlus)))){
item2Flags = (item2Flags + 1);
};
if ((((green1 >= colorObj.gMinus)) && ((green1 <= colorObj.gPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((green2 >= colorObj.gMinus)) && ((green2 <= colorObj.gPlus)))){
item2Flags = (item2Flags + 1);
};
if ((((red1 >= colorObj.rMinus)) && ((red1 <= colorObj.rPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((red2 >= colorObj.rMinus)) && ((red2 <= colorObj.rPlus)))){
item2Flags = (item2Flags + 1);
};
if ((((alpha1 >= colorObj.aMinus)) && ((alpha1 <= colorObj.aPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((alpha2 >= colorObj.aMinus)) && ((alpha2 <= colorObj.aPlus)))){
item2Flags = (item2Flags + 1);
};
if ((((item1Flags == 4)) || ((item2Flags == 4)))){
colorFlag = true;
};
n = (n + 1);
};
};
if (!colorFlag){
overlap = true;
collisionPoint = (k >> 2);
locY = (collisionPoint / bmd1.width);
locX = (collisionPoint % bmd1.width);
locY = (locY - item1yDiff);
locX = (locX - item1xDiff);
locStage = item1.localToGlobal(new Point(locX, locY));
overlapping.push(locStage);
};
};
};
if (overlap){
angle = (_returnAngle) ? findAngle(item1, item2) : 0;
recordedCollision = {object1:item1, object2:item2, angle:angle, overlapping:overlapping};
objectCollisionArray.push(recordedCollision);
};
if (item1_isText){
item1.antiAliasType = "advanced";
};
if (item2_isText){
item2.antiAliasType = "advanced";
};
_local4 = false;
item2_isText = _local4;
item1_isText = _local4;
}
public function dispose():void{
objectArray = [];
}
public function excludeColor(_arg1:uint, _arg2:uint=0xFF, _arg3:uint=20, _arg4:uint=20, _arg5:uint=20):void{
var _local6:int;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:Object;
_local6 = colorExclusionArray.length;
_local7 = 0;
while (_local7 < _local6) {
if (colorExclusionArray[_local7].color == _arg1){
throw (new Error((("Color could not be added - color already in the exclusion list [" + _arg1) + "]")));
};
_local7++;
};
_local8 = (((_arg1 >> 24) & 0xFF) + _arg2);
_local9 = (_local8 - (_arg2 << 1));
_local10 = (((_arg1 >> 16) & 0xFF) + _arg3);
_local11 = (_local10 - (_arg3 << 1));
_local12 = (((_arg1 >> 8) & 0xFF) + _arg4);
_local13 = (_local12 - (_arg4 << 1));
_local14 = ((_arg1 & 0xFF) + _arg5);
_local15 = (_local14 - (_arg5 << 1));
_local16 = {color:_arg1, aPlus:_local8, aMinus:_local9, rPlus:_local10, rMinus:_local11, gPlus:_local12, gMinus:_local13, bPlus:_local14, bMinus:_local15};
colorExclusionArray.push(_local16);
}
public function get numChildren():uint{
return (objectArray.length);
}
public function get alphaThreshold():Number{
return (_alphaThreshold);
}
public function removeItem(_arg1):void{
var _local2:int;
_local2 = objectArray.indexOf(_arg1);
if (_local2 > -1){
objectArray.splice(_local2, 1);
} else {
throw (new Error((_arg1 + " could not be removed - object not found in item list.")));
};
}
public function set returnAngleType(_arg1:String):void{
_arg1 = _arg1.toUpperCase();
switch (_arg1){
case "DEGREES":
case "DEGREE":
case "DEG":
case "DEGS":
_returnAngleType = "DEGREES";
break;
case "RADIANS":
case "RADIAN":
case "RAD":
case "RADS":
_returnAngleType = "RADIANS";
break;
default:
throw (new Error("returnAngleType expects 'DEGREES' or 'RADIANS'"));
};
}
private function findAngle(_arg1:DisplayObject, _arg2:DisplayObject):Number{
var center:Point;
var pixels:ByteArray;
var columnHeight:uint;
var rowWidth:uint;
var pixel:uint;
var thisAlpha:uint;
var lastAlpha:int;
var edgeArray:Array;
var hasColors:int;
var j:uint;
var edgePoint:int;
var numEdges:int;
var slopeYAvg:Number;
var slopeXAvg:Number;
var average:Number;
var k:uint;
var upperLimit:int;
var colorFlag:Boolean;
var red1:uint;
var green1:uint;
var blue1:uint;
var colorObj:Object;
var a:uint;
var r:uint;
var g:uint;
var b:uint;
var item1Flags:uint;
var n:uint;
var item1 = _arg1;
var item2 = _arg2;
center = new Point((item1.width >> 1), (item1.height >> 1));
pixels = pixels2;
transMatrix2.tx = (transMatrix2.tx + center.x);
transMatrix2.ty = (transMatrix2.ty + center.y);
bmdResample = new BitmapData((item1.width << 1), (item1.height << 1), true, 0xFFFFFF);
bmdResample.draw(item2, transMatrix2, colorTransform2, null, null, true);
pixels = bmdResample.getPixels(new Rectangle(0, 0, bmdResample.width, bmdResample.height));
center.x = (bmdResample.width >> 1);
center.y = (bmdResample.height >> 1);
columnHeight = Math.round(bmdResample.height);
rowWidth = Math.round(bmdResample.width);
edgeArray = [];
hasColors = colorExclusionArray.length;
j = 0;
while (j < columnHeight) {
k = ((j * rowWidth) << 2);
pixels.position = k;
lastAlpha = -1;
upperLimit = (((j + 1) * rowWidth) << 2);
while (k < upperLimit) {
k = pixels.position;
try {
pixel = pixels.readUnsignedInt();
} catch(e:EOFError) {
break;
};
thisAlpha = ((pixel >> 24) & 0xFF);
if (lastAlpha == -1){
lastAlpha = thisAlpha;
} else {
if (thisAlpha > _alphaThreshold){
colorFlag = false;
if (hasColors){
red1 = ((pixel >> 16) & 0xFF);
green1 = ((pixel >> 8) & 0xFF);
blue1 = (pixel & 0xFF);
n = 0;
while (n < hasColors) {
colorObj = Object(colorExclusionArray[n]);
item1Flags = 0;
if ((((blue1 >= colorObj.bMinus)) && ((blue1 <= colorObj.bPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((green1 >= colorObj.gMinus)) && ((green1 <= colorObj.gPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((red1 >= colorObj.rMinus)) && ((red1 <= colorObj.rPlus)))){
item1Flags = (item1Flags + 1);
};
if ((((thisAlpha >= colorObj.aMinus)) && ((thisAlpha <= colorObj.aPlus)))){
item1Flags = (item1Flags + 1);
};
if (item1Flags == 4){
colorFlag = true;
};
n = (n + 1);
};
};
if (!colorFlag){
edgeArray.push((k >> 2));
};
};
};
};
j = (j + 1);
};
numEdges = edgeArray.length;
slopeYAvg = 0;
slopeXAvg = 0;
j = 0;
while (j < numEdges) {
edgePoint = int(edgeArray[j]);
slopeYAvg = (slopeYAvg + (center.y - (edgePoint / rowWidth)));
slopeXAvg = (slopeXAvg + ((edgePoint % rowWidth) - center.x));
j = (j + 1);
};
average = -(Math.atan2(slopeYAvg, slopeXAvg));
average = ((_returnAngleType == "RADIANS")) ? average : (average * 57.2957795);
return (average);
}
public function addItem(_arg1):void{
if ((_arg1 is DisplayObject)){
objectArray.push(_arg1);
} else {
throw (new Error((("Cannot add item: " + _arg1) + " - item must be a Display Object.")));
};
}
public function get returnAngleType():String{
return (_returnAngleType);
}
public function set alphaThreshold(_arg1:Number):void{
if ((((_arg1 <= 1)) && ((_arg1 >= 0)))){
_alphaThreshold = (_arg1 * 0xFF);
} else {
throw (new Error("alphaThreshold expects a value from 0 to 1"));
};
}
public function removeExcludeColor(_arg1:uint):void{
var _local2:Boolean;
var _local3:int;
var _local4:uint;
_local2 = false;
_local3 = colorExclusionArray.length;
_local4 = 0;
while (_local4 < _local3) {
if (colorExclusionArray[_local4].color == _arg1){
colorExclusionArray.splice(_local4, 1);
_local2 = true;
break;
};
_local4++;
};
if (!_local2){
throw (new Error((("Color could not be removed - color not found in exclusion list [" + _arg1) + "]")));
};
}
protected function clearArrays():void{
objectCheckArray = [];
objectCollisionArray = [];
}
}
}//package com.coreyoneil.collision
Section 4
//CollisionList (com.coreyoneil.collision.CollisionList)
package com.coreyoneil.collision {
import flash.display.*;
public class CollisionList extends CDK {
public function CollisionList(_arg1, ... _args):void{
var _local3:uint;
super();
addItem(_arg1);
_local3 = 0;
while (_local3 < _args.length) {
addItem(_args[_local3]);
_local3++;
};
}
public function swapTarget(_arg1):void{
if ((_arg1 is DisplayObject)){
objectArray[0] = _arg1;
} else {
throw (new Error((("Cannot swap target: " + _arg1) + " - item must be a Display Object.")));
};
}
public function checkCollisions():Array{
var _local1:uint;
var _local2:*;
var _local3:DisplayObject;
var _local4:uint;
clearArrays();
_local1 = objectArray.length;
_local2 = DisplayObject(objectArray[0]);
_local4 = 1;
while (_local4 < _local1) {
_local3 = DisplayObject(objectArray[_local4]);
if (_local2.hitTestObject(_local3)){
if ((_local3.width * _local3.height) > (_local2.width * _local2.height)){
objectCheckArray.push([_local2, _local3]);
} else {
objectCheckArray.push([_local3, _local2]);
};
};
_local4++;
};
_local1 = objectCheckArray.length;
_local4 = 0;
while (_local4 < _local1) {
findCollisions(DisplayObject(objectCheckArray[_local4][0]), DisplayObject(objectCheckArray[_local4][1]));
_local4++;
};
return (objectCollisionArray);
}
override public function removeItem(_arg1):void{
var _local2:int;
_local2 = objectArray.indexOf(_arg1);
if (_local2 > 0){
objectArray.splice(_local2, 1);
} else {
if (_local2 == 0){
throw (new Error("You cannot remove the target from CollisionList. Use swapTarget to change the target."));
};
throw (new Error((_arg1 + " could not be removed - object not found in item list.")));
};
}
}
}//package com.coreyoneil.collision
Section 5
//Tracker (com.memecounter.Tracker)
package com.memecounter {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class Tracker {
public static const ORI_DOM:String = "ori_dom";
public static const LOCALHOST:String = "localhost";
public static const LOCAL:String = "Local";
public static const TRACKER_PATH:String = "/node/tracking/trackerAS3.swf";
private static var ori_dom:String;
private static var lurl:String;
private static var _isReady:Boolean = false;
public static var a:uint = 0;
public static var root:DisplayObject;
public static var c:uint;
public static var d:String = "";
private static var _isInited:Boolean = false;
public static var mcEvent:Function;
public static var fpv:String = "";
private static var l:Loader;
private static var tracker:MovieClip;
public static var da:Array = ["distralytics.com", "distralytics.co.uk"];
private static function loadError(_arg1:Event):void{
a++;
lc();
}
public static function init(_arg1:uint, _arg2:DisplayObject):void{
var _local3:uint;
if (!_isInited){
_isInited = true;
c = _arg1;
root = _arg2;
_local3 = 0;
while (_local3 < da.length) {
Security.allowDomain(("*" + da[_local3]));
Security.allowDomain(da[_local3]);
Security.allowDomain(((c + ".c.") + da[_local3]));
Security.allowDomain(("*." + da[_local3]));
_local3++;
};
ori_dom = (root.loaderInfo.parameters.hasOwnProperty(ORI_DOM)) ? root.loaderInfo.parameters[ORI_DOM] : "";
d = ((ori_dom)!="") ? ori_dom : ((new LocalConnection().domain.indexOf(LOCALHOST))==-1) ? new LocalConnection().domain : LOCAL;
fpv = Capabilities.version.split(" ")[1].split(",")[0];
lurl = (((((((((TRACKER_PATH + "?c=") + c) + "&r=") + Math.floor((Math.random() * 10000000000))) + "&d=") + d) + "&p=") + fpv) + "&as=3");
l = new Loader();
l.contentLoaderInfo.addEventListener(Event.INIT, loadComplete);
l.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
lc();
mcEvent = kvEvent;
};
}
public static function kvClick(_arg1:uint):void{
if (_isReady){
tracker.kvClick(_arg1);
};
}
public static function get isReady():Boolean{
return (_isReady);
}
public static function mcClick(_arg1:String, _arg2:String=null):void{
if (_isReady){
tracker.mcClick(_arg1, _arg2);
};
}
public static function kvEvent(_arg1):void{
if (_isReady){
tracker.kvEvent(_arg1);
};
}
public static function kvCountry():String{
if (_isReady){
return (tracker.kvCountry());
};
return ("");
}
private static function lc():void{
var _local1:String;
var _local2:String;
_local2 = da[(a % da.length)];
if (_local2.charAt(0) === "."){
_local1 = (("http://" + _local2.substr(1, (_local2.length - 1))) + lurl);
} else {
_local1 = (((("http://" + c) + ".c.") + _local2) + lurl);
};
Security.allowDomain(_local1);
l.load(new URLRequest(_local1));
}
private static function loadComplete(_arg1:Event):void{
var e = _arg1;
try {
tracker = e.target.content;
tracker.init(getDefinitionByName("com.memecounter.Tracker"), root);
_isReady = true;
} catch(e:Error) {
trace("Memecounter error: unable to access tracker object due to security sandbox.");
};
}
}
}//package com.memecounter
Section 6
//__game_mc_395 (damtotheham_fla.__game_mc_395)
package damtotheham_fla {
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import gs.easing.*;
import com.coreyoneil.collision.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class __game_mc_395 extends MovieClip {
public var objCurrDest:MovieClip;
public var arrCenter:Array;
public var arrPorts;
public var arrPeople:Array;
public var objGoalPort:MovieClip;
public var intBoatAccel:Number;
public var objPlaneGauge:MovieClip;
public var objBubble:MovieClip;
public var objWater:MovieClip;
public var intCarriedPeople:uint;
public var arrSeatPos:Array;
public var objGoalDest:MovieClip;
public var isLevelOver:Boolean;
public var objRoot;
public var objHUD:MovieClip;
public var objTimer:Timer;
public var intBoatSpeedMax:Number;
public var objGoalPerson:MovieClip;
public var arrCurrPeople:Array;
public var strCurrQueue:String;
public var objCurrQueue:MovieClip;
public var intSecs;
public var intLevel:uint;
public var objBoat:MovieClip;
public var intAwardMax:int;
public var objMap:MovieClip;
public var arrPlanePeople:Array;
public var isEngineStarted:Boolean;
public var arrGoalPersonLoc:Array;
public var isBoatAnimating:Boolean;
public var intPeopleLimit:int;
public var intMins;
public var isPlaneFull:Boolean;
public var intPort:uint;
public var isReversed:Boolean;
public var objHit:MovieClip;
public var intItems:uint;
public var strCurrPort:String;
public var arrLevels:Array;
public var objMessage:MovieClip;
public var strCity:String;
public var arrBubblePeople:Array;
public var objLevels:Object;
public var objPorts:Object;
public var arrItemDests:Array;
public var arrBoatLastPos:Array;
public var intPeople:uint;
public var objDockPort:MovieClip;
public var intTotalPeople:uint;
public var objLang:Object;
public var intPlaneCapacity:uint;
public var intBoatRot:Number;
public var objGame:MovieClip;
public var intGoalPerson:uint;
public var strGoalPort:String;
public var isBoatHit:Boolean;
public var objPlane:MovieClip;
public var intPoints:int;
public var intAward:Number;
public var objCollList:CollisionList;
public var intBoatSpeed:Number;
public var original;
public var objWipe:MovieClip;
public var temp;
public var objCurrPort:MovieClip;
public var arrKeys:Array;
public var intTimerSecs:int;
public function __game_mc_395(){
addFrameScript(0, frame1);
}
public function showPickupPort():void{
var _local1:Point;
objBoat.alpha = 0;
_local1 = new Point(0, 0);
_local1 = objCurrDest.localToGlobal(_local1);
scrollMapToPoint(_local1);
TweenLite.delayedCall(1.1, showPickupPortInfo);
}
public function startTimer():void{
objTimer = new Timer(1000);
objTimer.addEventListener("timer", updateTimer);
objTimer.start();
}
public function destroyControl():void{
objBoat.water_mc.visible = false;
objBoat.removeEventListener(Event.ENTER_FRAME, controlBoat);
}
public function dockBoat():void{
var isHorzPort:Boolean;
var intRot:Number;
var intBoatRot:Number;
stopTimer();
objBoat.water_mc.visible = false;
arrBoatLastPos = [objBoat.x, objBoat.y];
isBoatAnimating = true;
stopEngine();
isHorzPort = false;
if (objCurrPort.rotation == 0){
isHorzPort = true;
};
intRot = 0;
intBoatRot = objBoat.rotation;
if ((((intBoatRot >= 90)) && ((intBoatRot <= 180)))){
if (isHorzPort){
intRot = 180;
} else {
intRot = 90;
};
} else {
if ((((intBoatRot >= 0)) && ((intBoatRot <= 90)))){
intRot = 0;
if (isHorzPort){
intRot = 0;
} else {
intRot = 90;
};
} else {
if ((((intBoatRot > -90)) && ((intBoatRot < 0)))){
intRot = 0;
if (isHorzPort){
intRot = 0;
} else {
intRot = -90;
};
} else {
if ((((intBoatRot < -90)) && ((intBoatRot >= -180)))){
if (isHorzPort){
intRot = -180;
} else {
intRot = -90;
};
} else {
intRot = intBoatRot;
};
};
};
};
TweenLite.to(objBoat, 0.25, {rotation:intRot, onComplete:function (){
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = new Point(0, 0);
_local1 = objCurrPort.localToGlobal(_local1);
_local2 = _local1.x;
_local3 = _local1.y;
TweenLite.to(objBoat, 1, {x:_local2, y:_local3});
if (objCurrPort == objGoalPort){
intGoalPerson = 0;
stopTimer();
if (isReversed){
TweenLite.delayedCall(1.2, movePeopleToDest);
} else {
TweenLite.delayedCall(1.2, movePeopleToAirport);
};
} else {
TweenLite.delayedCall(1.2, movePeopleToBoat);
};
}});
}
public function nextPort():void{
if (isReversed){
if (intPeople >= arrPeople.length){
gameOver(false);
return;
};
strGoalPort = arrPorts[intPort];
strCurrPort = (strCity + "_goal");
} else {
strCurrPort = arrPorts[intPort];
strGoalPort = (strCity + "_goal");
};
objCurrQueue = objMap[("queue_" + objPorts[strCurrPort].port)];
objCurrPort = objMap[("port_" + objPorts[strCurrPort].port)];
objCurrDest = objMap[("dest_" + objPorts[strCurrPort].port)];
objGoalDest = objMap[("dest_" + objPorts[strGoalPort].port)];
objGoalPort = objMap[("port_" + objPorts[strGoalPort].port)];
intPort++;
if (intPort >= arrPorts.length){
intPort = 0;
};
objDockPort = objCurrPort;
placePeopleAtPort();
showPickupPort();
TweenLite.delayedCall(2.5, showDropoffPort);
}
public function initTimer():void{
resetTimer();
}
public function updateTimer(_arg1:Event):void{
if (isLevelOver){
intPoints++;
updateScoreDisplay();
};
intSecs--;
if (intSecs < 0){
intSecs = 59;
intMins--;
};
if (intMins < 0){
intMins = 0;
intSecs = 0;
stopTimer();
if (isLevelOver){
TweenLite.delayedCall(1, moveToNextLevel);
} else {
gameOver();
};
} else {
if ((((((intMins == 0)) && ((intSecs < 10)))) && (!(isLevelOver)))){
objHUD.text_time.textColor = 0xFF0000;
objRoot.playSound("time");
};
};
updateTimeDisplay(intMins, intSecs);
}
public function initControl():void{
isBoatAnimating = false;
objBoat.water_mc.visible = false;
objBoat.addEventListener(Event.ENTER_FRAME, controlBoat, false, 0, true);
}
public function movePeopleToBoat():void{
intCarriedPeople = 0;
arrCurrPeople.sortOn("y", (Array.NUMERIC | Array.DESCENDING));
movePersonToBoat();
}
public function controlBoat(_arg1:Event){
var collisions:Array;
var collision:Object;
var angle:Number;
var overlap:Number;
var sin:Number;
var cos:Number;
var vx0:Number;
var vy0:Number;
var intAngle:Number;
var intAngleCos:Number;
var intAngleSin:Number;
var e = _arg1;
if (isBoatAnimating){
objBoat.vx = 0;
objBoat.vy = 0;
intBoatSpeed = 0;
return (false);
};
if (arrKeys[37]){
objBoat.rotation = (objBoat.rotation - intBoatRot);
};
if (arrKeys[39]){
objBoat.rotation = (objBoat.rotation + intBoatRot);
};
decreaseAward();
collisions = objCollList.checkCollisions();
if (collisions.length){
collision = collisions[0];
angle = collision.angle;
overlap = collision.overlapping.length;
sin = Math.sin(angle);
cos = Math.cos(angle);
vx0 = ((objBoat.vx * cos) + (objBoat.vy * sin));
vy0 = ((objBoat.vy * cos) - (objBoat.vx * sin));
objBoat.vx = ((vx0 * cos) - (vy0 * sin));
objBoat.vy = ((vy0 * cos) + (vx0 * sin));
objBoat.vx = (objBoat.vx - ((cos * overlap) / objBoat.radius));
objBoat.vy = (objBoat.vy - ((sin * overlap) / objBoat.radius));
if (!isBoatHit){
objBoat.x = (objBoat.x + (objBoat.vx * 0.15));
objBoat.y = (objBoat.y + (objBoat.vy * 0.15));
objBoat.vx = 0;
objBoat.vy = 0;
objRoot.playSound("bump");
personFallFromBoat();
isBoatHit = true;
intBoatSpeed = 0;
TweenLite.delayedCall(0.5, function (){
isBoatHit = false;
});
};
} else {
if ((((intBoatSpeed > 1)) && (!(isBoatAnimating)))){
objBoat.water_mc.visible = true;
} else {
objBoat.water_mc.visible = false;
};
if (!isBoatHit){
if (objCurrPort != null){
if (objBoat.hitTestObject(objCurrPort)){
dockBoat();
};
};
if (arrKeys[38]){
if (intBoatSpeed < intBoatSpeedMax){
intBoatSpeed = (intBoatSpeed + intBoatAccel);
};
startEngine();
} else {
if (arrKeys[40]){
if (Math.abs(intBoatSpeed) < intBoatSpeedMax){
intBoatSpeed = (intBoatSpeed - (intBoatAccel / 3));
};
} else {
if (intBoatSpeed > 0){
intBoatSpeed = (intBoatSpeed * 0.9);
};
};
};
if (((!(arrKeys[38])) || (isBoatHit))){
stopEngine();
};
intAngle = (objBoat.rotation * 0.0174532925);
intAngleCos = (Math.cos(intAngle) * 1.1);
intAngleSin = (Math.sin(intAngle) * 1.1);
objBoat.vx = (intBoatSpeed * intAngleCos);
objBoat.vy = (intBoatSpeed * intAngleSin);
};
};
objBoat.vy = (objBoat.vy * 0.98);
objBoat.vx = (objBoat.vx * 0.98);
if ((((((((objBoat.x > arrCenter[1])) || ((objBoat.x < arrCenter[0])))) || ((((objBoat.vx < 0)) && ((objMap.x > objLevels[strCity].boundX[0])))))) || ((((objBoat.vx > 0)) && ((objMap.x < objLevels[strCity].boundX[1])))))){
objBoat.x = (objBoat.x + objBoat.vx);
} else {
objMap.x = (objMap.x - objBoat.vx);
};
if ((((((((objBoat.y > arrCenter[1])) || ((objBoat.y < arrCenter[0])))) || ((((objBoat.vy > 0)) && ((objMap.y < objLevels[strCity].boundY[0])))))) || ((((objBoat.vy < 0)) && ((objMap.y > objLevels[strCity].boundY[1])))))){
objBoat.y = (objBoat.y + objBoat.vy);
} else {
objMap.y = (objMap.y - objBoat.vy);
};
objHit.x = objMap.x;
objHit.y = objMap.y;
}
public function startLevel():void{
isLevelOver = false;
isPlaneFull = false;
initBoatContents();
objBoat.x = objLevels[strCity].initBoatPos[0];
objBoat.y = objLevels[strCity].initBoatPos[1];
objBoat.vx = 0;
objBoat.vy = 0;
intBoatSpeed = 0;
objHit.x = objMap.x;
objHit.y = objMap.y;
objBoat.rotation = 90;
TweenLite.to(objBoat, 1, {alpha:1, onComplete:function (){
hideBubble(objBubble);
if (isReversed){
arrBoatLastPos = [objBoat.x, objBoat.y];
movePeopleToBoat();
} else {
initControl();
startTimer();
};
}});
}
public function showMessage(_arg1:String):void{
objMessage = new message();
objMessage.x = 300;
objMessage.y = 300;
objMessage.alpha = 0;
objMessage.text_message.text = _arg1.toUpperCase();
objGame.addChild(objMessage);
TweenLite.to(objMessage, 0.5, {alpha:1});
TweenLite.delayedCall(1.5, hideMessage);
}
public function nextLevel():void{
var _local1:Object;
var _local2:Object;
var _local3:uint;
var _local4:*;
intPeopleLimit = 5;
strCity = arrLevels[intLevel];
_local1 = getDefinitionByName(("map_" + strCity));
objMap = new (_local1);
objMap.x = objLevels[strCity].initPos[0];
objMap.y = objLevels[strCity].initPos[1];
_local2 = getDefinitionByName(("hit_" + strCity));
objHit = new (_local2);
objHit.x = objMap.x;
objHit.y = objMap.y;
objWater = new water_mc();
objBoat.x = objLevels[strCity].initBoatPos[0];
objBoat.y = objLevels[strCity].initBoatPos[1];
objBoat.rotation = 90;
objGame.addChild(objHit);
objGame.addChild(objWater);
objGame.addChild(objBoat);
objGame.addChild(objMap);
objCollList = new CollisionList(objHit);
objCollList.addItem(objBoat);
_local3 = objMap.numChildren;
_local4 = 0;
while (_local4 < _local3) {
if (objMap.getChildAt(_local4).name.indexOf("dest_") === 0){
objMap.getChildAt(_local4).visible = false;
};
_local4++;
};
objGoalPerson = objMap["airport_mc"];
objGoalPerson.visible = false;
objGoalPerson.mask = objMap["airport_mask"];
arrGoalPersonLoc = [objGoalPerson.x, objGoalPerson.y];
}
public function resetAward():void{
intAward = intAwardMax;
}
public function decreaseAward():void{
intAward = (intAward - 0.05);
if (intAward < 10){
intAward = 10;
return;
};
}
public function showDropoffPortInfo():void{
var strTitle:String;
var isItem:Boolean;
strTitle = "";
objBubble = objGoalDest["bubble_mc"];
strTitle = objPorts[strGoalPort].name;
objBubble.text_title.htmlText = strTitle;
isItem = setBubblePeople();
if (isItem){
if (arrBubblePeople.length < 2){
objBubble.text_instruct.htmlText = objLang["dropoffitemsingle"];
} else {
objBubble.text_instruct.htmlText = objLang["dropoff"];
};
} else {
objBubble.text_instruct.htmlText = objLang["dropoff"];
};
objBubble.parent.visible = true;
objBubble.scaleX = (objBubble.scaleY = 0);
objBubble.alpha = 1;
TweenLite.to(objBubble, 0.2, {scaleX:0.5, scaleY:0.5, ease:Back.easeOut});
TweenLite.delayedCall(2, function (){
hideBubble(objBubble);
focusOnDockPort();
});
}
public function hideMessage():void{
TweenLite.to(objMessage, 0.5, {alpha:0, onComplete:function (){
objGame.removeChild(objMessage);
}});
}
public function resetCounters():void{
updateScoreDisplay();
}
function frame1(){
objRoot = Object(root);
objLang = objRoot.objLang[objRoot.strLang];
objGame = this;
arrKeys = [];
intLevel = 0;
arrLevels = ["amsterdam", "birmingham", "birmingham"];
objLevels = new Object();
objLevels["birmingham"] = {name:"Birmingham", initPos:[-975, -400], introPos:[420, 300], outroPos:[420, 900], takeoffPos:[1585, 1150], initBoatPos:[300, 300], boundX:[-15, -1080], boundY:[-1100, -100], ports:["bttower", "rotunda", "waterside", "jewellery", "villapark", "townhall", "edgbaston", "bullring", "standrews", "mailbox", "thecube"]};
objLevels["amsterdam"] = {name:"Amsterdam", initPos:[-968, -510], introPos:[450, 200], outroPosOld:[370, 800], outroPos:[450, 800], takeoffPos:[1615, 1200], initBoatPos:[300, 300], boundX:[-25, -1080], boundY:[-1155, 10], ports:["station", "palace", "vondelpark", "vangogh", "museumplein"]};
intPort = 0;
arrPorts = [];
objPorts = new Object();
objPorts["rotunda"] = {name:"The Rotunda", port:"rt"};
objPorts["waterside"] = {name:"Brindleyplace", port:"ws"};
objPorts["jewellery"] = {name:"Jewellery Quarter", port:"jq"};
objPorts["villapark"] = {name:"Villa Park", port:"vp"};
objPorts["bttower"] = {name:"BT Tower", port:"bt"};
objPorts["townhall"] = {name:"Victoria Square", port:"th"};
objPorts["edgbaston"] = {name:"Edgbaston", port:"ed"};
objPorts["bullring"] = {name:"Bullring", port:"br"};
objPorts["standrews"] = {name:"St Andrews", port:"sa"};
objPorts["mailbox"] = {name:"The Mailbox", port:"mb"};
objPorts["thecube"] = {name:"The Cube", port:"cu"};
objPorts["palace"] = {name:"Koninklijk Paleis", port:"pa"};
objPorts["station"] = {name:"Centraal Station", port:"st"};
objPorts["vondelpark"] = {name:"Vondelpark", port:"vo"};
objPorts["vangogh"] = {name:"Van Gogh Museum", port:"vg"};
objPorts["museumplein"] = {name:"Museumplein", port:"mp"};
objPorts["birmingham_goal"] = {name:"Airport", port:"ba"};
objPorts["amsterdam_goal"] = {name:"Airport", port:"aa"};
intItems = 0;
arrItemDests = ["standrews", "jewellery", "waterside"];
objRoot.text_disclaim.text = objLang["disclaimer"];
strCity = "";
strCurrPort = "";
strCurrQueue = "";
strGoalPort = "";
intBoatRot = 6;
intBoatSpeed = 0;
intBoatSpeedMax = 7;
intBoatAccel = 0.2;
isBoatHit = false;
isBoatAnimating = false;
arrSeatPos = [0, 0];
arrBoatLastPos = [0, 0];
intPlaneCapacity = 9;
arrPlanePeople = [];
isPlaneFull = false;
arrCenter = [270, 330];
intTotalPeople = 10;
arrPeople = [];
intPeople = 0;
arrBubblePeople = [];
arrCurrPeople = [];
arrGoalPersonLoc = [0, 0];
intGoalPerson = 0;
intCarriedPeople = 0;
intPeopleLimit = 0;
intMins = 0;
intSecs = 0;
intTimerSecs = 0;
isReversed = false;
isEngineStarted = false;
intPoints = 0;
intAward = 0;
intAwardMax = 100;
isLevelOver = false;
Array.prototype.insert = function (_arg1, _arg2){
if (!(_arg1 >= 0)){
return;
};
original = this.slice();
temp = original.splice(_arg1);
original[_arg1] = _arg2;
original = original.concat(temp);
return (original);
};
init();
}
public function initBoat():void{
objBoat = new boat();
objBoat.alpha = 0;
objBoat.vx = 0;
objBoat.vy = 0;
objBoat.radius = 40;
initBoatContents();
}
public function initLevel():void{
nextLevel();
}
public function stopTimer():void{
if (objTimer != null){
objTimer.stop();
objTimer.removeEventListener("timer", updateTimer);
};
}
public function showGoalInfo():void{
}
public function hideBubble(_arg1:MovieClip):void{
var objB = _arg1;
TweenLite.to(objB, 0.2, {scaleX:0, scaleY:0, ease:Back.easeIn, onComplete:function (){
objB.parent.visible = false;
}});
}
public function delayedAddToPort(_arg1:Event):void{
var _local2:Object;
_local2 = _arg1.currentTarget;
_local2.removeEventListener(Event.ENTER_FRAME, delayedAddToPort);
_local2.inner_mc.gotoAndStop(_local2.strFrame);
_local2.addEventListener(Event.ENTER_FRAME, delayedAddToPort2);
}
public function movePersonToBoat():void{
var objBP:Point;
var objPP:Point;
var intDestX:Number;
var intDestY:Number;
objBP = new Point(0, 0);
objBP = objBoat[("sitter_" + (arrCurrPeople.length - 1))].localToGlobal(objBP);
objPP = new Point(0, 0);
objPP = arrCurrPeople[0].localToGlobal(objPP);
intDestX = ((arrCurrPeople[0].x + objBP.x) - objPP.x);
intDestY = ((arrCurrPeople[0].y + objBP.y) - objPP.y);
TweenLite.to(arrCurrPeople[0], 0.5, {x:intDestX, y:intDestY});
objRoot.playSound("jump");
TweenLite.delayedCall(0.45, function (){
var _local1:*;
objBoat.scaleX = (objBoat.scaleY = 0.95);
TweenLite.to(objBoat, 0.25, {scaleX:1, scaleY:1, ease:Bounce.easeOut});
objRoot.playSound("land");
if (isReversed){
_local1 = objPlaneGauge.getChildAt(0);
objPlaneGauge.removeChild(_local1);
};
});
TweenLite.to(arrCurrPeople[0].inner_mc, 0.25, {y:(arrCurrPeople[0].inner_mc.y - 20), onComplete:function (){
TweenLite.to(arrCurrPeople[0].inner_mc, 0.25, {y:(arrCurrPeople[0].inner_mc.y + 20), ease:Back.easeOut, onComplete:function (){
var _local1:*;
_local1 = arrCurrPeople[0].currentFrame;
objCurrQueue.removeChild(arrCurrPeople[0]);
arrCurrPeople.shift();
intCarriedPeople++;
objBoat[("sitter_" + arrCurrPeople.length)].gotoAndStop(_local1);
objBoat[("sitter_" + arrCurrPeople.length)].visible = true;
objBoat[("sitter_" + arrCurrPeople.length)].isItem = false;
if (_local1 > intTotalPeople){
objBoat[("sitter_" + arrCurrPeople.length)].isItem = true;
};
if (arrCurrPeople.length > 0){
movePersonToBoat();
} else {
undockBoat();
};
}});
}});
}
public function personFallFromBoat():void{
var i:*;
var objSeat:MovieClip;
var objBP:Point;
var objSplash:MovieClip;
var strLimit:String;
if (intBoatSpeed < 3){
return;
};
i = 0;
while (i < 3) {
objSeat = objBoat[("sitter_" + i)];
if ((((objSeat.visible == true)) && (!(objSeat.isItem)))){
objSeat.visible = false;
objBP = new Point(0, 0);
objBP = objSeat.localToGlobal(objBP);
objSplash = new splash_anim();
objSplash.x = objBP.x;
objSplash.y = (objBP.y + 20);
objRoot.playSound("splash");
if (intPeopleLimit <= 0){
gameOver(false);
return;
};
strLimit = "";
showTickerMessage(objLang["overboard"], strLimit);
objWater.addChild(objSplash);
intCarriedPeople--;
if (intCarriedPeople <= 0){
stopEngine();
stopTimer();
destroyControl();
TweenLite.to(objBoat, 1, {alpha:0, onComplete:function (){
objBoat.y = -3000;
nextPort();
}});
};
return;
};
i = (i + 1);
};
}
public function updateTimeDisplay(_arg1:uint, _arg2:uint){
var _local3:String;
var _local4:String;
_local3 = _arg1.toString();
_local4 = _arg2.toString();
if (_arg1 < 10){
_local3 = ("0" + _local3);
};
if (_arg2 < 10){
_local4 = ("0" + _local4);
};
objHUD.text_time.text = ((_local3 + ":") + _local4);
}
public function keyPressUp(_arg1:KeyboardEvent):void{
stage.focus = stage;
arrKeys[_arg1.keyCode] = false;
}
public function initPorts():void{
arrPorts = shuffle(objLevels[strCity].ports);
}
public function moveAirportPersonToBoat():void{
var objQP:*;
var objBP:Point;
var objPP:Point;
var intDestX:Number;
var intDestY:Number;
objQP = objPlaneGauge.getChildAt(0);
objBP = new Point(0, 0);
objBP = objBoat[("sitter_" + (arrCurrPeople.length - 1))].localToGlobal(objBP);
objPP = new Point(0, 0);
objPP = objQP.localToGlobal(objPP);
objRoot.playSound("jump");
intDestX = ((objQP.x + objBP.x) - objPP.x);
intDestY = ((objQP.y + objBP.y) - objPP.y);
TweenLite.to(objQP, 0.5, {x:intDestX, y:intDestY, onComplete:function (){
var _local1:*;
_local1 = objQP.currentFrame;
objPlaneGauge.removeChild(objQP);
objRoot.playSound("land");
arrCurrPeople.shift();
objBoat[("sitter_" + arrCurrPeople.length)].gotoAndStop(_local1);
objBoat[("sitter_" + arrCurrPeople.length)].visible = true;
intCarriedPeople++;
if (arrCurrPeople.length > 0){
movePersonToBoat();
} else {
undockBoat();
};
}});
}
public function stopEngine():void{
if (isEngineStarted){
objRoot.stopEngine();
isEngineStarted = false;
objRoot.playSound("engine3");
};
}
public function outroTakeOff():void{
objBoat.visible = false;
objPlane = new plane();
objPlane.x = objLevels[strCity].takeoffPos[0];
objPlane.y = objLevels[strCity].takeoffPos[1];
objMap.addChild(objPlane);
scrollMapToPoint(new Point(objLevels[strCity].outroPos[0], objLevels[strCity].outroPos[1]), true);
TweenLite.delayedCall(2, function (){
objRoot.playSound("planefly");
});
TweenLite.delayedCall(1.2, function (){
TweenLite.to(objPlane, 4, {y:(objPlane.y + 700), scaleX:1.5, scaleY:1.5, ease:Strong.easeIn, onComplete:completeLevel});
});
}
public function destroyKeys():void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyPressUp);
}
public function shuffle(_arg1:Array, _arg2:int=0, _arg3:int=0):Array{
var _local4:int;
var _local5:int;
var _local6:*;
if (_arg3 == 0){
_arg3 = (_arg1.length - 1);
};
_local4 = _arg3;
while (_local4 > _arg2) {
_local5 = (Math.floor((Math.random() * _arg3)) + _arg2);
_local6 = _arg1[_local4];
_arg1[_local4] = _arg1[_local5];
_arg1[_local5] = _local6;
_local4--;
};
return (_arg1);
}
public function initPlane():void{
initPlaneGauge();
}
public function initNewLevel():void{
initPeople();
initBoat();
initLevel();
initPorts();
initHUD();
initPlane();
initTimer();
}
public function delayToDest(_arg1:Event):void{
var isHorzPort:Boolean;
var objP:*;
var objQP:Point;
var intDestX:Number;
var intDestY:Number;
var e = _arg1;
isHorzPort = false;
if (objCurrPort.rotation == 0){
isHorzPort = true;
};
objP = e.currentTarget;
objP.removeEventListener(Event.ENTER_FRAME, delayToDest);
objQP = new Point(0, 0);
objQP = objCurrQueue.localToGlobal(objQP);
intDestX = (objQP.x + (objCurrQueue.width / 2));
intDestY = (objQP.y + (objCurrQueue.height / 2));
if (!isHorzPort){
if (intDestX <= objP.x){
objP.inner_mc.gotoAndStop("LEFT");
} else {
objP.inner_mc.gotoAndStop("RIGHT");
};
} else {
if (intDestY <= objP.y){
objP.inner_mc.gotoAndStop("BACK");
} else {
objP.inner_mc.gotoAndStop("FRONT");
};
};
TweenLite.to(objP, 0.5, {x:intDestX, y:intDestY, ease:Strong.easeIn, onComplete:function (){
awardPoints();
TweenLite.to(objP, 0.3, {alpha:0, onComplete:function (){
objGame.removeChild(objP);
movePeopleToDest();
}});
}});
}
public function initKeys():void{
stage.focus = stage;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressDown, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_UP, keyPressUp, false, 0, true);
}
public function resetTimer():void{
intMins = 3;
intSecs = 30;
objHUD.text_time.textColor = 0xFFFFFF;
updateTimeDisplay(intMins, intSecs);
}
public function updateScoreDisplay():void{
objHUD.text_score.text = intPoints.toString();
}
public function init():void{
initKeys();
initNewLevel();
playIntro();
}
public function initPlaneGauge():void{
var _local1:Number;
var _local2:Number;
var _local3:uint;
var _local4:*;
var _local5:MovieClip;
objPlaneGauge = new MovieClip();
objPlaneGauge.x = 8;
objPlaneGauge.y = 46;
_local1 = 0;
_local2 = 0;
_local3 = (intPlaneCapacity + 3);
_local4 = 0;
while (_local4 < _local3) {
_local5 = new person();
new person().scaleX = (_local5.scaleY = 0.65);
if (arrPlanePeople[_local4]){
_local5.gotoAndStop(arrPlanePeople[_local4]);
} else {
_local5.gotoAndStop(1);
_local5.visible = false;
};
_local5.x = _local1;
_local5.y = _local2;
objPlaneGauge.addChild(_local5);
if (((((_local4 % 9) == 0)) && ((_local4 > 0)))){
_local1 = 0;
_local2 = (_local2 + 20);
} else {
_local1 = (_local1 + 16);
};
_local4++;
};
objHUD.addChild(objPlaneGauge);
}
public function cleanupLevel(){
stopTimer();
destroyControl();
}
public function playOutro():void{
showMessage(objLang["complete"]);
TweenLite.delayedCall(1.5, function (){
if (!isReversed){
outroTakeOff();
} else {
TweenLite.delayedCall(2, completeLevel);
};
intLevel++;
if (intLevel == 1){
isReversed = true;
} else {
isReversed = false;
};
if (intLevel != 1){
arrPlanePeople = [];
};
});
}
public function startEngine():void{
if (((!(isEngineStarted)) && (!(isBoatAnimating)))){
isEngineStarted = true;
objRoot.playSound("engine1");
objRoot.playEngine();
};
}
public function focusOnDockPort():void{
if ((((strCurrPort.indexOf("_goal") > 0)) || (!(isReversed)))){
TweenLite.to(objMap, 1, {x:objLevels[strCity].initPos[0], y:objLevels[strCity].initPos[1]});
TweenLite.delayedCall(1, function (){
startLevel();
});
} else {
startLevel();
};
}
public function placePeopleAtPort():void{
var _local1:Boolean;
var _local2:uint;
var _local3:Number;
var _local4:*;
var _local5:MovieClip;
var _local6:Boolean;
var _local7:int;
var _local8:String;
arrBubblePeople = [];
_local1 = false;
if (objCurrPort.rotation == 0){
_local1 = true;
};
_local2 = 5;
_local3 = 0;
_local4 = 0;
while (_local4 < 3) {
_local5 = new person();
new person().scaleX = (_local5.scaleY = 0.8);
trace(arrPeople);
_local5.gotoAndStop(arrPeople[intPeople]);
_local5.isItem = false;
_local6 = false;
if (arrPeople[intPeople] > intTotalPeople){
_local5.isItem = true;
};
if (arrPeople[(intPeople + 1)] > intTotalPeople){
_local6 = true;
};
if (_local1){
_local3 = 80;
_local5.x = Math.floor((Math.random() * _local3));
_local5.y = _local2;
_local2 = (_local2 + 10);
if ((((strCurrPort == "standrews")) || ((strCurrPort == "vondelpark")))){
_local5.strFrame = "BACK";
} else {
_local5.strFrame = "FRONT";
};
} else {
_local3 = 40;
_local5.x = Math.floor((Math.random() * _local3));
_local5.y = _local2;
_local2 = (_local2 + 27);
if (strCurrPort == "villapark"){
_local5.strFrame = "RIGHT";
} else {
_local5.strFrame = "LEFT";
};
};
objCurrQueue.addChild(_local5);
_local5.visible = false;
arrCurrPeople.push(_local5);
arrBubblePeople.push(arrPeople[intPeople]);
_local5.addEventListener(Event.ENTER_FRAME, delayedAddToPort);
if (((_local5.isItem) && (isReversed))){
_local7 = ((arrPeople[intPeople] - intTotalPeople) - 1);
trace(_local7);
_local8 = arrItemDests[_local7];
strGoalPort = _local8;
objGoalDest = objMap[("dest_" + objPorts[_local8].port)];
objGoalPort = objMap[("port_" + objPorts[_local8].port)];
};
intPeople++;
if (isReversed){
if (((_local5.isItem) || (_local6))){
return;
};
};
if (intPeople >= arrPeople.length){
return;
};
_local4++;
};
}
public function startGame():void{
objRoot.playMusic("music_1");
nextPort();
}
public function delayedAddToPort2(_arg1:Event):void{
var _local2:Object;
_local2 = _arg1.currentTarget;
if (!_local2.isItem){
if ((((_local2.strFrame == "FRONT")) || ((_local2.strFrame == "BACK")))){
_local2.inner_mc.anim_mc.gotoAndStop(1);
} else {
_local2.inner_mc.anim_mc.gotoAndStop(4);
};
};
_local2.removeEventListener(Event.ENTER_FRAME, delayedAddToPort2);
_local2.visible = true;
}
public function clearLevel():void{
while (objGame.numChildren) {
objGame.removeChildAt(0);
};
}
public function checkForFullPlane():void{
intCarriedPeople--;
if ((((intCarriedPeople <= 0)) && (!(isPlaneFull)))){
nextPort();
} else {
destroyControl();
if (!isPlaneFull){
movePeopleToAirport();
};
};
}
public function scrollMapToPoint(_arg1:Point, _arg2:Boolean=false):void{
var _local3:Number;
var _local4:Number;
_local3 = 0;
_local4 = 0;
_local3 = (objMap.x - _arg1.x);
_local4 = (objMap.y - _arg1.y);
_local3 = (_local3 + 300);
_local4 = (_local4 + 300);
if (!_arg2){
if (_local3 > objLevels[strCity].boundX[0]){
_local3 = objLevels[strCity].boundX[0];
} else {
if (_local3 < objLevels[strCity].boundX[1]){
_local3 = objLevels[strCity].boundX[1];
};
};
if (_local4 < objLevels[strCity].boundY[0]){
_local4 = objLevels[strCity].boundY[0];
} else {
if (_local4 > objLevels[strCity].boundY[1]){
_local4 = objLevels[strCity].boundY[1];
};
};
};
TweenLite.to(objMap, 1, {x:_local3, y:_local4});
}
public function playIntro():void{
if (intLevel == 2){
showMessage(objLevels[strCity].name);
TweenLite.delayedCall(2, startGame);
return;
};
objPlane = new plane();
objPlane.x = 490;
objPlane.y = -190;
objPlane.scaleX = (objPlane.scaleY = 1.5);
objGame.addChild(objPlane);
objRoot.playSound("planeland");
scrollMapToPoint(new Point(objLevels[strCity].introPos[0], objLevels[strCity].introPos[1]), true);
TweenLite.delayedCall(3, function (){
showMessage(objLevels[strCity].name);
});
TweenLite.delayedCall(1, function (){
TweenLite.to(objPlane, 5, {y:730, scaleX:1, scaleY:1, ease:Strong.easeOut, onComplete:function (){
objGame.removeChild(objPlane);
startGame();
}});
});
}
public function showTickerMessage(_arg1:String, _arg2:String=""){
var objMessageT:MovieClip;
var strText = _arg1;
var strSubTitle = _arg2;
objMessageT = new ticker_message();
objMessageT.x = 700;
objMessageT.y = 300;
objMessageT.text_message.text = strText.toUpperCase();
objMessageT.text_subtitle.text = strSubTitle.toUpperCase();
objGame.addChild(objMessageT);
TweenLite.to(objMessageT, 0.5, {x:300});
TweenLite.delayedCall(1.5, function (){
TweenLite.to(objMessageT, 0.5, {x:-500});
});
}
public function movePeopleToDest():void{
var _local1:Number;
var _local2:*;
var _local3:MovieClip;
var _local4:MovieClip;
var _local5:Point;
_local1 = 0;
_local2 = 0;
while (_local2 < 3) {
_local3 = objBoat[("sitter_" + _local2)];
if (_local3.visible == true){
_local3.visible = false;
_local4 = new person();
_local4.gotoAndStop(_local3.currentFrame);
_local5 = new Point(0, 0);
_local5 = _local3.localToGlobal(_local5);
_local4.x = _local5.x;
_local4.y = _local5.y;
_local4.scaleX = (_local4.scaleY = 0.8);
objGame.addChild(_local4);
_local4.addEventListener(Event.ENTER_FRAME, delayToDest);
return;
};
_local2++;
};
if (intPeople >= arrPeople.length){
playOutro();
} else {
nextPort();
};
}
public function showDropoffPort():void{
var _local1:Point;
objBoat.alpha = 0;
_local1 = new Point(0, 0);
trace(objGoalDest);
_local1 = objGoalDest.localToGlobal(_local1);
scrollMapToPoint(_local1);
TweenLite.delayedCall(1.1, showDropoffPortInfo);
}
public function moveToNextLevel(){
if (intLevel == 3){
gameOver(true);
return;
};
objRoot.stopMusic();
TweenLite.to(objWipe, 1, {x:0, ease:Strong.easeOut, onComplete:function (){
clearLevel();
initNewLevel();
objWipe = new level_wipe();
objGame.addChild(objWipe);
TweenLite.to(objWipe, 1, {x:-600, ease:Strong.easeIn, onComplete:function (){
playIntro();
}});
}});
}
public function updatePlaneGauge():void{
var _local1:Object;
awardPoints();
_local1 = objPlaneGauge.getChildAt((arrPlanePeople.length - 1));
_local1.gotoAndStop(arrPlanePeople[(arrPlanePeople.length - 1)]);
_local1.visible = true;
if (arrPlanePeople.length >= (intPlaneCapacity + 3)){
isPlaneFull = true;
trace(("On plane:" + arrPlanePeople));
playOutro();
};
}
public function delayToAirport(_arg1:Event):void{
var e = _arg1;
objGoalPerson.removeEventListener(Event.ENTER_FRAME, delayToAirport);
objGoalPerson.visible = true;
objGoalPerson.alpha = 1;
objGoalPerson.mask = objMap["airport_mask"];
if (objGoalPerson.isItem){
TweenLite.to(objGoalPerson, 1.2, {x:(objGoalPerson.x + 88), ease:Strong.easeIn, onComplete:function (){
arrPlanePeople.push(objGoalPerson.currentFrame);
updatePlaneGauge();
TweenLite.to(objGoalPerson, 1, {alpha:0, ease:Strong.easeOut, onComplete:checkForFullPlane});
}});
} else {
objGoalPerson["inner_mc"].gotoAndStop("RIGHT");
TweenLite.to(objGoalPerson, 1.2, {x:(objGoalPerson.x + 88), ease:Strong.easeIn, onComplete:function (){
objGoalPerson.inner_mc.gotoAndStop("BACK");
arrPlanePeople.push(objGoalPerson.currentFrame);
updatePlaneGauge();
TweenLite.to(objGoalPerson, 1, {y:(objGoalPerson.y - 55), ease:Strong.easeOut, onComplete:checkForFullPlane});
}});
};
}
public function showGoal(){
hideBubble(objBubble);
TweenLite.to(objMap, 1, {x:objLevels[strCity].initPos[0], y:objLevels[strCity].initPos[1], onComplete:showGoalInfo});
}
public function initBoatContents():void{
objBoat.sitter_0.gotoAndStop(1);
objBoat.sitter_1.gotoAndStop(1);
objBoat.sitter_2.gotoAndStop(1);
objBoat.sitter_0.visible = false;
objBoat.sitter_1.visible = false;
objBoat.sitter_2.visible = false;
objBoat.water_mc.visible = false;
}
public function undockBoat():void{
TweenLite.to(objBoat, 1, {x:arrBoatLastPos[0], y:arrBoatLastPos[1], onComplete:function (){
startTimer();
resetAward();
objCurrPort = objGoalPort;
isBoatAnimating = false;
if (isReversed){
objCurrQueue = objMap[("queue_" + objPorts[strGoalPort].port)];
initControl();
};
}});
}
public function awardPoints():void{
intPoints = (intPoints + Math.round(intAward));
updateScoreDisplay();
objRoot.playSound("success");
}
public function showPickupPortInfo():void{
var _local1:String;
var _local2:Boolean;
_local1 = "";
objBubble = objCurrDest["bubble_mc"];
_local1 = objPorts[strCurrPort].name;
objBubble.text_instruct.htmlText = objLang["pickup"];
objBubble.text_title.htmlText = _local1;
_local2 = setBubblePeople();
if (_local2){
if (arrBubblePeople.length < 2){
objBubble.text_instruct.htmlText = objLang["pickupitemsingle"];
} else {
objBubble.text_instruct.htmlText = objLang["pickupitem"];
};
} else {
if (arrBubblePeople.length < 2){
objBubble.text_instruct.htmlText = objLang["pickupsingle"];
} else {
objBubble.text_instruct.htmlText = objLang["pickup"];
};
};
objBubble.parent.visible = true;
objBubble.scaleX = (objBubble.scaleY = 0);
objBubble.alpha = 1;
TweenLite.to(objBubble, 0.2, {scaleX:0.5, scaleY:0.5, ease:Back.easeOut});
TweenLite.delayedCall(2, hideBubble, [objBubble]);
}
public function setBubblePeople():Boolean{
var _local1:uint;
var _local2:Boolean;
var _local3:*;
var _local4:*;
var _local5:MovieClip;
_local1 = (intPeople - 3);
_local2 = false;
_local3 = arrBubblePeople.length;
objBubble["person_0"].visible = false;
objBubble["person_1"].visible = false;
objBubble["person_2"].visible = false;
_local4 = 0;
while (_local4 < _local3) {
_local5 = objBubble[("person_" + _local4)];
_local5.visible = true;
_local5.gotoAndStop(arrBubblePeople[_local4]);
if (arrBubblePeople[_local4] > intTotalPeople){
_local2 = true;
};
_local1++;
_local4++;
};
return (_local2);
}
public function initHUD():void{
objHUD = new hud();
objHUD.x = 7;
objHUD.y = 7;
objGame.addChild(objHUD);
resetCounters();
}
public function timerToScore():void{
objTimer = new Timer(10);
objTimer.addEventListener("timer", updateTimer);
objTimer.start();
}
public function initPeople():void{
var _local1:Array;
var _local2:*;
var _local3:uint;
var _local4:uint;
intPeople = 0;
intItems = 0;
if (isReversed){
arrPeople = arrPlanePeople;
return;
};
_local1 = [];
_local2 = 1;
while (_local2 <= intTotalPeople) {
_local1.push(_local2);
_local2++;
};
_local3 = (3 * 20);
while (arrPeople.length < _local3) {
arrPeople = arrPeople.concat(shuffle(_local1));
};
if (intLevel < 1){
_local4 = arrPeople.length;
_local2 = 0;
while (_local2 < _local4) {
if ((((((_local2 == 4)) || ((_local2 == 10)))) || ((_local2 == 13)))){
intItems++;
arrPeople = arrPeople.insert(_local2, (intTotalPeople + intItems));
};
_local2++;
};
};
}
public function completeLevel():void{
cleanupLevel();
if (intLevel != 2){
objWipe = new level_wipe();
objWipe.x = -600;
objGame.addChild(objWipe);
};
isLevelOver = true;
timerToScore();
}
public function gameOver(_arg1:Boolean=false):void{
var isSuccess = _arg1;
stopEngine();
destroyControl();
stopTimer();
if (isSuccess){
showMessage(objLang["success"]);
} else {
if ((((intMins <= 0)) && ((intSecs <= 0)))){
showMessage(objLang["timeup"]);
} else {
showMessage(objLang["gameover"]);
};
};
TweenLite.delayedCall(3, function (){
destroyKeys();
objRoot.stopMusic();
objRoot.intScore = intPoints;
objRoot.strNextScreen = "gameover";
cleanupLevel();
clearLevel();
objRoot.gotoAndStop("screens");
});
}
public function keyPressDown(_arg1:KeyboardEvent):void{
stage.focus = stage;
arrKeys[_arg1.keyCode] = true;
}
public function movePeopleToAirport():void{
var _local1:uint;
var _local2:*;
objGoalPerson.x = arrGoalPersonLoc[0];
objGoalPerson.y = arrGoalPersonLoc[1];
objGoalPerson.isItem = false;
_local1 = 0;
_local2 = 0;
while (_local2 < 3) {
if (objBoat[("sitter_" + _local2)].visible){
_local1 = objBoat[("sitter_" + _local2)].currentFrame;
objBoat[("sitter_" + _local2)].visible = false;
objBoat[("sitter_" + _local2)].isItem = false;
break;
};
_local2++;
};
if (_local1 > intTotalPeople){
objGoalPerson.isItem = true;
};
objGoalPerson.gotoAndStop(_local1);
intGoalPerson++;
objGoalPerson.addEventListener(Event.ENTER_FRAME, delayToAirport);
}
}
}//package damtotheham_fla
Section 7
//boat_sitters_16 (damtotheham_fla.boat_sitters_16)
package damtotheham_fla {
import flash.display.*;
public dynamic class boat_sitters_16 extends MovieClip {
public var person_mc:MovieClip;
}
}//package damtotheham_fla
Section 8
//btn_highscores_294 (damtotheham_fla.btn_highscores_294)
package damtotheham_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btn_highscores_294 extends MovieClip {
public var text_label:TextField;
}
}//package damtotheham_fla
Section 9
//btn_instructions_291 (damtotheham_fla.btn_instructions_291)
package damtotheham_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btn_instructions_291 extends MovieClip {
public var text_label:TextField;
}
}//package damtotheham_fla
Section 10
//btn_playnow_288 (damtotheham_fla.btn_playnow_288)
package damtotheham_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btn_playnow_288 extends MovieClip {
public var text_label:TextField;
}
}//package damtotheham_fla
Section 11
//btn_round_305 (damtotheham_fla.btn_round_305)
package damtotheham_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btn_round_305 extends MovieClip {
public var text_label:TextField;
}
}//package damtotheham_fla
Section 12
//btn_sendfriend_297 (damtotheham_fla.btn_sendfriend_297)
package damtotheham_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btn_sendfriend_297 extends MovieClip {
public var text_label:TextField;
}
}//package damtotheham_fla
Section 13
//btn_sound_3 (damtotheham_fla.btn_sound_3)
package damtotheham_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btn_sound_3 extends MovieClip {
public var text_label:TextField;
}
}//package damtotheham_fla
Section 14
//btn_terms_362 (damtotheham_fla.btn_terms_362)
package damtotheham_fla {
import flash.display.*;
import flash.text.*;
public dynamic class btn_terms_362 extends MovieClip {
public var text_label:TextField;
}
}//package damtotheham_fla
Section 15
//clock_dynamic_55 (damtotheham_fla.clock_dynamic_55)
package damtotheham_fla {
import flash.display.*;
public dynamic class clock_dynamic_55 extends MovieClip {
public var minhand:MovieClip;
}
}//package damtotheham_fla
Section 16
//dest_bubble_62 (damtotheham_fla.dest_bubble_62)
package damtotheham_fla {
import flash.display.*;
import flash.text.*;
public dynamic class dest_bubble_62 extends MovieClip {
public var text_instruct:TextField;
public var text_title:TextField;
public var person_1:person;
public var person_2:person;
public var person_0:person;
}
}//package damtotheham_fla
Section 17
//dest_mc_61 (damtotheham_fla.dest_mc_61)
package damtotheham_fla {
import flash.display.*;
public dynamic class dest_mc_61 extends MovieClip {
public var bubble_mc:MovieClip;
}
}//package damtotheham_fla
Section 18
//MainTimeline (damtotheham_fla.MainTimeline)
package damtotheham_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import com.memecounter.*;
import flash.media.*;
import flash.text.*;
import flash.errors.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var logo_game:MovieClip;
public var intScore:int;
public var btn_tamba:MovieClip;
public var strNextScreen:String;
public var intScoreSub:uint;
public var intSoundVol:uint;
public var text_disclaim:TextField;
public var btn_sound:MovieClip;
public var intMusicVol:uint;
public var objLang:Object;
public var preload_mc:MovieClip;
public var objChannelM:SoundChannel;
public var objChannelS:SoundChannel;
public var objChannelE:SoundChannel;
public var strLang:String;
public var arrListeners:Array;
public var logo_client:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 2, frame3);
}
public function playSound(_arg1:String, _arg2:uint=1):void{
var objClassDef:Object;
var objSound:Sound;
var strSound = _arg1;
var intRepeat = _arg2;
try {
objClassDef = getDefinitionByName(strSound);
objSound = new (objClassDef);
objChannelS = objSound.play(0, intRepeat);
setSoundVolume(intSoundVol);
} catch(e:Error) {
trace(("Failed to load sound: " + strSound));
};
}
public function onClientLogoClicked(_arg1:MouseEvent):void{
getURL("http://www.visitbirmingham.com", "_blank");
}
public function stopSound():void{
try {
objChannelS.stop();
} catch(e:Error) {
};
}
public function setGlobalVolume(_arg1:uint):void{
setMusicVolume(_arg1);
setSoundVolume(_arg1);
}
public function toggleSound():void{
if (intSoundVol < 1){
btn_sound.text_label.textColor = 0xFFFFFF;
setGlobalVolume(1);
} else {
btn_sound.text_label.textColor = 0xFF0000;
setGlobalVolume(0);
};
}
public function stopEngine():void{
try {
objChannelE.stop();
} catch(e:Error) {
};
}
public function startPreloader():void{
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, preloaderLoop);
this.loaderInfo.addEventListener(Event.COMPLETE, preloaderDone);
}
public function stopMusic():void{
try {
objChannelM.stop();
} catch(e:Error) {
};
}
public function preloaderDone(_arg1:Event){
this.loaderInfo.removeEventListener(Event.COMPLETE, preloaderDone);
gotoAndStop("screens");
}
public function getURL(_arg1:String, _arg2:String=null):void{
var req:URLRequest;
var url = _arg1;
var window = _arg2;
req = new URLRequest(url);
try {
navigateToURL(req, window);
} catch(e:Error) {
trace("Navigate to URL failed", e.message);
};
}
public function setSoundVolume(_arg1:uint):void{
var objTransS:SoundTransform;
var intVolume = _arg1;
try {
objTransS = objChannelS.soundTransform;
objTransS.volume = intVolume;
objChannelS.soundTransform = objTransS;
objChannelE.soundTransform = objTransS;
} catch(e:Error) {
};
intSoundVol = intVolume;
}
function frame3(){
stop();
}
public function playMusic(_arg1:String):void{
var objClassDef:Object;
var objMusic:Sound;
var strMusic = _arg1;
try {
objClassDef = getDefinitionByName(strMusic);
objMusic = new (objClassDef);
trace(("v" + intMusicVol));
objChannelM = objMusic.play(0, 999);
setMusicVolume(intMusicVol);
} catch(e:Error) {
trace(("Failed to load music: " + strMusic));
};
}
function frame1(){
stop();
try {
Tracker.init(740, root);
} catch(e:Error) {
};
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.showDefaultContextMenu = false;
arrListeners = [];
intMusicVol = 1;
intSoundVol = 1;
strLang = "eng";
strNextScreen = "lang";
intScore = 0;
intScoreSub = 0;
objLang = new Object();
objLang["eng"] = new Object();
objLang["eng"]["sound"] = "Sound On/Off";
objLang["eng"]["playnow"] = "Play Now";
objLang["eng"]["instruct"] = "Instructions";
objLang["eng"]["highscores"] = "High Scores";
objLang["eng"]["sendfriend"] = "Send to a Friend";
objLang["eng"]["back"] = "Back";
objLang["eng"]["play"] = "Play";
objLang["eng"]["submit"] = "Submit";
objLang["eng"]["yourname"] = "Your Name";
objLang["eng"]["youremail"] = "Your Email";
objLang["eng"]["friendname"] = "Friend's Name";
objLang["eng"]["friendemail"] = "Friend's Email";
objLang["eng"]["gameover"] = "Game Over";
objLang["eng"]["submitscore"] = "Submit Score";
objLang["eng"]["score"] = "Score";
objLang["eng"]["complete"] = "Level Complete!";
objLang["eng"]["pickup"] = "Pick up <font color=\"#00B2D7\">people</font> from here";
objLang["eng"]["pickupitem"] = "Pick up <font color=\"#00B2D7\">people</font> and <font color=\"#00B2D7\">cargo</font> here";
objLang["eng"]["pickupsingle"] = "Pick up <font color=\"#00B2D7\">a person</font> here";
objLang["eng"]["pickupitemsingle"] = "Pick up <font color=\"#00B2D7\">cargo</font> here";
objLang["eng"]["dropoff"] = "...and drop them off here!";
objLang["eng"]["dropoffitemsingle"] = "...and drop it off here!";
objLang["eng"]["timeup"] = "Time Up";
objLang["eng"]["success"] = "Game Complete!";
objLang["eng"]["overboard"] = "Man Overboard!";
objLang["eng"]["overboardlimit"] = "Lose NN more and it's game over!";
objLang["eng"]["error_yourname"] = "Please enter your name";
objLang["eng"]["error_youremail"] = "Please enter a valid email address";
objLang["eng"]["error_friends"] = "Please complete your friends' details";
objLang["eng"]["send_success"] = "Email sent. Would you like to send another?";
objLang["eng"]["disclaimer"] = "This is not a true representation of the Birmingham and Amsterdam canal networks. Artistic license has been used for the purposes of gameplay.";
objLang["eng"]["competition"] = "Submit your score to our leaderboard for a chance to win an <b>overnight stay at a 4 star hotel in Birmingham</b>, and if you are located in Amsterdam we will even fly you over here too!";
objLang["eng"]["terms"] = "Terms and Conditions apply - click here";
objLang["eng"]["controls"] = "CONTROLS";
objLang["eng"]["accel"] = "Accelerate";
objLang["eng"]["rotate"] = "Rotate";
objLang["eng"]["reverse"] = "Reverse";
objLang["eng"]["gameplay"] = "GAMEPLAY";
objLang["eng"]["gameplay_1"] = "Level 1: Pick up people from around Amsterdam and transport them to the airport.";
objLang["eng"]["gameplay_2"] = "Level 2: Transport your passengers from Birmingham airport to their chosen destinations.";
objLang["eng"]["gameplay_3"] = "Level 3: Pick up people from around Birmingham and transport them to the airport.";
objLang["net"] = new Object();
objLang["net"]["sound"] = "Geluid aan/uit";
objLang["net"]["playnow"] = "Spelen Nu";
objLang["net"]["instruct"] = "Instructies";
objLang["net"]["highscores"] = "Topscores";
objLang["net"]["sendfriend"] = "Stuur naar een vriend";
objLang["net"]["back"] = "Terug";
objLang["net"]["play"] = "Spelen";
objLang["net"]["submit"] = "Indienen";
objLang["net"]["yourname"] = "Uw Naam";
objLang["net"]["youremail"] = "Uw e-mail";
objLang["net"]["friendname"] = "Naam vriend";
objLang["net"]["friendemail"] = "E-mail vriend";
objLang["net"]["gameover"] = "Game Einde";
objLang["net"]["submitscore"] = "Opslaan score";
objLang["net"]["score"] = "Score";
objLang["net"]["complete"] = "Voltooid!";
objLang["net"]["pickup"] = "Pick-up <font color=\"#00B2D7\">mensen</font> van hier";
objLang["net"]["pickupsingle"] = "Pick-up <font color=\"#00B2D7\">een persoon</font> hier";
objLang["net"]["dropoff"] = "...en hier laat ze!";
objLang["net"]["pickupitem"] = "Pick-up <font color=\"#00B2D7\">personen</font> en <font color=\"#00B2D7\">vracht</font>";
objLang["net"]["pickupitemsingle"] = "Pick-up <font color=\"#00B2D7\">vracht</font> hier";
objLang["net"]["timeup"] = "Geen tijd meer";
objLang["net"]["dropoffitemsingle"] = "...en hier laat!";
objLang["net"]["success"] = "Game Compleet!";
objLang["net"]["overboard"] = "Passagier in water";
objLang["net"]["overboardlimit"] = "Lose NN meer en het 's einde van het spel";
objLang["net"]["error_yourname"] = "Uw naam ontbreekt";
objLang["net"]["error_youremail"] = "Uw e-mailadres is onjuist";
objLang["net"]["error_friends"] = "Jouw vrienden informatie ontbreekt";
objLang["net"]["send_success"] = "E-mail verzonden. Stuur een ander?";
objLang["net"]["disclaimer"] = "Dit is geen getrouwe weergave van de Birmingham en Amsterdamse gracht netwerken. Vrijheden werden gebruikt voor de doeleinden van de gameplay.";
objLang["net"]["competition"] = "Wie scoort het hoogste \"'Dam to the 'Ham\" zal <b>een overnachting winnen in een 4-sterren hotel</b> in Birmingham, en als u zich in Amsterdam zullen we zelfs vliegen je hier ook!";
objLang["net"]["terms"] = "Algemene Voorwaarden van toepassing - klik hier";
objLang["net"]["controls"] = "CONTROLE";
objLang["net"]["accel"] = "Versnel";
objLang["net"]["rotate"] = "Roteren";
objLang["net"]["reverse"] = "Keerzijde";
objLang["net"]["gameplay"] = "SPELREGELS";
objLang["net"]["gameplay_1"] = "Niveau 1: Pick-up mensen van rond Amsterdam en het vervoer ervan naar de luchthaven.";
objLang["net"]["gameplay_2"] = "Niveau 2: Vervoer uw passagiers uit Birmingham luchthaven naar hun gekozen bestemmingen.";
objLang["net"]["gameplay_3"] = "Niveau 3: Pick-up mensen uit de hele Birmingham en vervoer ze naar de luchthaven.";
btn_sound.text_label.text = objLang[strLang]["sound"];
addButtonHandler(logo_client, "CLICK", onClientLogoClicked);
addButtonHandler(btn_tamba, "CLICK", onTAMBAClicked);
addButtonHandler(btn_sound, "CLICK", onSoundClicked);
startPreloader();
}
public function onSoundClicked(_arg1:MouseEvent):void{
toggleSound();
}
public function preloaderLoop(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100);
preload_mc.text_pct.text = (Math.floor(_local2) + "%");
if (_local2 == 100){
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, preloaderLoop);
};
}
public function addButtonHandler(_arg1:Object, _arg2:String, _arg3:Function):void{
_arg1.addEventListener(MouseEvent[_arg2], _arg3);
if ((_arg1 is MovieClip)){
_arg1.mouseChildren = false;
_arg1.buttonMode = true;
_arg1.useHandCursor = true;
};
arrListeners.push([_arg1, _arg2, _arg3]);
}
public function playEngine():void{
var objClassDef:Object;
var objSound:Sound;
try {
objClassDef = getDefinitionByName("engine2");
objSound = new (objClassDef);
objChannelE = objSound.play(0, 99999);
setSoundVolume(intSoundVol);
} catch(e:Error) {
};
}
public function onTAMBAClicked(_arg1:MouseEvent):void{
getURL("http://www.tamba.co.uk", "_blank");
}
public function setMusicVolume(_arg1:uint):void{
var objTrans:SoundTransform;
var intVolume = _arg1;
try {
objTrans = objChannelM.soundTransform;
objTrans.volume = intVolume;
objChannelM.soundTransform = objTrans;
} catch(e:Error) {
};
intMusicVol = intVolume;
}
}
}//package damtotheham_fla
Section 19
//p1_f_66 (damtotheham_fla.p1_f_66)
package damtotheham_fla {
import flash.display.*;
public dynamic class p1_f_66 extends MovieClip {
public function p1_f_66(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 20
//p10_f_271 (damtotheham_fla.p10_f_271)
package damtotheham_fla {
import flash.display.*;
public dynamic class p10_f_271 extends MovieClip {
public function p10_f_271(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 21
//p2_f_85 (damtotheham_fla.p2_f_85)
package damtotheham_fla {
import flash.display.*;
public dynamic class p2_f_85 extends MovieClip {
public function p2_f_85(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 22
//p3_f_104 (damtotheham_fla.p3_f_104)
package damtotheham_fla {
import flash.display.*;
public dynamic class p3_f_104 extends MovieClip {
public function p3_f_104(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 23
//p4_f_129 (damtotheham_fla.p4_f_129)
package damtotheham_fla {
import flash.display.*;
public dynamic class p4_f_129 extends MovieClip {
public function p4_f_129(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 24
//p5_f_166 (damtotheham_fla.p5_f_166)
package damtotheham_fla {
import flash.display.*;
public dynamic class p5_f_166 extends MovieClip {
public function p5_f_166(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 25
//p6_f_201 (damtotheham_fla.p6_f_201)
package damtotheham_fla {
import flash.display.*;
public dynamic class p6_f_201 extends MovieClip {
public function p6_f_201(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 26
//p7_f_220 (damtotheham_fla.p7_f_220)
package damtotheham_fla {
import flash.display.*;
public dynamic class p7_f_220 extends MovieClip {
public function p7_f_220(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 27
//p8_f_239 (damtotheham_fla.p8_f_239)
package damtotheham_fla {
import flash.display.*;
public dynamic class p8_f_239 extends MovieClip {
public function p8_f_239(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 28
//p9_f_258 (damtotheham_fla.p9_f_258)
package damtotheham_fla {
import flash.display.*;
public dynamic class p9_f_258 extends MovieClip {
public function p9_f_258(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 29
//person_1_64 (damtotheham_fla.person_1_64)
package damtotheham_fla {
import flash.display.*;
public dynamic class person_1_64 extends MovieClip {
public var anim_mc:MovieClip;
public function person_1_64(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 30
//person_10_270 (damtotheham_fla.person_10_270)
package damtotheham_fla {
import flash.display.*;
public dynamic class person_10_270 extends MovieClip {
public var anim_mc:MovieClip;
public function person_10_270(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 31
//person_2_84 (damtotheham_fla.person_2_84)
package damtotheham_fla {
import flash.display.*;
public dynamic class person_2_84 extends MovieClip {
public var anim_mc:MovieClip;
public function person_2_84(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 32
//person_3_103 (damtotheham_fla.person_3_103)
package damtotheham_fla {
import flash.display.*;
public dynamic class person_3_103 extends MovieClip {
public var anim_mc:MovieClip;
public function person_3_103(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 33
//person_4_128 (damtotheham_fla.person_4_128)
package damtotheham_fla {
import flash.display.*;
public dynamic class person_4_128 extends MovieClip {
public var anim_mc:MovieClip;
public function person_4_128(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 34
//person_5_165 (damtotheham_fla.person_5_165)
package damtotheham_fla {
import flash.display.*;
public dynamic class person_5_165 extends MovieClip {
public var anim_mc:MovieClip;
public function person_5_165(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 35
//person_6_200 (damtotheham_fla.person_6_200)
package damtotheham_fla {
import flash.display.*;
public dynamic class person_6_200 extends MovieClip {
public var anim_mc:MovieClip;
public function person_6_200(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 36
//person_7_219 (damtotheham_fla.person_7_219)
package damtotheham_fla {
import flash.display.*;
public dynamic class person_7_219 extends MovieClip {
public var anim_mc:MovieClip;
public function person_7_219(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 37
//person_8_238 (damtotheham_fla.person_8_238)
package damtotheham_fla {
import flash.display.*;
public dynamic class person_8_238 extends MovieClip {
public var anim_mc:MovieClip;
public function person_8_238(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 38
//person_9_257 (damtotheham_fla.person_9_257)
package damtotheham_fla {
import flash.display.*;
public dynamic class person_9_257 extends MovieClip {
public var anim_mc:MovieClip;
public function person_9_257(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package damtotheham_fla
Section 39
//preload_mc_2 (damtotheham_fla.preload_mc_2)
package damtotheham_fla {
import flash.display.*;
import flash.text.*;
public dynamic class preload_mc_2 extends MovieClip {
public var text_pct:TextField;
}
}//package damtotheham_fla
Section 40
//screens_mc_394 (damtotheham_fla.screens_mc_394)
package damtotheham_fla {
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import gs.easing.*;
import flash.media.*;
import flash.text.*;
import remoting.*;
import fl.containers.*;
import flash.errors.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class screens_mc_394 extends MovieClip {
public var strNextScreen:String;
public var objScreens:MovieClip;
public var objRoot;
public var objCurrScreen:MovieClip;
public var objNextScreen:MovieClip;
public var objLang:Object;
public var arrListeners:Array;
public function screens_mc_394(){
addFrameScript(0, frame1);
}
public function onTextOut(_arg1:MouseEvent):void{
_arg1.currentTarget["text_label"].textColor = 0;
}
public function onLangNetClicked(_arg1:MouseEvent):void{
setLang("net");
}
public function showNextScreen():void{
if (objCurrScreen != null){
objScreens.removeChild(objCurrScreen);
};
TweenLite.to(objNextScreen, 0.3, {x:300, ease:Back.easeOut});
objCurrScreen = objNextScreen;
}
public function initLang():void{
objNextScreen = new screen_lang();
addButtonHandler(objNextScreen.btn_eng, "CLICK", onLangEngClicked);
addButtonHandler(objNextScreen.btn_net, "CLICK", onLangNetClicked);
addNextScreen();
}
public function initGameOver():void{
objNextScreen = new screen_gameover();
objNextScreen.text_prize.htmlText = objLang["competition"];
objNextScreen.btn_terms.text_label.htmlText = (("<i>" + objLang["terms"]) + "</i>");
objNextScreen.text_title.text = objLang["gameover"].toUpperCase();
objNextScreen.text_score.text = objLang["score"].toUpperCase();
objNextScreen.text_points.text = objRoot.intScore.toString();
objNextScreen.btn_submit.text_label.text = objLang["submit"].toUpperCase();
objNextScreen.btn_play.text_label.text = objLang["play"].toUpperCase();
addButtonHandler(objNextScreen.btn_play, "CLICK", onPlayClicked);
addButtonHandler(objNextScreen.btn_submit, "CLICK", onGameOverSubmitClicked);
addButtonHandler(objNextScreen.btn_terms, "CLICK", onTermsClicked);
addNextScreen();
}
public function addMouseOverEffect(_arg1:Object):void{
_arg1.addEventListener(MouseEvent.MOUSE_OVER, onTextOver);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, onTextOut);
arrListeners.push([_arg1, "MOUSE_OVER", onTextOver]);
arrListeners.push([_arg1, "MOUSE_OUT", onTextOut]);
}
public function onPlayClicked(_arg1:MouseEvent):void{
goToGame();
}
public function onTermsClicked(_arg1:MouseEvent):void{
if (objRoot.strLang == "net"){
objRoot.getURL("http://www.visitbirmingham.com/damtothehamnl/", "_blank");
} else {
objRoot.getURL("http://www.visitbirmingham.com/damtothehamuk/", "_blank");
};
}
public function validateSendFriendSubmit(_arg1:String, _arg2:String, _arg3:Array):Boolean{
var _local4:RegExp;
var _local5:uint;
var _local6:*;
_local4 = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/i;
_local5 = 0;
if (_arg1.length < 1){
objNextScreen.text_error.text = objLang["error_yourname"];
return (false);
};
if (!_local4.test(_arg2)){
objNextScreen.text_error.text = objLang["error_youremail"];
return (false);
};
_local6 = 0;
while (_local6 < _arg3.length) {
if (((_arg3[_local6][0]) && (!(_local4.test(_arg3[_local6][1]))))){
objNextScreen.text_error.text = objLang["error_friends"];
return (false);
};
if (((!(_arg3[_local6][0])) && (_local4.test(_arg3[_local6][1])))){
objNextScreen.text_error.text = objLang["error_friends"];
return (false);
};
if (((_arg3[_local6][0]) && (_local4.test(_arg3[_local6][1])))){
_local5++;
};
_local6++;
};
if (_local5 <= 0){
objNextScreen.text_error.text = objLang["error_friends"];
return (false);
};
return (true);
}
public function onGameOverSubmitClicked(_arg1:MouseEvent):void{
if (objRoot.intScoreSub == 1){
strNextScreen = "highscores";
} else {
strNextScreen = "submitscore";
};
swapScreens();
}
public function trim(_arg1:String):String{
if (_arg1 == null){
return ("");
};
return (_arg1.replace(/^\s+|\s+$/g, ""));
}
public function onSubmitScoreBackClicked(_arg1:MouseEvent):void{
strNextScreen = "gameover";
swapScreens();
}
public function onTitleSendFriendClicked(_arg1:MouseEvent):void{
strNextScreen = "sendfriend";
swapScreens();
}
public function initSubmitScore():void{
objNextScreen = new screen_submitscore();
objNextScreen.text_prize.htmlText = objLang["competition"];
objNextScreen.btn_terms.text_label.htmlText = (("<i>" + objLang["terms"]) + "</i>");
addButtonHandler(objNextScreen.btn_terms, "CLICK", onTermsClicked);
objNextScreen.text_title.text = objLang["submitscore"].toUpperCase();
objNextScreen.text_yourname.text = objLang["yourname"];
objNextScreen.text_youremail.text = objLang["youremail"];
objNextScreen.btn_back.text_label.text = objLang["back"].toUpperCase();
objNextScreen.btn_submit.text_label.text = objLang["submit"].toUpperCase();
addButtonHandler(objNextScreen.btn_submit, "CLICK", onSubmitScoreSubmitted);
addButtonHandler(objNextScreen.btn_back, "CLICK", onSubmitScoreBackClicked);
addNextScreen();
}
public function submittedScore():void{
objRoot.intScoreSub = 1;
strNextScreen = "highscores";
swapScreens();
}
public function validateScoreSubmit(_arg1:String, _arg2:String):Boolean{
var _local3:RegExp;
_local3 = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/i;
if (_arg1.length < 1){
objNextScreen.text_error.text = objLang["error_yourname"];
return (false);
};
if (!_local3.test(_arg2)){
objNextScreen.text_error.text = objLang["error_youremail"];
return (false);
};
return (true);
}
public function onInstructBackClicked(_arg1:MouseEvent):void{
strNextScreen = "title";
swapScreens();
}
public function submitScore():void{
var _local1:String;
var _local2:String;
var _local3:Remoting;
_local1 = trim(objNextScreen.input_name.text);
_local2 = trim(objNextScreen.input_email.text);
if (validateScoreSubmit(_local1, _local2)){
objNextScreen.btn_submit.visible = false;
_local3 = new Remoting(this);
_local3.setHighScore(_local1, _local2, objRoot.intScore);
};
}
function frame1(){
objRoot = Object(root);
objScreens = this;
strNextScreen = objRoot.strNextScreen;
objCurrScreen = null;
objNextScreen = null;
objLang = objRoot.objLang[objRoot.strLang];
arrListeners = [];
objRoot.text_disclaim.text = "";
swapScreens();
}
public function showHighScores(_arg1:Object):void{
var _local2:MovieClip;
var _local3:ScrollPane;
var _local4:*;
var _local5:*;
var _local6:leaderboard_line;
_local2 = new MovieClip();
_local3 = new ScrollPane();
_local4 = 0;
objNextScreen.addChild(_local2);
objNextScreen.addChild(_local3);
_local2.scaleX = (_local2.scaleY = 0.8);
_local5 = 0;
while (_local5 < _arg1.length) {
_local6 = new leaderboard_line();
_local6.y = _local4;
_local6.text_name.text = _arg1[_local5]["name"];
_local6.text_score.text = _arg1[_local5]["score"];
_local2.addChild(_local6);
_local4 = (_local4 + _local6.height);
_local5++;
};
_local2.x = -60;
_local2.y = -78;
_local3.move(_local2.x, _local2.y);
_local3.setSize((_local2.width + 25), 190);
_local3.setStyle("upSkin", new MovieClip());
_local3.source = _local2;
}
public function setLang(_arg1:String):void{
objRoot.strLang = _arg1;
objLang = objRoot.objLang[objRoot.strLang];
objRoot.btn_sound.text_label.text = objLang["sound"];
strNextScreen = "title";
swapScreens();
}
public function initSendFriend():void{
objNextScreen = new screen_sendfriend();
objNextScreen.text_title.text = objLang["sendfriend"].toUpperCase();
objNextScreen.text_yourname.text = objLang["yourname"];
objNextScreen.text_youremail.text = objLang["youremail"];
objNextScreen.text_friendname.text = objLang["friendname"];
objNextScreen.text_friendemail.text = objLang["friendemail"];
objNextScreen.btn_back.text_label.text = objLang["back"].toUpperCase();
objNextScreen.btn_submit.text_label.text = objLang["submit"].toUpperCase();
addButtonHandler(objNextScreen.btn_submit, "CLICK", onSendFriendSubmitted);
addButtonHandler(objNextScreen.btn_back, "CLICK", onSendFriendBackClicked);
addNextScreen();
}
public function swapScreens():void{
killListeners();
initScreen(strNextScreen);
if (objCurrScreen != null){
TweenLite.to(objCurrScreen, 0.4, {x:-(objCurrScreen.width), ease:Strong.easeIn, onComplete:function (){
showNextScreen();
}});
} else {
showNextScreen();
};
}
public function onSendFriendBackClicked(_arg1:MouseEvent):void{
strNextScreen = "title";
swapScreens();
}
public function addButtonHandler(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Boolean=false):void{
_arg1.addEventListener(MouseEvent[_arg2], _arg3);
if ((_arg1 is MovieClip)){
_arg1.mouseChildren = false;
_arg1.buttonMode = true;
_arg1.useHandCursor = true;
};
arrListeners.push([_arg1, _arg2, _arg3]);
if (_arg4){
addMouseOverEffect(_arg1);
};
}
public function killListeners():void{
var s:*;
for (s in arrListeners) {
try {
arrListeners[s][0].removeEventListener(MouseEvent[arrListeners[s][1]], arrListeners[s][2]);
arrListeners.shift();
} catch(e:Error) {
};
};
}
public function initHighScores():void{
var _local1:Remoting;
_local1 = new Remoting(this);
_local1.getHighScores(20);
objNextScreen = new screen_scores();
objNextScreen.text_title.text = objLang["highscores"].toUpperCase();
objNextScreen.btn_back.text_label.text = objLang["back"].toUpperCase();
addButtonHandler(objNextScreen.btn_back, "CLICK", onScoresBackClicked);
addNextScreen();
}
public function sendToFriend():void{
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:Array;
var _local10:Remoting;
var _local11:*;
_local1 = objNextScreen.input_yourname.text;
_local2 = objNextScreen.input_youremail.text;
_local3 = objNextScreen.input_friendname_1.text;
_local4 = objNextScreen.input_friendemail_1.text;
_local5 = objNextScreen.input_friendname_2.text;
_local6 = objNextScreen.input_friendemail_2.text;
_local7 = objNextScreen.input_friendname_3.text;
_local8 = objNextScreen.input_friendemail_3.text;
_local9 = [[_local3, _local4], [_local5, _local6], [_local7, _local8]];
if (validateSendFriendSubmit(_local1, _local2, _local9)){
objNextScreen.btn_submit.visible = false;
_local10 = new Remoting(this);
_local11 = 0;
_local10.sendToFriend(_local1, _local2, _local9, _local11, objRoot.strLang);
};
}
public function onTitleInstructClicked(_arg1:MouseEvent):void{
strNextScreen = "instruct";
swapScreens();
}
public function onTextOver(_arg1:MouseEvent):void{
_arg1.currentTarget["text_label"].textColor = 45783;
}
public function sentToFriend():void{
objNextScreen.btn_submit.visible = true;
objNextScreen.input_friendname_1.text = "";
objNextScreen.input_friendemail_1.text = "";
objNextScreen.input_friendname_2.text = "";
objNextScreen.input_friendemail_2.text = "";
objNextScreen.input_friendname_3.text = "";
objNextScreen.input_friendemail_3.text = "";
objNextScreen.text_error.text = objLang["send_success"];
}
public function clearScreens():void{
killListeners();
while (objScreens.numChildren) {
objScreens.removeChildAt(0);
};
}
public function onTitleScoresClicked(_arg1:MouseEvent):void{
strNextScreen = "highscores";
swapScreens();
}
public function initTitleScreen():void{
objNextScreen = new screen_title();
objNextScreen.btn_playnow.text_label.text = objLang["playnow"].toUpperCase();
objNextScreen.btn_instruct.text_label.text = objLang["instruct"].toUpperCase();
objNextScreen.btn_highscores.text_label.text = objLang["highscores"].toUpperCase();
objNextScreen.btn_sendfriend.text_label.text = objLang["sendfriend"].toUpperCase();
addButtonHandler(objNextScreen.btn_playnow, "CLICK", onPlayClicked, true);
addButtonHandler(objNextScreen.btn_instruct, "CLICK", onTitleInstructClicked, true);
addButtonHandler(objNextScreen.btn_highscores, "CLICK", onTitleScoresClicked, true);
addButtonHandler(objNextScreen.btn_sendfriend, "CLICK", onTitleSendFriendClicked, true);
addNextScreen();
}
public function onLangEngClicked(_arg1:MouseEvent):void{
setLang("eng");
}
public function initScreen(_arg1:String):void{
if (_arg1 == "title"){
initTitleScreen();
} else {
if (_arg1 == "instruct"){
initInstructions();
} else {
if (_arg1 == "highscores"){
initHighScores();
} else {
if (_arg1 == "submitscore"){
initSubmitScore();
} else {
if (_arg1 == "sendfriend"){
initSendFriend();
} else {
if (_arg1 == "gameover"){
initGameOver();
} else {
if (_arg1 == "lang"){
initLang();
};
};
};
};
};
};
};
}
public function addNextScreen():void{
objNextScreen.scaleX = (objNextScreen.scaleY = 1.2);
objNextScreen.x = -(objNextScreen.width);
objNextScreen.y = 300;
objScreens.addChild(objNextScreen);
}
public function goToGame():void{
objRoot.intScoreSub = 0;
objRoot.stopSound();
clearScreens();
objRoot.gotoAndStop("game");
}
public function initInstructions():void{
objNextScreen = new screen_instruct();
objNextScreen.text_title.text = objLang["instruct"].toUpperCase();
objNextScreen.text_controls.text = objLang["controls"];
objNextScreen.text_up.text = objLang["accel"];
objNextScreen.text_down.text = objLang["reverse"];
objNextScreen.text_left.text = objLang["rotate"];
objNextScreen.text_right.text = objLang["rotate"];
objNextScreen.text_gameplay.text = objLang["gameplay"];
objNextScreen.text_gameplay_1.text = objLang["gameplay_1"];
objNextScreen.text_gameplay_2.text = objLang["gameplay_2"];
objNextScreen.text_gameplay_3.text = objLang["gameplay_3"];
objNextScreen.btn_back.text_label.text = objLang["back"].toUpperCase();
objNextScreen.btn_play.text_label.text = objLang["play"].toUpperCase();
addButtonHandler(objNextScreen.btn_play, "CLICK", onPlayClicked);
addButtonHandler(objNextScreen.btn_back, "CLICK", onInstructBackClicked);
addNextScreen();
}
public function onScoresBackClicked(_arg1:MouseEvent):void{
strNextScreen = "title";
swapScreens();
}
public function onSubmitScoreSubmitted(_arg1:MouseEvent):void{
submitScore();
}
public function onSendFriendSubmitted(_arg1:MouseEvent):void{
sendToFriend();
}
}
}//package damtotheham_fla
Section 41
//splash_mc_398 (damtotheham_fla.splash_mc_398)
package damtotheham_fla {
import flash.display.*;
public dynamic class splash_mc_398 extends MovieClip {
public function splash_mc_398(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package damtotheham_fla
Section 42
//BaseScrollPane (fl.containers.BaseScrollPane)
package fl.containers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.geom.*;
import fl.events.*;
public class BaseScrollPane extends UIComponent {
protected var defaultLineScrollSize:Number;// = 4
protected var _maxHorizontalScrollPosition:Number;// = 0
protected var vScrollBar:Boolean;
protected var disabledOverlay:Shape;
protected var hScrollBar:Boolean;
protected var availableWidth:Number;
protected var _verticalPageScrollSize:Number;// = 0
protected var vOffset:Number;// = 0
protected var _verticalScrollBar:ScrollBar;
protected var useFixedHorizontalScrolling:Boolean;// = false
protected var contentWidth:Number;// = 0
protected var contentHeight:Number;// = 0
protected var _horizontalPageScrollSize:Number;// = 0
protected var background:DisplayObject;
protected var _useBitmpScrolling:Boolean;// = false
protected var contentPadding:Number;// = 0
protected var availableHeight:Number;
protected var _horizontalScrollBar:ScrollBar;
protected var contentScrollRect:Rectangle;
protected var _horizontalScrollPolicy:String;
protected var _verticalScrollPolicy:String;
protected static const SCROLL_BAR_STYLES:Object = {upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {repeatDelay:500, repeatInterval:35, skin:"ScrollPane_upSkin", contentPadding:0, disabledAlpha:0.5};
public function BaseScrollPane(){
contentWidth = 0;
contentHeight = 0;
contentPadding = 0;
vOffset = 0;
_maxHorizontalScrollPosition = 0;
_horizontalPageScrollSize = 0;
_verticalPageScrollSize = 0;
defaultLineScrollSize = 4;
useFixedHorizontalScrolling = false;
_useBitmpScrolling = false;
super();
}
protected function handleWheel(_arg1:MouseEvent):void{
if (((((!(enabled)) || (!(_verticalScrollBar.visible)))) || ((contentHeight <= availableHeight)))){
return;
};
_verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * verticalLineScrollSize));
setVerticalScrollPosition(_verticalScrollBar.scrollPosition);
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _arg1.delta, horizontalScrollPosition));
}
public function get verticalScrollPosition():Number{
return (_verticalScrollBar.scrollPosition);
}
protected function drawDisabledOverlay():void{
if (enabled){
if (contains(disabledOverlay)){
removeChild(disabledOverlay);
};
} else {
disabledOverlay.x = (disabledOverlay.y = contentPadding);
disabledOverlay.width = availableWidth;
disabledOverlay.height = availableHeight;
disabledOverlay.alpha = (getStyleValue("disabledAlpha") as Number);
addChild(disabledOverlay);
};
}
public function set verticalScrollPosition(_arg1:Number):void{
drawNow();
_verticalScrollBar.scrollPosition = _arg1;
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
}
protected function setContentSize(_arg1:Number, _arg2:Number):void{
if ((((((contentWidth == _arg1)) || (useFixedHorizontalScrolling))) && ((contentHeight == _arg2)))){
return;
};
contentWidth = _arg1;
contentHeight = _arg2;
invalidate(InvalidationType.SIZE);
}
public function get horizontalScrollPosition():Number{
return (_horizontalScrollBar.scrollPosition);
}
public function get horizontalScrollBar():ScrollBar{
return (_horizontalScrollBar);
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
_verticalScrollBar.enabled = _arg1;
_horizontalScrollBar.enabled = _arg1;
super.enabled = _arg1;
}
public function get verticalLineScrollSize():Number{
return (_verticalScrollBar.lineScrollSize);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
protected function calculateAvailableSize():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = ScrollBar.WIDTH;
_local2 = (contentPadding = Number(getStyleValue("contentPadding")));
_local3 = ((height - (2 * _local2)) - vOffset);
vScrollBar = (((_verticalScrollPolicy == ScrollPolicy.ON)) || ((((_verticalScrollPolicy == ScrollPolicy.AUTO)) && ((contentHeight > _local3)))));
_local4 = ((width - (vScrollBar) ? _local1 : 0) - (2 * _local2));
_local5 = (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - _local4);
hScrollBar = (((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_local5 > 0)))));
if (hScrollBar){
_local3 = (_local3 - _local1);
};
if (((((((hScrollBar) && (!(vScrollBar)))) && ((_verticalScrollPolicy == ScrollPolicy.AUTO)))) && ((contentHeight > _local3)))){
vScrollBar = true;
_local4 = (_local4 - _local1);
};
availableHeight = (_local3 + vOffset);
availableWidth = _local4;
}
public function get maxVerticalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentHeight - availableHeight)));
}
public function set horizontalScrollPosition(_arg1:Number):void{
drawNow();
_horizontalScrollBar.scrollPosition = _arg1;
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
}
public function get horizontalLineScrollSize():Number{
return (_horizontalScrollBar.lineScrollSize);
}
public function set verticalPageScrollSize(_arg1:Number):void{
_verticalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function get useBitmapScrolling():Boolean{
return (_useBitmpScrolling);
}
protected function handleScroll(_arg1:ScrollEvent):void{
if (_arg1.target == _verticalScrollBar){
setVerticalScrollPosition(_arg1.position);
} else {
setHorizontalScrollPosition(_arg1.position);
};
}
public function set verticalLineScrollSize(_arg1:Number):void{
_verticalScrollBar.lineScrollSize = _arg1;
}
public function get verticalScrollBar():ScrollBar{
return (_verticalScrollBar);
}
protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function set horizontalPageScrollSize(_arg1:Number):void{
_horizontalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STATE)){
drawLayout();
};
updateChildren();
super.draw();
}
public function set horizontalScrollPolicy(_arg1:String):void{
_horizontalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function configUI():void{
var _local1:Graphics;
super.configUI();
contentScrollRect = new Rectangle(0, 0, 85, 85);
_verticalScrollBar = new ScrollBar();
_verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_verticalScrollBar.visible = false;
_verticalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_verticalScrollBar);
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
_horizontalScrollBar = new ScrollBar();
_horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL;
_horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_horizontalScrollBar.visible = false;
_horizontalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_horizontalScrollBar);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
disabledOverlay = new Shape();
_local1 = disabledOverlay.graphics;
_local1.beginFill(0xFFFFFF);
_local1.drawRect(0, 0, width, height);
_local1.endFill();
addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);
}
protected function calculateContentWidth():void{
}
public function get verticalPageScrollSize():Number{
if (isNaN(availableHeight)){
drawNow();
};
return (((((_verticalPageScrollSize == 0)) && (!(isNaN(availableHeight))))) ? availableHeight : _verticalPageScrollSize);
}
protected function drawLayout():void{
calculateAvailableSize();
calculateContentWidth();
background.width = width;
background.height = height;
if (vScrollBar){
_verticalScrollBar.visible = true;
_verticalScrollBar.x = ((width - ScrollBar.WIDTH) - contentPadding);
_verticalScrollBar.y = contentPadding;
_verticalScrollBar.height = availableHeight;
} else {
_verticalScrollBar.visible = false;
};
_verticalScrollBar.setScrollProperties(availableHeight, 0, (contentHeight - availableHeight), verticalPageScrollSize);
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
if (hScrollBar){
_horizontalScrollBar.visible = true;
_horizontalScrollBar.x = contentPadding;
_horizontalScrollBar.y = ((height - ScrollBar.WIDTH) - contentPadding);
_horizontalScrollBar.width = availableWidth;
} else {
_horizontalScrollBar.visible = false;
};
_horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), horizontalPageScrollSize);
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
drawDisabledOverlay();
}
protected function drawBackground():void{
var _local1:DisplayObject;
_local1 = background;
background = getDisplayObjectInstance(getStyleValue("skin"));
background.width = width;
background.height = height;
addChildAt(background, 0);
if (((!((_local1 == null))) && (!((_local1 == background))))){
removeChild(_local1);
};
}
public function set horizontalLineScrollSize(_arg1:Number):void{
_horizontalScrollBar.lineScrollSize = _arg1;
}
public function get horizontalPageScrollSize():Number{
if (isNaN(availableWidth)){
drawNow();
};
return (((((_horizontalPageScrollSize == 0)) && (!(isNaN(availableWidth))))) ? availableWidth : _horizontalPageScrollSize);
}
public function get maxHorizontalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentWidth - availableWidth)));
}
protected function setStyles():void{
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
}
protected function updateChildren():void{
_verticalScrollBar.enabled = (_horizontalScrollBar.enabled = enabled);
_verticalScrollBar.drawNow();
_horizontalScrollBar.drawNow();
}
public function set verticalScrollPolicy(_arg1:String):void{
_verticalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set useBitmapScrolling(_arg1:Boolean):void{
_useBitmpScrolling = _arg1;
invalidate(InvalidationType.STATE);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.containers
Section 43
//ScrollPane (fl.containers.ScrollPane)
package fl.containers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public class ScrollPane extends BaseScrollPane implements IFocusManagerComponent {
protected var scrollDragHPos:Number;
protected var loader:Loader;
protected var yOffset:Number;
protected var currentContent:Object;
protected var xOffset:Number;
protected var _source:Object;// = ""
protected var scrollDragVPos:Number;
protected var _scrollDrag:Boolean;// = false
protected var contentClip:Sprite;
private static var defaultStyles:Object = {upSkin:"ScrollPane_upSkin", disabledSkin:"ScrollPane_disabledSkin", focusRectSkin:null, focusRectPadding:null, contentPadding:0};
public function ScrollPane(){
_source = "";
_scrollDrag = false;
super();
}
public function get source():Object{
return (_source);
}
public function set source(_arg1:Object):void{
var _local2:*;
clearContent();
if (isLivePreview){
return;
};
_source = _arg1;
if ((((_source == "")) || ((_source == null)))){
return;
};
currentContent = getDisplayObjectInstance(_arg1);
if (currentContent != null){
_local2 = contentClip.addChild((currentContent as DisplayObject));
dispatchEvent(new Event(Event.INIT));
update();
} else {
load(new URLRequest(_source.toString()));
};
}
public function get bytesLoaded():Number{
return (((((loader == null)) || ((loader.contentLoaderInfo == null)))) ? 0 : loader.contentLoaderInfo.bytesLoaded);
}
protected function doDrag(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = (scrollDragVPos - (mouseY - yOffset));
_verticalScrollBar.setScrollPosition(_local2);
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, true);
_local3 = (scrollDragHPos - (mouseX - xOffset));
_horizontalScrollBar.setScrollPosition(_local3);
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, true);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = calculateAvailableHeight();
switch (_arg1.keyCode){
case Keyboard.DOWN:
verticalScrollPosition++;
break;
case Keyboard.UP:
verticalScrollPosition--;
break;
case Keyboard.RIGHT:
horizontalScrollPosition++;
break;
case Keyboard.LEFT:
horizontalScrollPosition--;
break;
case Keyboard.END:
verticalScrollPosition = maxVerticalScrollPosition;
break;
case Keyboard.HOME:
verticalScrollPosition = 0;
break;
case Keyboard.PAGE_UP:
verticalScrollPosition = (verticalScrollPosition - _local2);
break;
case Keyboard.PAGE_DOWN:
verticalScrollPosition = (verticalScrollPosition + _local2);
break;
};
}
protected function doStartDrag(_arg1:MouseEvent):void{
if (!enabled){
return;
};
xOffset = mouseX;
yOffset = mouseY;
scrollDragHPos = horizontalScrollPosition;
scrollDragVPos = verticalScrollPosition;
stage.addEventListener(MouseEvent.MOUSE_MOVE, doDrag, false, 0, true);
}
public function get content():DisplayObject{
var _local1:Object;
_local1 = currentContent;
if ((_local1 is URLRequest)){
_local1 = loader.content;
};
return ((_local1 as DisplayObject));
}
public function get percentLoaded():Number{
if (loader != null){
return (Math.round(((bytesLoaded / bytesTotal) * 100)));
};
return (0);
}
protected function endDrag(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
}
public function update():void{
var _local1:DisplayObject;
_local1 = contentClip.getChildAt(0);
setContentSize(_local1.width, _local1.height);
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:*;
_local3 = contentClip.scrollRect;
_local3.x = _arg1;
contentClip.scrollRect = _local3;
}
public function refreshPane():void{
if ((_source is URLRequest)){
_source = _source.url;
};
source = _source;
}
protected function passEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
protected function calculateAvailableHeight():Number{
var _local1:Number;
_local1 = Number(getStyleValue("contentPadding"));
return (((height - (_local1 * 2)) - ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0));
}
public function load(_arg1:URLRequest, _arg2:LoaderContext=null):void{
if (_arg2 == null){
_arg2 = new LoaderContext(false, ApplicationDomain.currentDomain);
};
clearContent();
initLoader();
currentContent = (_source = _arg1);
loader.load(_arg1, _arg2);
}
override protected function handleScroll(_arg1:ScrollEvent):void{
passEvent(_arg1);
super.handleScroll(_arg1);
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:*;
_local3 = contentClip.scrollRect;
_local3.y = _arg1;
contentClip.scrollRect = _local3;
}
protected function initLoader():void{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, passEvent, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onContentLoad, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.INIT, passEvent, false, 0, true);
contentClip.addChild(loader);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
drawBackground();
};
if (isInvalid(InvalidationType.STATE)){
setScrollDrag();
};
super.draw();
}
override protected function configUI():void{
super.configUI();
contentClip = new Sprite();
addChild(contentClip);
contentClip.scrollRect = contentScrollRect;
_horizontalScrollPolicy = ScrollPolicy.AUTO;
_verticalScrollPolicy = ScrollPolicy.AUTO;
}
public function set scrollDrag(_arg1:Boolean):void{
_scrollDrag = _arg1;
invalidate(InvalidationType.STATE);
}
protected function clearContent():void{
if (contentClip.numChildren == 0){
return;
};
contentClip.removeChildAt(0);
currentContent = null;
if (loader != null){
try {
loader.close();
} catch(e) {
};
try {
loader.unload();
} catch(e) {
};
loader = null;
};
}
override protected function drawLayout():void{
super.drawLayout();
contentScrollRect = contentClip.scrollRect;
contentScrollRect.width = availableWidth;
contentScrollRect.height = availableHeight;
contentClip.cacheAsBitmap = useBitmapScrolling;
contentClip.scrollRect = contentScrollRect;
contentClip.x = (contentClip.y = contentPadding);
}
override protected function drawBackground():void{
var _local1:DisplayObject;
_local1 = background;
background = getDisplayObjectInstance(getStyleValue((enabled) ? "upSkin" : "disabledSkin"));
background.width = width;
background.height = height;
addChildAt(background, 0);
if (((!((_local1 == null))) && (!((_local1 == background))))){
removeChild(_local1);
};
}
public function get bytesTotal():Number{
return (((((loader == null)) || ((loader.contentLoaderInfo == null)))) ? 0 : loader.contentLoaderInfo.bytesTotal);
}
protected function onContentLoad(_arg1:Event):void{
var _local2:*;
update();
_local2 = calculateAvailableHeight();
calculateAvailableSize();
horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), availableWidth);
verticalScrollBar.setScrollProperties(_local2, 0, (contentHeight - _local2), _local2);
passEvent(_arg1);
}
public function get scrollDrag():Boolean{
return (_scrollDrag);
}
protected function setScrollDrag():void{
if (_scrollDrag){
contentClip.addEventListener(MouseEvent.MOUSE_DOWN, doStartDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, endDrag, false, 0, true);
} else {
contentClip.removeEventListener(MouseEvent.MOUSE_DOWN, doStartDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, endDrag);
removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
};
contentClip.buttonMode = _scrollDrag;
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseScrollPane.getStyleDefinition()));
}
}
}//package fl.containers
Section 44
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.utils.*;
import fl.events.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 45
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 46
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 47
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 48
//ScrollBar (fl.controls.ScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import fl.events.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
protected var inDrag:Boolean;// = false
protected var upArrow:BaseButton;
private var _pageScrollSize:Number;// = 0
protected var downArrow:BaseButton;
private var _pageSize:Number;// = 10
private var thumbScrollOffset:Number;
private var _maxScrollPosition:Number;// = 0
private var _scrollPosition:Number;// = 0
protected var track:BaseButton;
private var _minScrollPosition:Number;// = 0
private var _lineScrollSize:Number;// = 1
protected var thumb:LabelButton;
protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0};
public static const WIDTH:Number = 15;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35};
public function ScrollBar(){
_pageSize = 10;
_pageScrollSize = 0;
_lineScrollSize = 1;
_minScrollPosition = 0;
_maxScrollPosition = 0;
_scrollPosition = 0;
_direction = ScrollBarDirection.VERTICAL;
inDrag = false;
super();
setStyles();
focusEnabled = false;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
public function set minScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _arg1, _maxScrollPosition);
}
public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
_local3 = scrollPosition;
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1));
if (_local3 == _scrollPosition){
return;
};
if (_arg2){
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition));
};
updateThumb();
}
public function set scrollPosition(_arg1:Number):void{
setScrollPosition(_arg1, true);
}
public function get pageScrollSize():Number{
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize);
}
public function set pageSize(_arg1:Number):void{
if (_arg1 > 0){
_pageSize = _arg1;
};
}
public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
this.pageSize = _arg1;
_minScrollPosition = _arg2;
_maxScrollPosition = _arg3;
if (_arg4 >= 0){
_pageScrollSize = _arg4;
};
enabled = (_maxScrollPosition > _minScrollPosition);
setScrollPosition(_scrollPosition, false);
updateThumb();
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition))))));
updateThumb();
}
protected function updateThumb():void{
var _local1:Number;
_local1 = ((_maxScrollPosition - _minScrollPosition) + _pageSize);
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = Math.max(13, ((_pageSize / _local1) * track.height));
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition))));
thumb.visible = enabled;
};
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
inDrag = true;
thumbScrollOffset = (mouseY - thumb.y);
thumb.mouseStateLocked = true;
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
inDrag = false;
mouseChildren = true;
thumb.mouseStateLocked = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
}
public function set pageScrollSize(_arg1:Number):void{
if (_arg1 >= 0){
_pageScrollSize = _arg1;
};
}
protected function handleThumbDrag(_arg1:MouseEvent):void{
var _local2:Number;
_local2 = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset)));
setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition));
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
if (_direction == _arg1){
return;
};
_direction = _arg1;
if (isLivePreview){
return;
};
setScaleY(1);
_local2 = (_direction == ScrollBarDirection.HORIZONTAL);
if (((_local2) && (componentInspectorSetting))){
if (rotation == 90){
return;
};
setScaleX(-1);
rotation = -90;
};
if (!componentInspectorSetting){
if (((_local2) && ((rotation == 0)))){
rotation = -90;
setScaleX(-1);
} else {
if (((!(_local2)) && ((rotation == -90)))){
rotation = 0;
setScaleX(1);
};
};
};
invalidate(InvalidationType.SIZE);
}
public function set lineScrollSize(_arg1:Number):void{
if (_arg1 > 0){
_lineScrollSize = _arg1;
};
}
override public function get height():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height);
}
protected function scrollPressHandler(_arg1:ComponentEvent):void{
var _local2:Number;
var _local3:Number;
_arg1.stopImmediatePropagation();
if (_arg1.currentTarget == upArrow){
setScrollPosition((_scrollPosition - _lineScrollSize));
} else {
if (_arg1.currentTarget == downArrow){
setScrollPosition((_scrollPosition + _lineScrollSize));
} else {
_local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition);
_local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize;
if (_scrollPosition < _local2){
setScrollPosition(Math.min(_local2, (_scrollPosition + _local3)));
} else {
if (_scrollPosition > _local2){
setScrollPosition(Math.max(_local2, (_scrollPosition - _local3)));
};
};
};
};
}
public function get pageSize():Number{
return (_pageSize);
}
public function set maxScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _minScrollPosition, _arg1);
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
var _local1:Number;
if (isInvalid(InvalidationType.SIZE)){
_local1 = super.height;
downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height)));
track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height))));
updateThumb();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
};
downArrow.drawNow();
upArrow.drawNow();
track.drawNow();
thumb.drawNow();
validate();
}
override protected function configUI():void{
super.configUI();
track = new BaseButton();
track.move(0, 14);
track.useHandCursor = false;
track.autoRepeat = true;
track.focusEnabled = false;
addChild(track);
thumb = new LabelButton();
thumb.label = "";
thumb.setSize(WIDTH, 15);
thumb.move(0, 15);
thumb.focusEnabled = false;
addChild(thumb);
downArrow = new BaseButton();
downArrow.setSize(WIDTH, 14);
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
addChild(downArrow);
upArrow = new BaseButton();
upArrow.setSize(WIDTH, 14);
upArrow.move(0, 0);
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
addChild(upArrow);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
enabled = false;
}
public function get direction():String{
return (_direction);
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if (_direction == ScrollBarDirection.HORIZONTAL){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
override public function get width():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 49
//ScrollBarDirection (fl.controls.ScrollBarDirection)
package fl.controls {
public class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
}
}//package fl.controls
Section 50
//ScrollPolicy (fl.controls.ScrollPolicy)
package fl.controls {
public class ScrollPolicy {
public static const OFF:String = "off";
public static const ON:String = "on";
public static const AUTO:String = "auto";
}
}//package fl.controls
Section 51
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 52
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 53
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import fl.managers.*;
import fl.events.*;
import flash.system.*;
import flash.text.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 54
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 55
//ScrollEvent (fl.events.ScrollEvent)
package fl.events {
import flash.events.*;
public class ScrollEvent extends Event {
private var _position:Number;
private var _direction:String;
private var _delta:Number;
public static const SCROLL:String = "scroll";
public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){
super(ScrollEvent.SCROLL, false, false);
_direction = _arg1;
_delta = _arg2;
_position = _arg3;
}
override public function clone():Event{
return (new ScrollEvent(_direction, _delta, _position));
}
public function get position():Number{
return (_position);
}
override public function toString():String{
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position"));
}
public function get delta():Number{
return (_delta);
}
public function get direction():String{
return (_direction);
}
}
}//package fl.events
Section 56
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 57
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 58
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 59
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 60
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.utils.*;
import flash.text.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 61
//Back (gs.easing.Back)
package gs.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package gs.easing
Section 62
//Bounce (gs.easing.Bounce)
package gs.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package gs.easing
Section 63
//Strong (gs.easing.Strong)
package gs.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package gs.easing
Section 64
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
}
}//package gs.plugins
Section 65
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _info:Array;
protected var _a:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function init(_arg1:Array, _arg2:Array):void{
var _local3:int;
_a = _arg1;
_local3 = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
}
}//package gs.plugins
Section 66
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
public var frame:int;
protected var _target:MovieClip;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
}
}//package gs.plugins
Section 67
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 68
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
protected var _target:DisplayObject;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _target.transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:ColorTransform;
if (!(_arg1 is DisplayObject)){
return (false);
};
_local4 = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
}
}//package gs.plugins
Section 69
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var round:Boolean;
public var onComplete:Function;
public var propName:String;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
_changeFactor = 0;
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package gs.plugins
Section 70
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
}
}//package gs.plugins
Section 71
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _st:SoundTransform;
protected var _target:Object;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
}
}//package gs.plugins
Section 72
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var index:uint;
public var start:Number;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 73
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package gs.utils.tween
Section 74
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import gs.utils.tween.*;
import gs.plugins.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var started:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var vars:Object;
public var ease:Function;
public var tweens:Array;
public var exposedVars:Object;
public var combinedTimeScale:Number;
public var initTime:Number;
public static const version:Number = 10.092;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:int;
super();
if (_arg1 == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
_local4 = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
_local2 = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local2:uint;
var _local3:Dictionary;
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
_local2 = (currentTime = getTimer());
_local3 = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 75
//Remoting (remoting.Remoting)
package remoting {
import flash.display.*;
import flash.net.*;
import com.adobe.crypto.*;
public class Remoting extends Sprite {
private var _strRemoteClass:String;// = "GameFunctions"
private var _objParent;
private var _strRootURL:String;// = "http://www.tamba-games.co.uk/mktgbirm"
private var rspGetHighScores:Responder;
private var rspSendToFriend:Responder;
private var _strServiceURL:String;
private var rspSetHighScore:Responder;
private var _objNC:NetConnection;
public function Remoting(_arg1):void{
_strRootURL = "http://www.tamba-games.co.uk/mktgbirm";
_strServiceURL = (_strRootURL + "/amfphp/gateway.php");
_objNC = new NetConnection();
_strRemoteClass = "GameFunctions";
rspGetHighScores = new Responder(handleGetHighScores, errorHandler);
rspSetHighScore = new Responder(handleSetHighScore, errorHandler);
rspSendToFriend = new Responder(handleSendToFriend, errorHandler);
super();
_objParent = _arg1;
remoteConnect();
}
private function handleSetHighScore(_arg1:Object):void{
_objParent.submittedScore();
remoteDisconnect();
}
private function handleGetHighScores(_arg1:Object):void{
_objParent.showHighScores(_arg1);
remoteDisconnect();
}
private function errorHandler(_arg1:Object):void{
trace(("Remoting error: " + _arg1.description));
}
public function getHighScores(_arg1:int=20):void{
trace("Retrieving high score list...");
_objNC.call((_strRemoteClass + ".getHighScores"), rspGetHighScores, _arg1);
}
private function remoteDisconnect(){
trace("Closing connection to remoting server...");
_objNC.close();
}
public function sendToFriend(_arg1:String, _arg2:String, _arg3:Array, _arg4:uint, _arg5:String):void{
trace(_arg3);
_objNC.call((_strRemoteClass + ".sendToFriend"), rspSendToFriend, _arg1, _arg2, _arg3, _arg4, _arg5);
}
public function setHighScore(_arg1:String, _arg2:String, _arg3:int):void{
var _local4:String;
_local4 = MD5.hash(((((("client=mktgbirm&name=" + _arg1) + "&email=") + _arg2) + "&score=") + _arg3));
_objNC.call((_strRemoteClass + ".setHighScore"), rspSetHighScore, _arg1, _arg2, _arg3, _local4);
}
private function remoteConnect():void{
trace("Opening connection to remoting server...");
_objNC.connect(_strServiceURL);
}
private function handleSendToFriend(_arg1:Object):void{
trace(3);
_objParent.sentToFriend();
remoteDisconnect();
}
}
}//package remoting
Section 76
//boat (boat)
package {
import flash.display.*;
public dynamic class boat extends MovieClip {
public var sitter_1:MovieClip;
public var sitter_2:MovieClip;
public var sitter_0:MovieClip;
public var seats_mc:MovieClip;
public var water_mc:MovieClip;
public var base_mc:MovieClip;
}
}//package
Section 77
//bump (bump)
package {
import flash.media.*;
public dynamic class bump extends Sound {
}
}//package
Section 78
//engine1 (engine1)
package {
import flash.media.*;
public dynamic class engine1 extends Sound {
}
}//package
Section 79
//engine2 (engine2)
package {
import flash.media.*;
public dynamic class engine2 extends Sound {
}
}//package
Section 80
//engine3 (engine3)
package {
import flash.media.*;
public dynamic class engine3 extends Sound {
}
}//package
Section 81
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 82
//hit_amsterdam (hit_amsterdam)
package {
import flash.display.*;
public dynamic class hit_amsterdam extends MovieClip {
}
}//package
Section 83
//hit_birmingham (hit_birmingham)
package {
import flash.display.*;
public dynamic class hit_birmingham extends MovieClip {
}
}//package
Section 84
//hud (hud)
package {
import flash.display.*;
import flash.text.*;
public dynamic class hud extends MovieClip {
public var text_score:TextField;
public var clock:MovieClip;
public var text_time:TextField;
}
}//package
Section 85
//jump (jump)
package {
import flash.media.*;
public dynamic class jump extends Sound {
}
}//package
Section 86
//land (land)
package {
import flash.media.*;
public dynamic class land extends Sound {
}
}//package
Section 87
//leaderboard_line (leaderboard_line)
package {
import flash.display.*;
import flash.text.*;
public dynamic class leaderboard_line extends MovieClip {
public var text_score:TextField;
public var text_name:TextField;
}
}//package
Section 88
//level_wipe (level_wipe)
package {
import flash.display.*;
public dynamic class level_wipe extends MovieClip {
}
}//package
Section 89
//map_amsterdam (map_amsterdam)
package {
import flash.display.*;
public dynamic class map_amsterdam extends MovieClip {
public var dest_st:MovieClip;
public var port_mp:MovieClip;
public var port_vg:MovieClip;
public var port_vo:MovieClip;
public var queue_st:MovieClip;
public var dest_vo:MovieClip;
public var port_pa:MovieClip;
public var airport_mc:person;
public var dest_vg:MovieClip;
public var queue_mp:MovieClip;
public var dest_mp:MovieClip;
public var queue_vg:MovieClip;
public var queue_vo:MovieClip;
public var dest_pa:MovieClip;
public var port_aa:MovieClip;
public var dest_aa:MovieClip;
public var airport_mask:MovieClip;
public var port_st:MovieClip;
public var queue_pa:MovieClip;
}
}//package
Section 90
//map_birmingham (map_birmingham)
package {
import flash.display.*;
public dynamic class map_birmingham extends MovieClip {
public var dest_jq:MovieClip;
public var port_mb:MovieClip;
public var queue_ba:MovieClip;
public var queue_rt:MovieClip;
public var queue_sa:MovieClip;
public var queue_br:MovieClip;
public var dest_mb:MovieClip;
public var queue_bt:MovieClip;
public var queue_th:MovieClip;
public var queue_cu:MovieClip;
public var queue_ed:MovieClip;
public var queue_vp:MovieClip;
public var port_ba:MovieClip;
public var port_rt:MovieClip;
public var queue_ws:MovieClip;
public var port_sa:MovieClip;
public var port_br:MovieClip;
public var port_bt:MovieClip;
public var port_cu:MovieClip;
public var port_th:MovieClip;
public var dest_ba:MovieClip;
public var dest_rt:MovieClip;
public var dest_sa:MovieClip;
public var dest_br:MovieClip;
public var dest_bt:MovieClip;
public var port_ed:MovieClip;
public var dest_cu:MovieClip;
public var dest_th:MovieClip;
public var queue_jq:MovieClip;
public var port_vp:MovieClip;
public var port_ws:MovieClip;
public var dest_ed:MovieClip;
public var dest_vp:MovieClip;
public var queue_mb:MovieClip;
public var airport_mc:person;
public var dest_ws:MovieClip;
public var port_jq:MovieClip;
public var airport_mask:MovieClip;
}
}//package
Section 91
//message (message)
package {
import flash.display.*;
import flash.text.*;
public dynamic class message extends MovieClip {
public var text_message:TextField;
}
}//package
Section 92
//music_1 (music_1)
package {
import flash.media.*;
public dynamic class music_1 extends Sound {
}
}//package
Section 93
//person (person)
package {
import flash.display.*;
public dynamic class person extends MovieClip {
public var inner_mc:MovieClip;
}
}//package
Section 94
//plane (plane)
package {
import flash.display.*;
public dynamic class plane extends MovieClip {
}
}//package
Section 95
//planefly (planefly)
package {
import flash.media.*;
public dynamic class planefly extends Sound {
}
}//package
Section 96
//planeland (planeland)
package {
import flash.media.*;
public dynamic class planeland extends Sound {
}
}//package
Section 97
//screen_gameover (screen_gameover)
package {
import flash.display.*;
import flash.text.*;
public dynamic class screen_gameover extends MovieClip {
public var btn_terms:MovieClip;
public var text_score:TextField;
public var text_points:TextField;
public var btn_play:MovieClip;
public var btn_submit:MovieClip;
public var text_prize:TextField;
public var text_title:TextField;
}
}//package
Section 98
//screen_instruct (screen_instruct)
package {
import flash.display.*;
import flash.text.*;
public dynamic class screen_instruct extends MovieClip {
public var btn_play:MovieClip;
public var text_down:TextField;
public var text_right:TextField;
public var text_controls:TextField;
public var text_gameplay_3:TextField;
public var text_gameplay_1:TextField;
public var text_gameplay_2:TextField;
public var text_title:TextField;
public var text_left:TextField;
public var text_up:TextField;
public var btn_back:MovieClip;
public var text_gameplay:TextField;
}
}//package
Section 99
//screen_lang (screen_lang)
package {
import flash.display.*;
public dynamic class screen_lang extends MovieClip {
public var btn_eng:MovieClip;
public var btn_net:MovieClip;
}
}//package
Section 100
//screen_scores (screen_scores)
package {
import flash.display.*;
import flash.text.*;
public dynamic class screen_scores extends MovieClip {
public var text_title:TextField;
public var btn_back:MovieClip;
}
}//package
Section 101
//screen_sendfriend (screen_sendfriend)
package {
import flash.display.*;
import flash.text.*;
public dynamic class screen_sendfriend extends MovieClip {
public var input_friendname_2:TextField;
public var text_yourname:TextField;
public var input_yourname:TextField;
public var input_youremail:TextField;
public var input_friendemail_1:TextField;
public var input_friendemail_2:TextField;
public var input_friendemail_3:TextField;
public var btn_submit:MovieClip;
public var text_error:TextField;
public var text_friendname:TextField;
public var text_friendemail:TextField;
public var text_youremail:TextField;
public var text_title:TextField;
public var btn_back:MovieClip;
public var input_friendname_3:TextField;
public var input_friendname_1:TextField;
}
}//package
Section 102
//screen_submitscore (screen_submitscore)
package {
import flash.display.*;
import flash.text.*;
public dynamic class screen_submitscore extends MovieClip {
public var btn_terms:MovieClip;
public var text_yourname:TextField;
public var btn_submit:MovieClip;
public var text_error:TextField;
public var text_prize:TextField;
public var text_youremail:TextField;
public var text_title:TextField;
public var input_name:TextField;
public var input_email:TextField;
public var btn_back:MovieClip;
}
}//package
Section 103
//screen_title (screen_title)
package {
import flash.display.*;
public dynamic class screen_title extends MovieClip {
public var btn_highscores:MovieClip;
public var btn_playnow:MovieClip;
public var btn_instruct:MovieClip;
public var btn_sendfriend:MovieClip;
}
}//package
Section 104
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 105
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 106
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 107
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 108
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 109
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 110
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 111
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 112
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 113
//ScrollPane_disabledSkin (ScrollPane_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollPane_disabledSkin extends MovieClip {
}
}//package
Section 114
//ScrollPane_upSkin (ScrollPane_upSkin)
package {
import flash.display.*;
public dynamic class ScrollPane_upSkin extends MovieClip {
}
}//package
Section 115
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 116
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 117
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 118
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 119
//splash (splash)
package {
import flash.media.*;
public dynamic class splash extends Sound {
}
}//package
Section 120
//splash_anim (splash_anim)
package {
import flash.display.*;
public dynamic class splash_anim extends MovieClip {
public function splash_anim(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package
Section 121
//success (success)
package {
import flash.media.*;
public dynamic class success extends Sound {
}
}//package
Section 122
//ticker_message (ticker_message)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ticker_message extends MovieClip {
public var text_message:TextField;
public var text_subtitle:TextField;
}
}//package
Section 123
//time (time)
package {
import flash.media.*;
public dynamic class time extends Sound {
}
}//package
Section 124
//titlemusic (titlemusic)
package {
import flash.media.*;
public dynamic class titlemusic extends Sound {
}
}//package
Section 125
//water_mc (water_mc)
package {
import flash.display.*;
public dynamic class water_mc extends MovieClip {
}
}//package
Section 126
//yeah (yeah)
package {
import flash.media.*;
public dynamic class yeah extends Sound {
}
}//package