Section 1
//_Btn_42 (amberJelly_fla._Btn_42)
package amberJelly_fla {
import flash.display.*;
import flash.text.*;
public dynamic class _Btn_42 extends MovieClip {
public var _txt:TextField;
}
}//package amberJelly_fla
Section 2
//amber_1 (amberJelly_fla.amber_1)
package amberJelly_fla {
import flash.display.*;
public dynamic class amber_1 extends MovieClip {
public var counter:MovieClip;
public var eye1:MovieClip;
public var eye2:MovieClip;
public var bg:MovieClip;
public var tail:MovieClip;
public var jellyItems:MovieClip;
public var jellyTop:MovieClip;
public var mouth:MovieClip;
public var jellyBlob1:MovieClip;
public var jellyBlob2:MovieClip;
public var plate:MovieClip;
public var blush1:MovieClip;
public var blush2:MovieClip;
public var pouch:MovieClip;
public var top:MovieClip;
public var arm2:MovieClip;
public var arm1:MovieClip;
public var foot1:MovieClip;
public var foot2:MovieClip;
public var breast2:MovieClip;
public var fur:MovieClip;
public var breast1:MovieClip;
public var ear1:MovieClip;
public var ear2:MovieClip;
public var body:MovieClip;
public var hand1:MovieClip;
public var hand2:MovieClip;
public var eatBlob0:MovieClip;
public var eatBlob1:MovieClip;
public var eatBlob2:MovieClip;
public var eatBlob3:MovieClip;
public var eatBlob4:MovieClip;
public var nose:MovieClip;
public var belly:MovieClip;
public var head:MovieClip;
public var leg1:MovieClip;
public var leg2:MovieClip;
public var poke_mc:MovieClip;
}
}//package amberJelly_fla
Section 3
//bounce_btn_43 (amberJelly_fla.bounce_btn_43)
package amberJelly_fla {
import flash.display.*;
import flash.text.*;
public dynamic class bounce_btn_43 extends MovieClip {
public var _txt:TextField;
}
}//package amberJelly_fla
Section 4
//eye1_30 (amberJelly_fla.eye1_30)
package amberJelly_fla {
import flash.display.*;
public dynamic class eye1_30 extends MovieClip {
public var pupil:MovieClip;
}
}//package amberJelly_fla
Section 5
//eye2_32 (amberJelly_fla.eye2_32)
package amberJelly_fla {
import flash.display.*;
public dynamic class eye2_32 extends MovieClip {
public var pupil:MovieClip;
}
}//package amberJelly_fla
Section 6
//jellyItems_5 (amberJelly_fla.jellyItems_5)
package amberJelly_fla {
import flash.display.*;
public dynamic class jellyItems_5 extends MovieClip {
public var tc_15:MovieClip;
public var bc_l:MovieClip;
public var tc_20:MovieClip;
public var tc_21:MovieClip;
public var tc_23:MovieClip;
public var ba_11:MovieClip;
public var ba_12:MovieClip;
public var ba_14:MovieClip;
public var ba_10:MovieClip;
public var ba_18:MovieClip;
public var ba_19:MovieClip;
public var tl_0:MovieClip;
public var tl_2:MovieClip;
public var tl_3:MovieClip;
public var tl_4:MovieClip;
public var tl_5:MovieClip;
public var tl_7:MovieClip;
public var tl_1:MovieClip;
public var ba_2:MovieClip;
public var ba_3:MovieClip;
public var ba_4:MovieClip;
public var ba_17:MovieClip;
public var tl_6:MovieClip;
public var ba_0:MovieClip;
public var ba_8:MovieClip;
public var ba_5:MovieClip;
public var ba_21:MovieClip;
public var ba_13:MovieClip;
public var ba_20:MovieClip;
public var tc_1:MovieClip;
public var tc_3:MovieClip;
public var tc_5:MovieClip;
public var tc_7:MovieClip;
public var tc_2:MovieClip;
public var ts_3:MovieClip;
public var ts_4:MovieClip;
public var ts_5:MovieClip;
public var ts_6:MovieClip;
public var ts_7:MovieClip;
public var ts_8:MovieClip;
public var ts_9:MovieClip;
public var ba_22:MovieClip;
public var ts_2:MovieClip;
public var tc_9:MovieClip;
public var tc_0:MovieClip;
public var tl_8:MovieClip;
public var ts_1:MovieClip;
public var ba_1:MovieClip;
public var ts_0:MovieClip;
public var bc_11:MovieClip;
public var bc_13:MovieClip;
public var ta_3:MovieClip;
public var ta_5:MovieClip;
public var ta_7:MovieClip;
public var ta_9:MovieClip;
public var ta_4:MovieClip;
public var ta_6:MovieClip;
public var ta_8:MovieClip;
public var bc_19:MovieClip;
public var ta_0:MovieClip;
public var bc_21:MovieClip;
public var bc_20:MovieClip;
public var bc_22:MovieClip;
public var bc_16:MovieClip;
public var bc_18:MovieClip;
public var ta_2:MovieClip;
public var ta_1:MovieClip;
public var bc_17:MovieClip;
public var ta_10:MovieClip;
public var ta_11:MovieClip;
public var ta_12:MovieClip;
public var ta_14:MovieClip;
public var ta_15:MovieClip;
public var ta_17:MovieClip;
public var ta_18:MovieClip;
public var ta_19:MovieClip;
public var ta_13:MovieClip;
public var ta_16:MovieClip;
public var ta_20:MovieClip;
public var ta_21:MovieClip;
public var ta_22:MovieClip;
public var ta_23:MovieClip;
public var ta_24:MovieClip;
public var bl_0:MovieClip;
public var bl_1:MovieClip;
public var bl_2:MovieClip;
public var bl_4:MovieClip;
public var bl_6:MovieClip;
public var bl_7:MovieClip;
public var bl_8:MovieClip;
public var bl_3:MovieClip;
public var bl_5:MovieClip;
public var bc_0:MovieClip;
public var bc_1:MovieClip;
public var bc_2:MovieClip;
public var bc_3:MovieClip;
public var bc_5:MovieClip;
public var bc_7:MovieClip;
public var bc_9:MovieClip;
public var ts_10:MovieClip;
public var tc_11:MovieClip;
public var tc_13:MovieClip;
public var bc_r:MovieClip;
public var tc_18:MovieClip;
public var tc_16:MovieClip;
public var tc_17:MovieClip;
public var tc_19:MovieClip;
}
}//package amberJelly_fla
Section 7
//MainTimeline (amberJelly_fla.MainTimeline)
package amberJelly_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import as3.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public const BREAST_TIMESPEED:Number = 1.2;
public const TAIL_K:Number = 0.6;
public const BELLY_TIMESPEED:Number = 1;
public const TAIL_TIMESPEED:Number = 1;
public const LEG_TIMESPEED:Number = 2;
public const TOP_MOVE_SCALE:Number = 0.5;
public const LEG_DT:Number = 0.1;
public const MAX_BELLY_SIZE:Number = 0.15;
public const BREAST_K:Number = 0.9;
public const BELLY_FRICTION:Number = 0.96;
public const ARM_DT:Number = 0.1;
public const EAR_K:Number = 0.9;
public const CLICK_TIMER:int = 5;
public const ARM_FRICTION:Number = 0.6;
public const BELLY_DT:Number = 0.1;
public const BREAST_DT:Number = 0.05;
public const EAR_FRICTION:Number = 0.6;
public const BELLY_K:Number = 0.6;
public const TAIL_FRICTION:Number = 0.9;
public const LEG_FRICTION:Number = 0.6;
public const EAR_DT:Number = 0.05;
public const LEG_K:Number = 0.9;
public const BREAST_MOVE_SCALE:Number = 0.1;
public const BREAST_FRICTION:Number = 0.99;
public const TOP_FRICTION:Number = 0.85;
public const TAIL_DT:Number = 0.1;
public const TOP_TIMESPEED:Number = 1;
public const MIN_BELLY_SIZE:Number = -0.15;
public const ARM_K:Number = 0.9;
public const BELLY_POKE_TIMER:int = 20;
public const ARM_TIMESPEED:Number = 2;
public const BELLY_RANGE:Number = 0.3;
public const EAR_TIMESPEED:Number = 2;
public const TOP_K:Number = 0.5;
public const TOP_DT:Number = 0.5;
public const INV_BELLY_RANGE:Number = 3.33333333333333;
public var JELLY_FRONT_BOTTOM:Array;
public var JELLY_SHINES:Array;
public var eye1:MovieClip;
public var eye2:MovieClip;
public var JELLY_DIF_X:Number;
public var JELLY_DIF_Y:Number;
public var blushAlpha:Number;
public var BG:Shape;
public var tail:MovieClip;
public var JELLY_SHINE_COLOR:uint;
public var JELLY_LEFT_BACK_TOP:Array;
public var JELLY_BACK_LEFT_BOTTOM:Array;
public var TAIL_RANGE:int;
public var JELLY_RIGHT_BACK_BOTTOM:Array;
public var bellyPoke:int;
public var JELLY_LONG_SHINES:Array;
public var offset:Number;
public var EAT_BLOBS:Array;
public var DEST_BELLY_SIZE:Number;
public var plateShade:MovieClip;
public var _zoom:Number;
public var currentBlob:MovieClip;
public var JELLY_RIGHT_BOTTOM:Array;
public var mouth:MovieClip;
public var angle:Number;
public var amber:MovieClip;
public var BREAST_Y:Array;
public var STAGE_WIDTH:Number;
public var oldPlateX:Number;
public var oldPlateY:Number;
public var JELLY_RIGHT_TOP:Array;
public var LEG_SCALE_X:Array;
public var JELLY_TOP:MovieClip;
public var clickTarget:MovieClip;
public var pouch:MovieClip;
public var JELLY_BACK_TOP:Array;
public var TAIL_SKEW_X:Array;
public var PLATE_X:Number;
public var PLATE_Y:Number;
public var arm1:MovieClip;
public var arm2:MovieClip;
public var frequency:Number;
public var foot1:MovieClip;
public var foot2:MovieClip;
public var breast2:MovieClip;
public var JELLY_BACK_BOTTOM:Array;
public var fur:MovieClip;
public var breast1:MovieClip;
public var TAIL_SCALE_Y:Array;
public var STAGE_HEIGHT:Number;
public var JELLY_BACK_RIGHT_TOP:Array;
public var ARM_SKEW_Y:Array;
public var LEG_SKEW_Y:Array;
public var head:MovieClip;
public var oldMX:Number;
public var oldMY:Number;
public var clickDown:int;
public var ATTACH_LIST:Array;
public var JELLY_SHINE_ALPHA:Number;
public var JELLY_FRONT_RIGHT_BOTTOM:Array;
public var lcd_stolen_bg:MovieClip;
public var amberMask:MovieClip;
public var _plus:MovieClip;
public var EXPAND_SIZE:Number;
public var USED_EAT_BLOBS:Array;
public var JELLY_BACK_LEFT_TOP:Array;
public var JELLY_CENTER_LEFT_BOTTOM:Array;
public var bouncy:int;
public var bounds:Rectangle;
public var blushMode:int;
public var JELLY_FRONT_TOP:Array;
public var JELLY_LEFT_BACK_BOTTOM:Array;
public var BELLY_MX:Number;
public var BELLY_MY:Number;
public var JELLY_SHINE_THICKNESS:Number;
public var BELLY_SIZE:Number;
public var curOffset:Number;
public var BELLY_SCALE_Y:Array;
public var JELLY_PARTS:Array;
public var BELLY_SKEW_X:Array;
public var oldX:Number;
public var oldY:Number;
public var plate:MovieClip;
public var JELLY_SHINE_BASE_VALUES:Array;
public var TAIL_CENTER:int;
public var JELLY_CENTER_LEFT_TOP:Array;
public var bounceAngle:Number;
public var EAT_BLOB_BOX:MovieClip;
public var blush1:MovieClip;
public var blush2:MovieClip;
public var JELLY_FRONT_RIGHT_TOP:Array;
public var JELLY_BASE_VALUES:Array;
public var FOOT_SKEW_Y:Array;
public var ITEM_PARENT:DisplayObjectContainer;
public var info_txt:TextField;
public var JELLY_RIGHT_BACK_TOP:Array;
public var JELLY_CENTER_RIGHT_TOP:Array;
public var movingPlate:Boolean;
public var _minus:MovieClip;
public var TAIL_FRAMES:int;
public var JELLY_CENTER_RIGHT_BOTTOM:Array;
public var STAGE_WIDTH_2:Number;
public var _zero:MovieClip;
public var EAR_SKEW_Y:Array;
public var EAR_SKEW_X:Array;
public var ear1:MovieClip;
public var ear2:MovieClip;
public var JELLY_SHADES:Array;
public var _bounce:MovieClip;
public var lcd_stolen_item:MovieClip;
public var JELLY:MovieClip;
public var TOP_X:Array;
public var TOP_Y:Array;
public var nose:MovieClip;
public var belly:MovieClip;
public var lcd_stolen:String;
public var TOP_LEVEL:MovieClip;
public var JELLY_ITEMS:Array;
public var leg1:MovieClip;
public var leg2:MovieClip;
public var JELLY_BACK_RIGHT_BOTTOM:Array;
public var poke_mc:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1);
}
public function eFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Matrix;
var _local15:Number;
var _local16:Matrix;
var _local17:Number;
var _local18:String;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
_local2 = stage.mouseX;
_local3 = stage.mouseY;
if (bouncy){
bounceAngle = (bounceAngle + (0.11 * bouncy));
TOP_Y[1] = (TOP_Y[1] + ((Math.sin(bounceAngle) * 5) * (1 - ((0.7 * (bouncy - 1)) * 0.2))));
TOP_X[1] = (TOP_X[1] + ((Math.cos(bounceAngle) * 4) * (1 - ((0.7 * (bouncy - 1)) * 0.2))));
};
if (poke_mc.visible){
if (poke_mc.currentFrame == poke_mc.totalFrames){
poke_mc.gotoAndStop(1);
poke_mc.visible = false;
};
};
_local4 = "";
if (clickTarget == belly){
_local19 = (amber.mouseX - belly.x);
_local20 = (amber.mouseY - belly.y);
if (belly.hitTestPoint(_local2, _local3, true)){
TOP_X[1] = (TOP_X[1] - (_local19 * 0.02));
TOP_Y[1] = (TOP_Y[1] - (_local20 * 0.02));
BELLY_SCALE_Y[1] = (BELLY_SCALE_Y[1] - ((Math.abs(belly.mouseY) - Math.abs(belly.mouseX)) * 0.0002));
BELLY_MX = _local19;
BELLY_MY = _local20;
blushMode = 2;
} else {
TOP_X[1] = (TOP_X[1] - (BELLY_MX * 0.02));
TOP_Y[1] = (TOP_Y[1] - (BELLY_MY * 0.02));
BELLY_SCALE_Y[1] = (BELLY_SCALE_Y[1] - ((Math.abs(BELLY_MY) - Math.abs(BELLY_MX)) * 0.0002));
BELLY_MX = (BELLY_MX * 0.95);
BELLY_MY = (BELLY_MY * 0.95);
};
_local4 = "bellyrub";
};
if (bellyPoke){
bellyPoke--;
};
clickDown = (clickDown) ? (clickDown - 1) : 0;
if (movingPlate){
plate.vX = (plate.x - oldPlateX);
plate.vY = (plate.y - oldPlateY);
} else {
if (plate.y < PLATE_Y){
_local21 = plate.x;
_local22 = plate.y;
plate.x = (plate.x + plate.vX);
plate.y = (plate.y + plate.vY);
plate.vY = (plate.vY + 50);
if (plate.y >= PLATE_Y){
plate.y = PLATE_Y;
if (plate.vY > 100){
plate.vY = (plate.vY * -0.1);
plate.y--;
} else {
plate.vY = 0;
};
};
TOP_X[0] = (TOP_X[0] - ((plate.x - _local21) * TOP_MOVE_SCALE));
TOP_Y[0] = (TOP_Y[0] - ((plate.y - _local22) * TOP_MOVE_SCALE));
_local23 = (1 / amber.scaleX);
_local24 = ((STAGE_WIDTH_2 * 0.9) * _local23);
if (plate.x > (PLATE_X + _local24)){
plate.x = (PLATE_X + _local24);
} else {
if (plate.x < (PLATE_X - _local24)){
plate.x = (PLATE_X - _local24);
};
};
JELLY.x = (plate.x + JELLY_DIF_X);
JELLY.y = (plate.y + JELLY_DIF_Y);
plateShade.x = plate.x;
};
};
plateShade.alpha = (1 / (1 - ((plate.y - PLATE_Y) * 0.005)));
oldPlateX = plate.x;
oldPlateY = plate.y;
_local5 = (((Math.sin(angle) * 0.5) + 0.5) * curOffset);
curOffset = (curOffset + ((offset - curOffset) * 0.5));
angle = (angle + frequency);
TOP_Y[1] = (TOP_Y[1] + (_local5 * 0.5));
Physics.verlet(TOP_X, 0, TOP_FRICTION, TOP_K, TOP_DT, TOP_TIMESPEED);
_local6 = TOP_X[0];
_local9 = -200;
_local8 = 200;
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
TOP_X[0] = _local6;
Physics.verlet(TOP_Y, 0, TOP_FRICTION, TOP_K, TOP_DT, TOP_TIMESPEED);
_local6 = TOP_Y[0];
_local9 = -100;
_local8 = 200;
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
TOP_Y[0] = _local6;
_local10 = TOP_X[0];
_local11 = TOP_Y[0];
_local12 = TOP_X[1];
_local13 = TOP_Y[1];
moveTopTo(_local10, _local11);
_local15 = (0.05 * (((BELLY_SIZE - MIN_BELLY_SIZE) * INV_BELLY_RANGE) - 0.9));
BELLY_SCALE_Y[0] = (BELLY_SCALE_Y[0] + (_local13 * 0.005));
Physics.verlet(BELLY_SCALE_Y, 1, (BELLY_FRICTION + _local15), BELLY_K, BELLY_DT, BELLY_TIMESPEED);
BELLY_SKEW_X[0] = (BELLY_SKEW_X[0] + (_local12 * 0.005));
Physics.verlet(BELLY_SKEW_X, 0, (BELLY_FRICTION + _local15), BELLY_K, BELLY_DT, BELLY_TIMESPEED);
_local16 = pouch.transform.matrix;
_local14 = belly.transform.matrix;
_local6 = BELLY_SCALE_Y[0];
_local9 = (1 - 0.1);
_local8 = (1 + 0.1);
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
_local16.d = (_local14.d = (_local6 + BELLY_SIZE));
_local16.a = (_local14.a = ((2 - _local6) + BELLY_SIZE));
_local7 = BELLY_SKEW_X[0];
_local9 = -0.2;
_local8 = 0.2;
_local7 = ((_local7)>_local8) ? _local8 : ((_local7)<_local9) ? _local9 : _local7;
_local16.c = (_local14.c = _local7);
belly.transform.matrix = _local14;
pouch.transform.matrix = _local16;
Physics.verlet(ARM_SKEW_Y, (_local13 * 0.02), ARM_FRICTION, ARM_K, ARM_DT, ARM_TIMESPEED);
_local6 = ARM_SKEW_Y[0];
_local9 = -0.2;
_local8 = 0.2;
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
_local14 = arm1.transform.matrix;
_local14.b = _local6;
_local14.a = (1 - (_local6 * 0.2));
TOP_LEVEL.jellyBlob1.scaleY = (1 + (_local6 * 1.5));
arm1.transform.matrix = _local14;
_local14 = arm2.transform.matrix;
_local14.b = -(_local6);
TOP_LEVEL.jellyBlob2.scaleY = (1 + (_local6 * 1.5));
arm2.transform.matrix = _local14;
Physics.verlet(EAR_SKEW_X, (_local12 * 0.03), EAR_FRICTION, EAR_K, EAR_DT, EAR_TIMESPEED);
Physics.verlet(EAR_SKEW_Y, (_local13 * 0.05), EAR_FRICTION, EAR_K, EAR_DT, EAR_TIMESPEED);
_local6 = EAR_SKEW_X[0];
_local9 = -0.4;
_local8 = 0.4;
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
_local7 = EAR_SKEW_Y[0];
_local9 = -0.4;
_local8 = 0.4;
_local7 = ((_local7)>_local8) ? _local8 : ((_local7)<_local9) ? _local9 : _local7;
_local14 = ear1.transform.matrix;
_local14.c = (_local6 - _local7);
_local14.b = (_local7 - _local6);
ear1.transform.matrix = _local14;
_local14 = ear2.transform.matrix;
_local14.c = (_local6 + _local7);
_local14.b = (-(_local7) - _local6);
ear2.transform.matrix = _local14;
Physics.verlet(LEG_SCALE_X, (1 + (_local12 * 0.02)), LEG_FRICTION, LEG_K, LEG_DT, LEG_TIMESPEED);
Physics.verlet(LEG_SKEW_Y, (_local13 * 0.02), LEG_FRICTION, LEG_K, LEG_DT, LEG_TIMESPEED);
_local6 = LEG_SCALE_X[0];
_local9 = (1 - 0.3);
_local8 = (1 + 0.3);
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
_local7 = LEG_SKEW_Y[0];
_local9 = -0.4;
_local8 = 0.6;
_local7 = ((_local7)>_local8) ? _local8 : ((_local7)<_local9) ? _local9 : _local7;
_local14 = leg1.transform.matrix;
_local14.a = (_local6 - (_local7 * 0.4));
_local14.b = _local7;
leg1.transform.matrix = _local14;
_local14 = leg2.transform.matrix;
_local14.a = ((2 - _local6) - (_local7 * 0.4));
_local14.b = -(_local7);
leg2.transform.matrix = _local14;
Physics.verlet(FOOT_SKEW_Y, (_local7 * 4), LEG_FRICTION, LEG_K, LEG_DT, LEG_TIMESPEED);
_local6 = FOOT_SKEW_Y[0];
_local9 = -0.4;
_local8 = 1;
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
foot1.rotation = ((_local6 * 50) + (_local12 * 0.4));
foot2.rotation = ((-(_local6) * 50) + (_local12 * 0.4));
Physics.verlet(TAIL_SCALE_Y, (_local13 * 0.02), TAIL_FRICTION, TAIL_K, TAIL_DT, TAIL_TIMESPEED);
Physics.verlet(TAIL_SKEW_X, 0, TAIL_FRICTION, TAIL_K, TAIL_DT, TAIL_TIMESPEED);
_local6 = TAIL_SCALE_Y[0];
_local9 = -0.1;
_local8 = 0.4;
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
_local7 = TAIL_SKEW_X[0];
tail.scaleY = (1 - _local6);
tail.gotoAndStop((TAIL_CENTER + int(((_local7 * TAIL_RANGE) * 0.01))));
Physics.verlet(BREAST_Y, 0, BREAST_FRICTION, BREAST_K, BREAST_DT, BREAST_TIMESPEED);
_local6 = BREAST_Y[0];
breast2.scaleY = (breast1.scaleY = (1 - (_local6 * 0.05)));
breast2.scaleX = (breast1.scaleX = (1 + (_local6 * 0.05)));
_local17 = tail.x;
Physics.updateAttached(ATTACH_LIST);
_local6 = ((_local13 * 0.17) * 1.5);
_local9 = -6;
_local8 = 6;
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
_local7 = ((_local13 * 0.25) * 1.5);
_local9 = -8;
_local8 = 8;
_local7 = ((_local6)>_local8) ? _local8 : ((_local7)<_local9) ? _local9 : _local7;
eye1.y = (eye1.y - _local6);
eye2.y = (eye2.y - _local6);
mouth.y = (mouth.y - _local7);
nose.y = (nose.y - _local7);
_local6 = ((_local13 * 0.1) * 1.5);
_local9 = -3;
_local8 = 3;
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
head.y = (head.y - _local6);
ear1.y = (ear1.y - _local6);
ear2.y = (ear2.y - _local6);
_local6 = BREAST_Y[0];
breast1.y = (breast1.y + (_local6 - (_local5 * 2)));
breast2.y = (breast2.y + (_local6 - (_local5 * 2)));
fur.scaleY = (1 - (_local5 * 0.1));
_local6 = (_local12 * 0.5);
_local7 = (_local13 * 0.1);
breast1.x = (breast1.x - (_local6 - _local7));
breast2.x = (breast2.x - (_local6 + _local7));
fur.x = (fur.x - _local6);
BREAST_Y[0] = (BREAST_Y[0] + (_local13 * BREAST_MOVE_SCALE));
_local6 = ((_local12 * 0.2) * 2);
_local9 = -4;
_local8 = 4;
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
eye1.x = (eye1.x - _local6);
eye2.x = (eye2.x - _local6);
_local6 = ((_local12 * 0.3) * 2);
_local9 = -6;
_local8 = 6;
_local6 = ((_local6)>_local8) ? _local8 : ((_local6)<_local9) ? _local9 : _local6;
mouth.x = (mouth.x - (_local6 * 1.05));
nose.x = (nose.x - _local6);
TAIL_SKEW_X[0] = (TAIL_SKEW_X[0] + (_local17 - tail.x));
if ((((Math.abs(TOP_Y[1]) > 15)) || ((Math.abs(TOP_X[1]) > 15)))){
_local4 = "move";
};
_local18 = mouth.currentLabel;
if ((((_local18 == "eat")) || ((_local18 == "eat2")))){
} else {
if (_local18 == "mideat"){
DEST_BELLY_SIZE = (DEST_BELLY_SIZE + EXPAND_SIZE);
} else {
if (bellyPoke){
eye1.gotoAndStop("mad");
eye2.gotoAndStop("shut");
mouth.gotoAndStop("open");
} else {
if (bouncy){
blushAlpha = (bouncy / 5);
eye1.gotoAndStop("medium");
eye2.gotoAndStop("medium");
mouth.gotoAndStop("happy");
} else {
if (_local4 == "move"){
frequency = 0.4;
eye1.gotoAndStop("open");
eye2.gotoAndStop("open");
mouth.gotoAndStop("open");
} else {
if (_local4 == "bellyrub"){
frequency = 0.3;
offset = 1;
eye1.gotoAndStop("small");
eye2.gotoAndStop("small");
mouth.gotoAndStop("happy");
} else {
frequency = 0.1;
offset = 1;
eye1.gotoAndStop("medium");
eye2.gotoAndStop("medium");
mouth.gotoAndStop("full");
};
};
};
};
};
};
BELLY_SIZE = (BELLY_SIZE + ((DEST_BELLY_SIZE - BELLY_SIZE) * 0.2));
updateBlush();
drawJelly(JELLY.graphics, JELLY_PARTS, JELLY_LONG_SHINES, JELLY_SHINE_THICKNESS, JELLY_SHINE_COLOR, JELLY_SHINE_ALPHA);
if (_zoom){
amber.scaleX = (amber.scaleX + _zoom);
if (amber.scaleX < 0.3333){
amber.scaleX = 0.3333;
};
if (amber.scaleX > 1.4){
amber.scaleX = 1.4;
};
amber.scaleY = amber.scaleX;
amberMask.x = ((amber.bg.x * amber.scaleX) + amber.x);
amberMask.y = ((amber.bg.y * amber.scaleY) + amber.y);
amberMask.graphics.clear();
amberMask.graphics.beginFill(0);
amberMask.graphics.drawRect(0, 0, (amber.bg.width * amber.scaleX), (amber.bg.height * amber.scaleY));
amberMask.graphics.endFill();
_local23 = (1 / amber.scaleX);
STAGE_WIDTH_2 = (stage.stageWidth * 0.5);
_local24 = ((STAGE_WIDTH_2 * 0.9) * _local23);
if (plate.x > (PLATE_X + _local24)){
plate.x = (PLATE_X + _local24);
} else {
if (plate.x < (PLATE_X - _local24)){
plate.x = (PLATE_X - _local24);
};
};
JELLY.x = (plate.x + JELLY_DIF_X);
JELLY.y = (plate.y + JELLY_DIF_Y);
plateShade.x = plate.x;
};
}
public function zoomIn(_arg1:MouseEvent){
_zoom = 0.02;
stage.addEventListener(MouseEvent.MOUSE_UP, stopZoom);
}
function frame1(){
lcd_stolen = new LocalConnection().domain;
if (lcd_stolen.toLowerCase().indexOf("swfchan") != -1){
stop();
lcd_stolen_bg = new MovieClip();
while (numChildren) {
removeChildAt(0);
};
lcd_stolen_bg.graphics.beginFill(0xFFFFFF);
lcd_stolen_bg.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
lcd_stolen_bg.graphics.endFill();
lcd_stolen_item = new MovieClip();
lcd_stolen_item.tF = new TextFormat();
lcd_stolen_item.tF.bold = true;
lcd_stolen_item.tF.size = 64;
lcd_stolen_item.tF.color = 0xFF2200;
lcd_stolen_item.tF.font = "Trebuchet MS";
lcd_stolen_item.txt = new TextField();
lcd_stolen_item.txt.defaultTextFormat = lcd_stolen_item.tF;
lcd_stolen_item.txt.text = "swfchan.com";
lcd_stolen_item.txt.width = (lcd_stolen_item.txt.textWidth + 5);
lcd_stolen_item.txt.height = (lcd_stolen_item.txt.textHeight + 5);
lcd_stolen_item.bmp = new Bitmap(new BitmapData((lcd_stolen_item.txt.textWidth + 5), (lcd_stolen_item.txt.textHeight + 5), true, 0));
lcd_stolen_item.bmp.bitmapData.draw(lcd_stolen_item.txt);
lcd_stolen_item.bmp.x = (lcd_stolen_item.bmp.x - (lcd_stolen_item.bmp.width * 0.5));
lcd_stolen_item.bmp.y = (lcd_stolen_item.bmp.y - (lcd_stolen_item.bmp.height * 0.5));
lcd_stolen_item.addChild(lcd_stolen_item.bmp);
delete lcd_stolen_item.txt;
delete lcd_stolen_item.tF;
lcd_stolen_item.x = (Math.random() * stage.stageWidth);
lcd_stolen_item.y = (Math.random() * stage.stageWidth);
lcd_stolen_item.vX = (5 + (Math.random() * 10));
lcd_stolen_item.vY = (5 + (Math.random() * 10));
lcd_stolen_item.vR = (1 + ((Math.random() * 5) * ((Math.random())<0.5) ? -1 : 1));
stage.addChild(lcd_stolen_bg);
stage.addChild(lcd_stolen_item);
stage.addEventListener(Event.RESIZE, function (_arg1:Event){
lcd_stolen_bg.graphics.clear();
lcd_stolen_bg.graphics.beginFill(0xFFFFFF);
lcd_stolen_bg.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
lcd_stolen_bg.graphics.endFill();
});
stage.addEventListener(Event.ENTER_FRAME, function (_arg1:Event){
lcd_stolen_item.x = (lcd_stolen_item.x + lcd_stolen_item.vX);
lcd_stolen_item.y = (lcd_stolen_item.y + lcd_stolen_item.vY);
lcd_stolen_item.rotation = (lcd_stolen_item.rotation + lcd_stolen_item.vR);
bounds = lcd_stolen_item.getBounds(stage);
if ((((((bounds.left < 0)) && ((lcd_stolen_item.vX < 0)))) || ((((bounds.right > stage.stageWidth)) && ((lcd_stolen_item.vX > 0)))))){
lcd_stolen_item.vX = -(lcd_stolen_item.vX);
};
if ((((((bounds.top < 0)) && ((lcd_stolen_item.vY < 0)))) || ((((bounds.bottom > stage.stageHeight)) && ((lcd_stolen_item.vY > 0)))))){
lcd_stolen_item.vY = -(lcd_stolen_item.vY);
};
});
return;
};
stage.scaleMode = StageScaleMode.NO_SCALE;
STAGE_WIDTH = 800;
STAGE_HEIGHT = 600;
STAGE_WIDTH_2 = (stage.stageWidth * 0.5);
ATTACH_LIST = [];
TOP_LEVEL = amber;
ITEM_PARENT = TOP_LEVEL.jellyItems;
JELLY = new MovieClip();
BG = new Shape();
JELLY_TOP = amber.jellyTop;
movingPlate = false;
clickDown = 0;
clickTarget = null;
plateShade = new MovieClip();
bellyPoke = 0;
bouncy = 0;
bounceAngle = 0;
plate = TOP_LEVEL.plate;
head = TOP_LEVEL.head;
belly = TOP_LEVEL.belly;
pouch = TOP_LEVEL.pouch;
tail = TOP_LEVEL.tail;
mouth = TOP_LEVEL.mouth;
nose = TOP_LEVEL.nose;
eye1 = TOP_LEVEL.eye1;
eye2 = TOP_LEVEL.eye2;
ear1 = TOP_LEVEL.ear1;
ear2 = TOP_LEVEL.ear2;
arm1 = TOP_LEVEL.arm1;
arm2 = TOP_LEVEL.arm2;
leg1 = TOP_LEVEL.leg1;
leg2 = TOP_LEVEL.leg2;
foot1 = TOP_LEVEL.foot1;
foot2 = TOP_LEVEL.foot2;
breast1 = TOP_LEVEL.breast1;
breast2 = TOP_LEVEL.breast2;
blush1 = TOP_LEVEL.blush1;
blush2 = TOP_LEVEL.blush2;
fur = TOP_LEVEL.fur;
poke_mc = amber.poke_mc;
angle = 0;
frequency = 0.1;
curOffset = 1;
offset = 1;
JELLY_SHINE_THICKNESS = 10;
JELLY_SHINE_COLOR = 6737151;
JELLY_SHINE_ALPHA = 0.5;
EAT_BLOB_BOX = new MovieClip();
EAT_BLOBS = [TOP_LEVEL.eatBlob0, TOP_LEVEL.eatBlob1, TOP_LEVEL.eatBlob2, TOP_LEVEL.eatBlob3, TOP_LEVEL.eatBlob4];
USED_EAT_BLOBS = [];
EXPAND_SIZE = (BELLY_RANGE / EAT_BLOBS.length);
DEST_BELLY_SIZE = MIN_BELLY_SIZE;
BELLY_SIZE = MIN_BELLY_SIZE;
TOP_X = [0, 0];
TOP_Y = [0, 0];
BELLY_SCALE_Y = [1, 0];
BELLY_SKEW_X = [0, 0];
ARM_SKEW_Y = [0, 0];
EAR_SKEW_Y = [0, 0];
EAR_SKEW_X = [0, 0];
LEG_SCALE_X = [1, 0];
LEG_SKEW_Y = [0, 0];
FOOT_SKEW_Y = [0, 0];
BREAST_Y = [0, 0];
TAIL_SCALE_Y = [0, 0];
TAIL_SKEW_X = [0, 0];
TAIL_FRAMES = tail.totalFrames;
TAIL_CENTER = (TAIL_FRAMES >> 1);
TAIL_RANGE = (TAIL_CENTER - 1);
JELLY_BACK_TOP = [[ITEM_PARENT["ta_0"], ITEM_PARENT["tc_0"], ITEM_PARENT["ta_1"]], [ITEM_PARENT["ta_1"], ITEM_PARENT["tc_1"], ITEM_PARENT["ta_2"]], [ITEM_PARENT["ta_2"], ITEM_PARENT["tc_2"], ITEM_PARENT["ta_3"]], [ITEM_PARENT["ta_3"], ITEM_PARENT["tc_3"], ITEM_PARENT["ta_4"]]];
JELLY_BACK_BOTTOM = [[ITEM_PARENT["ba_4"], ITEM_PARENT["bc_3"], ITEM_PARENT["ba_3"]], [ITEM_PARENT["ba_3"], ITEM_PARENT["bc_2"], ITEM_PARENT["ba_2"]], [ITEM_PARENT["ba_2"], ITEM_PARENT["bc_1"], ITEM_PARENT["ba_1"]], [ITEM_PARENT["ba_1"], ITEM_PARENT["bc_0"], ITEM_PARENT["ba_0"]]];
JELLY_BACK_LEFT_TOP = [[ITEM_PARENT["ta_5"], ITEM_PARENT["tc_5"], ITEM_PARENT["ta_6"]], [ITEM_PARENT["ta_6"], ITEM_PARENT["ta_0"]]];
JELLY_BACK_LEFT_BOTTOM = [[ITEM_PARENT["ba_0"], ITEM_PARENT["bc_5"], ITEM_PARENT["ba_5"]]];
JELLY_BACK_RIGHT_TOP = [[ITEM_PARENT["ta_4"], ITEM_PARENT["ta_7"]], [ITEM_PARENT["ta_7"], ITEM_PARENT["tc_7"], ITEM_PARENT["ta_8"]]];
JELLY_BACK_RIGHT_BOTTOM = [[ITEM_PARENT["ba_8"], ITEM_PARENT["bc_7"], ITEM_PARENT["ba_4"]]];
JELLY_RIGHT_TOP = [[ITEM_PARENT["ta_8"], ITEM_PARENT["ta_9"]], [ITEM_PARENT["ta_9"], ITEM_PARENT["tc_9"], ITEM_PARENT["ta_10"]]];
JELLY_RIGHT_BOTTOM = [[ITEM_PARENT["ba_10"], ITEM_PARENT["bc_9"], ITEM_PARENT["ba_8"]]];
JELLY_LEFT_BACK_TOP = [[ITEM_PARENT["ta_11"], ITEM_PARENT["tc_11"], ITEM_PARENT["ta_12"]], [ITEM_PARENT["ta_12"], ITEM_PARENT["ta_5"]]];
JELLY_LEFT_BACK_BOTTOM = [[ITEM_PARENT["ba_5"], ITEM_PARENT["bc_l"], ITEM_PARENT["ba_11"]]];
JELLY_RIGHT_BACK_TOP = [[ITEM_PARENT["ta_10"], ITEM_PARENT["tc_13"]], [ITEM_PARENT["ta_13"], ITEM_PARENT["tc_13"], ITEM_PARENT["ta_14"]]];
JELLY_RIGHT_BACK_BOTTOM = [[ITEM_PARENT["ba_14"], ITEM_PARENT["bc_r"], ITEM_PARENT["ba_10"]]];
JELLY_CENTER_LEFT_TOP = [[ITEM_PARENT["ta_11"], ITEM_PARENT["tc_11"], ITEM_PARENT["ta_12"]], [ITEM_PARENT["ta_12"], ITEM_PARENT["tc_15"], ITEM_PARENT["ta_15"]]];
JELLY_CENTER_LEFT_BOTTOM = [[ITEM_PARENT["ba_12"], ITEM_PARENT["bc_11"], ITEM_PARENT["ba_11"]]];
JELLY_CENTER_RIGHT_TOP = [[ITEM_PARENT["ta_24"], ITEM_PARENT["tc_23"]], [ITEM_PARENT["tc_23"], ITEM_PARENT["ta_13"]], [ITEM_PARENT["ta_13"], ITEM_PARENT["tc_13"], ITEM_PARENT["ta_14"]]];
JELLY_CENTER_RIGHT_BOTTOM = [[ITEM_PARENT["ba_14"], ITEM_PARENT["bc_13"], ITEM_PARENT["ba_13"]]];
JELLY_FRONT_RIGHT_TOP = [[ITEM_PARENT["ta_22"], ITEM_PARENT["ta_23"]], [ITEM_PARENT["ta_23"], ITEM_PARENT["tc_23"], ITEM_PARENT["ta_24"]]];
JELLY_FRONT_RIGHT_BOTTOM = [[ITEM_PARENT["ba_13"], ITEM_PARENT["bc_22"], ITEM_PARENT["ba_22"]]];
JELLY_FRONT_TOP = [[ITEM_PARENT["ta_15"], ITEM_PARENT["tc_15"], ITEM_PARENT["ta_16"]], [ITEM_PARENT["ta_16"], ITEM_PARENT["tc_16"], ITEM_PARENT["ta_17"]], [ITEM_PARENT["ta_17"], ITEM_PARENT["tc_17"], ITEM_PARENT["ta_18"]], [ITEM_PARENT["ta_18"], ITEM_PARENT["tc_18"], ITEM_PARENT["ta_19"]], [ITEM_PARENT["ta_19"], ITEM_PARENT["tc_19"], ITEM_PARENT["ta_20"]], [ITEM_PARENT["ta_20"], ITEM_PARENT["tc_20"], ITEM_PARENT["ta_21"]], [ITEM_PARENT["ta_21"], ITEM_PARENT["tc_21"], ITEM_PARENT["ta_22"]]];
JELLY_FRONT_BOTTOM = [[ITEM_PARENT["ba_22"], ITEM_PARENT["bc_21"], ITEM_PARENT["ba_21"]], [ITEM_PARENT["ba_21"], ITEM_PARENT["bc_20"], ITEM_PARENT["ba_20"]], [ITEM_PARENT["ba_20"], ITEM_PARENT["bc_19"], ITEM_PARENT["ba_19"]], [ITEM_PARENT["ba_19"], ITEM_PARENT["bc_18"], ITEM_PARENT["ba_18"]], [ITEM_PARENT["ba_18"], ITEM_PARENT["bc_17"], ITEM_PARENT["ba_17"]], [ITEM_PARENT["ba_17"], ITEM_PARENT["bc_16"], ITEM_PARENT["ba_12"]]];
JELLY_SHINE_BASE_VALUES = [ITEM_PARENT["ts_0"], ITEM_PARENT["ts_1"], ITEM_PARENT["ts_2"], ITEM_PARENT["ts_3"], ITEM_PARENT["ts_4"], ITEM_PARENT["ts_5"], ITEM_PARENT["ts_6"], ITEM_PARENT["ts_7"], ITEM_PARENT["ts_8"], ITEM_PARENT["ts_9"], ITEM_PARENT["ts_10"]];
JELLY_LONG_SHINES = [ITEM_PARENT["tl_0"], ITEM_PARENT["tl_1"], ITEM_PARENT["tl_2"], ITEM_PARENT["tl_3"], ITEM_PARENT["tl_4"], ITEM_PARENT["tl_5"], ITEM_PARENT["tl_6"], ITEM_PARENT["tl_7"], ITEM_PARENT["tl_8"], ITEM_PARENT["bl_0"], ITEM_PARENT["bl_1"], ITEM_PARENT["bl_2"], ITEM_PARENT["bl_3"], ITEM_PARENT["bl_4"], ITEM_PARENT["bl_5"], ITEM_PARENT["bl_6"], ITEM_PARENT["bl_7"], ITEM_PARENT["bl_8"]];
JELLY_ITEMS = [ITEM_PARENT["ta_0"], ITEM_PARENT["ta_1"], ITEM_PARENT["ta_2"], ITEM_PARENT["ta_3"], ITEM_PARENT["ta_4"], ITEM_PARENT["ta_5"], ITEM_PARENT["ta_6"], ITEM_PARENT["ta_7"], ITEM_PARENT["ta_8"], ITEM_PARENT["ta_9"], ITEM_PARENT["ta_10"], ITEM_PARENT["ta_11"], ITEM_PARENT["ta_12"], ITEM_PARENT["ta_13"], ITEM_PARENT["ta_14"], ITEM_PARENT["ta_15"], ITEM_PARENT["ta_16"], ITEM_PARENT["ta_17"], ITEM_PARENT["ta_18"], ITEM_PARENT["ta_19"], ITEM_PARENT["ta_20"], ITEM_PARENT["ta_21"], ITEM_PARENT["ta_22"], ITEM_PARENT["ta_23"], ITEM_PARENT["ta_24"], ITEM_PARENT["tc_0"], ITEM_PARENT["tc_1"], ITEM_PARENT["tc_2"], ITEM_PARENT["tc_3"], ITEM_PARENT["tc_5"], ITEM_PARENT["tc_7"], ITEM_PARENT["tc_9"], ITEM_PARENT["tc_11"], ITEM_PARENT["tc_13"], ITEM_PARENT["tc_15"], ITEM_PARENT["tc_16"], ITEM_PARENT["tc_17"], ITEM_PARENT["tc_18"], ITEM_PARENT["tc_19"], ITEM_PARENT["tc_20"], ITEM_PARENT["tc_21"], ITEM_PARENT["tc_23"], ITEM_PARENT["tl_0"], ITEM_PARENT["tl_1"], ITEM_PARENT["tl_2"], ITEM_PARENT["tl_3"], ITEM_PARENT["tl_4"], ITEM_PARENT["tl_5"], ITEM_PARENT["tl_6"], ITEM_PARENT["tl_7"], ITEM_PARENT["tl_8"], JELLY_TOP];
JELLY_BASE_VALUES = [];
JELLY_PARTS = [[JELLY_BACK_TOP, JELLY_BACK_BOTTOM], [JELLY_BACK_LEFT_TOP, JELLY_BACK_LEFT_BOTTOM], [JELLY_BACK_RIGHT_TOP, JELLY_BACK_RIGHT_BOTTOM], [JELLY_RIGHT_TOP, JELLY_RIGHT_BOTTOM], [JELLY_LEFT_BACK_TOP, JELLY_LEFT_BACK_BOTTOM], [JELLY_RIGHT_BACK_TOP, JELLY_RIGHT_BACK_BOTTOM], [JELLY_CENTER_LEFT_TOP, JELLY_CENTER_LEFT_BOTTOM], [JELLY_CENTER_RIGHT_TOP, JELLY_CENTER_RIGHT_BOTTOM], [JELLY_FRONT_RIGHT_TOP, JELLY_FRONT_RIGHT_BOTTOM], [JELLY_FRONT_TOP, JELLY_FRONT_BOTTOM]];
Physics.attach(ATTACH_LIST, TOP_LEVEL.body, JELLY_TOP);
Physics.attach(ATTACH_LIST, TOP_LEVEL.top, TOP_LEVEL.body);
Physics.attach(ATTACH_LIST, TOP_LEVEL.breast1, TOP_LEVEL.top);
Physics.attach(ATTACH_LIST, TOP_LEVEL.breast2, TOP_LEVEL.top);
Physics.attach(ATTACH_LIST, TOP_LEVEL.fur, TOP_LEVEL.top);
Physics.attach(ATTACH_LIST, TOP_LEVEL.arm1, TOP_LEVEL.top);
Physics.attach(ATTACH_LIST, TOP_LEVEL.arm2, TOP_LEVEL.top);
Physics.attach(ATTACH_LIST, TOP_LEVEL.head, TOP_LEVEL.top);
Physics.attach(ATTACH_LIST, TOP_LEVEL.belly, TOP_LEVEL.body);
Physics.attach(ATTACH_LIST, TOP_LEVEL.leg1, TOP_LEVEL.body);
Physics.attach(ATTACH_LIST, TOP_LEVEL.leg2, TOP_LEVEL.body);
Physics.attach(ATTACH_LIST, TOP_LEVEL.tail, TOP_LEVEL.body);
Physics.attach(ATTACH_LIST, TOP_LEVEL.hand1, TOP_LEVEL.arm1);
Physics.attach(ATTACH_LIST, TOP_LEVEL.hand2, TOP_LEVEL.arm2);
Physics.attach(ATTACH_LIST, TOP_LEVEL.foot1, TOP_LEVEL.leg1);
Physics.attach(ATTACH_LIST, TOP_LEVEL.foot2, TOP_LEVEL.leg2);
Physics.attach(ATTACH_LIST, TOP_LEVEL.pouch, TOP_LEVEL.belly);
Physics.attach(ATTACH_LIST, TOP_LEVEL.jellyBlob1, TOP_LEVEL.hand1);
Physics.attach(ATTACH_LIST, TOP_LEVEL.jellyBlob2, TOP_LEVEL.hand2);
Physics.attach(ATTACH_LIST, TOP_LEVEL.mouth, TOP_LEVEL.head);
Physics.attach(ATTACH_LIST, TOP_LEVEL.nose, TOP_LEVEL.head);
Physics.attach(ATTACH_LIST, TOP_LEVEL.eye1, TOP_LEVEL.head);
Physics.attach(ATTACH_LIST, TOP_LEVEL.eye2, TOP_LEVEL.head);
Physics.attach(ATTACH_LIST, TOP_LEVEL.ear1, TOP_LEVEL.head);
Physics.attach(ATTACH_LIST, TOP_LEVEL.ear2, TOP_LEVEL.head);
Physics.attach(ATTACH_LIST, TOP_LEVEL.blush1, TOP_LEVEL.head);
Physics.attach(ATTACH_LIST, TOP_LEVEL.blush2, TOP_LEVEL.head);
initialize();
currentBlob = null;
blushAlpha = 0;
blushMode = 0;
_zoom = 0;
_plus._txt.text = "+";
_minus._txt.text = "-";
_zero._txt.text = "0";
_plus.addEventListener(MouseEvent.MOUSE_DOWN, zoomIn);
_minus.addEventListener(MouseEvent.MOUSE_DOWN, zoomOut);
_zero.addEventListener(MouseEvent.CLICK, resetScale);
_bounce.addEventListener(MouseEvent.CLICK, makeBouncy);
}
public function addShines(_arg1:MovieClip, _arg2:Array, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:uint, _arg7:Number, _arg8:Number=0, _arg9:Number=0){
var _local10:int;
var _local11:int;
var _local12:Number;
var _local13:Number;
var _local14:Object;
var _local15:Shape;
var _local16:Graphics;
var _local17:Array;
_local12 = (-(_arg3) * 0.5);
_local13 = (-(_arg4) * 0.5);
_local11 = _arg2.length;
_local17 = new Array(_local11);
_local10 = 0;
while (_local10 < _local11) {
_local14 = _arg2[_local10];
_local15 = new Shape();
_local17[_local10] = _local15;
_local15.rotation = _arg5;
_local16 = _local15.graphics;
_local16.beginFill(_arg6, _arg7);
_local16.drawEllipse((_arg8 + _local12), (_arg9 + _local13), _arg3, _arg4);
_local16.endFill();
_local15.x = _local14.x;
_local15.y = _local14.y;
_arg1.addChild(_local15);
_local10++;
};
return (_local17);
}
public function resize(_arg1:Event){
var _local2:Number;
var _local3:Number;
_local2 = (1 / amber.scaleX);
STAGE_WIDTH_2 = (stage.stageWidth * 0.5);
_local3 = ((STAGE_WIDTH_2 * 0.9) * _local2);
if (plate.x > (PLATE_X + _local3)){
plate.x = (PLATE_X + _local3);
} else {
if (plate.x < (PLATE_X - _local3)){
plate.x = (PLATE_X - _local3);
};
};
JELLY.x = (plate.x + JELLY_DIF_X);
JELLY.y = (plate.y + JELLY_DIF_Y);
plateShade.x = plate.x;
BG.x = (-((stage.stageWidth - STAGE_WIDTH)) * 0.5);
BG.y = (-((stage.stageHeight - STAGE_HEIGHT)) * 0.5);
BG.graphics.clear();
BG.graphics.beginFill(0);
BG.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
BG.graphics.endFill();
info_txt.x = (-((stage.stageWidth - STAGE_WIDTH)) * 0.5);
info_txt.y = ((stage.stageHeight - ((stage.stageHeight - STAGE_HEIGHT) * 0.5)) - info_txt.height);
_plus.x = ((STAGE_WIDTH + ((stage.stageWidth - STAGE_WIDTH) * 0.5)) - 50);
_zero.x = ((STAGE_WIDTH + ((stage.stageWidth - STAGE_WIDTH) * 0.5)) - 100);
_minus.x = ((STAGE_WIDTH + ((stage.stageWidth - STAGE_WIDTH) * 0.5)) - 150);
_plus.y = (_zero.y = (_minus.y = ((-((stage.stageHeight - STAGE_HEIGHT)) * 0.5) + 10)));
_bounce.x = _plus.x;
_bounce.y = (_plus.y + 50);
amberMask.x = ((amber.bg.x * amber.scaleX) + amber.x);
amberMask.y = ((amber.bg.y * amber.scaleY) + amber.y);
amberMask.graphics.clear();
amberMask.graphics.beginFill(0);
amberMask.graphics.drawRect(0, 0, (amber.bg.width * amber.scaleX), (amber.bg.height * amber.scaleY));
amberMask.graphics.endFill();
updateBlobList();
}
public function drawJelly(_arg1:Graphics, _arg2:Array, _arg3:Array, _arg4:Number, _arg5:uint, _arg6:Number){
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:Array;
var _local13:Array;
var _local14:Array;
var _local15:Object;
var _local16:Object;
var _local17:Object;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
_arg1.clear();
_local7 = _arg2.length;
_local9 = 0;
while (_local9 < _local7) {
_local11 = _arg2[_local9];
_local12 = _local11[0];
_local13 = _local11[1];
_local15 = _local12[0][0];
_arg1.moveTo(_local15.x, _local15.y);
_arg1.beginFill(39423, 0.5);
_local8 = _local12.length;
_local10 = 0;
while (_local10 < _local8) {
_local14 = _local12[_local10];
Drawing.drawCurvyLine(_arg1, null, _local14, null);
_local10++;
};
_local15 = _local13[0][0];
_arg1.lineTo(_local15.x, _local15.y);
_local8 = _local13.length;
_local10 = 0;
while (_local10 < _local8) {
_local14 = _local13[_local10];
Drawing.drawCurvyLine(_arg1, null, _local14, null);
_local10++;
};
_arg1.endFill();
_local9++;
};
_local20 = (_arg3.length >> 1);
_local18 = 0;
_local19 = _local20;
while (_local18 < _local20) {
_local16 = _arg3[_local18];
_local21 = _local16.x;
_local22 = _local16.y;
_local17 = _arg3[_local19];
_local23 = _local17.x;
_local24 = _local17.y;
_arg1.beginFill(_arg5, _arg6);
_arg1.moveTo(_local21, _local22);
_arg1.lineTo((_local21 + _arg4), _local22);
_arg1.lineTo((_local23 + _arg4), _local24);
_arg1.lineTo(_local23, _local24);
_arg1.endFill();
_local18++;
_local19++;
};
}
public function resetScale(_arg1:MouseEvent){
amber.scaleX = (amber.scaleY = 1);
amberMask.x = ((amber.bg.x * amber.scaleX) + amber.x);
amberMask.y = ((amber.bg.y * amber.scaleY) + amber.y);
amberMask.graphics.clear();
amberMask.graphics.beginFill(0);
amberMask.graphics.drawRect(0, 0, (amber.bg.width * amber.scaleX), (amber.bg.height * amber.scaleY));
amberMask.graphics.endFill();
}
public function moveTopTo(_arg1:Number, _arg2:Number){
var _local3:int;
var _local4:int;
var _local5:Object;
var _local6:Object;
var _local7:Object;
_local4 = JELLY_ITEMS.length;
_local3 = 0;
while (_local3 < _local4) {
_local5 = JELLY_ITEMS[_local3];
_local7 = JELLY_BASE_VALUES[_local3];
_local5.x = (_local7.x + _arg1);
_local5.y = (_local7.y + _arg2);
_local3++;
};
_local4 = JELLY_SHINES.length;
_local3 = 0;
while (_local3 < _local4) {
_local5 = JELLY_SHINES[_local3];
_local6 = JELLY_SHADES[_local3];
_local7 = JELLY_SHINE_BASE_VALUES[_local3];
_local6.x = (_local5.x = (_local7.x + _arg1));
_local6.y = (_local5.y = (_local7.y + _arg2));
_local3++;
};
}
public function updateBlush(){
if (blushMode){
if (blushAlpha <= 1){
blushAlpha = (blushAlpha + 0.1);
if (blushAlpha >= 1){
blushAlpha = 1;
if (blushMode == 2){
blushMode = 0;
};
};
blush1.alpha = (blush2.alpha = blushAlpha);
};
} else {
if (blushAlpha > 0){
blushAlpha = (blushAlpha - 0.05);
if (blushAlpha < 0){
blushAlpha = 0;
};
blush1.alpha = (blush2.alpha = blushAlpha);
};
};
}
public function updateBlobList(){
var _local1:int;
var _local2:int;
var _local3:MovieClip;
var _local4:Rectangle;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local8 = (1 / amber.scaleX);
_local2 = USED_EAT_BLOBS.length;
_local7 = (((110 + ((STAGE_HEIGHT - stage.stageHeight) * 0.5)) - amber.y) * _local8);
_local1 = 0;
while (_local1 < _local2) {
_local3 = USED_EAT_BLOBS[_local1];
_local4 = _local3.getBounds(amber);
_local5 = (((STAGE_WIDTH + ((stage.stageWidth - STAGE_WIDTH) * 0.5)) - amber.x) * _local8);
_local6 = _local7;
_local3.x = (_local3.x + (_local5 - _local4.right));
_local3.y = (_local3.y + (_local6 - _local4.top));
_local7 = (_local7 + _local4.height);
_local1++;
};
}
public function makeBouncy(_arg1:MouseEvent){
bouncy = ((bouncy + 1) % 7);
if (bouncy){
_bounce.gotoAndStop(2);
_bounce._txt.text = ("Bouncy\n" + bouncy);
} else {
_bounce.gotoAndStop(1);
_bounce._txt.text = "Bouncy";
};
}
public function dragPlate(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local2 = TOP_LEVEL.mouseX;
_local3 = TOP_LEVEL.mouseY;
_local4 = (_local2 - oldMX);
_local5 = (_local3 - oldMY);
_local6 = plate.y;
_local7 = plate.x;
plate.x = (oldX + _local4);
plate.y = (oldY + _local5);
if (plate.y >= PLATE_Y){
plate.y = PLATE_Y;
_local5 = (_local5 + (plate.y - _local6));
};
_local8 = (1 / amber.scaleX);
_local9 = ((STAGE_WIDTH_2 * 0.9) * _local8);
if (plate.x > (PLATE_X + _local9)){
plate.x = (PLATE_X + _local9);
} else {
if (plate.x < (PLATE_X - _local9)){
plate.x = (PLATE_X - _local9);
};
};
plateShade.x = plate.x;
JELLY.x = (plate.x + JELLY_DIF_X);
JELLY.y = (plate.y + JELLY_DIF_Y);
_local4 = (plate.x - _local7);
_local5 = (plate.y - _local6);
TOP_X[0] = (TOP_X[0] - (_local4 * TOP_MOVE_SCALE));
TOP_Y[0] = (TOP_Y[0] - (_local5 * TOP_MOVE_SCALE));
}
public function zoomOut(_arg1:MouseEvent){
_zoom = -0.02;
stage.addEventListener(MouseEvent.MOUSE_UP, stopZoom);
}
public function mDown(_arg1:Event){
var _local2:Number;
var _local3:Number;
oldMX = TOP_LEVEL.mouseX;
oldMY = TOP_LEVEL.mouseY;
_local2 = stage.mouseX;
_local3 = stage.mouseY;
clickDown = CLICK_TIMER;
if (belly.hitTestPoint(_local2, _local3, true)){
clickTarget = belly;
} else {
if (plate.hitTestPoint(_local2, _local3, true)){
oldX = plate.x;
oldY = plate.y;
stage.addEventListener(MouseEvent.MOUSE_MOVE, dragPlate);
movingPlate = true;
};
};
stage.addEventListener(MouseEvent.MOUSE_UP, mUp);
}
public function dragBlob(_arg1:MouseEvent){
currentBlob.x = currentBlob.parent.mouseX;
currentBlob.y = currentBlob.parent.mouseY;
}
public function stopZoom(_arg1:MouseEvent){
_zoom = 0;
stage.removeEventListener(MouseEvent.MOUSE_UP, stopZoom);
}
public function dropBlob(_arg1:MouseEvent){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, dragBlob);
stage.removeEventListener(MouseEvent.MOUSE_UP, dropBlob);
if (((((((((currentBlob.hitTestObject(mouth)) && (!((mouth.currentLabel == "eat"))))) && (!((mouth.currentLabel == "eat2"))))) && (!((mouth.currentLabel == "mideat"))))) && (!((mouth.currentLabel == "endeat"))))){
currentBlob.removeEventListener(MouseEvent.MOUSE_DOWN, pickBlob);
currentBlob.addEventListener(Event.ENTER_FRAME, eatBlobFrame);
} else {
USED_EAT_BLOBS[USED_EAT_BLOBS.length] = currentBlob;
updateBlobList();
};
currentBlob = null;
}
public function eatBlobFrame(_arg1:Event){
var _local2:MovieClip;
_local2 = (_arg1.currentTarget as MovieClip);
if (_local2.currentFrame == _local2.totalFrames){
mouth.gotoAndPlay("eat");
eye1.gotoAndPlay("eat");
eye2.gotoAndPlay("eat");
_local2.removeEventListener(Event.ENTER_FRAME, eatBlobFrame);
_local2.parent.removeChild(_local2);
} else {
mouth.gotoAndStop("eat");
eye1.gotoAndStop("eat");
eye2.gotoAndStop("eat");
_local2.nextFrame();
_local2.x = mouth.x;
_local2.y = mouth.y;
};
}
public function pickBlob(_arg1:MouseEvent){
var _local2:int;
var _local3:int;
currentBlob = (_arg1.currentTarget as MovieClip);
Physics.detach(ATTACH_LIST, currentBlob, JELLY_TOP);
currentBlob.parent.addChild(currentBlob);
_bounce.visible = true;
_local3 = USED_EAT_BLOBS.length;
_local2 = 0;
while (_local2 < _local3) {
if (USED_EAT_BLOBS[_local2] == currentBlob){
USED_EAT_BLOBS.splice(_local2, 1);
updateBlobList();
break;
};
_local2++;
};
stage.addEventListener(MouseEvent.MOUSE_MOVE, dragBlob);
stage.addEventListener(MouseEvent.MOUSE_UP, dropBlob);
}
public function initialize(){
var _local1:int;
var _local2:int;
var _local3:Object;
var _local4:MovieClip;
ITEM_PARENT.visible = false;
JELLY.x = ITEM_PARENT.x;
JELLY.y = ITEM_PARENT.y;
TOP_LEVEL.addChildAt(JELLY, (TOP_LEVEL.getChildIndex(plate) + 1));
JELLY.addChild(JELLY_TOP);
JELLY_TOP.x = (JELLY_TOP.x - JELLY.x);
JELLY_TOP.y = (JELLY_TOP.y - JELLY.y);
_local2 = JELLY_ITEMS.length;
_local1 = 0;
while (_local1 < _local2) {
_local3 = JELLY_ITEMS[_local1];
JELLY_BASE_VALUES[_local1] = {x:_local3.x, y:_local3.y};
_local1++;
};
drawJelly(JELLY.graphics, JELLY_PARTS, JELLY_LONG_SHINES, JELLY_SHINE_THICKNESS, JELLY_SHINE_COLOR, JELLY_SHINE_ALPHA);
JELLY_SHADES = addShines(JELLY, JELLY_SHINE_BASE_VALUES, 35, 15, 0, 39423, 0.333, 25, 10);
JELLY_SHINES = addShines(JELLY, JELLY_SHINE_BASE_VALUES, 25, 10, -30, 0xFFFFFF, 0.5);
tail.gotoAndStop(TAIL_CENTER);
mouth.gotoAndStop("full");
JELLY_DIF_X = (JELLY.x - plate.x);
JELLY_DIF_Y = (JELLY.y - plate.y);
oldPlateX = (PLATE_X = plate.x);
oldPlateY = (PLATE_Y = plate.y);
plate.vX = (plate.vY = 0);
plateShade.graphics.beginFill(0, 0.5);
plateShade.graphics.drawEllipse((-(plate.width) * 0.5), (-(plate.height) * 0.35), plate.width, (plate.height * 1));
plateShade.graphics.endFill();
plate.parent.addChildAt(plateShade, plate.parent.getChildIndex(plate));
plateShade.x = plate.x;
plateShade.y = plate.y;
poke_mc.gotoAndStop(1);
poke_mc.visible = false;
info_txt = new TextField();
info_txt.selectable = false;
info_txt.mouseEnabled = false;
info_txt.tabEnabled = false;
info_txt.wordWrap = false;
info_txt.multiline = true;
info_txt.defaultTextFormat = new TextFormat("Arial", 12, 0);
info_txt.text = "Amber's big, bouncy jelly snack\nDrawn and programmed by Doom the wolf\nhttp://doom-the-wolf.deviantart.com";
info_txt.width = (info_txt.textWidth + 5);
info_txt.height = (info_txt.textHeight + 5);
info_txt.x = (-((stage.stageWidth - STAGE_WIDTH)) * 0.5);
info_txt.y = ((stage.stageHeight - ((stage.stageHeight - STAGE_HEIGHT) * 0.5)) - info_txt.height);
info_txt.blendMode = BlendMode.INVERT;
stage.addChild(info_txt);
stage.addChildAt(BG, 0);
BG.x = (-((stage.stageWidth - STAGE_WIDTH)) * 0.5);
BG.y = (-((stage.stageHeight - STAGE_HEIGHT)) * 0.5);
BG.graphics.beginFill(0);
BG.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
BG.graphics.endFill();
_local2 = EAT_BLOBS.length;
_local1 = 0;
while (_local1 < _local2) {
_local4 = EAT_BLOBS[_local1];
_local4.gotoAndStop(1);
_local4.addEventListener(MouseEvent.MOUSE_DOWN, pickBlob);
Physics.attach(ATTACH_LIST, _local4, JELLY_TOP);
_local1++;
};
blush1.alpha = (blush2.alpha = 0);
amberMask = new MovieClip();
stage.addChild(amberMask);
amber.mask = amberMask;
amberMask.x = ((amber.bg.x * amber.scaleX) + amber.x);
amberMask.y = ((amber.bg.y * amber.scaleY) + amber.y);
amberMask.graphics.clear();
amberMask.graphics.beginFill(0);
amberMask.graphics.drawRect(0, 0, (amber.bg.width * amber.scaleX), (amber.bg.height * amber.scaleY));
amberMask.graphics.endFill();
_bounce.visible = false;
_bounce.gotoAndStop(1);
stage.addEventListener(Event.ENTER_FRAME, eFrame);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mDown);
stage.addEventListener(Event.RESIZE, resize);
resize(null);
}
public function moveTop(_arg1:Number, _arg2:Number){
var _local3:int;
var _local4:int;
var _local5:Object;
var _local6:Object;
var _local7:Object;
_local4 = JELLY_ITEMS.length;
_local3 = 0;
while (_local3 < _local4) {
_local5 = JELLY_ITEMS[_local3];
JELLY_ITEMS[_local3].x = (_local5.x + _arg1);
_local5.y = (_local5.y + _arg2);
_local3++;
};
_local4 = JELLY_SHINES.length;
_local3 = 0;
while (_local3 < _local4) {
_local5 = JELLY_SHINES[_local3];
_local6 = JELLY_SHADES[_local3];
_local7 = JELLY_SHINE_BASE_VALUES[_local3];
_local5.x = (_local5.x + _arg1);
_local5.y = (_local5.y + _arg2);
_local6.x = (_local6.x + _arg1);
_local6.y = (_local6.y + _arg2);
_local3++;
};
}
public function mUp(_arg1:Event){
if (clickDown){
if (clickTarget == belly){
TOP_Y[1] = (TOP_Y[1] + 10);
poke_mc.visible = true;
poke_mc.gotoAndPlay(1);
poke_mc.x = amber.mouseX;
poke_mc.y = amber.mouseY;
bellyPoke = BELLY_POKE_TIMER;
blushMode = 2;
};
};
clickTarget = null;
clickDown = 0;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, dragPlate);
stage.removeEventListener(MouseEvent.MOUSE_UP, mUp);
movingPlate = false;
}
}
}//package amberJelly_fla
Section 8
//Drawing (as3.Drawing)
package as3 {
import flash.display.*;
import flash.geom.*;
import fl.motion.*;
public class Drawing {
public static function drawHeart(_arg1:Graphics, _arg2:Number, _arg3:Number){
var _local4:Number;
var _local5:Number;
var _local6:Object;
var _local7:Object;
var _local8:Object;
var _local9:Object;
var _local10:Object;
var _local11:Object;
var _local12:Object;
var _local13:Object;
var _local14:Object;
var _local15:Object;
_local4 = (_arg3 / 1.5);
_local5 = (_arg2 / 1.5);
_local6 = {x:0, y:1};
_local7 = {x:1, y:0};
_local8 = {x:0, y:-1};
_local9 = {x:1.2, y:-0.5};
_local10 = {x:1, y:-1};
_local11 = {x:0.5, y:-1.2};
_local12 = Geometry.intersectLines(_local7.x, _local7.y, (_local7.x + 1), (_local7.y - 1), _local9.x, _local9.y, _local9.x, (_local9.y + 1));
_local13 = Geometry.intersectLines(_local10.x, _local10.y, (_local10.x + 1), (_local10.y + 1), _local9.x, _local9.y, _local9.x, (_local9.y + 1));
_local14 = Geometry.intersectLines(_local10.x, _local10.y, (_local10.x + 1), (_local10.y + 1), _local11.x, _local11.y, (_local11.x + 1), _local11.y);
_local15 = Geometry.intersectLines(_local8.x, _local8.y, (_local8.x + 1), (_local8.y - 1), _local11.x, _local11.y, (_local11.x + 1), _local11.y);
_arg1.moveTo((_local5 * _local6.x), (_local4 * _local6.y));
_arg1.lineTo((_local5 * _local7.x), (_local4 * _local7.y));
_arg1.curveTo((_local5 * _local12.x), (_local4 * _local12.y), (_local5 * _local9.x), (_local4 * _local9.y));
_arg1.curveTo((_local5 * _local13.x), (_local4 * _local13.y), (_local5 * _local10.x), (_local4 * _local10.y));
_arg1.curveTo((_local5 * _local14.x), (_local4 * _local14.y), (_local5 * _local11.x), (_local4 * _local11.y));
_arg1.curveTo((_local5 * _local15.x), (_local4 * _local15.y), (_local5 * _local8.x), (_local4 * _local8.y));
_arg1.curveTo((-(_local5) * _local15.x), (_local4 * _local15.y), (-(_local5) * _local11.x), (_local4 * _local11.y));
_arg1.curveTo((-(_local5) * _local14.x), (_local4 * _local14.y), (-(_local5) * _local10.x), (_local4 * _local10.y));
_arg1.curveTo((-(_local5) * _local13.x), (_local4 * _local13.y), (-(_local5) * _local9.x), (_local4 * _local9.y));
_arg1.curveTo((-(_local5) * _local12.x), (_local4 * _local12.y), (-(_local5) * _local7.x), (_local4 * _local7.y));
_arg1.lineTo((-(_local5) * _local6.x), (_local4 * _local6.y));
}
public static function drawPolyLine(_arg1:Array, _arg2:Graphics){
var _local3:int;
_local3 = 1;
while (_local3 < _arg1.length) {
_arg2.lineTo(_arg1[_local3].x, _arg1[_local3].y);
_local3++;
};
}
public static function getLinePoint(_arg1:Object, _arg2:Object, _arg3:Object):Object{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = (_arg2.x - _arg1.x);
_local5 = (_arg2.y - _arg1.y);
_local6 = Math.atan2(_local5, _local4);
_local7 = (_arg3.x - _arg2.x);
_local8 = (_arg3.y - _arg2.y);
_local9 = Math.atan2(_local8, _local7);
_local10 = Geometry.interpolateAngle(_local6, _local9, 0.5);
return ({x:(_arg2.x + (Math.cos(_local10) * 2)), y:(_arg2.y + (Math.sin(_local10) * 2))});
}
public static function drawPoints(_arg1:Array, _arg2:Graphics){
var _local3:int;
_local3 = 0;
while (_local3 < _arg1.length) {
_arg2.moveTo(_arg1[_local3].x, (_arg1[_local3].y - 0.5));
_arg2.lineTo(_arg1[_local3].x, (_arg1[_local3].y + 0.5));
_local3++;
};
}
public static function drawKick(_arg1:Graphics, _arg2:Graphics, _arg3:Graphics, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number, _arg13:uint=0xFFFFFF, _arg14:uint=0xFFFFFF, _arg15:Number=1, _arg16=1){
var _local17:Number;
var _local18:Point;
var _local19:Number;
var _local20:Point;
var _local21:Point;
var _local22:Point;
var _local23:Point;
var _local24:Point;
var _local25:Point;
var _local26:Point;
var _local27:Point;
var _local28:Matrix;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Point;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
_local17 = 0.85;
_local18 = Geometry.rotatePoint(-(_arg8), new Point((_arg9 - _arg4), (_arg10 - _arg5)), null);
Geometry.rotatePoint(-(_arg8), new Point((_arg9 - _arg4), (_arg10 - _arg5)), null).x = (_local18.x / _arg6);
_local18.y = (_local18.y / _arg7);
_local19 = _local18.length;
_arg14 = Color.interpolateColor(_arg13, _arg14, _arg12);
_local29 = (_arg5 / _arg4);
if (_local19 < _local17){
_local30 = 0.5;
_local31 = (1 / _local17);
_local32 = ((1 - (_local30 * Math.abs(_local18.x))) * _arg11);
_local33 = ((1 - (_local30 * Math.abs(_local18.y))) * _arg11);
_local34 = (((Math.PI * 0.125) * (_local18.y * _local31)) * (-(_local18.x) * _local31));
_local35 = (((Math.PI * 0.125) * (_local18.x * _local31)) * (-(_local18.y) * _local31));
_local28 = new Matrix((_local32 * Math.cos(_local34)), (_local32 * Math.sin(_local34)), (_local33 * Math.sin(_local35)), (_local33 * Math.cos(_local35)));
_local28.tx = _arg9;
_local28.ty = _arg10;
_local36 = new Point(-1, 0);
_local24 = _local28.transformPoint(_local36);
_local36.x = 1;
_local25 = _local28.transformPoint(_local36);
_local36.x = 0;
_local36.y = -2;
_local22 = _local28.transformPoint(_local36);
_local36.y = 1;
_local23 = _local28.transformPoint(_local36);
_local37 = ((2 * Math.SQRT1_2) - 0.5);
_local36.x = -(_local37);
_local36.y = _local37;
_local26 = _local28.transformPoint(_local36);
_local36.x = _local37;
_local27 = _local28.transformPoint(_local36);
_local36.x = ((_local18.x * _arg12) * 0.75);
_local36.y = ((_local18.y * _arg12) * 0.75);
_local21 = _local28.transformPoint(_local36);
_local36.x = (((_local18.x * 0.75) * 2) * _arg12);
_local36.y = ((1 + ((Math.abs((_local18.y * 0.75)) - 1) * _arg12)) * 2);
_local20 = _local28.transformPoint(_local36);
_local28.createGradientBox(_arg11, _arg11, 0, (_local21.x - (_arg11 * 0.5)), (_local21.y - (_arg11 * 0.5)));
_arg1.beginGradientFill(GradientType.RADIAL, [_arg14, _arg13], [_arg16, _arg15], [0, 0xFF], _local28);
_arg1.moveTo(_local24.x, _local24.y);
_arg1.curveTo(_local22.x, _local22.y, _local25.x, _local25.y);
_arg1.curveTo(_local27.x, _local27.y, _local23.x, _local23.y);
_arg1.curveTo(_local26.x, _local26.y, _local24.x, _local24.y);
_arg1.endFill();
_arg2.moveTo(_local24.x, _local24.y);
_arg2.curveTo(_local20.x, _local20.y, _local25.x, _local25.y);
_arg2.curveTo(_local27.x, _local27.y, _local23.x, _local23.y);
_arg2.curveTo(_local26.x, _local26.y, _local24.x, _local24.y);
} else {
_local38 = _local18.x;
_local39 = _local18.y;
_local40 = (_arg8 + Math.atan2(_local39, _local38));
_local41 = ((_local38)<0) ? -1 : 1;
_local38 = Math.cos(_local40);
_local39 = Math.sin(_local40);
_local28 = new Matrix((_arg11 * _local38), (_arg11 * _local39), (_arg11 * -(_local39)), (_arg11 * _local38), _arg9, _arg10);
_local36 = new Point();
_local36.x = 0;
_local36.y = (-1 * _local41);
_local22 = _local28.transformPoint(_local36);
_local36.y = (1 * _local41);
_local23 = _local28.transformPoint(_local36);
_local36.x = 0.5;
_local36.y = (0 * _local41);
_local25 = _local28.transformPoint(_local36);
_local36.x = -0.5;
_local24 = _local28.transformPoint(_local36);
_local36.x = 0.5;
_local36.y = (-0.5 * _local41);
_local26 = _local28.transformPoint(_local36);
_local36.y = (0.5 * _local41);
_local27 = _local28.transformPoint(_local36);
_local36.x = 0.5;
_local36.y = 0;
_local20 = _local28.transformPoint(_local36);
_local36.x = (0.5 * ((_local18.y * 0.5) + 0.5));
_local36.y = ((2 + ((-0.5 - 2) * ((_local18.y * 0.5) + 0.5))) * _local41);
_local21 = _local28.transformPoint(_local36);
_arg3.moveTo(_local22.x, _local22.y);
_arg3.curveTo(_local26.x, _local26.y, _local25.x, _local25.y);
_arg3.curveTo(_local27.x, _local27.y, _local23.x, _local23.y);
_local28.createGradientBox(_arg11, _arg11, 0, (_local20.x - (_arg11 * 0.5)), (_local20.y - (_arg11 * 0.5)));
_arg1.beginGradientFill(GradientType.RADIAL, [_arg14, _arg13], [_arg16, _arg15], [0, 0xFF], _local28);
_arg1.moveTo(_local22.x, _local22.y);
_arg1.curveTo(_local26.x, _local26.y, _local25.x, _local25.y);
_arg1.curveTo(_local27.x, _local27.y, _local23.x, _local23.y);
_arg1.curveTo(_local24.x, _local24.y, _local22.x, _local22.y);
_arg1.endFill();
_arg2.moveTo(_local22.x, _local22.y);
_arg2.curveTo(_local21.x, _local21.y, _local25.x, _local25.y);
_arg2.curveTo(_local27.x, _local27.y, _local23.x, _local23.y);
_arg2.curveTo(_local24.x, _local24.y, _local22.x, _local22.y);
};
}
public static function getLinePoint2(_arg1:Object, _arg2:Object, _arg3:Object, _arg4:Object):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local5 = _arg3.x;
_local6 = _arg3.y;
_local9 = (_local5 - _arg2.x);
_local10 = (_local6 - _arg2.y);
_local8 = (((_local9) || (_local10))) ? (1 / Math.sqrt(((_local9 * _local9) + (_local10 * _local10)))) : 0;
_local9 = (_local9 * _local8);
_local10 = (_local10 * _local8);
_local11 = (_arg4.x - _local5);
_local12 = (_arg4.y - _local6);
_local8 = (((_local11) || (_local12))) ? (1 / Math.sqrt(((_local11 * _local11) + (_local12 * _local12)))) : 0;
_local11 = (_local11 * _local8);
_local12 = (_local12 * _local8);
_arg1.x = ((_local5 + _local9) + _local11);
_arg1.y = ((_local6 + _local10) + _local12);
}
public static function drawConnection(_arg1:Graphics, _arg2:Object, _arg3:Object, _arg4:Object, _arg5:Object, _arg6:Number){
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Object;
var _local47:Object;
_local7 = _arg2.x;
_local8 = _arg3.x;
_local9 = _arg2.y;
_local10 = _arg3.y;
_local14 = (_arg4) ? (_arg4.x - _local7) : 0;
_local15 = (_arg4) ? (_arg4.y - _local9) : 0;
_local16 = (_arg5) ? (_arg5.x - _local8) : 0;
_local17 = (_arg5) ? (_arg5.y - _local10) : 0;
_local18 = (((_local14) || (_local15))) ? (1 / Math.sqrt(((_local14 * _local14) + (_local15 * _local15)))) : 0;
_local19 = (_local14 * _local18);
_local20 = (_local15 * _local18);
_local18 = (((_local16) || (_local17))) ? (1 / Math.sqrt(((_local16 * _local16) + (_local17 * _local17)))) : 0;
_local21 = (_local16 * _local18);
_local22 = (_local17 * _local18);
_local11 = (_local8 - _local7);
_local12 = (_local10 - _local9);
_local13 = Math.sqrt(((_local11 * _local11) + (_local12 * _local12)));
_local23 = (_arg6 * _local13);
_local24 = (_local19 * _local23);
_local25 = (_local21 * _local23);
_local26 = (_local20 * _local23);
_local27 = (_local22 * _local23);
_local28 = (_local7 + _local24);
_local29 = (_local9 + _local26);
_local30 = (_local7 - _local24);
_local31 = (_local9 - _local26);
_local32 = (_local8 + _local25);
_local33 = (_local10 + _local27);
_local34 = (_local8 - _local25);
_local35 = (_local10 - _local27);
_local36 = (0.5 * (_local7 + _local8));
_local37 = (0.5 * (_local9 + _local10));
_local11 = (_local28 - _local36);
_local12 = (_local29 - _local37);
_local38 = ((_local11 * _local11) + (_local12 * _local12));
_local11 = (_local30 - _local36);
_local12 = (_local31 - _local37);
_local39 = ((_local11 * _local11) + (_local12 * _local12));
_local11 = (_local32 - _local36);
_local12 = (_local33 - _local37);
_local40 = ((_local11 * _local11) + (_local12 * _local12));
_local11 = (_local34 - _local36);
_local12 = (_local35 - _local37);
_local41 = ((_local11 * _local11) + (_local12 * _local12));
if (_local38 < _local39){
_local42 = _local28;
_local43 = _local29;
} else {
_local42 = _local30;
_local43 = _local31;
};
if (_local40 < _local41){
_local44 = _local32;
_local45 = _local33;
} else {
_local44 = _local34;
_local45 = _local35;
};
if (!_arg4){
_arg1.curveTo(_local44, _local45, _local8, _local10);
return;
};
if (!_arg5){
_arg1.curveTo(_local42, _local43, _local8, _local10);
return;
};
_arg1.curveTo(_local42, _local43, ((_local42 + _local44) * 0.5), ((_local43 + _local45) * 0.5));
_arg1.curveTo(_local44, _local45, _local8, _local10);
}
public static function drawSparkle(_arg1:Graphics, _arg2:Number, _arg3:int, _arg4:Number, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0){
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
if (_arg3 < 1){
return;
};
_local14 = ((Math.PI * 2) / _arg3);
_arg1.moveTo(((Math.cos(_arg5) * _arg2) + _arg6), (_arg7 + (Math.sin(_arg5) * _arg2)));
_local15 = 0;
while (_local15 < _arg3) {
_local8 = (Math.cos(((Number((_local15 + 1)) * _local14) + _arg5)) * _arg2);
_local9 = (Math.sin(((Number((_local15 + 1)) * _local14) + _arg5)) * _arg2);
_local10 = ((Math.cos(((Number((_local15 + 0.5)) * _local14) + _arg5)) * _arg2) * _arg4);
_local11 = ((Math.sin(((Number((_local15 + 0.5)) * _local14) + _arg5)) * _arg2) * _arg4);
_local12 = ((Math.cos(((Number((_local15 + 0.25)) * _local14) + _arg5)) * _arg2) * _arg4);
_local13 = ((Math.sin(((Number((_local15 + 0.25)) * _local14) + _arg5)) * _arg2) * _arg4);
_arg1.curveTo((_arg6 + _local12), (_arg7 + _local13), (_arg6 + _local10), (_arg7 + _local11));
_local12 = ((Math.cos(((Number((_local15 + 0.75)) * _local14) + _arg5)) * _arg2) * _arg4);
_local13 = ((Math.sin(((Number((_local15 + 0.75)) * _local14) + _arg5)) * _arg2) * _arg4);
_arg1.curveTo((_arg6 + _local12), (_arg7 + _local13), (_arg6 + _local8), (_arg7 + _local9));
_local15++;
};
}
public static function drawCurvyLine(_arg1:Graphics, _arg2:Object, _arg3:Array, _arg4:Object, _arg5:Number=0.25){
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Object;
var _local10:Object;
var _local11:Object;
var _local12:Object;
var _local13:Object;
var _local14:Object;
var _local15:Object;
var _local16:Number;
_local7 = _arg3.length;
_local8 = (_local7 - 1);
_local11 = new Object();
_local12 = new Object();
_local16 = (_arg5 * 2);
_local6 = 1;
while (_local6 < _local7) {
_local13 = _arg3[(_local6 - 1)];
_local14 = _arg3[_local6];
if (_local6 < _local8){
getLinePoint2(_local11, _local13, _local14, _arg3[(_local6 + 1)]);
_local9 = _local11;
} else {
_local9 = _arg4;
};
if (_local6 > 1){
getLinePoint2(_local12, _arg3[(_local6 - 2)], _local13, _local14);
_local10 = _local12;
} else {
_local10 = _arg2;
};
if (((!(_local10)) && (!(_local9)))){
_arg1.lineTo(_local14.x, _local14.y);
} else {
if (((!(_local10)) || (!(_local9)))){
drawConnection(_arg1, _local13, _local14, _local10, _local9, _local16);
} else {
drawConnection(_arg1, _local13, _local14, _local10, _local9, _arg5);
};
};
_local6++;
};
}
public static function drawPolygon(_arg1:Array, _arg2:Graphics){
var _local3:int;
_arg2.moveTo(_arg1[0].x, _arg1[0].y);
_local3 = 1;
while (_local3 < _arg1.length) {
_arg2.lineTo(_arg1[_local3].x, _arg1[_local3].y);
_local3++;
};
}
public static function controlPointIntersect(_arg1:Object, _arg2:Object, _arg3:Object, _arg4:Object):Object{
var _local5:Object;
var _local6:Object;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local5 = Geometry.intersectLines(_arg1.x, _arg1.y, _arg2.x, _arg2.y, _arg3.x, _arg3.y, _arg4.x, _arg4.y);
if (!_local5){
return (null);
};
_local6 = {x:((_arg2.x + _arg3.x) * 0.5), y:((_arg2.y + _arg3.y) * 0.5)};
_local7 = (_arg3.x - _arg2.x);
_local8 = (_arg3.y - _arg2.y);
_local9 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local10 = (_local5.x - _local6.x);
_local11 = (_local5.y - _local6.y);
_local12 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
if (_local12 > _local9){
return (null);
};
return ({x:(_local6.x + ((_local5.x - _local6.x) * 0.5)), y:(_local6.y + ((_local5.y - _local6.y) * 0.5))});
}
public static function drawStar(_arg1:Graphics, _arg2:Number, _arg3:uint, _arg4:Number, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0){
var _local8:int;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local8 = 0;
if (!_arg3){
return;
};
_local9 = (_arg2 * _arg4);
_local10 = (Math.PI / _arg3);
_local11 = ((-(Math.PI) * 0.5) + _arg5);
_arg3 = (_arg3 << 1);
_local8 = 0;
while (_local8 <= _arg3) {
if ((_local8 % 2)){
_local12 = (_arg6 + (Math.cos(_local11) * _local9));
_local13 = (_arg7 + (Math.sin(_local11) * _local9));
} else {
_local12 = (_arg6 + (Math.cos(_local11) * _arg2));
_local13 = (_arg7 + (Math.sin(_local11) * _arg2));
};
if (!_local8){
_arg1.moveTo(_local12, _local13);
} else {
_arg1.lineTo(_local12, _local13);
};
_local11 = (_local11 + _local10);
_local8++;
};
}
public static function drawClosedCurve(_arg1:Array, _arg2:Graphics):Array{
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Array;
var _local8:int;
var _local9:Object;
if (_arg1.length < 3){
return ([]);
};
_local7 = new Array();
_arg2.moveTo(_arg1[0].x, _arg1[0].y);
_local8 = 0;
while (_local8 < _arg1.length) {
_local3 = _arg1[_local8];
_local4 = _arg1[(int(((_arg1.length + _local8) - 1)) % _arg1.length)];
_local5 = _arg1[(int((_local8 + 1)) % _arg1.length)];
_local6 = _arg1[(int((_local8 + 2)) % _arg1.length)];
_local9 = controlPointIntersect(_local4, _local3, _local5, _local6);
if (_local9 == null){
_arg2.lineTo(_local5.x, _local5.y);
} else {
_local7.push(_local9);
_arg2.curveTo(_local9.x, _local9.y, _local5.x, _local5.y);
};
_local8++;
};
return (_local7);
}
}
}//package as3
Section 9
//Geometry (as3.Geometry)
package as3 {
import flash.display.*;
import flash.geom.*;
public class Geometry {
public static const DEG_TO_RAD:Number = 0.0174532925199433;
public static const RAD_TO_DEG:Number = 57.2957795130823;
public static const TOLERANCE:Number = 1E-5;
function regularPolygonArea(_arg1:Number, _arg2:int){
var _local3:Number;
var _local4:Number;
if (_arg2 < 3){
return (0);
};
_local3 = ((Math.PI * 2) / _arg2);
_local4 = (Math.sin(_local3) * _arg1);
return ((((_local4 * _arg1) * 0.5) * _arg2));
}
public static function intersectLines(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Boolean=false):Object{
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Object;
var _local19:Boolean;
var _local20:Boolean;
_local10 = (_arg1 - _arg3);
_local11 = (_arg5 - _arg7);
_local12 = (_arg2 - _arg4);
_local13 = (_arg6 - _arg8);
_local14 = ((_arg1 * _arg4) - (_arg2 * _arg3));
_local15 = ((_arg5 * _arg8) - (_arg6 * _arg7));
_local16 = ((_local10 * _local13) - (_local12 * _local11));
if (!_local16){
return (null);
};
_local17 = (1 / _local16);
_local18 = {x:(((_local14 * _local11) - (_local10 * _local15)) * _local17), y:(((_local14 * _local13) - (_local12 * _local15)) * _local17)};
if (_arg9){
_local19 = pointInsideRect(_local18.x, _local18.y, _arg1, _arg2, _arg3, _arg4);
_local20 = pointInsideRect(_local18.x, _local18.y, _arg5, _arg6, _arg7, _arg8);
if (((!(_local19)) || (!(_local20)))){
return (null);
};
};
return (_local18);
}
public static function pointFromEllipse(_arg1:Object, _arg2:Object):Object{
var _local3:Point;
var _local4:Object;
_local3 = new Point();
_local3.x = (_arg1.x + ((_arg1.radius * Math.cos(_arg2.angle)) * _arg2.distance));
_local3.y = (_arg1.y + (((_arg1.radius * _arg1.excentricity) * Math.sin(_arg2.angle)) * _arg2.distance));
_local4 = rotate(_arg1.rotation, _local3.x, _local3.y, _arg1.x, _arg1.y);
return (new Point(_local4.x, _local4.y));
}
public static function polygonArea(_arg1:Array):Number{
var _local2:Point;
var _local3:Point;
var _local4:Number;
if (_arg1.length < 3){
return (0);
};
_local4 = 0;
return (_local4);
}
public static function getEllipse(_arg1:DisplayObject):Object{
var obj:Object;
var rect:Rectangle;
var clip = _arg1;
obj = {};
rect = clip.getRect(clip);
obj.x = clip.x;
obj.y = clip.y;
obj.radius = (-(rect.x) * clip.scaleX);
obj.rotation = ((clip.rotation * Math.PI) / 180);
obj.excentricity = (clip.scaleY / clip.scaleX);
obj.toString = function (){
return ((((((((((("[ x=" + this.x) + ", y=") + this.y) + ", radius=") + this.radius) + ", rotation=") + this.rotation) + ", excentricity=") + this.excentricity) + " ]"));
};
return (obj);
}
public static function pointToEllipse(_arg1:Object, _arg2:Object):Object{
var obj:Object;
var untranslated:Point;
var unrotated:Object;
var unexcentered:Point;
var unscaled:Point;
var point = _arg1;
var ellipse = _arg2;
obj = {};
untranslated = new Point((point.x - ellipse.x), (point.y - ellipse.y));
unrotated = rotate(-(ellipse.rotation), untranslated.x, untranslated.y);
unexcentered = new Point(unrotated.x, (unrotated.y / ellipse.excentricity));
unscaled = new Point((unexcentered.x / ellipse.radius), (unexcentered.y / ellipse.radius));
obj.distance = Math.sqrt(((unscaled.x * unscaled.x) + (unscaled.y * unscaled.y)));
obj.hDist = unscaled.x;
obj.vDist = unscaled.y;
obj.normal = (Math.atan2(unscaled.y, unscaled.x) + ellipse.rotation);
obj.angle = Math.atan2(unscaled.y, unscaled.x);
obj.rotation = ellipse.rotation;
obj.toString = function (){
return ((((((((((((("[ distance=" + obj.distance) + ", normal=") + obj.normal) + ", angle=") + obj.angle) + ", hDist=") + obj.hDist) + ", vDist=") + obj.vDist) + ", rotation=") + obj.rotation) + " ]"));
};
return (obj);
}
public static function getOuterPoints(_arg1:Array):Array{
var _local2:Array;
var _local3:Point;
var _local4:int;
var _local5:Array;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Point;
var _local11:int;
var _local12:Number;
var _local13:Point;
var _local14:int;
var _local15:Number;
var _local16:Number;
_local2 = _arg1.concat();
_local3 = _local2[0];
_local4 = 1;
while (_local4 < _local2.length) {
if (_local2[_local4].y < _local3.y){
_local3 = _local2[_local4];
};
_local4++;
};
_local5 = [_local3];
_local6 = Infinity;
_local8 = 0;
_local9 = 0;
_local10 = _local5[0];
_local11 = _local2.length;
while (1) {
_local12 = (Math.PI * 2);
_local13 = null;
_local4 = 0;
while (_local4 < _local2.length) {
_local7 = Math.atan2((_local2[_local4].y - _local5[(_local5.length - 1)].y), (_local2[_local4].x - _local5[(_local5.length - 1)].x));
_local16 = getLowestPositiveAngle((_local7 - _local8));
if ((((_local16 <= _local12)) && (!((_local2[_local4] == _local5[(_local5.length - 1)]))))){
_local13 = _local2[_local4];
_local12 = _local16;
};
_local4++;
};
if ((((_local13 == null)) || ((((_local13 == _local5[0])) && ((_local5.length > 1)))))){
break;
};
_local15 = _local8;
_local8 = getLowestPositiveAngle(Math.atan2((_local13.y - _local5[(_local5.length - 1)].y), (_local13.x - _local5[(_local5.length - 1)].x)));
_local9 = (_local9 + getLowestPositiveAngle((_local8 - _local15)));
if (_local9 >= (Math.PI * 2)){
break;
};
_local5.push(_local13);
--_local11;
if (!_local11){
trace(("FAILURE: " + (_local9 - (Math.PI * 2))), "\n");
break;
};
};
if ((((_local5.length > 2)) && ((_local5[(_local5.length - 1)] == _local5[1])))){
_local5.pop();
};
return (_local5);
}
public static function getSidePoints(_arg1:Array, _arg2:Number):Array{
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Array;
var _local7:Point;
var _local8:Point;
var _local9:Number;
var _local10:Number;
var _local11:Array;
var _local12:Number;
var _local13:Number;
_local4 = Infinity;
_local5 = -(Infinity);
_local3 = 0;
while (_local3 < _arg1.length) {
if (_arg1[_local3].y < _local4){
_local4 = _arg1[_local3].y;
};
if (_arg1[_local3].y > _local5){
_local5 = _arg1[_local3].y;
};
_local3++;
};
if (_arg2 < _local4){
_arg2 = _local4;
} else {
if (_arg2 > _local5){
_arg2 = _local5;
};
};
_local6 = [];
_local3 = 0;
while (_local3 < _arg1.length) {
_local7 = _arg1[_local3];
_local8 = _arg1[((_local3 + 1) % _arg1.length)];
if ((((((_arg2 <= _local7.y)) && ((_arg2 >= _local8.y)))) || ((((_arg2 >= _local7.y)) && ((_arg2 <= _local8.y)))))){
if (_local8.y == _local7.y){
_local6.push(new Point(_local7.x, _local7.y));
_local6.push(new Point(_local8.x, _local8.y));
} else {
_local12 = ((_arg2 - _local7.y) / (_local8.y - _local7.y));
_local13 = (_local7.x + ((_local8.x - _local7.x) * _local12));
_local6.push(new Point(_local13, _arg2));
};
};
_local3++;
};
_local9 = Infinity;
_local10 = -(Infinity);
_local3 = 0;
while (_local3 < _local6.length) {
_local7 = _local6[_local3];
if (_local7.x < _local9){
_local9 = _local7.x;
};
if (_local7.x > _local10){
_local10 = _local7.x;
};
_local3++;
};
_local11 = [];
_local3 = 0;
while (_local3 < _local6.length) {
if (_local6[_local3].x <= (_local9 + TOLERANCE)){
_local11[0] = _local6[_local3];
};
if (_local6[_local3].x >= (_local10 - TOLERANCE)){
_local11[1] = _local6[_local3];
};
_local3++;
};
return (_local11);
}
public static function projectPointOnLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Object{
var _local7:Object;
var _local8:Object;
_local7 = getNormal(_arg3, _arg4, _arg5, _arg6);
_local8 = intersectLines(_arg1, _arg2, (_arg1 + _local7.x), (_arg2 + _local7.y), _arg3, _arg4, _arg5, _arg6, false);
if (_local8 == null){
throw ("Unexpected error in Geometry::closestPointToLine. Perpendicular lines aren't intersecting!\n");
};
return (_local8);
}
private static function getLowestPositiveAngle(_arg1:Number):Number{
var _local2:Number;
_local2 = _arg1;
while (_local2 < 0) {
_local2 = (_local2 + (Math.PI * 2));
};
while (_local2 >= (Math.PI * 2)) {
_local2 = (_local2 - (Math.PI * 2));
};
return (_local2);
}
public static function generateRegularPolygon(_arg1:Number, _arg2:Number):Array{
var _local3:Array;
var _local4:Number;
var _local5:int;
_local3 = new Array(_arg1);
_local4 = ((Math.PI * 2) / _arg1);
_local5 = 0;
while (_local5 < _arg1) {
_local3[_local5] = new Point();
_local3[_local5].x = (_arg2 * Math.cos((_local5 * _local4)));
_local3[_local5].y = (_arg2 * Math.sin((_local5 * _local4)));
_local5++;
};
return (_local3);
}
public static function triangleArea(_arg1:Point, _arg2:Point, _arg3:Point):Number{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local4 = (_arg2.x - _arg1.x);
_local5 = (_arg3.x - _arg1.x);
_local6 = (_arg2.y - _arg1.y);
_local7 = (_arg3.y - _arg1.y);
return ((0.5 * Math.abs(((_local4 * _local7) - (_local5 * _local6)))));
}
public static function pointInsideRect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
if (_arg3 < _arg5){
_local7 = _arg3;
_local9 = _arg5;
} else {
_local7 = _arg5;
_local9 = _arg3;
};
if (_arg4 < _arg6){
_local8 = _arg4;
_local10 = _arg6;
} else {
_local8 = _arg6;
_local10 = _arg4;
};
_local11 = 0.0001;
return (!((((((((_arg1 < (_local7 - _local11))) || ((_arg1 > (_local9 + _local11))))) || ((_arg2 < (_local8 - _local11))))) || ((_arg2 > (_local10 + _local11))))));
}
public static function interpolateAngle(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
var _local5:Number;
while (_arg1 < 0) {
_arg1 = (_arg1 + (Math.PI * 2));
};
while (_arg2 < 0) {
_arg2 = (_arg2 + (Math.PI * 2));
};
while (_arg1 >= (Math.PI * 2)) {
_arg1 = (_arg1 - (Math.PI * 2));
};
while (_arg2 >= (Math.PI * 2)) {
_arg2 = (_arg2 - (Math.PI * 2));
};
if (_arg1 > _arg2){
if ((_arg1 - _arg2) > Math.PI){
_arg1 = (_arg1 - (Math.PI * 2));
};
} else {
if ((_arg2 - _arg1) > Math.PI){
_arg2 = (_arg2 - (Math.PI * 2));
};
};
_local5 = (_arg1 + (_arg3 * (_arg2 - _arg1)));
while (_local5 > Math.PI) {
_local5 = (_local5 - (Math.PI * 2));
};
while (_local5 < -(Math.PI)) {
_local5 = (_local5 + (Math.PI * 2));
};
return (_local5);
}
public static function rotate(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0, _arg5:Number=0):Object{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local6 = (_arg2 - _arg4);
_local7 = (_arg3 - _arg5);
_local8 = Math.cos(_arg1);
_local9 = Math.sin(_arg1);
return ({x:((_arg4 + (_local6 * _local8)) - (_local7 * _local9)), y:((_arg5 + (_local6 * _local9)) + (_local7 * _local8))});
}
public static function rotatePoint(_arg1:Number, _arg2:Point, _arg3:Point=null):Point{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
if (_arg3 == null){
_local5 = 0;
_local4 = _local5;
} else {
_local4 = _arg3.x;
_local5 = _arg3.y;
};
_local6 = (_arg2.x - _local4);
_local7 = (_arg2.y - _local5);
_local8 = Math.cos(_arg1);
_local9 = Math.sin(_arg1);
return (new Point(((_local4 + (_local6 * _local8)) - (_local7 * _local9)), ((_local5 + (_local6 * _local9)) + (_local7 * _local8))));
}
public static function getNormal(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Object{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Object;
_local5 = (_arg1 - _arg3);
_local6 = (_arg2 - _arg4);
_local7 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
if (!_local7){
return ({x:0, y:0});
};
_local8 = {x:(_local6 / _local7), y:(-(_local5) / _local7)};
return (_local8);
}
public static function intersectPolygons(_arg1:Array, _arg2:Array){
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:Point;
var _local7:Point;
var _local8:Point;
var _local9:Point;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Object;
var _local15:int;
var _local16:int;
_local3 = (_arg1.length - 1);
_local4 = (_arg2.length - 1);
_local5 = [];
if ((((_local3 < 2)) || ((_local4 < 2)))){
return;
};
_local15 = 0;
while (_local15 < _local3) {
_local6 = _arg1[_local15];
_local7 = _arg1[(_local15 + 1)];
_local10 = _local6.x;
_local11 = _local6.y;
_local12 = _local7.x;
_local13 = _local7.y;
_local16 = 0;
while (_local16 < _local4) {
_local8 = _arg2[_local16];
_local9 = _arg2[(_local16 + 1)];
_local14 = intersectLines(_local10, _local11, _local12, _local13, _local8.x, _local8.y, _local9.x, _local9.y, true);
if (_local14){
_local5[_local5.length] = new Point(_local14.x, _local14.y);
};
_local16++;
};
_local8 = _arg2[_local16];
_local9 = _arg2[0];
_local14 = intersectLines(_local10, _local11, _local12, _local13, _local8.x, _local8.y, _local9.x, _local9.y, true);
if (_local14){
_local5[_local5.length] = new Point(_local14.x, _local14.y);
};
_local15++;
};
_local6 = _arg1[_local15];
_local7 = _arg1[0];
_local10 = _local6.x;
_local11 = _local6.y;
_local12 = _local7.x;
_local13 = _local7.y;
_local16 = 0;
while (_local16 < _local4) {
_local8 = _arg2[_local16];
_local9 = _arg2[(_local16 + 1)];
_local14 = intersectLines(_local10, _local11, _local12, _local13, _local8.x, _local8.y, _local9.x, _local9.y, true);
if (_local14){
_local5[_local5.length] = new Point(_local14.x, _local14.y);
};
_local16++;
};
_local8 = _arg2[_local16];
_local9 = _arg2[0];
_local14 = intersectLines(_local10, _local11, _local12, _local13, _local8.x, _local8.y, _local9.x, _local9.y, true);
if (_local14){
_local5[_local5.length] = new Point(_local14.x, _local14.y);
};
return (_local5);
}
}
}//package as3
Section 10
//Physics (as3.Physics)
package as3 {
import flash.display.*;
import flash.geom.*;
public class Physics {
public static const ROTATION_PROP:String = "rotation";
public static const Y_PROP:String = "y";
public static const SKEWY_PROP:String = "skewY";
public static const SCALEX_PROP:String = "scaleX";
public static const X_PROP:String = "x";
public static const SCALEY_PROP:String = "scaleY";
public static const SKEWX_PROP:String = "skewX";
public static function attach(_arg1:Array, _arg2:DisplayObject, _arg3:MovieClip, _arg4:Array=null){
var _local5:Point;
var _local6:Point;
_local5 = _arg2.localToGlobal(new Point());
_local6 = _arg3.globalToLocal(_local5);
if (_arg4 == null){
_arg4 = [];
};
_arg1[_arg1.length] = {mc:_arg2, par:_arg3, point:_local6, props:_arg4};
}
public static function updateSkewY(_arg1:Object, _arg2:Point, _arg3:Matrix, _arg4:Array, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number){
_arg4[0] = (_arg4[0] + ((-(_arg9) * (_arg2.y - _arg1.position.y)) / _arg1.hWeight));
balancePoint(_arg4, _arg5, _arg6, _arg7, _arg8);
_arg3.b = _arg4[0];
}
public static function updateElastic(_arg1:Array){
var _local2:int;
var _local3:int;
_local3 = _arg1.length;
_local2 = 0;
while (_local2 < _local3) {
updateElasticClip(_arg1[_local2]);
_local2++;
};
}
public static function updateAttached(_arg1:Array){
var _local2:int;
var _local3:int;
var _local4:Object;
var _local5:Point;
var _local6:Point;
var _local7:int;
var _local8:int;
var _local9:Array;
_local3 = _arg1.length;
_local2 = 0;
while (_local2 < _local3) {
_local4 = _arg1[_local2];
if (_local4.mc.parent){
_local5 = _local4.par.localToGlobal(_local4.point);
_local6 = _local4.mc.parent.globalToLocal(_local5);
_local4.mc.x = _local6.x;
_local4.mc.y = _local6.y;
};
_local9 = _local4.props;
_local8 = _local9.length;
_local7 = 0;
while (_local7 < _local8) {
_local4.mc[_local9[_local7]] = _local4.par[_local9[_local7]];
_local7++;
};
_local2++;
};
}
public static function detach(_arg1:Array, _arg2:DisplayObject, _arg3:MovieClip, _arg4:Array=null){
var _local5:int;
var _local6:int;
var _local7:Object;
_local6 = _arg1.length;
_local5 = 0;
while (_local5 < _local6) {
_local7 = _arg1[_local5];
if ((((_local7.mc == _arg2)) && ((_local7.par == _arg3)))){
_arg1.splice(_local5, 1);
return;
};
_local5++;
};
}
public static function verlet(_arg1:Array, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1, _arg6:Number=1){
var _local7:int;
var _local8:Number;
var _local9:int;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local8 = ((0.5 * _arg5) * _arg5);
_local9 = (_arg6 / _arg5);
_local10 = _arg1[0];
_local11 = _arg1[1];
_local12 = 0;
_local7 = 0;
while (_local7 < _local9) {
_local12 = (_arg4 * (_arg2 - _local10));
_local10 = (_local10 + ((_local11 * _arg5) + (_local12 * _local8)));
_local11 = ((_local11 + (_local12 * _arg5)) * _arg3);
_local7++;
};
_arg1[0] = _local10;
_arg1[1] = _local11;
}
public static function updateSkewX(_arg1:Object, _arg2:Point, _arg3:Matrix, _arg4:Array, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number){
_arg4[0] = (_arg4[0] + ((-(_arg9) * (_arg2.x - _arg1.position.x)) / _arg1.vWeight));
balancePoint(_arg4, _arg5, _arg6, _arg7, _arg8);
_arg3.c = _arg4[0];
}
public static function balancePoint(_arg1:Array, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int=1){
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
_local6 = _arg1[0];
_local7 = _arg1[1];
_local8 = _arg1[2];
_local9 = 0;
while (_local9 < _arg5) {
_arg1[1] = ((_arg1[1] * _arg2) + _arg1[2]);
_arg1[2] = ((_arg3 - _arg1[0]) * _arg4);
_arg1[0] = (_arg1[0] + (_local7 * _arg2));
_local9++;
};
}
public static function setElastic(_arg1:Array, _arg2:DisplayObjectContainer, _arg3:MovieClip, _arg4:Array, _arg5:Array, _arg6:Array, _arg7:Array, _arg8:Array, _arg9:Array):Object{
var _local10:Array;
var _local11:int;
var _local12:int;
var _local13:String;
var _local14:Point;
var _local15:Rectangle;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
if (!_arg3.parent){
return (null);
};
_local10 = [ROTATION_PROP];
_local12 = _arg4.length;
_local11 = 0;
while (_local11 < _local12) {
_local13 = _arg4[_local11];
_local10[_local11] = [_arg6[_local11], 0, 0];
_local11++;
};
_local14 = _arg3.localToGlobal(new Point());
_local14 = _arg2.globalToLocal(_local14);
_local15 = _arg3.getBounds(_arg3);
_local16 = (_local15.right + _local15.left);
_local17 = (_local15.bottom + _local15.top);
_local18 = ((_local16)<0) ? _local15.left : _local15.right;
_local19 = ((_local17)<0) ? _local15.top : _local15.bottom;
_arg1[_arg1.length] = {clip:_arg3, props:_arg4, position:_local14, values:_local10, topLevel:_arg2, rect:_local15, hWeight:_local18, vWeight:_local19, frictions:_arg5, dests:_arg6, multipliers:_arg7, speeds:_arg8, scales:_arg9};
return (_arg1[(_arg1.length - 1)]);
}
public static function editElastic(_arg1:Array, _arg2:MovieClip, _arg3:String, _arg4:Number){
var _local5:int;
var _local6:int;
_local6 = _arg1.length;
_local5 = 0;
while (_local5 < _local6) {
if (_arg1[_local5].clip == _arg2){
_arg1[_local5].dests[_arg3] = _arg4;
return;
};
_local5++;
};
}
public static function updateScaleX(_arg1:Object, _arg2:Point, _arg3:Matrix, _arg4:Array, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number){
var _local10:Rectangle;
var _local11:Number;
_local10 = _arg1.clip.getBounds(_arg1.topLevel);
_local11 = (_local10.right - _local10.left);
_arg4[0] = (_arg4[0] + ((-(_arg9) * (_arg2.x - _arg1.position.x)) / _local11));
balancePoint(_arg4, _arg5, _arg6, _arg7, _arg8);
_arg3.a = _arg4[0];
}
public static function updateScaleY(_arg1:Object, _arg2:Point, _arg3:Matrix, _arg4:Array, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number){
var _local10:Rectangle;
var _local11:Number;
_local10 = _arg1.clip.getBounds(_arg1.topLevel);
_local11 = (_local10.bottom - _local10.top);
_arg4[0] = (_arg4[0] + ((-(_arg9) * (_arg2.y - _arg1.position.y)) / _local11));
balancePoint(_arg4, _arg5, _arg6, _arg7, _arg8);
_arg3.d = _arg4[0];
}
public static function updateElasticClip(_arg1:Object){
var _local2:int;
var _local3:Array;
var _local4:int;
var _local5:Point;
var _local6:String;
var _local7:Matrix;
_local3 = _arg1.props;
_local4 = _local3.length;
_local5 = _arg1.clip.localToGlobal(new Point());
_local5 = _arg1.topLevel.globalToLocal(_local5);
_local7 = _arg1.clip.transform.matrix;
_local2 = 0;
while (_local2 < _local4) {
_local6 = _local3[_local2];
switch (_local6){
case SKEWX_PROP:
updateSkewX(_arg1, _local5, _local7, _arg1.values[_local2], _arg1.frictions[_local2], _arg1.dests[_local2], _arg1.multipliers[_local2], _arg1.speeds[_local2], _arg1.scales[_local2]);
break;
case SKEWY_PROP:
updateSkewY(_arg1, _local5, _local7, _arg1.values[_local2], _arg1.frictions[_local2], _arg1.dests[_local2], _arg1.multipliers[_local2], _arg1.speeds[_local2], _arg1.scales[_local2]);
break;
case SCALEX_PROP:
updateScaleX(_arg1, _local5, _local7, _arg1.values[_local2], _arg1.frictions[_local2], _arg1.dests[_local2], _arg1.multipliers[_local2], _arg1.speeds[_local2], _arg1.scales[_local2]);
break;
case SCALEY_PROP:
updateScaleY(_arg1, _local5, _local7, _arg1.values[_local2], _arg1.frictions[_local2], _arg1.dests[_local2], _arg1.multipliers[_local2], _arg1.speeds[_local2], _arg1.scales[_local2]);
break;
};
_local2++;
};
_arg1.clip.transform.matrix = _local7;
_arg1.position = _local5;
}
}
}//package as3
Section 11
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion