Section 1
//Algorithms (as3.Algorithms)
package as3 {
import flash.display.*;
import flash.geom.*;
public class Algorithms {
public static function insertIntoArray(_arg1, _arg2:Array):Boolean{
var _local3:int;
_local3 = 0;
while (_local3 < _arg2.length) {
if (_arg2[_local3] == _arg1){
return (false);
};
_local3++;
};
_arg2.push(_arg1);
return (true);
}
public static function orderPointsClockwise(_arg1:Array):Array{
var _local2:int;
var _local3:Object;
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:int;
var _local8:int;
_local3 = new Object();
_local3.x = (_local3.y = 0);
_local2 = 0;
while (_local2 < _arg1.length) {
_local3.x = (_local3.x + _arg1[_local2].x);
_local3.y = (_local3.y + _arg1[_local2].y);
_local2++;
};
_local3.x = (_local3.x / _arg1.length);
_local3.y = (_local3.y / _arg1.length);
_local4 = new Array(_arg1.length);
_local2 = 0;
while (_local2 < _arg1.length) {
_local4[_local2] = Math.atan2((_arg1[_local2].y - _local3.y), (_arg1[_local2].x - _local3.x));
_local2++;
};
_local5 = new Array();
_local2 = 0;
while (_local2 < _arg1.length) {
_local6 = Infinity;
_local7 = -1;
_local8 = 0;
while (_local8 < _arg1.length) {
if (((!(isNaN(_local4[_local8]))) && ((_local4[_local8] < _local6)))){
_local7 = _local8;
_local6 = _local4[_local8];
};
_local8++;
};
_local5.push(_arg1[_local7]);
_local4[_local7] = NaN;
_local2++;
};
return (_local5);
}
public static function pointsToShape(_arg1:Array):Array{
var _local2:Array;
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:*;
_local2 = new Array();
_local6 = 0;
_local7 = 0;
while (_local7 < (_arg1.length - 1)) {
_local3 = new Object();
_local4 = (_arg1[(_local7 + 1)].x - _arg1[_local7].x);
_local5 = (_arg1[(_local7 + 1)].y - _arg1[_local7].y);
_local3.length = Math.floor(_pointShapeDistance(_arg1[_local7], _arg1[(_local7 + 1)]));
if (Math.abs(_local4) > (Math.abs(_local5) * 3)){
_local3.dir = ((_local4 > 0)) ? "r" : "l";
} else {
if (Math.abs(_local5) > (Math.abs(_local4) * 3)){
_local3.dir = ((_local5 > 0)) ? "d" : "u";
} else {
_local3.dir = ((_local5 > 0)) ? "d" : "u";
_local3.dir = (_local3.dir + ((_local4 > 0)) ? "r" : "l");
};
};
_local2.push(_local3);
_local6 = Math.max(_local6, _local3.length);
_local7++;
};
_local7 = 0;
while (_local7 < _local2.length) {
if (_local2[_local7].length < (_local6 / 5)){
_local2.splice(_local7, 1);
_local7--;
};
if ((((_local7 > 0)) && ((_local2[_local7].dir == _local2[(_local7 - 1)].dir)))){
_local2[(_local7 - 1)].length = (_local2[(_local7 - 1)].length + _local2[_local7].length);
_local2.splice(_local7, 1);
_local7--;
};
_local7++;
};
_local7 = 0;
while (_local7 < _local2.length) {
switch (_local2[_local7].dir){
case "ur":
_local2[_local7] = "e";
break;
case "dr":
_local2[_local7] = "f";
break;
case "dl":
_local2[_local7] = "g";
break;
case "ul":
_local2[_local7] = "h";
break;
default:
_local2[_local7] = _local2[_local7].dir;
};
_local7++;
};
return (_local2);
}
public static function deform(_arg1:MovieClip, _arg2:Number, _arg3:Number){
var _local4:Matrix;
var _local5:Matrix;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Matrix;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local4 = new Matrix();
_local4.a = 1;
_local4.b = 0;
_local4.c = 0;
_local4.d = 1;
_local5 = new Matrix();
_local5.a = ((1 + (Math.abs(_arg2) * _arg1.deformDist)) - (Math.abs(_arg3) * _arg1.deformDist));
_local5.b = 0;
_local5.c = 0;
_local5.d = ((1 + (Math.abs(_arg3) * _arg1.deformDist)) - (Math.abs(_arg2) * _arg1.deformDist));
_local6 = Math.sqrt(((_arg2 * _arg2) + (_arg3 * _arg3)));
_local7 = 0;
_local8 = (Boolean(((_arg2 * _arg3) < 0))) ? -1 : 1;
if (_local6){
_local10 = Math.atan2(_arg3, _arg2);
_local11 = Math.floor(((_local10 * 8) / Number((Math.PI * 2))));
_local12 = (_local10 - (((_local11 * Math.PI) * 2) / 8));
_local7 = (_local12 / Number((Math.PI * 0.25)));
if ((_local11 % 2)){
_local7 = (1 - _local7);
};
};
_local9 = new Matrix();
_local9.a = 1;
_local9.b = ((((_local8 * _local7) * _arg1.maxAngle) * _arg1.deformDist) * _local6);
_local9.c = ((((_local8 * _local7) * _arg1.maxAngle) * _arg1.deformDist) * _local6);
_local9.d = 1;
_local4.concat(_local5);
_local4.concat(_local9);
_local4.tx = _arg1.transform.matrix.tx;
_local4.ty = _arg1.transform.matrix.ty;
_arg1.transform.matrix = _local4;
}
public static function deformMatrix(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number=1){
var _local5:Matrix;
var _local6:Number;
var _local7:Matrix;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Matrix;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local5 = new Matrix();
_local5.a = 1;
_local5.b = 0;
_local5.c = 0;
_local5.d = 1;
_local6 = ((Math.abs(_arg2) - Math.abs(_arg3)) * _arg4);
_local7 = new Matrix();
_local7.a = (1 + _local6);
_local7.b = 0;
_local7.c = 0;
_local7.d = (1 - _local6);
_local8 = (Math.PI * 0.25);
_local9 = ((Math.PI * 2) / 8);
_local10 = (1 / _local9);
_local11 = (Math.sqrt(((_arg2 * _arg2) + (_arg3 * _arg3))) * _arg4);
_local12 = 0;
_local13 = (Boolean(!(((_arg2 <= 0) == (_arg3 <= 0))))) ? -1 : 1;
if (_local11){
_local16 = Math.atan2(_arg3, _arg2);
_local17 = Math.floor((_local16 * _local10));
_local18 = (_local16 - (_local17 * _local9));
_local12 = (_local18 / Number(_local8));
if ((_local17 % 2)){
_local12 = (1 - _local12);
};
};
_local14 = ((_local13)<0) ? ((-(_local12) * _local8) * _local11) : ((_local12 * _local8) * _local11);
_local15 = new Matrix();
_local15.a = 1;
_local15.b = _local14;
_local15.c = _local14;
_local15.d = 1;
_local5.concat(_local7);
_local5.concat(_local15);
_arg1.a = _local5.a;
_arg1.b = _local5.b;
_arg1.c = _local5.c;
_arg1.d = _local5.d;
}
public static function isInArray(_arg1, _arg2:Array):Boolean{
var _local3:int;
_local3 = 0;
while (_local3 < _arg2.length) {
if (_arg2[_local3] == _arg1){
return (true);
};
_local3++;
};
return (false);
}
public static function removeFromArray(_arg1, _arg2:Array):Boolean{
var _local3:int;
_local3 = 0;
while (_local3 < _arg2.length) {
if (_arg2[_local3] == _arg1){
_arg2.splice(_local3, 1);
return (true);
};
_local3++;
};
return (false);
}
private static function _pointShapeDistance(_arg1:Object, _arg2:Object):Number{
return (Math.sqrt((Math.pow((_arg2.x - _arg1.x), 2) + Math.pow((_arg2.y - _arg1.y), 2))));
}
public static function simplifyPointsList(_arg1:Array):Array{
var _local2:Array;
var _local3:Number;
var _local4:*;
_local2 = new Array();
_local3 = 0;
_local2.push(_arg1[0]);
_local4 = 1;
while (_local4 < (_arg1.length - 1)) {
if ((((Math.abs((_pointShapeAngle(_arg1[(_local4 + 1)], _arg1[_local4]) - _pointShapeAngle(_arg1[_local4], _arg1[(_local4 - 1)]))) >= (Math.PI / 2.5))) || ((Math.abs(_local3) >= (Math.PI / 3))))){
_local2.push(_arg1[_local4]);
_local3 = 0;
} else {
_local3 = (_local3 + (_pointShapeAngle(_arg1[(_local4 + 1)], _arg1[_local4]) - _pointShapeAngle(_arg1[_local4], _arg1[(_local4 - 1)])));
};
_local4++;
};
_local2.push(_arg1[(_arg1.length - 1)]);
return (_local2);
}
private static function _pointShapeAngle(_arg1:Object, _arg2:Object):Number{
return (Math.atan2((_arg2.y - _arg1.y), (_arg2.x - _arg1.x)));
}
public static function balancePoint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:int=1):Array{
var _local8:Array;
var _local9:int;
_local8 = [_arg1, _arg2, _arg3];
_local9 = 0;
while (_local9 < _arg7) {
_local8 = [(_local8[0] + (_arg2 * _arg4)), ((_local8[1] * _arg4) + _local8[2]), ((_arg5 - _local8[0]) * _arg6)];
_local9++;
};
return (_local8);
}
public static function myGetShape(_arg1:Array):String{
var _local2:Array;
var _local3:Number;
var _local4:String;
var _local5:String;
_local2 = simplifyPointsList(_arg1);
_local5 = pointsToShape(_local2).join("");
switch (_local5){
case "d":
return ("|v");
case "u":
return ("|^");
case "ef":
case "hg":
return ("^");
case "dr":
case "lu":
return ("L");
case "ur":
case "ld":
return ("Γ");
case "ldr":
case "lur":
return ("[");
case "ufu":
case "dhd":
return ("N");
default:
return ("");
};
}
public static function updateHand(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Array, _arg6:Object){
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local7 = (Math.PI * 0.5);
_arg1.x = _arg2;
_arg1.y = _arg3;
_arg4[0] = Geometry.interpolateAngle(_arg4[0], _arg5[0], 0.2);
_arg4[1] = Geometry.interpolateAngle(_arg4[1], _arg5[1], 0.2);
if (_arg5.length >= 3){
_arg4[2] = Geometry.interpolateAngle(_arg4[2], _arg5[2], 0.2);
} else {
_arg4[2] = Geometry.interpolateAngle(_arg4[2], 0, 0.2);
};
if (_arg4[0] > _local7){
_arg4[0] = _local7;
} else {
if (_arg4[0] < -(_local7)){
_arg4[0] = -(_local7);
};
};
if (_arg4[1] > _local7){
_arg4[1] = _local7;
} else {
if (_arg4[1] < -(_local7)){
_arg4[1] = -(_local7);
};
};
_local8 = Math.abs((_arg4[2] / _local7));
if (_arg4[0] < 0){
_arg1.addChildAt(_arg1.thumb_mc, 0);
} else {
_arg1.addChildAt(_arg1.thumb_mc, (_arg1.numChildren - 1));
};
if (_arg4[1] > 0){
_arg1.addChildAt(_arg1.wrist_mc, 0);
} else {
_arg1.addChildAt(_arg1.wrist_mc, (_arg1.numChildren - 1));
};
_local9 = (_arg4[0] / _local7);
_local10 = (_arg4[1] / _local7);
_local11 = Math.abs(_local9);
_local12 = Math.abs(_local10);
_local13 = ((((_local9 * _local10) * _local7) * (1 - _local8)) + (_local8 * _arg4[2]));
_arg1.glove_mc.scaleX = (_arg6.glove.max.x - (((_arg6.glove.max.x - _arg6.glove.min.x) * _local11) * (1 - _local12)));
_arg1.wrist_mc.scaleX = (_arg6.wrist.max.x - (((_arg6.wrist.max.x - _arg6.wrist.min.x) * _local11) * (1 - _local12)));
_arg1.thumb_mc.x = (_arg6.orig.thumbX + (((_arg6.end.thumbX - _arg6.orig.thumbX) * _local11) * (1 - _local12)));
_arg1.glove_mc.scaleY = (_arg6.glove.max.y - (((_arg6.glove.max.y - _arg6.glove.min.y) * _local12) * (1 - _local11)));
_arg1.thumb_mc.scaleY = _arg1.glove_mc.scaleY;
_arg1.wrist_mc.scaleY = (_arg6.wrist.min.y + (((_arg6.wrist.max.y - _arg6.wrist.min.y) * _local12) * (1 - _local11)));
_arg1.wrist_mc.y = (_arg6.orig.wristY + (((_arg6.end.wristY - _arg6.orig.wristY) * _local12) * (1 - _local11)));
_arg1.rotation = (_arg4[2] * Geometry.RAD_TO_DEG);
}
public static function liquidInPolygon(_arg1:Number, _arg2:Array, _arg3:Number, _arg4:Number):Array{
var _local5:Number;
var _local6:Number;
var _local7:Object;
var _local8:int;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Array;
var _local13:Array;
var _local14:Array;
var _local15:Point;
var _local16:Number;
var _local17:Number;
var _local18:int;
_local5 = -(Infinity);
_local6 = Infinity;
_local8 = 0;
while (_local8 < _arg2.length) {
_local7 = Geometry.rotate(_arg1, _arg2[_local8].x, _arg2[_local8].y);
_arg2[_local8].x = _local7.x;
_arg2[_local8].y = _local7.y;
_local5 = Math.max(_arg2[_local8].y, _local5);
_local6 = Math.min(_arg2[_local8].y, _local6);
_local8++;
};
_local9 = (_arg4 * _arg3);
_local10 = 0;
_local11 = 0;
_local13 = [];
_local14 = [];
_local15 = new Point();
_local16 = Math.abs((_local5 - _local6));
_local17 = ((_local6 + _local5) * 0.5);
_local18 = 50;
do {
_local13 = Geometry.getSidePoints(_arg2, _local17);
_local14 = [];
_local8 = 0;
while (_local8 < _arg2.length) {
if (_arg2[_local8].y >= _local17){
_local14.push(_arg2[_local8]);
};
_local8++;
};
_local12 = _local13.concat(_local14);
_local12 = orderPointsClockwise(_local12);
trace("Algorithm::liquidInPolygon\nYou'll have to fix this later. Try to connect the 'sides' and 'lower' arrays coherently.\nAvoid having to use the orderPointsClockwise() function.");
_local10 = Geometry.polygonArea(_local12);
_local17 = (_local17 - ((_local16 * (_local9 - _local10)) / _arg4));
_local18--;
} while ((((Math.abs((_local10 - _local9)) > Geometry.TOLERANCE)) && ((_local18 > 0))));
_local8 = 0;
while (_local8 < _local12.length) {
_local7 = Geometry.rotate(-(_arg1), _local12[_local8].x, _local12[_local8].y);
_local12[_local8].x = _local7.x;
_local12[_local8].y = _local7.y;
_local8++;
};
return (_local12);
}
public static function hasLabel(_arg1:MovieClip, _arg2:String):Boolean{
var _local3:Array;
var _local4:FrameLabel;
var _local5:int;
_local3 = _arg1.currentLabels;
_local5 = 0;
while (_local5 < _local3.length) {
_local4 = _local3[_local5];
if (_local4.name == _arg2){
return (true);
};
_local5++;
};
return (false);
}
public static function adjustScreen(_arg1:DisplayObject, _arg2:DisplayObject){
var _local3:Stage;
var _local4:Rectangle;
if (!_arg1.stage){
return;
};
_local3 = _arg1.stage;
_local4 = _arg2.getRect(_local3);
if (_local4.width < _local3.stageWidth){
_arg1.scaleX = (_arg1.scaleX * (_local3.stageWidth / _local4.width));
_arg1.scaleY = _arg1.scaleX;
_local4 = _arg2.getRect(_local3);
};
if (_local4.height < _local3.stageHeight){
_arg1.scaleY = (_arg1.scaleY * (_local3.stageHeight / _local4.height));
_arg1.scaleX = _arg1.scaleY;
_local4 = _arg2.getRect(_local3);
};
if (_local4.x > 0){
_arg1.x = (_arg1.x - _local4.x);
_local4 = _arg2.getRect(_local3);
};
if (_local4.y > 0){
_arg1.y = (_arg1.y - _local4.y);
_local4 = _arg2.getRect(_local3);
};
if ((_local4.x + _local4.width) < _local3.stageWidth){
_arg1.x = (_arg1.x + (_local3.stageWidth - (_local4.x + _local4.width)));
_local4 = _arg2.getRect(_local3);
};
if ((_local4.y + _local4.height) < _local3.stageHeight){
_arg1.y = (_arg1.y + (_local3.stageHeight - (_local4.y + _local4.height)));
_local4 = _arg2.getRect(_local3);
};
}
public static function approximatePoint(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return ((_arg1 + ((_arg2 - _arg1) * _arg3)));
}
}
}//package as3
Section 2
//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 3
//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 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 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 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 4
//Expansion (expansion.Expansion)
package expansion {
import flash.display.*;
import flash.events.*;
public class Expansion extends EventDispatcher {
private var _expanding:Array;
private var _sizes:Array;
private var _active:Boolean;
private var _numExpandables:uint;
private var _expandables:Array;
private var _checkPoints:Array;
private var _maxSizes:Array;
private var _stage:Stage;
public function Expansion(_arg1:Stage){
_stage = _arg1;
_active = false;
_numExpandables = 0;
_expandables = [];
_sizes = [];
_maxSizes = [];
_expanding = [];
_checkPoints = [];
if (_arg1 == null){
throw ("ERROR: Stage must not be null.");
};
}
public function set size(_arg1:Number){
var _local2:int;
_local2 = 0;
while (_local2 < _expandables.length) {
if (!_expandables[_local2]){
return;
};
setSize(_local2, _arg1);
_local2++;
};
}
public function setSize(_arg1:uint, _arg2:Number){
if (isNaN(_arg2)){
return;
};
_sizes[_arg1] = Math.max(1, Math.min(_arg2, _maxSizes[_arg1]));
_expandables[_arg1].gotoAndStop(Math.floor(_sizes[_arg1]));
}
public function getExpandableID(_arg1:MovieClip):int{
var _local2:int;
while (_local2 < _expandables.length) {
if (_expandables[_local2] == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
private function eFrame(_arg1:Event){
var _local2:int;
var _local3:Number;
var _local4:Boolean;
var _local5:Array;
var _local6:int;
_local4 = false;
_local5 = [];
_local2 = 0;
while (_local2 < _expandables.length) {
if (!_expandables[_local2]){
} else {
_local3 = _sizes[_local2];
_sizes[_local2] = Math.max(1, Math.min(_maxSizes[_local2], (_sizes[_local2] + _expanding[_local2])));
if (_local3 != _sizes[_local2]){
_local4 = true;
_expandables[_local2].gotoAndStop(Math.floor(_sizes[_local2]));
while (_local6 < _checkPoints.length) {
if (_checkPoints[_local6].expandable == _local2){
if ((((((_checkPoints[_local6].direction > 0)) && ((_checkPoints[_local6].size > _local3)))) && ((_checkPoints[_local6].size <= _sizes[_local2])))){
_local5.push(new ExpansionEvent("checkpoint", _expandables[_local2], _checkPoints[_local6].size, _checkPoints[_local6].direction, _checkPoints[_local6].reaction, _checkPoints[_local6].timer));
break;
} else {
if ((((((_checkPoints[_local6].direction < 0)) && ((_checkPoints[_local6].size >= _sizes[_local2])))) && ((_checkPoints[_local6].size < _local3)))){
_local5.push(new ExpansionEvent("checkpoint", _expandables[_local2], _checkPoints[_local6].size, _checkPoints[_local6].direction, _checkPoints[_local6].reaction, _checkPoints[_local6].timer));
break;
};
};
};
_local6++;
};
};
};
_local2++;
};
if (_local4){
dispatchEvent(new Event("sizeChanged"));
_local2 = 0;
while (_local2 < _local5.length) {
dispatchEvent(_local5[_local2]);
_local2++;
};
};
}
public function set maxSize(_arg1:uint){
var _local2:int;
_local2 = 0;
while (_local2 < _expandables.length) {
if (!_expandables[_local2]){
return;
};
setMaxSize(_local2, _arg1);
_local2++;
};
}
public function set growth(_arg1:Number){
var _local2:int;
_local2 = 0;
while (_local2 < _expandables.length) {
if (!_expandables[_local2]){
return;
};
setGrowth(_local2, _arg1);
_local2++;
};
}
public function insertExpandable(_arg1:MovieClip, _arg2:int=-1):int{
var _local3:int;
if (_arg1 == null){
return (-1);
};
_local3 = 0;
while (_local3 < _expandables.length) {
if (_expandables[_local3] == _arg1){
if (_arg2 > 0){
_maxSizes[_local3] = _arg2;
} else {
if (!_arg2){
_maxSizes[_local3] = _arg1.totalFrames;
};
};
return (_local3);
};
_local3++;
};
_local3 = 0;
while (_local3 < _expandables.length) {
if (_expandables[_local3] == null){
break;
};
_local3++;
};
_arg1.gotoAndStop(1);
_numExpandables++;
_sizes[_local3] = 1;
_expandables[_local3] = _arg1;
_expanding[_local3] = 0;
if (_arg2 > 0){
_maxSizes[_local3] = _arg2;
} else {
_maxSizes[_local3] = _arg1.totalFrames;
};
return (_local3);
}
public function clearCheckPoint(_arg1:uint, _arg2:int, _arg3:int=1){
var _local4:MovieClip;
var _local5:int;
_local4 = _expandables[_arg1];
if (!_local4){
return;
};
_local5 = 0;
while (_local5 < _checkPoints.length) {
if ((((((_checkPoints[_local5].size == _arg2)) && ((_checkPoints.expandable == _local4)))) && ((_checkPoints[_local5].direction == _arg3)))){
delete _checkPoints[_local5];
_checkPoints.splice(_local5, 1);
return;
};
_local5++;
};
}
public function get numExpandables():uint{
return (_numExpandables);
}
public function removeExpandable(_arg1:MovieClip){
var _local2:int;
while (_local2 < _expandables.length) {
if (_expandables[_local2] == _arg1){
clearCheckPointByID(_local2);
delete _expandables[_local2];
_expandables[_local2] = null;
_sizes[_local2] = 0;
_maxSizes[_local2] = 0;
_expanding[_local2] = 0;
_numExpandables--;
if (_local2 == (_expandables.length - 1)){
_expandables.splice(_local2, 1);
_sizes.splice(_local2, 1);
_maxSizes.splice(_local2, 1);
_expanding.splice(_local2, 1);
};
return;
};
_local2++;
};
}
public function getGrowth(_arg1:uint):Number{
if (_arg1 > _expandables.length){
return (0);
};
return (_expanding[_arg1]);
}
public function setMaxSize(_arg1:uint, _arg2:uint){
if (isNaN(_arg2)){
return;
};
_maxSizes[_arg1] = Math.max(1, Math.min(_expandables[_arg1].totalFrames, _arg2));
if (_sizes[_arg1] > _arg2){
setSize(_arg1, _arg2);
};
}
public function setGrowth(_arg1:uint, _arg2:Number){
if (isNaN(_arg2)){
return;
};
_expanding[_arg1] = _arg2;
}
public function getMaxSize(_arg1:uint):uint{
if (_arg1 > _expandables.length){
return (0);
};
return (_maxSizes[_arg1]);
}
public function getCheckPoint(_arg1:int, _arg2:int, _arg3:int=1):String{
var _local4:MovieClip;
var _local5:int;
_local4 = _expandables[_arg1];
if (!_local4){
return ("");
};
_local5 = 0;
while (_local5 < _checkPoints.length) {
if ((((((_checkPoints[_local5].size == _arg2)) && ((_checkPoints.expandable == _local4)))) && ((_checkPoints[_local5].direction == _arg3)))){
return (_checkPoints[_local5].reaction);
};
_local5++;
};
return ("");
}
private function clearCheckPointByID(_arg1:uint){
var _local2:MovieClip;
var _local3:int;
_local2 = _expandables[_arg1];
if (!_local2){
return;
};
_local3 = 0;
while (_local3 < _checkPoints.length) {
if (_checkPoints.expandable == _local2){
delete _checkPoints[_local3];
_checkPoints.splice(_local3, 1);
_local3--;
};
_local3++;
};
}
public function getExpandable(_arg1:uint):MovieClip{
if (_arg1 > _expandables.length){
return (null);
};
return (_expandables[_arg1]);
}
public function removeExpandableAt(_arg1:uint){
if ((((_arg1 < _expandables.length)) && (!((_expandables[_arg1] == null))))){
clearCheckPointByID(_arg1);
_expandables[_arg1] = null;
_sizes[_arg1] = 0;
_maxSizes[_arg1] = 0;
_expanding[_arg1] = 0;
_numExpandables--;
if (_arg1 == (_expandables.length - 1)){
_expandables.splice(_arg1, 1);
_sizes.splice(_arg1, 1);
_maxSizes.splice(_arg1, 1);
_expanding.splice(_arg1, 1);
};
};
}
public function setCheckPoint(_arg1:uint, _arg2:int, _arg3:int=1, _arg4:String="", _arg5:int=30){
var _local6:MovieClip;
var _local7:int;
_local6 = _expandables[_arg1];
if (!_local6){
return;
};
_local7 = 0;
while (_local7 < _checkPoints.length) {
if ((((((_checkPoints[_local7].size == _arg2)) && ((_checkPoints[_local7].expandable == _arg1)))) && ((_checkPoints[_local7].direction == _arg3)))){
_checkPoints[_local7].reaction = _arg4;
return;
};
_local7++;
};
if (_arg3 < 0){
_arg3 = -1;
} else {
if (_arg3 > 0){
_arg3 = 1;
};
};
_checkPoints.push({size:_arg2, reaction:_arg4, expandable:_arg1, direction:_arg3, timer:_arg5});
}
public function activate(_arg1:Boolean=true){
if (_active == _arg1){
return;
};
_active = _arg1;
if (_active){
_stage.addEventListener("enterFrame", eFrame);
} else {
_stage.removeEventListener("enterFrame", eFrame);
};
}
public function getSize(_arg1:uint):Number{
if (_arg1 > _expandables.length){
return (0);
};
return (_sizes[_arg1]);
}
}
}//package expansion
Section 5
//ExpansionEvent (expansion.ExpansionEvent)
package expansion {
import flash.display.*;
import flash.events.*;
public class ExpansionEvent extends Event {
public var timer:int;
public var size:int;
public var reaction:String;
public var expandable:MovieClip;
public var direction:int;
public function ExpansionEvent(_arg1:String, _arg2:MovieClip, _arg3:int, _arg4:int=1, _arg5:String="", _arg6:int=30){
super(_arg1);
expandable = _arg2;
size = _arg3;
direction = _arg4;
reaction = _arg5;
timer = _arg6;
}
}
}//package expansion
Section 6
//Expression (expansion.Expression)
package expansion {
import flash.display.*;
import flash.events.*;
public class Expression extends EventDispatcher {
private var _position:Number;
private var _state:String;
private var _curState:Array;
private var _states:Array;
private var _active:Boolean;
private var _permanent:Boolean;
private var _offset:Number;
private var _interruptible:Boolean;
private var _eyes:Array;
private var _partBaseValues:Array;
private var _timer:int;
private var _canBlink:Boolean;
private var _partTypes:Array;
private var _expansion:Expansion;
private var _angle:Number;
private var _frequency:Number;
private var _parts:Array;
private var _blinking:Boolean;
private var _savedState:Array;
private var _reactions:Array;
private var _stage:Stage;
public static const ANIMATED:int = 0;
public static const ROTATION_SPEED:int = 2;
public static const X_POS:int = 3;
public static const Y_POS:int = 4;
public static const FRAME:int = 0;
public static const MOVABLE:int = 1;
public static const ROTATION:int = 1;
public function Expression(_arg1:Stage){
_active = false;
_stage = _arg1;
_state = "";
_canBlink = true;
_blinking = false;
_offset = 0;
_frequency = 0;
_angle = 0;
_position = 0;
_curState = [];
_states = [];
_eyes = [];
_parts = [];
_partTypes = [];
_partBaseValues = [];
_savedState = null;
_reactions = [];
_interruptible = true;
_timer = -1;
_permanent = false;
_expansion = null;
if (_arg1 == null){
throw ("ERROR: Stage must not be null.");
};
}
public function get reacting():Boolean{
return (!((_savedState == null)));
}
public function get canBlink():Boolean{
return (_canBlink);
}
public function addPartToState(_arg1:Array, _arg2:int, _arg3:String, _arg4:Number=0, _arg5:Number=1, _arg6:Number=NaN, _arg7:Number=NaN){
var _local8:MovieClip;
if (!_arg1){
return;
};
_local8 = getPartAt(_arg2);
if (!_local8){
throw ("This part is not in the list. Try using addPart() first.");
};
if (_arg1[_arg2]){
delete _arg1[_arg2];
};
_arg1[_arg2] = [];
_arg1[_arg2][FRAME] = _arg3;
if (isNaN(_arg4)){
_arg1[_arg2][ROTATION] = undefined;
} else {
_arg1[_arg2][ROTATION] = _arg4;
};
if (isNaN(_arg5)){
_arg1[_arg2][ROTATION_SPEED] = undefined;
} else {
_arg1[_arg2][ROTATION_SPEED] = _arg5;
};
if (isNaN(_arg6)){
_arg1[_arg2][X_POS] = undefined;
} else {
_arg1[_arg2][X_POS] = _arg6;
};
if (isNaN(_arg7)){
_arg1[_arg2][Y_POS] = undefined;
} else {
_arg1[_arg2][Y_POS] = _arg7;
};
}
public function get state():String{
return (_state);
}
public function get offset():Number{
return (_offset);
}
public function get blinking():Boolean{
return (_blinking);
}
private function _reacting(_arg1:Event){
var _local2:Object;
_local2 = getReaction((_arg1.target as EventDispatcher), _arg1.type);
if (_local2 == null){
throw ("Reaction not found on the list.");
};
react(_local2.state, _local2.timer);
}
public function destroy(){
var _local1:int;
if (_expansion != null){
_expansion.removeEventListener("checkpoint", expansionReaction);
_expansion = null;
};
_local1 = 0;
while (_local1 < _reactions.length) {
_reactions[_local1].hit.removeEventListener(_reactions[_local1].type, _reacting);
delete _reactions[_local1];
_local1++;
};
_reactions = [];
_curState = [];
_states = [];
_parts = [];
_partTypes = [];
_partBaseValues = [];
_savedState = null;
_state = "";
_canBlink = true;
_blinking = false;
_offset = 0;
_frequency = 0;
_angle = 0;
_position = 0;
_timer = -1;
}
public function endReact(){
if (!_savedState){
return;
};
_curState.state = _savedState.state;
_savedState = null;
setState(_curState.state);
_timer = -1;
dispatchEvent(new Event("endreact"));
}
public function removePart(_arg1:MovieClip){
var _local2:int;
var _local3:int;
_local2 = 0;
while (_local2 < _parts.length) {
if (_parts[_local2] == _arg1){
delete _parts[_local2];
delete _partTypes[_local2];
_parts[_local2] = null;
_partTypes[_local2] = 0;
_local3 = 0;
while (_local3 < _eyes.length) {
if (_eyes[_local3] == _local2){
_eyes.splice(_local3, 1);
break;
};
_local3++;
};
if (_local2 == (_parts.length - 1)){
_parts.splice(_local2, 1);
_partTypes.splice(_local2, 1);
};
return;
};
_local2++;
};
}
public function getReaction(_arg1:EventDispatcher, _arg2:String):Object{
var _local3:int;
_local3 = 0;
while (_local3 < _reactions.length) {
if ((((_reactions[_local3].hit == _arg1)) && ((_reactions[_local3].type == _arg2)))){
return (_reactions[_local3]);
};
_local3++;
};
return (null);
}
public function set offset(_arg1:Number){
if (!isNaN(_arg1)){
_offset = _arg1;
};
}
public function get position():Number{
return (_position);
}
private function eFrame(_arg1:Event){
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
if ((((((((Math.random() > 0.99)) && (_canBlink))) && ((_savedState == null)))) && (_eyes.length))){
_local2 = 0;
while (_local2 < _eyes.length) {
_parts[_eyes[_local2]].gotoAndPlay("blink");
_local2++;
};
_blinking = true;
dispatchEvent(new Event("blink"));
};
if (((_blinking) && ((_parts[_eyes[0]].currentLabel == "endblink")))){
_local2 = 0;
while (_local2 < _eyes.length) {
if (((_curState[_eyes[_local2]]) && (_curState[_eyes[_local2]][FRAME]))){
_parts[_eyes[_local2]].gotoAndPlay(_curState[_eyes[_local2]][FRAME]);
};
_local2++;
};
_blinking = false;
dispatchEvent(new Event("endblink"));
};
_local2 = 0;
while (_local2 < _curState.length) {
if (((_curState[_local2]) && (_parts[_local2]))){
if (!isNaN((_curState[_local2][ROTATION] + _curState[_local2][ROTATION_SPEED]))){
_local3 = (_curState[_local2][ROTATION] + _partBaseValues[_local2].rotation);
_local4 = (_local3 - 360);
_local5 = (_local3 + 360);
_local6 = _local3;
_local7 = Math.abs((_local4 - _parts[_local2].rotation));
_local8 = Math.abs((_local5 - _parts[_local2].rotation));
_local9 = Math.abs((_local3 - _parts[_local2].rotation));
if (_local7 <= _local9){
_local6 = _local4;
};
if ((((_local8 <= _local7)) && ((_local8 <= _local9)))){
_local6 = _local5;
};
if (_parts[_local2].rotation < (_local6 - _curState[_local2][ROTATION_SPEED])){
_parts[_local2].rotation = (_parts[_local2].rotation + _curState[_local2][ROTATION_SPEED]);
} else {
if (_parts[_local2].rotation > (_local6 + _curState[_local2][ROTATION_SPEED])){
_parts[_local2].rotation = (_parts[_local2].rotation - _curState[_local2][ROTATION_SPEED]);
} else {
_parts[_local2].rotation = _local3;
};
};
};
if (!isNaN(_curState[_local2][X_POS])){
_local3 = (_curState[_local2][X_POS] + _partBaseValues[_local2].x);
_parts[_local2].x = (_parts[_local2].x + ((_local3 - _parts[_local2].x) * 0.5));
};
if (!isNaN(_curState[_local2][Y_POS])){
_local3 = (_curState[_local2][Y_POS] + _partBaseValues[_local2].y);
_parts[_local2].y = (_parts[_local2].y + ((_local3 - _parts[_local2].y) * 0.5));
};
};
_local2++;
};
_position = Math.sin(_angle);
_angle = (_angle + _frequency);
if (_angle > 500){
_angle = (_angle - ((Math.PI * 2) * (500 / (Math.PI * 2))));
};
if (_savedState){
if (_timer > 0){
_timer--;
} else {
if (_timer == 0){
endReact();
};
};
};
dispatchEvent(new Event("enterFrame"));
}
public function react(_arg1:String, _arg2:int=30){
var _local3:Array;
if (((_savedState) && (!(_interruptible)))){
return;
};
if (((!(_arg1)) || (!(_arg1.length)))){
return;
};
_local3 = null;
if (!_savedState){
_local3 = _curState;
} else {
_local3 = _savedState;
};
_savedState = null;
_timer = _arg2;
setState(_arg1);
if (_local3 != null){
_savedState = _local3;
};
dispatchEvent(new Event("react"));
}
public function removePartAt(_arg1:uint){
var _local2:int;
if ((((_arg1 >= _parts.length)) || ((_parts[_arg1] == null)))){
return;
};
delete _parts[_arg1];
delete _partTypes[_arg1];
_parts[_arg1] = null;
_partTypes[_arg1] = 0;
_local2 = 0;
while (_local2 < _eyes.length) {
if (_eyes[_local2] == _arg1){
_eyes.splice(_local2, 1);
break;
};
_local2++;
};
if (_arg1 == (_parts.length - 1)){
_parts.splice(_arg1, 1);
_partTypes.splice(_arg1, 1);
};
}
public function addPart(_arg1:MovieClip, _arg2:int=0, _arg3:Boolean=false):int{
var _local4:int;
if (!_arg1){
return (-1);
};
_local4 = 0;
while (_local4 < _parts.length) {
if (_parts[_local4] == _arg1){
_partTypes[_local4] = _arg2;
return (_local4);
};
_local4++;
};
_local4 = 0;
while (_local4 < _parts.length) {
if (_parts[_local4] == null){
break;
};
_local4++;
};
_arg1.stop();
if (_arg3){
_eyes.push(_local4);
};
_parts[_local4] = _arg1;
_partTypes[_local4] = _arg2;
_partBaseValues[_local4] = {x:_arg1.x, y:_arg1.y, scaleX:_arg1.scaleX, scaleY:_arg1.scaleY, rotation:_arg1.rotation};
return (_local4);
}
public function get interruptible():Boolean{
return (_interruptible);
}
public function get curState():Array{
return (_curState);
}
public function getStateByName(_arg1:String):Object{
if (!_states[_arg1]){
return (null);
};
return (_states[_arg1]);
}
public function set frequency(_arg1:Number){
if (!isNaN(_arg1)){
_frequency = _arg1;
};
}
public function getPartID(_arg1:MovieClip):int{
var _local2:int;
_local2 = 0;
while (_local2 < _parts.length) {
if (_parts[_local2] == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
public function get timer():int{
return (_timer);
}
public function get defaultState():String{
if (!_savedState){
return (_state);
};
return (_savedState.state);
}
public function get angle():Number{
return (_angle);
}
public function set canBlink(_arg1:Boolean){
_canBlink = _arg1;
}
public function reactTo(_arg1:Expansion, _arg2:Boolean=false){
if (_expansion != null){
_expansion.removeEventListener("checkpoint", expansionReaction);
_expansion = null;
};
_permanent = _arg2;
if (!_arg1){
return;
};
_expansion = _arg1;
_arg1.addEventListener("checkpoint", expansionReaction, false, 1, true);
}
public function get frequency():Number{
return (_frequency);
}
private function expansionReaction(_arg1:ExpansionEvent){
if (((!(_arg1.reaction)) || (!(_arg1.reaction.length)))){
return;
};
if (_permanent){
if (reacting){
_savedState.state = _arg1.reaction;
} else {
setState(_arg1.reaction);
};
} else {
react(_arg1.reaction, _arg1.timer);
};
}
public function setState(_arg1:String, _arg2:Boolean=false){
var _local3:Array;
var _local4:int;
var _local5:String;
if (_arg1 == _state){
return;
};
if (_savedState){
if (_arg2){
_savedState.state = _arg1;
};
return;
};
if (!_states[_arg1]){
return;
};
_local3 = _curState;
_curState = [];
_curState.state = (_state = _arg1);
if (_states[_arg1]["canBlink"] != undefined){
_canBlink = _states[_arg1]["canBlink"];
};
if (!isNaN(_states[_arg1]["frequency"])){
_frequency = _states[_arg1]["frequency"];
};
if (!isNaN(_states[_arg1]["offset"])){
_offset = _states[_arg1]["offset"];
};
_blinking = false;
_local4 = 0;
while (_local4 < _states[_arg1].length) {
_curState[_local4] = _states[_arg1][_local4];
_local4++;
};
_local4 = 0;
while (_local4 < _parts.length) {
if (((((!(_states[_arg1][_local4])) || (!(_states[_arg1][_local4][FRAME])))) || (!(_states[_arg1][_local4][FRAME].length)))){
} else {
if ((((_partTypes[_local4] == MOVABLE)) && (_local3[_local4]))){
_local5 = ((_local3[_local4][FRAME] + "2") + _states[_arg1][_local4][FRAME]);
if (((!((_parts[_local4].currentLabel == _states[_arg1][_local4][FRAME]))) && (hasLabel(_parts[_local4], _local5)))){
_parts[_local4].gotoAndPlay(_local5);
} else {
if (_states[_arg1][_local4][FRAME] != _local3[_local4][FRAME]){
_parts[_local4].gotoAndPlay(_states[_arg1][_local4][FRAME]);
throw ((((((("Label " + _local5) + " is missing! in Movieclip #") + _local4) + "(") + _parts[_local4].name) + ")."));
};
};
} else {
if (((_states[_arg1][_local4][FRAME]) && (_states[_arg1][_local4][FRAME].length))){
_parts[_local4].gotoAndPlay(_states[_arg1][_local4][FRAME]);
};
};
};
_local4++;
};
}
public function set interruptible(_arg1:Boolean){
_interruptible = _arg1;
}
public function removeState(_arg1:String){
delete _states[_arg1];
}
public function addStateAttributes(_arg1:Array, _arg2:Boolean, _arg3:Number=NaN, _arg4:Number=NaN){
if (!_arg1){
return;
};
_arg1.canBlink = _arg2;
if (!isNaN(_arg3)){
_arg1.frequency = _arg3;
};
if (!isNaN(_arg4)){
_arg1.offset = _arg4;
};
}
public function removeReaction(_arg1:EventDispatcher, _arg2:String){
var _local3:int;
_local3 = 0;
while (_local3 < _reactions.length) {
if ((((_reactions[_local3].hit == _arg1)) && ((_reactions[_local3].type == _arg2)))){
_reactions[_local3].hit.removeEventListener(_arg2, _reacting);
delete _reactions[_local3];
_reactions.splice(_local3, 1);
return;
};
_local3++;
};
}
public function addState(_arg1:String, _arg2:Array){
var _local3:int;
if (_states[_arg1]){
delete _states[_arg1];
};
_states[_arg1] = new Array();
_local3 = 0;
while (_local3 < _arg2.length) {
if (_arg2[_local3]){
_states[_arg1][_local3] = _arg2[_local3].concat();
} else {
_states[_arg1][_local3] = null;
};
_local3++;
};
_states[_arg1].canBlink = _arg2.canBlink;
_states[_arg1].frequency = _arg2.frequency;
_states[_arg1].offset = _arg2.offset;
}
public function addReaction(_arg1:EventDispatcher, _arg2:String, _arg3:String, _arg4:int=30){
var _local5:Object;
_local5 = getReaction(_arg1, _arg2);
if (_local5 != null){
_local5.state = _arg3;
return;
};
_arg1.addEventListener(_arg2, _reacting, false, 2, true);
_reactions.push({hit:_arg1, type:_arg2, state:_arg3, timer:_arg4});
}
public function getBaseValues(_arg1:uint):Object{
var _local2:MovieClip;
_local2 = getPartAt(_arg1);
if (!_local2){
return (null);
};
return (_partBaseValues[_arg1]);
}
public function activate(_arg1:Boolean=true){
if (_active == _arg1){
return;
};
_active = _arg1;
if (_active){
_stage.addEventListener("enterFrame", eFrame);
} else {
_stage.removeEventListener("enterFrame", eFrame);
};
}
public function getPartAt(_arg1:int):MovieClip{
if (_parts[_arg1]){
return (_parts[_arg1]);
};
return (null);
}
public static function hasLabel(_arg1:MovieClip, _arg2:String):Boolean{
var _local3:Array;
var _local4:FrameLabel;
var _local5:int;
_local3 = _arg1.currentLabels;
_local5 = 0;
while (_local5 < _local3.length) {
_local4 = _local3[_local5];
if (_local4.name == _arg2){
return (true);
};
_local5++;
};
return (false);
}
}
}//package expansion
Section 7
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 8
//_btn1_43 (monoInflation_fla._btn1_43)
package monoInflation_fla {
import flash.display.*;
import flash.text.*;
public dynamic class _btn1_43 extends MovieClip {
public var _txt:TextField;
}
}//package monoInflation_fla
Section 9
//_btn2_44 (monoInflation_fla._btn2_44)
package monoInflation_fla {
import flash.display.*;
public dynamic class _btn2_44 extends MovieClip {
public function _btn2_44(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package monoInflation_fla
Section 10
//_btn3_45 (monoInflation_fla._btn3_45)
package monoInflation_fla {
import flash.display.*;
import flash.text.*;
public dynamic class _btn3_45 extends MovieClip {
public var _txt:TextField;
}
}//package monoInflation_fla
Section 11
//belly_34 (monoInflation_fla.belly_34)
package monoInflation_fla {
import flash.display.*;
public dynamic class belly_34 extends MovieClip {
public var ellipse:MovieClip;
}
}//package monoInflation_fla
Section 12
//eye1_28 (monoInflation_fla.eye1_28)
package monoInflation_fla {
import flash.display.*;
public dynamic class eye1_28 extends MovieClip {
public var pupil:MovieClip;
public function eye1_28(){
addFrameScript(1, frame2, 3, frame4, 5, frame6, 7, frame8, 9, frame10, 11, frame12, 13, frame14, 24, frame25, 39, frame40);
}
function frame10(){
this.gotoAndPlay(this.currentLabel);
}
function frame14(){
this.gotoAndPlay(this.currentLabel);
}
function frame12(){
this.gotoAndPlay(this.currentLabel);
}
function frame6(){
this.gotoAndPlay(this.currentLabel);
}
function frame8(){
this.gotoAndPlay(this.currentLabel);
}
function frame25(){
this.gotoAndPlay(this.currentLabel);
}
function frame4(){
this.gotoAndPlay(this.currentLabel);
}
function frame2(){
this.gotoAndPlay(this.currentLabel);
}
function frame40(){
this.gotoAndPlay(this.currentLabel);
}
}
}//package monoInflation_fla
Section 13
//eye2_26 (monoInflation_fla.eye2_26)
package monoInflation_fla {
import flash.display.*;
public dynamic class eye2_26 extends MovieClip {
public var pupil:MovieClip;
public function eye2_26(){
addFrameScript(1, frame2, 3, frame4, 5, frame6, 7, frame8, 9, frame10, 11, frame12, 13, frame14, 15, frame16, 24, frame25, 49, frame50, 64, frame65);
}
function frame65(){
this.gotoAndPlay(this.currentLabel);
}
function frame10(){
this.gotoAndPlay(this.currentLabel);
}
function frame14(){
this.gotoAndPlay(this.currentLabel);
}
function frame12(){
this.gotoAndPlay(this.currentLabel);
}
function frame6(){
this.gotoAndPlay(this.currentLabel);
}
function frame16(){
this.gotoAndPlay(this.currentLabel);
}
function frame8(){
this.gotoAndPlay(this.currentLabel);
}
function frame25(){
this.gotoAndPlay(this.currentLabel);
}
function frame4(){
this.gotoAndPlay(this.currentLabel);
}
function frame2(){
this.gotoAndPlay(this.currentLabel);
}
function frame50(){
this.gotoAndPlay(this.currentLabel);
}
}
}//package monoInflation_fla
Section 14
//hand_mc_41 (monoInflation_fla.hand_mc_41)
package monoInflation_fla {
import flash.display.*;
public dynamic class hand_mc_41 extends MovieClip {
public function hand_mc_41(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package monoInflation_fla
Section 15
//leg1_31 (monoInflation_fla.leg1_31)
package monoInflation_fla {
import flash.display.*;
public dynamic class leg1_31 extends MovieClip {
public var foot:MovieClip;
}
}//package monoInflation_fla
Section 16
//leg2_17 (monoInflation_fla.leg2_17)
package monoInflation_fla {
import flash.display.*;
public dynamic class leg2_17 extends MovieClip {
public var foot:MovieClip;
}
}//package monoInflation_fla
Section 17
//MainTimeline (monoInflation_fla.MainTimeline)
package monoInflation_fla {
import flash.display.*;
import flash.geom.*;
import fl.motion.*;
import flash.events.*;
import expansion.*;
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 STAR_COLORS:Array;
public const HONEY_X:Number = -4;
public const HONEY_Y:Number = 7;
public const BREAST2_DISTY:Number = 2;
public const BREAST1_BREATHX:Number = -2;
public const BREAST1_BREATHY:Number = -1;
public const BREAST2_DISTX:Number = -2;
public const HONEY_FRAME_BACK:Number = 0.25;
public const STAR_RATIOS:Array;
public const MIN_STAR_V:Number = 3;
public const MIN_REACTION_SPEED:Number = 0.1;
public const MAX_ARM_FRAME:int = 15;
public const CO:Number;
public const MIN_RUB_SPEED:Number = 1;
public const ANGLE:Number;
public const INV_BREAST_SIZE_START:Number = 1.29545454545455;
public const BREAST_MUL:Number = 0.4;
public const STAR_V_DIF:Number = 9;
public const BREAST1_DISTY:Number = 2;
public const BREAST1_DISTX:Number = 0;
public const MAX_STAR_V:Number = 12;
public const BLUSH_START_SPEED:Number = 0.1;
public const MAX_RUB_SPEED:Number = 5;
public const HONEY_COLOR:uint = 0xCC6600;
public const BALL_STEP:int = 7;
public const HAND_MIN_ALPHA:Number = 0;
public const MIN_STAR_SCALE:Number = 0.5;
public const HONEY_CHANGE:Number = 0.15;
public const STAR_ALPHAS:Array;
public const MAX_REACTION_DEPTH:int = 10;
public const BREAST_SPEED:int = 2;
public const MAX_POKE_TIMEOUT:int = 4;
public const BREAST_SIZE_START:Number = 0.228070175438596;
public const STAR_SIZE:Number = 15;
public const DEF_DIST:Number = 2;
public const BREAST2_SCALE:Number = 0.025;
public const WATER_COLOR:uint = 26367;
public const HONEY_SCALEX:Number;
public const HONEY_SCALEY:Number = 0.92;
public const HON_SPEED:int = 1;
public const STAR_SCALE_DIF:Number = 0.5;
public const DEF_RADIUS:Number = 50;
public const SI:Number;
public const BLUSH_STOP_SPEED:Number = 0.05;
public const MAX_POKE_TIME:int = 4;
public const BREAST1_SCALE:Number = 0.025;
public const MAX_RUB_LENGTH:int = 4;
public const BREAST_SCALE:Number = 0.05;
public const BALL_RADIUS:int = 10;
public const SPARK_DEVIATIONS:int = 10;
public const MAX_STAR_SCALE:Number = 1;
public const MAX_REACTION_SPEED:Number = 3;
public const HON_SCALE:Number = 0.01;
public const HONEY_ALPHA:Number = 2;
public const BREAST2_BREATHX:Number = -2;
public const BREAST2_BREATHY:Number = -1;
public const BALL_REFLECTIONS:int = 20;
public const SPARK_DEVIATION_RADIUS:int = 8;
public const STAR_DECAY:Number = 0.8;
public const HON_MUL:Number = 0.3;
public const BREAST_FRIC:Number = 0.4;
public const MIN_ARM_FRAME:int = 5;
public const WATER_ALPHA:Number = 1;
public const HON_FRIC:Number = 0.3;
public var SIZE:Number;
public var size:Number;
public var BREAST2_Y:Number;
public var OLD_X:Number;
public var OLD_Y:Number;
public var ARM1_ID:int;
public var BREAST2_X:Number;
public var TOUCH_ITEM:MovieClip;
public var DEF_SCALE:Number;
public var DEF_MUL:Number;
public var BREAST1_X:Number;
public var BREAST1_Y:Number;
public var DEF_FRAME:Number;
public var SURFACE:MovieClip;
public var SURFACE2_MAX_Y:Number;
public var ZOOM_SPEED:Number;
public var tmpRubParent:DisplayObjectContainer;
public var RUB_PARTS:Array;
public var RUB_ITEM:MovieClip;
public var _panel:MovieClip;
public var REACTION_DEPTH:int;
public var tmpRubItem:InteractiveObject;
public var BLUSH_VALUE:Number;
public var destArmFrame:int;
public var SURFACE2:MovieClip;
public var FRAME:int;
public var PLASMA:MovieClip;
public var DRAGGING:Boolean;
public var ENERGY_BALL:MovieClip;
public var SURFACE2_HEIGHT:Number;
public var DEF_X0:Number;
public var EYE1_ID:int;
public var ARM2:MovieClip;
public var DEF_Y0:Number;
public var REACTION_SPEED_LIST:Array;
public var DEF_RELEASE:Boolean;
public var TOUCH_PARTS:Array;
public var BLUSH_MODE:int;
public var HAND2:MovieClip;
public var PLASMA_ELLIPSE:MovieClip;
public var growth:Number;
public var SURFACE2_ALPHA:Number;
public var EYE2_ID:int;
public var ORIG_X:Number;
public var ORIG_Y:Number;
public var DEF_SCALE0:Number;
public var WATER_SYMBOL;
public var SURFACE_MAX_Y:Number;
public var DEF_SCALEY:Number;
public var BELLY_X:Number;
public var BELLY_Y:Number;
public var DEF_SCALEX:Number;
public var RUB_VX_LIST:Array;
public var MAX_SIZE:int;
public var PLASMA_RADIUS:Number;
public var PUPIL1_ID:int;
public var ENERGY_SPARK:Array;
public var STAR_MATRIX:Matrix;
public var ATTACH_LIST:Array;
public var st:Array;
public var lcd_stolen_bg:MovieClip;
public var RUB_STARS:Array;
public var DEF_Y:Array;
public var DEF_COLOR:Number;
public var DEF_X:Array;
public var PUPIL2_ID:int;
public var POKE_TIMEOUT:int;
public var BLUSH_DEST:Number;
public var POKE_PARTS:Array;
public var bounds:Rectangle;
public var DEF_B1X:Array;
public var DEF_B1Y:Array;
public var RUB_VY_LIST:Array;
public var SPARK:Array;
public var MIN_SPARK_ALPHA:Number;
public var HAND_MOVED:Boolean;
public var DEF_B2X:Array;
public var DEF_B2Y:Array;
public var SPARK_ALPHA_DECAY:Number;
public var mono:MovieClip;
public var OLD_MY:Number;
public var OLD_MX:Number;
public var DEF_FRIC:Number;
public var POKE_TIMER:int;
public var HONEY:Boolean;
public var RUBBING:Boolean;
public var HONEY_SYMBOL;
public var DEF_SPEED:int;
public var SURFACE_MIN_Y:Number;
public var HAND_MC:MovieClip;
public var RUB_TARGET:int;
public var emotions:Expression;
public var LAST_RUB_X:Number;
public var LAST_RUB_Y:Number;
public var DEF_DEST_X:Number;
public var DEF_DEST_Y:Number;
public var RUB_SPEED_LIST:Array;
public var MOUTH_ID:int;
public var SURFACE2Y:Number;
public var lcd_stolen_item:MovieClip;
public var SURFACE2_COLOR:uint;
public var tmpRubIndex:int;
public var lcd_stolen:String;
public var POKE_ITEM:MovieClip;
public function MainTimeline(){
STAR_COLORS = [16751103, 16737894];
STAR_ALPHAS = [1, 0];
STAR_RATIOS = [0, 0xFF];
ANGLE = (-(Math.PI) * 0.2);
CO = Math.cos(ANGLE);
SI = Math.sin(ANGLE);
HONEY_SCALEX = (1 + (1 - HONEY_SCALEY));
super();
addFrameScript(0, frame1);
}
public function eFrame(_arg1:Event){
var _local2:Number;
_local2 = size;
updateInflation();
updateEmotions();
if (ZOOM_SPEED){
zooming();
};
updatePanel();
updateSurface(SIZE);
updatePlasmaBall();
updateDeform();
updateRubbing();
updateBlush();
updateBreathing();
}
public function updatePlasmaBall(){
drawEnergyBall();
if (Math.random() < 0.1){
addEnergySpark();
} else {
PLASMA_ELLIPSE.graphics.clear();
};
drawEnergySpark();
}
public function moveDeform(_arg1:Event){
var _local2:Number;
DEF_DEST_X = (PLASMA_ELLIPSE.mouseX / PLASMA_RADIUS);
DEF_DEST_Y = (PLASMA_ELLIPSE.mouseY / PLASMA_RADIUS);
_local2 = ((DEF_DEST_X * DEF_DEST_X) + (DEF_DEST_Y * DEF_DEST_Y));
if (_local2 > 1){
_local2 = (1 / Math.sqrt(_local2));
DEF_DEST_X = (DEF_DEST_X * _local2);
DEF_DEST_Y = (DEF_DEST_Y * _local2);
};
}
public function pickDeform(_arg1:Event){
DEF_RELEASE = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, moveDeform, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, dropDeform, false, 0, true);
}
public function zoomIn(_arg1:Event){
ZOOM_SPEED = 0.02;
}
function frame1(){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
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.addEventListener(Event.ENTER_FRAME, eFrame);
SIZE = 0;
FRAME = 1;
MAX_SIZE = mono.belly.totalFrames;
growth = 0;
size = 1;
setSize(size);
_panel._expand._txt.text = "Expand";
_panel._revert._txt.text = "Revert";
_panel._plus._txt.text = "+";
_panel._minus._txt.text = "-";
_panel._zero._txt.text = "0";
_panel._cont_txt.text = "Continuous";
_panel._info.text = "Interactive Mono Inflation\nDrawn, animated and programmed by Doom the wolf.\nhttp://doom-the-wolf.deviantart.com";
_panel._expand.gotoAndStop(1);
_panel._revert.gotoAndStop(1);
_panel._cont.gotoAndStop(1);
_panel._expand.addEventListener(MouseEvent.MOUSE_DOWN, expand);
_panel._revert.addEventListener(MouseEvent.MOUSE_DOWN, revert);
stage.addEventListener(MouseEvent.MOUSE_UP, stopExpansion);
_panel._cont.addEventListener(MouseEvent.MOUSE_DOWN, toggleFrame);
ORIG_X = mono.x;
ORIG_Y = mono.y;
stage.addEventListener(MouseEvent.MOUSE_DOWN, pickStage);
_panel._plus.addEventListener(MouseEvent.MOUSE_DOWN, zoomIn);
_panel._minus.addEventListener(MouseEvent.MOUSE_DOWN, zoomOut);
_panel._zero.addEventListener(MouseEvent.MOUSE_DOWN, zoomReset);
stage.addEventListener(MouseEvent.MOUSE_UP, endZoom);
stage.addEventListener(Event.RESIZE, resize);
ZOOM_SPEED = 0;
destArmFrame = MIN_ARM_FRAME;
ARM2 = mono.arm2;
HAND2 = mono.hand2;
ARM2.gotoAndStop(MIN_ARM_FRAME);
HAND2.gotoAndStop(MIN_ARM_FRAME);
ATTACH_LIST = [];
Physics.attach(ATTACH_LIST, mono.mouth, mono.head, ["rotation"]);
Physics.attach(ATTACH_LIST, mono.eye1, mono.head, ["rotation"]);
Physics.attach(ATTACH_LIST, mono.eye2, mono.head, ["rotation"]);
Physics.attach(ATTACH_LIST, mono.ear1, mono.head, ["rotation"]);
Physics.attach(ATTACH_LIST, mono.ear2, mono.head, ["rotation"]);
Physics.attach(ATTACH_LIST, mono.hair1, mono.head);
Physics.attach(ATTACH_LIST, mono.hair2, mono.head);
Physics.attach(ATTACH_LIST, mono.hair3, mono.head);
emotions = new Expression(stage);
EYE1_ID = emotions.addPart(mono.eye1, Expression.ANIMATED, true);
EYE2_ID = emotions.addPart(mono.eye2, Expression.ANIMATED, true);
PUPIL1_ID = emotions.addPart(mono.eye1.pupil, Expression.ANIMATED);
PUPIL2_ID = emotions.addPart(mono.eye2.pupil, Expression.ANIMATED);
MOUTH_ID = emotions.addPart(mono.mouth, Expression.ANIMATED);
ARM1_ID = emotions.addPart(mono.arm1, Expression.MOVABLE);
st = [];
emotions.addStateAttributes(st, true, 0.1, 1);
emotions.addPartToState(st, EYE1_ID, "big", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "big", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "normal", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("normal", st);
st = [];
emotions.addStateAttributes(st, true, 0.1, 0.5);
emotions.addPartToState(st, EYE1_ID, "medium", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "medium", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "happy", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("enjoy", st);
st = [];
emotions.addStateAttributes(st, true, 0.1, 0.5);
emotions.addPartToState(st, EYE1_ID, "small", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "small", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "small", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("tired", st);
st = [];
emotions.addStateAttributes(st, true, 0.1, 0.5);
emotions.addPartToState(st, EYE1_ID, "small", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "small", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "small_honey", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("tired_honey", st);
st = [];
emotions.addStateAttributes(st, true, 0.1, 0.5);
emotions.addPartToState(st, EYE1_ID, "sad2", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "sad2", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "happy", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("full", st);
st = [];
emotions.addStateAttributes(st, true, 0.1, 0.5);
emotions.addPartToState(st, EYE1_ID, "sad2", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "sad2", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "happy_honey", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("full_honey", st);
st = [];
emotions.addStateAttributes(st, true, 0.1, 0.5);
emotions.addPartToState(st, EYE1_ID, "big", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "big", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "inflate", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("inflate", st);
st = [];
emotions.addStateAttributes(st, false, 0.4, 0.5);
emotions.addPartToState(st, EYE1_ID, "ecstatic", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "ecstatic", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 4);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 4);
emotions.addPartToState(st, MOUTH_ID, "ecstatic", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("motion", st);
st = [];
emotions.addStateAttributes(st, false, 0.2, 0.5);
emotions.addPartToState(st, EYE1_ID, "sad", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "sad", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, -2, 5);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 1, 7);
emotions.addPartToState(st, MOUTH_ID, "closed", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("belly_poke_small", st);
st = [];
emotions.addStateAttributes(st, false, 0.4, 1);
emotions.addPartToState(st, EYE1_ID, "open", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "sad", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "oh", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("belly_poke_medium", st);
st = [];
emotions.addStateAttributes(st, false, 0.2, 0.5);
emotions.addPartToState(st, EYE1_ID, "medium", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "medium", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "happy2", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("belly_poke_big", st);
st = [];
emotions.addStateAttributes(st, false, 1.2, 0.5);
emotions.addPartToState(st, EYE1_ID, "sad2", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "shut", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "laugh", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("foot_poke", st);
st = [];
emotions.addStateAttributes(st, false, 0.2, 0.5);
emotions.addPartToState(st, EYE1_ID, "medium", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "shut", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, -4);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, -4);
emotions.addPartToState(st, MOUTH_ID, "closed", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("breast_poke_small", st);
st = [];
emotions.addStateAttributes(st, false, 0.2, 0.5);
emotions.addPartToState(st, EYE1_ID, "sad", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "sad2", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 4, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 3, 0);
emotions.addPartToState(st, MOUTH_ID, "happy3", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("breast_poke_big", st);
st = [];
emotions.addStateAttributes(st, true, 0.2, 0.5);
emotions.addPartToState(st, EYE1_ID, "small", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "small", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 4);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 4);
emotions.addPartToState(st, MOUTH_ID, "smile", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("belly_touch_small", st);
st = [];
emotions.addStateAttributes(st, true, 0.2, 0.5);
emotions.addPartToState(st, EYE1_ID, "medium", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "medium", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 4, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 3, 0);
emotions.addPartToState(st, MOUTH_ID, "happy3", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("breast_touch_small", st);
st = [];
emotions.addStateAttributes(st, true, 0.1, 0.5);
emotions.addPartToState(st, EYE1_ID, "sad", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "sad", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, -4);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, -4);
emotions.addPartToState(st, MOUTH_ID, "normal", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("belly_rub_small", st);
st = [];
emotions.addStateAttributes(st, true, 0.1, 0.5);
emotions.addPartToState(st, EYE1_ID, "sad2", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "sad2", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "happy", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("foot_rub", st);
st = [];
emotions.addStateAttributes(st, true, 0.1, 0.5);
emotions.addPartToState(st, EYE1_ID, "sad2", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "sad2", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 4);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 4);
emotions.addPartToState(st, MOUTH_ID, "happy2", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("belly_rub_medium", st);
st = [];
emotions.addStateAttributes(st, false, 0.3, 0.5);
emotions.addPartToState(st, EYE1_ID, "closed", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "closed", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "happy", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("breast_rub_small", st);
st = [];
emotions.addStateAttributes(st, false, 0.3, 0.5);
emotions.addPartToState(st, EYE1_ID, "closed", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, EYE2_ID, "closed", NaN, NaN, NaN, NaN);
emotions.addPartToState(st, PUPIL1_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, PUPIL2_ID, null, NaN, NaN, 0, 0);
emotions.addPartToState(st, MOUTH_ID, "smile", 0, 0, NaN, NaN);
emotions.addPartToState(st, ARM1_ID, "normal", 0, 0, NaN, NaN);
emotions.addState("hair_rub", st);
emotions.activate();
emotions.setState("normal");
BLUSH_MODE = 0;
BLUSH_DEST = 0;
BLUSH_VALUE = 0;
tmpRubIndex = 0;
while (tmpRubIndex < mono.numChildren) {
tmpRubItem = (mono.getChildAt(tmpRubIndex) as InteractiveObject);
if (tmpRubItem){
tmpRubItem.mouseEnabled = false;
tmpRubParent = (tmpRubItem as DisplayObjectContainer);
if (tmpRubParent){
tmpRubParent.mouseChildren = false;
};
};
tmpRubIndex++;
};
RUB_PARTS = [mono.belly, mono.breast1, mono.breast2, mono.leg1.foot, mono.leg2.foot, mono.hair1, mono.hair3];
POKE_PARTS = [mono.belly, mono.breast1, mono.breast2, mono.leg1.foot, mono.leg2.foot];
TOUCH_PARTS = [mono.belly, mono.breast1, mono.breast2];
mono.belly.mouseEnabled = true;
mono.breast1.mouseEnabled = true;
mono.breast2.mouseEnabled = true;
mono.leg1.mouseChildren = true;
mono.leg2.mouseChildren = true;
mono.leg1.foot.mouseEnabled = true;
mono.leg2.foot.mouseEnabled = true;
mono.hair1.mouseEnabled = true;
mono.hair3.mouseEnabled = true;
mono.flower.mouseEnabled = true;
HAND_MC = mono.hand_mc;
LAST_RUB_X = 0;
LAST_RUB_Y = 0;
DRAGGING = false;
RUBBING = false;
HAND_MOVED = false;
POKE_TIMEOUT = 0;
POKE_TIMER = 0;
RUB_TARGET = 0;
RUB_SPEED_LIST = [];
RUB_VX_LIST = [];
RUB_VY_LIST = [];
RUB_ITEM = null;
POKE_ITEM = null;
TOUCH_ITEM = null;
HAND_MC.alpha = HAND_MIN_ALPHA;
stage.addEventListener(MouseEvent.MOUSE_DOWN, setDragging);
stage.addEventListener(MouseEvent.MOUSE_UP, resetDragging);
mono.addEventListener(MouseEvent.MOUSE_MOVE, rubMove);
STAR_MATRIX = new Matrix();
RUB_STARS = [];
STAR_MATRIX.createGradientBox((STAR_SIZE * 2), (STAR_SIZE * 2), 0, -(STAR_SIZE), -(STAR_SIZE));
SURFACE = mono.tank.surface;
SURFACE2 = mono.tank.surface2;
SURFACE_MIN_Y = -247;
SURFACE_MAX_Y = 153;
SURFACE2_COLOR = WATER_COLOR;
SURFACE2_ALPHA = 0.3;
SURFACE2Y = 104;
SURFACE2_MAX_Y = 245.2;
SURFACE2_HEIGHT = SURFACE2.height;
DEF_FRIC = 0.3;
DEF_SPEED = 1;
DEF_MUL = 0.5;
DEF_SCALE0 = 0.02;
BELLY_X = mono.belly.x;
BELLY_Y = mono.belly.y;
BREAST1_X = mono.breast1.x;
BREAST1_Y = mono.breast1.y;
BREAST2_X = mono.breast2.x;
BREAST2_Y = mono.breast2.y;
DEF_RELEASE = false;
DEF_X = [0, 0, 0];
DEF_Y = [0, 0, 0];
DEF_DEST_X = 0;
DEF_DEST_Y = 0;
DEF_B1X = [0, 0, 0];
DEF_B1Y = [0, 0, 0];
DEF_B2X = [0, 0, 0];
DEF_B2Y = [0, 0, 0];
HONEY = false;
WATER_SYMBOL = mono.tank.water_symbol;
HONEY_SYMBOL = new HoneySymbol();
HONEY_SYMBOL.x = WATER_SYMBOL.x;
HONEY_SYMBOL.y = WATER_SYMBOL.y;
HONEY_SYMBOL.alpha = 0;
mono.tank.addChild(HONEY_SYMBOL);
DEF_COLOR = 0;
DEF_SCALE = 0.02;
DEF_SCALEX = 1;
DEF_SCALEY = 1;
DEF_X0 = 0;
DEF_Y0 = 0;
DEF_FRAME = 1;
REACTION_SPEED_LIST = [];
REACTION_DEPTH = 0;
mono.flower.addEventListener(MouseEvent.MOUSE_DOWN, makeHoney);
mono.flower.tabEnabled = false;
mono.flower.tabChildren = false;
PLASMA = mono.plasma_ball;
PLASMA_ELLIPSE = PLASMA.ellipse;
ENERGY_BALL = new MovieClip();
ENERGY_SPARK = [];
SPARK = [];
MIN_SPARK_ALPHA = 0.1;
SPARK_ALPHA_DECAY = 0.9;
PLASMA_RADIUS = (PLASMA_ELLIPSE.getRect(PLASMA_ELLIPSE).width * 0.5);
PLASMA_ELLIPSE.addChild(ENERGY_BALL);
PLASMA.mouseChildren = true;
ENERGY_BALL.addEventListener(MouseEvent.MOUSE_DOWN, pickDeform);
}
public function blushOff(){
BLUSH_MODE = 0;
}
public function reactRub(_arg1:MovieClip){
switch (_arg1){
case mono.belly:
if (SIZE < 0.5){
emotions.react("belly_rub_small", 5);
} else {
emotions.react("belly_rub_medium", 5);
};
BLUSH_DEST = 1;
break;
case mono.breast1:
case mono.breast2:
emotions.react("breast_rub_small", 5);
BLUSH_DEST = 1;
break;
case mono.leg1.foot:
case mono.leg2.foot:
emotions.react("foot_rub", 5);
break;
case mono.hair1:
case mono.hair3:
emotions.react("hair_rub", 5);
break;
};
}
public function updateBreathing(){
var _local1:Number;
_local1 = (emotions.offset * ((Math.cos(emotions.angle) * 0.5) + 0.5));
mono.breast1.x = (mono.breast1.x + (BREAST1_BREATHX * _local1));
mono.breast1.y = (mono.breast1.y + (BREAST1_BREATHY * _local1));
mono.breast2.x = (mono.breast2.x + (BREAST2_BREATHX * _local1));
mono.breast2.y = (mono.breast2.y + (BREAST2_BREATHY * _local1));
mono.belly.x = (mono.belly.x + ((((BREAST1_BREATHX + BREAST2_BREATHX) * 0.5) * _local1) * SIZE));
mono.belly.y = (mono.belly.y + ((((BREAST1_BREATHY + BREAST2_BREATHY) * 0.5) * _local1) * SIZE));
}
public function resize(_arg1:Event){
Algorithms.adjustScreen(mono, mono.bg);
}
public function dropDeform(_arg1:Event){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, moveDeform, false);
stage.removeEventListener(MouseEvent.MOUSE_UP, dropDeform, false);
DEF_DEST_X = (DEF_DEST_Y = 0);
DEF_RELEASE = true;
}
public function blush(){
BLUSH_MODE = 2;
}
public function reactTouch(_arg1:MovieClip){
switch (_arg1){
case mono.belly:
emotions.react("belly_touch_small", 5);
break;
case mono.breast1:
case mono.breast2:
emotions.react("breast_touch_small", 5);
break;
};
}
public function drawEnergyBall(){
var _local1:Graphics;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local1 = ENERGY_BALL.graphics;
_local1.clear();
_local1.beginFill(6750054, 0.4);
_local1.drawCircle(0, 0, BALL_RADIUS);
_local1.endFill();
_local2 = 0;
while (_local2 < BALL_STEP) {
_local3 = ((Math.random() * Math.PI) * 2);
_local4 = (Math.random() * BALL_RADIUS);
ENERGY_SPARK[ENERGY_SPARK.length] = {x:(Math.cos(_local3) * _local4), y:(Math.sin(_local3) * _local4)};
_local2++;
};
while (ENERGY_SPARK.length > BALL_REFLECTIONS) {
ENERGY_SPARK.shift();
};
_local5 = (1 / ENERGY_SPARK.length);
_local6 = 0;
_local1.moveTo(ENERGY_SPARK[0].x, ENERGY_SPARK[0].y);
_local2 = 1;
while (_local2 < ENERGY_SPARK.length) {
_local6 = (_local6 + _local5);
_local1.lineStyle(1, 0xFF00, _local6);
_local1.lineTo(ENERGY_SPARK[_local2].x, ENERGY_SPARK[_local2].y);
_local2++;
};
}
public function zoomReset(_arg1:Event){
mono.scaleX = (mono.scaleY = 1);
mono.x = ORIG_X;
mono.y = ORIG_Y;
Algorithms.adjustScreen(mono, mono.bg);
}
public function dropStage(_arg1:Event){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, scrolling);
stage.removeEventListener(MouseEvent.MOUSE_UP, dropStage);
}
public function drawEnergySpark(){
var _local1:Graphics;
var _local2:int;
var _local3:int;
var _local4:Object;
var _local5:Number;
_local1 = PLASMA_ELLIPSE.graphics;
_local1.clear();
_local3 = SPARK.length;
if (!_local3){
return;
};
_local5 = 0;
_local2 = 1;
while (_local2 < _local3) {
_local4 = SPARK[_local2];
if (_local4.alpha < MIN_SPARK_ALPHA){
SPARK.splice(_local2, 1);
_local2--;
_local3--;
} else {
_local1.lineStyle(1, 0xFF00, _local4.alpha);
if (_local4.alpha == _local5){
_local1.lineTo(_local4.x, _local4.y);
} else {
_local1.moveTo(_local4.x, _local4.y);
_local5 = _local4.alpha;
};
_local4.alpha = (_local4.alpha * SPARK_ALPHA_DECAY);
};
_local2++;
};
}
public function generateStar(_arg1:MovieClip, _arg2:int, _arg3:Number, _arg4:Number){
var _local5:MovieClip;
var _local6:Number;
var _local7:Number;
_local5 = new MovieClip();
_local6 = (MIN_STAR_V + (Math.random() * STAR_V_DIF));
_local7 = ((Math.random() * 2) * Math.PI);
_arg1.addChildAt(_local5, _arg2);
_local5.mouseEnabled = (_local5.mouseChildren = false);
_local5.cacheAsBitmap = true;
_local5.graphics.beginGradientFill(GradientType.RADIAL, STAR_COLORS, STAR_ALPHAS, STAR_RATIOS, STAR_MATRIX);
_local5.graphics.drawCircle(0, 0, STAR_SIZE);
_local5.graphics.endFill();
_local5.x = _arg3;
_local5.y = _arg4;
_local5.scaleX = (_local5.scaleY = (MIN_STAR_SCALE + (Math.random() * STAR_SCALE_DIF)));
_local5.alpha = (_local6 / MAX_STAR_V);
_local5.vX = (Math.cos(_local7) * _local6);
_local5.vY = (Math.sin(_local7) * _local6);
RUB_STARS[RUB_STARS.length] = _local5;
}
public function updateBlush(){
if (BLUSH_VALUE <= (BLUSH_DEST - BLUSH_START_SPEED)){
BLUSH_VALUE = (BLUSH_VALUE + BLUSH_START_SPEED);
} else {
if (BLUSH_VALUE >= (BLUSH_DEST + BLUSH_STOP_SPEED)){
BLUSH_VALUE = (BLUSH_VALUE - BLUSH_STOP_SPEED);
} else {
BLUSH_VALUE = BLUSH_DEST;
};
};
mono.blush.alpha = (mono.blush2.alpha = BLUSH_VALUE);
if (BLUSH_MODE){
BLUSH_DEST = 1;
if ((((BLUSH_VALUE >= 0.999)) && ((BLUSH_MODE == 2)))){
BLUSH_MODE = 0;
};
} else {
BLUSH_DEST = 0;
};
}
public function reactPoke(_arg1:MovieClip){
switch (_arg1){
case mono.belly:
if (SIZE < 0.1){
emotions.react("belly_poke_small", 10);
} else {
if (SIZE < 0.5){
emotions.react("belly_poke_medium", 10);
blush();
} else {
emotions.react("belly_poke_big", 15);
};
};
break;
case mono.breast1:
case mono.breast2:
if (SIZE < 0.33){
emotions.react("breast_poke_small", 10);
} else {
emotions.react("breast_poke_big", 10);
};
break;
case mono.leg1.foot:
case mono.leg2.foot:
emotions.react("foot_poke", 10);
break;
};
}
public function resetAll(){
size = 1;
setSize(size);
DEF_X[0] = (DEF_X[1] = (DEF_X[2] = 0));
DEF_B1X[0] = (DEF_B1X[1] = (DEF_B1X[2] = 0));
DEF_B2X[0] = (DEF_B2X[1] = (DEF_B2X[2] = 0));
DEF_Y[0] = (DEF_Y[1] = (DEF_Y[2] = 0));
DEF_B1Y[0] = (DEF_B1Y[1] = (DEF_B1Y[2] = 0));
DEF_B2Y[0] = (DEF_B2Y[1] = (DEF_B2Y[2] = 0));
DEF_FRAME = 1;
emotions.endReact();
emotions.setState("normal");
BLUSH_DEST = (BLUSH_VALUE = 0);
ARM2.gotoAndStop(1);
HAND2.gotoAndStop(1);
}
public function addEnergySpark(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
_local1 = ((Math.random() * Math.PI) * 2);
_local2 = (Math.random() * PLASMA_RADIUS);
_local3 = (Math.cos(_local1) * _local2);
_local4 = (Math.sin(_local1) * _local2);
_local7 = ((_local3 - ENERGY_BALL.x) / SPARK_DEVIATIONS);
_local8 = ((_local4 - ENERGY_BALL.y) / SPARK_DEVIATIONS);
SPARK[SPARK.length] = {x:ENERGY_BALL.x, y:ENERGY_BALL.y, alpha:1};
_local9 = 0;
while (_local9 < SPARK_DEVIATIONS) {
_local1 = ((Math.random() * Math.PI) * 2);
_local2 = (Math.random() * SPARK_DEVIATION_RADIUS);
_local5 = ((ENERGY_BALL.x + (_local7 * _local9)) + (Math.cos(_local1) * _local2));
_local6 = ((ENERGY_BALL.y + (_local8 * _local9)) + (Math.sin(_local1) * _local2));
_local2 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
if (_local2 > PLASMA_RADIUS){
_local2 = (PLASMA_RADIUS / _local2);
_local5 = (_local5 * _local2);
_local6 = (_local6 * _local2);
};
SPARK[SPARK.length] = {x:_local5, y:_local6, alpha:1};
_local9++;
};
SPARK[SPARK.length] = {x:_local3, y:_local4, alpha:1};
}
public function revert(_arg1:Event){
if (growth == -1){
growth = 0;
} else {
growth = -1;
};
}
public function makeHoney(_arg1:Event){
HONEY = !(HONEY);
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
generateStar(mono, mono.numChildren, (mono.tank.x + HONEY_SYMBOL.x), (mono.tank.y + HONEY_SYMBOL.y));
}
public function scrolling(_arg1:Event){
mono.x = ((OLD_X + stage.mouseX) - OLD_MX);
mono.y = ((OLD_Y + stage.mouseY) - OLD_MY);
Algorithms.adjustScreen(mono, mono.bg);
}
public function updateInflation(){
if ((((((growth > 0)) && ((size < MAX_SIZE)))) || ((((growth < 0)) && ((size > 1)))))){
destArmFrame = MAX_ARM_FRAME;
} else {
destArmFrame = MIN_ARM_FRAME;
};
if (ARM2.currentFrame == destArmFrame){
if (HONEY){
size = (size + (growth * 0.5));
} else {
size = (size + growth);
};
if (size <= 1){
size = 1;
growth = 0;
destArmFrame = MIN_ARM_FRAME;
} else {
if (size > MAX_SIZE){
size = MAX_SIZE;
growth = 0;
destArmFrame = MIN_ARM_FRAME;
};
};
setSize(size);
} else {
if (ARM2.currentFrame < destArmFrame){
ARM2.nextFrame();
HAND2.nextFrame();
} else {
if (ARM2.currentFrame > destArmFrame){
ARM2.prevFrame();
HAND2.prevFrame();
};
};
};
}
public function updateRubbing(){
var _local1:int;
var _local2:int;
var _local3:Number;
var _local4:MovieClip;
var _local5:Number;
var _local6:Number;
var _local7:Rectangle;
var _local8:Rectangle;
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:Matrix;
_local3 = 0;
_local2 = RUB_SPEED_LIST.length;
_local1 = 0;
while (_local1 < _local2) {
_local3 = (_local3 + RUB_SPEED_LIST[_local1]);
_local1++;
};
if (!RUBBING){
RUB_SPEED_LIST.shift();
};
RUBBING = false;
if (POKE_TIMEOUT){
POKE_TIMEOUT--;
};
if (POKE_TIMER){
POKE_TIMER--;
if (!POKE_TIMER){
HAND_MC.alpha = HAND_MIN_ALPHA;
HAND_MC.gotoAndStop("normal");
};
} else {
if (_local3 > MIN_RUB_SPEED){
HAND_MC.alpha = 1;
if (DRAGGING == true){
HAND_MC.gotoAndStop("rub");
reactRub(RUB_ITEM);
if (RUB_ITEM == mono.belly){
_local5 = RUB_VX_LIST[(RUB_VX_LIST.length - 1)];
_local5 = ((_local5)<-1) ? -1 : ((_local5)>1) ? 1 : _local5;
_local6 = RUB_VY_LIST[(RUB_VY_LIST.length - 1)];
_local6 = ((_local6)<-1) ? -1 : ((_local6)>1) ? 1 : _local6;
if (HONEY){
_local5 = (_local5 * 0.5);
_local6 = (_local6 * 0.5);
};
DEF_X[1] = (DEF_X[1] + ((_local5 * 0.15) * SIZE));
DEF_Y[1] = (DEF_Y[1] + ((_local6 * 0.15) * SIZE));
} else {
if ((((RUB_ITEM == mono.breast1)) || ((RUB_ITEM == mono.breast2)))){
_local7 = mono.breast1.getRect(stage);
_local8 = mono.breast2.getRect(stage);
_local5 = RUB_VX_LIST[(RUB_VX_LIST.length - 1)];
_local5 = ((_local5)<-1) ? -1 : ((_local5)>1) ? 1 : _local5;
_local6 = RUB_VY_LIST[(RUB_VY_LIST.length - 1)];
_local6 = ((_local6)<-1) ? -1 : ((_local6)>1) ? 1 : _local6;
_local9 = ((((_local7.x + (_local7.width * 0.5)) + _local8.x) + (_local8.width * 0.5)) * 0.5);
_local10 = ((((_local7.y + (_local7.height * 0.5)) + _local8.y) + (_local8.height * 0.5)) * 0.5);
_local13 = (stage.mouseX - (_local7.x + (_local7.width * 0.5)));
_local14 = (stage.mouseY - (_local7.y + (_local7.height * 0.5)));
_local17 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local15 = (stage.mouseX - (_local8.x + (_local8.width * 0.5)));
_local16 = (stage.mouseY - (_local8.y + (_local8.height * 0.5)));
_local18 = Math.sqrt(((_local15 * _local15) + (_local16 * _local16)));
_local11 = (stage.mouseX - _local9);
_local12 = (stage.mouseY - _local10);
_local19 = Math.sqrt(((_local11 * _local11) + (_local12 * _local12)));
if (_local17 < (_local19 * 0.5)){
DEF_B1X[1] = (DEF_B1X[1] + ((_local5 * 0.15) - ((0.05 * _local13) / _local17)));
DEF_B1Y[1] = (DEF_B1Y[1] + ((_local6 * 0.15) - ((0.05 * _local14) / _local17)));
} else {
if (_local18 < (_local19 * 0.5)){
DEF_B2X[1] = (DEF_B2X[1] + ((_local5 * 0.15) - ((0.05 * _local15) / _local18)));
DEF_B2Y[1] = (DEF_B2Y[1] + ((_local6 * 0.15) - ((0.05 * _local16) / _local18)));
} else {
DEF_B1X[1] = (DEF_B1X[1] + ((_local5 * 0.15) - ((0.05 * _local13) / _local18)));
DEF_B1Y[1] = (DEF_B1Y[1] + ((_local6 * 0.15) - ((0.05 * _local14) / _local18)));
DEF_B2X[1] = (DEF_B2X[1] + ((_local5 * 0.15) - ((0.05 * _local15) / _local18)));
DEF_B2Y[1] = (DEF_B2Y[1] + ((_local6 * 0.15) - ((0.05 * _local16) / _local18)));
};
};
} else {
if (RUB_ITEM == mono.hair1){
_local6 = RUB_VY_LIST[(RUB_VY_LIST.length - 1)];
_local6 = ((_local6)<-1) ? -1 : ((_local6)>1) ? 1 : _local6;
if (_local6 > 0){
_local20 = mono.hair1.transform.matrix;
mono.hair1.transform.matrix.b = (_local20.b + (_local6 * 0.05));
if (_local20.b > 0.3){
_local20.b = 0.3;
};
mono.hair1.transform.matrix = _local20;
};
} else {
if (RUB_ITEM == mono.hair3){
_local6 = RUB_VY_LIST[(RUB_VY_LIST.length - 1)];
_local6 = ((_local6)<-1) ? -1 : ((_local6)>1) ? 1 : _local6;
if (_local6 > 0){
_local20 = mono.hair3.transform.matrix;
mono.hair3.transform.matrix.d = (_local20.d + (_local6 * 0.01));
if (_local20.d > 1.3){
_local20.d = 1.3;
};
mono.hair3.transform.matrix = _local20;
};
};
};
};
};
} else {
if (TOUCH_ITEM){
HAND_MC.gotoAndStop("touch");
reactTouch(TOUCH_ITEM);
};
};
} else {
HAND_MC.alpha = HAND_MIN_ALPHA;
HAND_MC.gotoAndStop("normal");
};
};
_local2 = RUB_STARS.length;
_local1 = 0;
while (_local1 < _local2) {
_local4 = RUB_STARS[_local1];
RUB_STARS[_local1].x = (_local4.x + _local4.vX);
_local4.y = (_local4.y + _local4.vY);
_local4.vX = (_local4.vX * STAR_DECAY);
_local4.vY = (_local4.vY * STAR_DECAY);
_local4.alpha = (_local4.alpha * STAR_DECAY);
if (_local4.alpha < 0.01){
_local4.parent.removeChild(_local4);
RUB_STARS.splice(_local1, 1);
_local1--;
_local2--;
};
_local1++;
};
}
public function toggleFrame(_arg1:Event){
var _local2:MovieClip;
_local2 = (_arg1.currentTarget as MovieClip);
if (_local2){
_local2.gotoAndStop((3 - _local2.currentFrame));
};
}
public function zoomOut(_arg1:Event){
ZOOM_SPEED = -0.02;
}
public function expand(_arg1:Event){
if (FRAME == MAX_SIZE){
resetAll();
} else {
if (growth == 1){
growth = 0;
} else {
growth = 1;
};
};
}
public function updatePanel(){
_panel.x = ((stage.stageWidth - _panel.width) * 0.5);
if (_panel.hitTestPoint(stage.mouseX, stage.mouseY, true)){
_panel.y = (_panel.y + (((stage.stageHeight - 100) - _panel.y) * 0.5));
} else {
_panel.y = (_panel.y + ((stage.stageHeight - _panel.y) * 0.5));
};
if (FRAME < MAX_SIZE){
_panel._expand._txt.text = "Expand";
} else {
_panel._expand._txt.text = "Reset";
};
}
public function stopExpansion(_arg1:Event){
if ((_panel._cont.currentFrame - 2)){
growth = 0;
};
}
public function updateDeform(){
var _local1:Matrix;
var _local2:ColorTransform;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local1 = mono.belly.transform.matrix;
if (HONEY){
DEF_COLOR = (DEF_COLOR + ((1 - DEF_COLOR) * HONEY_CHANGE));
Physics.balancePoint(DEF_X, HON_FRIC, DEF_DEST_X, HON_MUL, HON_SPEED);
Physics.balancePoint(DEF_Y, HON_FRIC, DEF_DEST_Y, HON_MUL, HON_SPEED);
DEF_SCALEX = (DEF_SCALEX + (((1 + ((HONEY_SCALEX - 1) * SIZE)) - DEF_SCALEX) * HONEY_CHANGE));
DEF_SCALEY = (DEF_SCALEY + (((1 + ((HONEY_SCALEY - 1) * SIZE)) - DEF_SCALEY) * HONEY_CHANGE));
DEF_X0 = (DEF_X0 + (((HONEY_X * SIZE) - DEF_X0) * HONEY_CHANGE));
DEF_Y0 = (DEF_Y0 + (((HONEY_Y * SIZE) - DEF_Y0) * HONEY_CHANGE));
DEF_FRAME = (DEF_FRAME + (((FRAME * (1 - HONEY_FRAME_BACK)) - DEF_FRAME) * HONEY_CHANGE));
DEF_SCALE = (DEF_SCALE + ((HON_SCALE - DEF_SCALE) * HONEY_CHANGE));
} else {
DEF_COLOR = (DEF_COLOR + ((0 - DEF_COLOR) * HONEY_CHANGE));
Physics.balancePoint(DEF_X, DEF_FRIC, DEF_DEST_X, DEF_MUL, DEF_SPEED);
Physics.balancePoint(DEF_Y, DEF_FRIC, DEF_DEST_Y, DEF_MUL, DEF_SPEED);
DEF_SCALEX = (DEF_SCALEX + ((1 - DEF_SCALEX) * HONEY_CHANGE));
DEF_SCALEY = (DEF_SCALEY + ((1 - DEF_SCALEY) * HONEY_CHANGE));
DEF_X0 = (DEF_X0 + ((0 - DEF_X0) * HONEY_CHANGE));
DEF_Y0 = (DEF_Y0 + ((0 - DEF_Y0) * HONEY_CHANGE));
DEF_FRAME = (DEF_FRAME + ((FRAME - DEF_FRAME) * HONEY_CHANGE));
DEF_SCALE = (DEF_SCALE + ((DEF_SCALE0 - DEF_SCALE) * HONEY_CHANGE));
};
SURFACE2_COLOR = Color.interpolateColor(WATER_COLOR, HONEY_COLOR, DEF_COLOR);
_local2 = new ColorTransform();
_local2.color = SURFACE2_COLOR;
_local2.alphaMultiplier = (WATER_ALPHA + ((HONEY_ALPHA - WATER_ALPHA) * DEF_COLOR));
SURFACE2.transform.colorTransform = _local2;
SURFACE.transform.colorTransform = _local2;
HONEY_SYMBOL.alpha = DEF_COLOR;
WATER_SYMBOL.alpha = (1 - DEF_COLOR);
_local3 = (DEF_X[0] * SIZE);
_local4 = (((DEF_X[0] * SI) + DEF_Y[0]) * SIZE);
if (HONEY){
_local3 = (_local3 * HONEY_SCALEX);
_local4 = (_local4 * HONEY_SCALEY);
};
Algorithms.deformMatrix(_local1, _local3, _local4, DEF_SCALE);
_local1.a = (_local1.a * DEF_SCALEX);
_local1.b = (_local1.b * DEF_SCALEX);
_local1.c = (_local1.c * DEF_SCALEY);
_local1.d = (_local1.d * DEF_SCALEY);
_local1.tx = ((BELLY_X + (_local3 * DEF_DIST)) + DEF_X0);
_local1.ty = ((BELLY_Y + (_local4 * DEF_DIST)) + DEF_Y0);
mono.belly.transform.matrix = _local1;
mono.breast1.gotoAndStop(int(DEF_FRAME));
mono.breast2.gotoAndStop(int(DEF_FRAME));
_local5 = Math.max(((SIZE - BREAST_SIZE_START) * INV_BREAST_SIZE_START), 0);
mono.breast1.x = (BREAST1_X + ((_local4 * BREAST1_DISTX) * _local5));
mono.breast1.y = (BREAST1_Y + (((_local4 * BREAST1_DISTY) + DEF_Y0) * _local5));
mono.breast2.x = (BREAST2_X + ((_local4 * BREAST2_DISTX) * _local5));
mono.breast2.y = (BREAST2_Y + (((_local4 * BREAST2_DISTY) + DEF_Y0) * _local5));
Physics.balancePoint(DEF_B1X, BREAST_FRIC, 0, BREAST_MUL, BREAST_SPEED);
Physics.balancePoint(DEF_B1Y, BREAST_FRIC, 0, BREAST_MUL, BREAST_SPEED);
_local1 = mono.breast1.transform.matrix;
Algorithms.deformMatrix(_local1, DEF_B1X[0], DEF_B1Y[0], BREAST_SCALE);
_local1.c = (_local1.c * (1 + ((_local4 * BREAST1_SCALE) * _local5)));
_local1.d = (_local1.d * (1 + ((_local4 * BREAST1_SCALE) * _local5)));
mono.breast1.transform.matrix = _local1;
Physics.balancePoint(DEF_B2X, BREAST_FRIC, 0, BREAST_MUL, BREAST_SPEED);
Physics.balancePoint(DEF_B2Y, BREAST_FRIC, 0, BREAST_MUL, BREAST_SPEED);
_local1 = mono.breast2.transform.matrix;
Algorithms.deformMatrix(_local1, DEF_B2X[0], DEF_B2Y[0], BREAST_SCALE);
_local1.c = (_local1.c * (1 + ((_local4 * BREAST2_SCALE) * _local5)));
_local1.d = (_local1.d * (1 + ((_local4 * BREAST2_SCALE) * _local5)));
mono.breast2.transform.matrix = _local1;
_local1 = mono.hair1.transform.matrix;
if (_local1.b < 0.05){
_local1.b = 0;
} else {
_local1.b = (_local1.b * 0.5);
};
mono.hair1.transform.matrix = _local1;
_local1 = mono.hair3.transform.matrix;
if ((_local1.d - 1) < 0.05){
_local1.d = 1;
} else {
_local1.d = (_local1.d + ((1 - _local1.d) * 0.5));
};
mono.hair3.transform.matrix = _local1;
_local6 = ((Math.abs(DEF_X[1]) + Math.abs(DEF_Y[1])) * SIZE);
REACTION_SPEED_LIST[REACTION_SPEED_LIST.length] = _local6;
if (REACTION_SPEED_LIST.length > 4){
REACTION_SPEED_LIST.shift();
};
ENERGY_BALL.x = (DEF_X[0] * DEF_RADIUS);
ENERGY_BALL.y = (DEF_Y[0] * DEF_RADIUS);
}
public function rubMove(_arg1:MouseEvent){
var _local2:MovieClip;
var _local3:int;
var _local4:Array;
var _local5:Number;
var _local6:Number;
_local2 = (_arg1.target as MovieClip);
HAND_MOVED = true;
if (((POKE_TIMER) || (!(_local2)))){
return;
};
HAND_MC.x = mono.mouseX;
HAND_MC.y = mono.mouseY;
RUB_ITEM = null;
TOUCH_ITEM = null;
_local4 = (DRAGGING) ? RUB_PARTS : TOUCH_PARTS;
_local3 = 0;
while (_local3 < _local4.length) {
if (_local2 == _local4[_local3]){
generateStar(mono, mono.getChildIndex(HAND_MC), mono.mouseX, mono.mouseY);
if (DRAGGING){
RUB_ITEM = _local2;
} else {
TOUCH_ITEM = _local2;
};
if (!RUB_SPEED_LIST.length){
RUB_SPEED_LIST[RUB_SPEED_LIST.length] = 0;
RUB_VX_LIST[RUB_VX_LIST.length] = 0;
RUB_VY_LIST[RUB_VY_LIST.length] = 0;
} else {
_local5 = (mono.mouseX - LAST_RUB_X);
_local6 = (mono.mouseY - LAST_RUB_Y);
RUB_VX_LIST[RUB_VX_LIST.length] = _local5;
RUB_VY_LIST[RUB_VY_LIST.length] = _local6;
RUB_SPEED_LIST[RUB_SPEED_LIST.length] = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
};
if (RUB_SPEED_LIST.length > MAX_RUB_LENGTH){
RUB_SPEED_LIST.shift();
};
RUBBING = true;
LAST_RUB_X = mono.mouseX;
LAST_RUB_Y = mono.mouseY;
break;
};
_local3++;
};
}
public function blushOn(){
BLUSH_MODE = 1;
}
public function zooming(){
mono.scaleX = (mono.scaleX + ZOOM_SPEED);
mono.scaleY = mono.scaleX;
Algorithms.adjustScreen(mono, mono.bg);
}
public function endZoom(_arg1:Event){
ZOOM_SPEED = 0;
}
public function pickStage(_arg1:Event){
if (!isDraggable()){
return;
};
OLD_MX = stage.mouseX;
OLD_MY = stage.mouseY;
OLD_X = mono.x;
OLD_Y = mono.y;
stage.addEventListener(MouseEvent.MOUSE_MOVE, scrolling, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, dropStage, false, 0, true);
}
public function updateEmotions(){
var _local1:Number;
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:MovieClip;
var _local5:int;
var _local6:int;
var _local7:Number;
_local1 = 0;
_local2 = mono.mouth;
_local3 = mono.eye1;
_local4 = mono.eye2;
_local5 = REACTION_SPEED_LIST.length;
_local7 = 0;
_local6 = 0;
while (_local6 < _local5) {
_local7 = (_local7 + REACTION_SPEED_LIST[_local6]);
_local6++;
};
if (((growth) && ((ARM2.currentFrame == destArmFrame)))){
if (emotions.state != "inflate"){
emotions.interruptible = true;
emotions.react("inflate", -1);
emotions.interruptible = false;
};
} else {
if (((emotions.reacting) && ((emotions.state == "inflate")))){
emotions.endReact();
emotions.interruptible = true;
} else {
if (_local7 > MIN_REACTION_SPEED){
if (emotions.state != "motion"){
emotions.react("motion", -1);
};
_local1 = ((MAX_REACTION_DEPTH * (_local7 - MIN_REACTION_SPEED)) / (MAX_REACTION_SPEED - MIN_REACTION_SPEED));
if ((REACTION_DEPTH + 2) < _local1){
REACTION_DEPTH = (REACTION_DEPTH + 2);
} else {
if ((REACTION_DEPTH - 2) > _local1){
REACTION_DEPTH = (REACTION_DEPTH - 2);
} else {
REACTION_DEPTH = _local1;
};
};
BLUSH_DEST = Math.min(((_local1 * 0.5) / MAX_REACTION_DEPTH), 1);
if (REACTION_DEPTH > MAX_REACTION_DEPTH){
_local2.gotoAndStop("mix");
_local2.gotoAndStop(((_local2.currentFrame + MAX_REACTION_DEPTH) - Math.min((REACTION_DEPTH - MAX_REACTION_DEPTH), MAX_REACTION_DEPTH)));
_local3.gotoAndStop("surprised");
_local3.gotoAndStop(((_local3.currentFrame + MAX_REACTION_DEPTH) - Math.min((REACTION_DEPTH - MAX_REACTION_DEPTH), MAX_REACTION_DEPTH)));
_local4.gotoAndStop("surprised");
_local4.gotoAndStop(((_local4.currentFrame + MAX_REACTION_DEPTH) - Math.min((REACTION_DEPTH - MAX_REACTION_DEPTH), MAX_REACTION_DEPTH)));
} else {
_local2.gotoAndStop("ecstatic");
_local2.gotoAndStop((_local2.currentFrame + REACTION_DEPTH));
_local3.gotoAndStop("ecstatic");
_local3.gotoAndStop((_local3.currentFrame + REACTION_DEPTH));
_local4.gotoAndStop("ecstatic");
_local4.gotoAndStop((_local4.currentFrame + REACTION_DEPTH));
};
} else {
if (((emotions.reacting) && ((emotions.state == "motion")))){
emotions.endReact();
BLUSH_DEST = (BLUSH_VALUE = 0);
};
};
};
};
switch (true){
case (size < 2):
emotions.setState("normal", true);
break;
case (size < 20):
break;
case (size < (MAX_SIZE * 0.5)):
emotions.setState("enjoy", true);
break;
case (size < MAX_SIZE):
if (HONEY){
emotions.setState("tired_honey", true);
} else {
emotions.setState("tired", true);
};
break;
case (size >= MAX_SIZE):
if (HONEY){
emotions.setState("full_honey", true);
} else {
emotions.setState("full", true);
};
break;
};
}
public function setSize(_arg1:int){
var _local2:int;
var _local3:int;
FRAME = _arg1;
SIZE = ((_arg1 - 1) / (MAX_SIZE - 1));
mono.belly.gotoAndStop(_arg1);
mono.breast1.gotoAndStop(_arg1);
mono.breast2.gotoAndStop(_arg1);
_local2 = mono.getChildIndex(mono.clothes1);
_local3 = mono.getChildIndex(mono.belly);
if ((((((FRAME < 91)) && ((_local2 < _local3)))) || ((((FRAME >= 91)) && ((_local2 > _local3)))))){
mono.swapChildren(mono.clothes1, mono.belly);
};
if (FRAME <= mono.clothes1.totalFrames){
mono.clothes1.gotoAndStop(FRAME);
} else {
mono.clothes1.gotoAndStop(mono.clothes1.totalFrames);
};
}
public function isDraggable():Boolean{
var _local1:Number;
var _local2:Number;
_local1 = stage.mouseX;
_local2 = stage.mouseY;
if (((((((((((((((((((((((((mono.body.hitTestPoint(_local1, _local2, true)) || (mono.head.hitTestPoint(_local1, _local2, true)))) || (mono.arm1.hitTestPoint(_local1, _local2, true)))) || (mono.arm2.hitTestPoint(_local1, _local2, true)))) || (mono.hand2.hitTestPoint(_local1, _local2, true)))) || (mono.leg1.hitTestPoint(_local1, _local2, true)))) || (mono.leg2.hitTestPoint(_local1, _local2, true)))) || (mono.belly.hitTestPoint(_local1, _local2, true)))) || (mono.tail.hitTestPoint(_local1, _local2, true)))) || (mono.hair1.hitTestPoint(_local1, _local2, true)))) || (mono.hair2.hitTestPoint(_local1, _local2, true)))) || (mono.hair3.hitTestPoint(_local1, _local2, true)))) || (PLASMA_ELLIPSE.hitTestPoint(_local1, _local2, true)))){
return (false);
};
if (_panel.y < (stage.stageHeight - 50)){
return (false);
};
return (true);
}
public function updateSurface(_arg1:Number){
var _local2:Graphics;
SURFACE.y = (SURFACE_MIN_Y + ((SURFACE_MAX_Y - SURFACE_MIN_Y) * _arg1));
SURFACE2.y = Math.min((SURFACE.y + SURFACE2Y), SURFACE2_MAX_Y);
_local2 = SURFACE2.graphics;
_local2.clear();
if (_arg1 < 1){
SURFACE.visible = true;
_local2.beginFill(SURFACE2_COLOR, SURFACE2_ALPHA);
_local2.drawRect(0, SURFACE2_HEIGHT, SURFACE2.width, (SURFACE2_MAX_Y - SURFACE2.y));
_local2.endFill();
} else {
SURFACE.visible = false;
};
}
public function resetDragging(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = (_arg1.target as MovieClip);
DRAGGING = false;
HAND_MC.gotoAndStop("normal");
HAND_MC.alpha = HAND_MIN_ALPHA;
if (((POKE_TIMEOUT) && (!(HAND_MOVED)))){
POKE_TIMER = MAX_POKE_TIME;
generateStar(mono, mono.getChildIndex(HAND_MC), mono.mouseX, mono.mouseY);
generateStar(mono, mono.getChildIndex(HAND_MC), mono.mouseX, mono.mouseY);
generateStar(mono, mono.getChildIndex(HAND_MC), mono.mouseX, mono.mouseY);
generateStar(mono, mono.getChildIndex(HAND_MC), mono.mouseX, mono.mouseY);
generateStar(mono, mono.getChildIndex(HAND_MC), mono.mouseX, mono.mouseY);
generateStar(mono, mono.getChildIndex(HAND_MC), mono.mouseX, mono.mouseY);
generateStar(mono, mono.getChildIndex(HAND_MC), mono.mouseX, mono.mouseY);
HAND_MC.gotoAndStop("poke");
HAND_MC.alpha = 1;
reactPoke(POKE_ITEM);
POKE_ITEM = null;
};
}
public function setDragging(_arg1:MouseEvent){
var _local2:MovieClip;
var _local3:int;
_local2 = (_arg1.target as MovieClip);
DRAGGING = true;
HAND_MOVED = false;
_local3 = 0;
while (_local3 < RUB_PARTS.length) {
if (_local2 == RUB_PARTS[_local3]){
RUB_ITEM = _local2;
break;
};
_local3++;
};
_local3 = 0;
while (_local3 < POKE_PARTS.length) {
if (_local2 == POKE_PARTS[_local3]){
POKE_TIMEOUT = MAX_POKE_TIMEOUT;
POKE_ITEM = _local2;
break;
};
_local3++;
};
}
}
}//package monoInflation_fla
Section 18
//mono_1 (monoInflation_fla.mono_1)
package monoInflation_fla {
import flash.display.*;
public dynamic class mono_1 extends MovieClip {
public var blush:MovieClip;
public var clothes1:MovieClip;
public var leg1:MovieClip;
public var leg2:MovieClip;
public var plasma_ball:MovieClip;
public var eye2:MovieClip;
public var blush2:MovieClip;
public var couch1:MovieClip;
public var bg:MovieClip;
public var tail:MovieClip;
public var flower:MovieClip;
public var arm2:MovieClip;
public var couch2:MovieClip;
public var arm1:MovieClip;
public var hand_mc:MovieClip;
public var eye1:MovieClip;
public var breast1:MovieClip;
public var hair2:MovieClip;
public var hair3:MovieClip;
public var tube:MovieClip;
public var breast2:MovieClip;
public var body:MovieClip;
public var ear1:MovieClip;
public var hand2:MovieClip;
public var ear2:MovieClip;
public var table:MovieClip;
public var hair1:MovieClip;
public var belly:MovieClip;
public var head:MovieClip;
public var pillow:MovieClip;
public var mouth:MovieClip;
public var clothes2:MovieClip;
public var tank:MovieClip;
}
}//package monoInflation_fla
Section 19
//mouth_30 (monoInflation_fla.mouth_30)
package monoInflation_fla {
import flash.display.*;
public dynamic class mouth_30 extends MovieClip {
public function mouth_30(){
addFrameScript(1, frame2, 4, frame5, 7, frame8, 11, frame12, 14, frame15, 17, frame18, 20, frame21, 23, frame24, 26, frame27, 29, frame30, 34, frame35, 37, frame38, 61, frame62, 97, frame98);
}
function frame98(){
this.gotoAndPlay(this.currentLabel);
}
function frame18(){
this.gotoAndStop(this.currentLabel);
}
function frame12(){
this.gotoAndStop(this.currentLabel);
}
function frame15(){
this.gotoAndStop(this.currentLabel);
}
function frame8(){
this.gotoAndStop(this.currentLabel);
}
function frame24(){
this.gotoAndStop(this.currentLabel);
}
function frame5(){
this.gotoAndStop(this.currentLabel);
}
function frame21(){
this.gotoAndStop(this.currentLabel);
}
function frame2(){
this.gotoAndStop(this.currentLabel);
}
function frame27(){
this.gotoAndStop(this.currentLabel);
}
function frame30(){
this.gotoAndStop(this.currentLabel);
}
function frame38(){
this.gotoAndStop(this.currentLabel);
}
function frame35(){
this.gotoAndPlay(this.currentLabel);
}
function frame62(){
this.gotoAndStop(this.currentLabel);
}
}
}//package monoInflation_fla
Section 20
//panel_42 (monoInflation_fla.panel_42)
package monoInflation_fla {
import flash.display.*;
import flash.text.*;
public dynamic class panel_42 extends MovieClip {
public var _revert:MovieClip;
public var _cont:MovieClip;
public var _minus:MovieClip;
public var _cont_txt:TextField;
public var _zero:MovieClip;
public var _plus:MovieClip;
public var _info:TextField;
public var _expand:MovieClip;
}
}//package monoInflation_fla
Section 21
//plasma_ball_10 (monoInflation_fla.plasma_ball_10)
package monoInflation_fla {
import flash.display.*;
public dynamic class plasma_ball_10 extends MovieClip {
public var ellipse:MovieClip;
}
}//package monoInflation_fla
Section 22
//tank_6 (monoInflation_fla.tank_6)
package monoInflation_fla {
import flash.display.*;
public dynamic class tank_6 extends MovieClip {
public var surface2:MovieClip;
public var surface:MovieClip;
public var water_symbol:MovieClip;
}
}//package monoInflation_fla
Section 23
//HoneySymbol (HoneySymbol)
package {
import flash.display.*;
public dynamic class HoneySymbol extends MovieClip {
}
}//package