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
//Drawing (as3.Drawing)
package as3 {
import flash.display.*;
import flash.geom.*;
import fl.motion.*;
public class Drawing {
public static function drawHeart(_arg1:Graphics, _arg2:Number, _arg3:Number){
var _local4:Number;
var _local5:Number;
var _local6:Object;
var _local7:Object;
var _local8:Object;
var _local9:Object;
var _local10:Object;
var _local11:Object;
var _local12:Object;
var _local13:Object;
var _local14:Object;
var _local15:Object;
_local4 = (_arg3 / 1.5);
_local5 = (_arg2 / 1.5);
_local6 = {x:0, y:1};
_local7 = {x:1, y:0};
_local8 = {x:0, y:-1};
_local9 = {x:1.2, y:-0.5};
_local10 = {x:1, y:-1};
_local11 = {x:0.5, y:-1.2};
_local12 = Geometry.intersectLines(_local7.x, _local7.y, (_local7.x + 1), (_local7.y - 1), _local9.x, _local9.y, _local9.x, (_local9.y + 1));
_local13 = Geometry.intersectLines(_local10.x, _local10.y, (_local10.x + 1), (_local10.y + 1), _local9.x, _local9.y, _local9.x, (_local9.y + 1));
_local14 = Geometry.intersectLines(_local10.x, _local10.y, (_local10.x + 1), (_local10.y + 1), _local11.x, _local11.y, (_local11.x + 1), _local11.y);
_local15 = Geometry.intersectLines(_local8.x, _local8.y, (_local8.x + 1), (_local8.y - 1), _local11.x, _local11.y, (_local11.x + 1), _local11.y);
_arg1.moveTo((_local5 * _local6.x), (_local4 * _local6.y));
_arg1.lineTo((_local5 * _local7.x), (_local4 * _local7.y));
_arg1.curveTo((_local5 * _local12.x), (_local4 * _local12.y), (_local5 * _local9.x), (_local4 * _local9.y));
_arg1.curveTo((_local5 * _local13.x), (_local4 * _local13.y), (_local5 * _local10.x), (_local4 * _local10.y));
_arg1.curveTo((_local5 * _local14.x), (_local4 * _local14.y), (_local5 * _local11.x), (_local4 * _local11.y));
_arg1.curveTo((_local5 * _local15.x), (_local4 * _local15.y), (_local5 * _local8.x), (_local4 * _local8.y));
_arg1.curveTo((-(_local5) * _local15.x), (_local4 * _local15.y), (-(_local5) * _local11.x), (_local4 * _local11.y));
_arg1.curveTo((-(_local5) * _local14.x), (_local4 * _local14.y), (-(_local5) * _local10.x), (_local4 * _local10.y));
_arg1.curveTo((-(_local5) * _local13.x), (_local4 * _local13.y), (-(_local5) * _local9.x), (_local4 * _local9.y));
_arg1.curveTo((-(_local5) * _local12.x), (_local4 * _local12.y), (-(_local5) * _local7.x), (_local4 * _local7.y));
_arg1.lineTo((-(_local5) * _local6.x), (_local4 * _local6.y));
}
public static function drawPolyLine(_arg1:Array, _arg2:Graphics){
var _local3:int;
_local3 = 1;
while (_local3 < _arg1.length) {
_arg2.lineTo(_arg1[_local3].x, _arg1[_local3].y);
_local3++;
};
}
public static function getLinePoint(_arg1:Object, _arg2:Object, _arg3:Object):Object{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = (_arg2.x - _arg1.x);
_local5 = (_arg2.y - _arg1.y);
_local6 = Math.atan2(_local5, _local4);
_local7 = (_arg3.x - _arg2.x);
_local8 = (_arg3.y - _arg2.y);
_local9 = Math.atan2(_local8, _local7);
_local10 = Geometry.interpolateAngle(_local6, _local9, 0.5);
return ({x:(_arg2.x + (Math.cos(_local10) * 2)), y:(_arg2.y + (Math.sin(_local10) * 2))});
}
public static function drawPoints(_arg1:Array, _arg2:Graphics){
var _local3:int;
_local3 = 0;
while (_local3 < _arg1.length) {
_arg2.moveTo(_arg1[_local3].x, (_arg1[_local3].y - 0.5));
_arg2.lineTo(_arg1[_local3].x, (_arg1[_local3].y + 0.5));
_local3++;
};
}
public static function drawKick(_arg1:Graphics, _arg2:Graphics, _arg3:Graphics, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number, _arg13:uint=0xFFFFFF, _arg14:uint=0xFFFFFF, _arg15:Number=1, _arg16=1){
var _local17:Number;
var _local18:Point;
var _local19:Number;
var _local20:Point;
var _local21:Point;
var _local22:Point;
var _local23:Point;
var _local24:Point;
var _local25:Point;
var _local26:Point;
var _local27:Point;
var _local28:Matrix;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Point;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
_local17 = 0.85;
_local18 = Geometry.rotatePoint(-(_arg8), new Point((_arg9 - _arg4), (_arg10 - _arg5)), null);
Geometry.rotatePoint(-(_arg8), new Point((_arg9 - _arg4), (_arg10 - _arg5)), null).x = (_local18.x / _arg6);
_local18.y = (_local18.y / _arg7);
_local19 = _local18.length;
_arg14 = Color.interpolateColor(_arg13, _arg14, _arg12);
_local29 = (_arg5 / _arg4);
if (_local19 < _local17){
_local30 = 0.5;
_local31 = (1 / _local17);
_local32 = ((1 - (_local30 * Math.abs(_local18.x))) * _arg11);
_local33 = ((1 - (_local30 * Math.abs(_local18.y))) * _arg11);
_local34 = (((Math.PI * 0.125) * (_local18.y * _local31)) * (-(_local18.x) * _local31));
_local35 = (((Math.PI * 0.125) * (_local18.x * _local31)) * (-(_local18.y) * _local31));
_local28 = new Matrix((_local32 * Math.cos(_local34)), (_local32 * Math.sin(_local34)), (_local33 * Math.sin(_local35)), (_local33 * Math.cos(_local35)));
_local28.tx = _arg9;
_local28.ty = _arg10;
_local36 = new Point(-1, 0);
_local24 = _local28.transformPoint(_local36);
_local36.x = 1;
_local25 = _local28.transformPoint(_local36);
_local36.x = 0;
_local36.y = -2;
_local22 = _local28.transformPoint(_local36);
_local36.y = 1;
_local23 = _local28.transformPoint(_local36);
_local37 = ((2 * Math.SQRT1_2) - 0.5);
_local36.x = -(_local37);
_local36.y = _local37;
_local26 = _local28.transformPoint(_local36);
_local36.x = _local37;
_local27 = _local28.transformPoint(_local36);
_local36.x = ((_local18.x * _arg12) * 0.75);
_local36.y = ((_local18.y * _arg12) * 0.75);
_local21 = _local28.transformPoint(_local36);
_local36.x = (((_local18.x * 0.75) * 2) * _arg12);
_local36.y = ((1 + ((Math.abs((_local18.y * 0.75)) - 1) * _arg12)) * 2);
_local20 = _local28.transformPoint(_local36);
_local28.createGradientBox(_arg11, _arg11, 0, (_local21.x - (_arg11 * 0.5)), (_local21.y - (_arg11 * 0.5)));
_arg1.beginGradientFill(GradientType.RADIAL, [_arg14, _arg13], [_arg16, _arg15], [0, 0xFF], _local28);
_arg1.moveTo(_local24.x, _local24.y);
_arg1.curveTo(_local22.x, _local22.y, _local25.x, _local25.y);
_arg1.curveTo(_local27.x, _local27.y, _local23.x, _local23.y);
_arg1.curveTo(_local26.x, _local26.y, _local24.x, _local24.y);
_arg1.endFill();
_arg2.moveTo(_local24.x, _local24.y);
_arg2.curveTo(_local20.x, _local20.y, _local25.x, _local25.y);
_arg2.curveTo(_local27.x, _local27.y, _local23.x, _local23.y);
_arg2.curveTo(_local26.x, _local26.y, _local24.x, _local24.y);
} else {
_local38 = _local18.x;
_local39 = _local18.y;
_local40 = (_arg8 + Math.atan2(_local39, _local38));
_local41 = ((_local38)<0) ? -1 : 1;
_local38 = Math.cos(_local40);
_local39 = Math.sin(_local40);
_local28 = new Matrix((_arg11 * _local38), (_arg11 * _local39), (_arg11 * -(_local39)), (_arg11 * _local38), _arg9, _arg10);
_local36 = new Point();
_local36.x = 0;
_local36.y = (-1 * _local41);
_local22 = _local28.transformPoint(_local36);
_local36.y = (1 * _local41);
_local23 = _local28.transformPoint(_local36);
_local36.x = 0.5;
_local36.y = (0 * _local41);
_local25 = _local28.transformPoint(_local36);
_local36.x = -0.5;
_local24 = _local28.transformPoint(_local36);
_local36.x = 0.5;
_local36.y = (-0.5 * _local41);
_local26 = _local28.transformPoint(_local36);
_local36.y = (0.5 * _local41);
_local27 = _local28.transformPoint(_local36);
_local36.x = 0.5;
_local36.y = 0;
_local20 = _local28.transformPoint(_local36);
_local36.x = (0.5 * ((_local18.y * 0.5) + 0.5));
_local36.y = ((2 + ((-0.5 - 2) * ((_local18.y * 0.5) + 0.5))) * _local41);
_local21 = _local28.transformPoint(_local36);
_arg3.moveTo(_local22.x, _local22.y);
_arg3.curveTo(_local26.x, _local26.y, _local25.x, _local25.y);
_arg3.curveTo(_local27.x, _local27.y, _local23.x, _local23.y);
_local28.createGradientBox(_arg11, _arg11, 0, (_local20.x - (_arg11 * 0.5)), (_local20.y - (_arg11 * 0.5)));
_arg1.beginGradientFill(GradientType.RADIAL, [_arg14, _arg13], [_arg16, _arg15], [0, 0xFF], _local28);
_arg1.moveTo(_local22.x, _local22.y);
_arg1.curveTo(_local26.x, _local26.y, _local25.x, _local25.y);
_arg1.curveTo(_local27.x, _local27.y, _local23.x, _local23.y);
_arg1.curveTo(_local24.x, _local24.y, _local22.x, _local22.y);
_arg1.endFill();
_arg2.moveTo(_local22.x, _local22.y);
_arg2.curveTo(_local21.x, _local21.y, _local25.x, _local25.y);
_arg2.curveTo(_local27.x, _local27.y, _local23.x, _local23.y);
_arg2.curveTo(_local24.x, _local24.y, _local22.x, _local22.y);
};
}
public static function getLinePoint2(_arg1:Object, _arg2:Object, _arg3:Object, _arg4:Object):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local5 = _arg3.x;
_local6 = _arg3.y;
_local9 = (_local5 - _arg2.x);
_local10 = (_local6 - _arg2.y);
_local8 = (((_local9) || (_local10))) ? (1 / Math.sqrt(((_local9 * _local9) + (_local10 * _local10)))) : 0;
_local9 = (_local9 * _local8);
_local10 = (_local10 * _local8);
_local11 = (_arg4.x - _local5);
_local12 = (_arg4.y - _local6);
_local8 = (((_local11) || (_local12))) ? (1 / Math.sqrt(((_local11 * _local11) + (_local12 * _local12)))) : 0;
_local11 = (_local11 * _local8);
_local12 = (_local12 * _local8);
_arg1.x = ((_local5 + _local9) + _local11);
_arg1.y = ((_local6 + _local10) + _local12);
}
public static function drawConnection(_arg1:Graphics, _arg2:Object, _arg3:Object, _arg4:Object, _arg5:Object, _arg6:Number){
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Object;
var _local47:Object;
_local7 = _arg2.x;
_local8 = _arg3.x;
_local9 = _arg2.y;
_local10 = _arg3.y;
_local14 = (_arg4.x - _local7);
_local15 = (_arg4.y - _local9);
_local16 = (_arg5.x - _local8);
_local17 = (_arg5.y - _local10);
_local18 = (((_local14) || (_local15))) ? (1 / Math.sqrt(((_local14 * _local14) + (_local15 * _local15)))) : 0;
_local19 = (_local14 * _local18);
_local20 = (_local15 * _local18);
_local18 = (((_local16) || (_local17))) ? (1 / Math.sqrt(((_local16 * _local16) + (_local17 * _local17)))) : 0;
_local21 = (_local16 * _local18);
_local22 = (_local17 * _local18);
_local11 = (_local8 - _local7);
_local12 = (_local10 - _local9);
_local13 = Math.sqrt(((_local11 * _local11) + (_local12 * _local12)));
_local23 = (_arg6 * _local13);
_local24 = (_local19 * _local23);
_local25 = (_local21 * _local23);
_local26 = (_local20 * _local23);
_local27 = (_local22 * _local23);
_local28 = (_local7 + _local24);
_local29 = (_local9 + _local26);
_local30 = (_local7 - _local24);
_local31 = (_local9 - _local26);
_local32 = (_local8 + _local25);
_local33 = (_local10 + _local27);
_local34 = (_local8 - _local25);
_local35 = (_local10 - _local27);
_local36 = (0.5 * (_local7 + _local8));
_local37 = (0.5 * (_local9 + _local10));
_local11 = (_local28 - _local36);
_local12 = (_local29 - _local37);
_local38 = ((_local11 * _local11) + (_local12 * _local12));
_local11 = (_local30 - _local36);
_local12 = (_local31 - _local37);
_local39 = ((_local11 * _local11) + (_local12 * _local12));
_local11 = (_local32 - _local36);
_local12 = (_local33 - _local37);
_local40 = ((_local11 * _local11) + (_local12 * _local12));
_local11 = (_local34 - _local36);
_local12 = (_local35 - _local37);
_local41 = ((_local11 * _local11) + (_local12 * _local12));
if (_local38 < _local39){
_local42 = _local28;
_local43 = _local29;
} else {
_local42 = _local30;
_local43 = _local31;
};
if (_local40 < _local41){
_local44 = _local32;
_local45 = _local33;
} else {
_local44 = _local34;
_local45 = _local35;
};
_arg1.curveTo(_local42, _local43, ((_local42 + _local44) * 0.5), ((_local43 + _local45) * 0.5));
_arg1.curveTo(_local44, _local45, _local8, _local10);
}
public static function drawSparkle(_arg1:Graphics, _arg2:Number, _arg3:int, _arg4:Number, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0){
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
if (_arg3 < 1){
return;
};
_local14 = ((Math.PI * 2) / _arg3);
_arg1.moveTo(((Math.cos(_arg5) * _arg2) + _arg6), (_arg7 + (Math.sin(_arg5) * _arg2)));
_local15 = 0;
while (_local15 < _arg3) {
_local8 = (Math.cos(((Number((_local15 + 1)) * _local14) + _arg5)) * _arg2);
_local9 = (Math.sin(((Number((_local15 + 1)) * _local14) + _arg5)) * _arg2);
_local10 = ((Math.cos(((Number((_local15 + 0.5)) * _local14) + _arg5)) * _arg2) * _arg4);
_local11 = ((Math.sin(((Number((_local15 + 0.5)) * _local14) + _arg5)) * _arg2) * _arg4);
_local12 = ((Math.cos(((Number((_local15 + 0.25)) * _local14) + _arg5)) * _arg2) * _arg4);
_local13 = ((Math.sin(((Number((_local15 + 0.25)) * _local14) + _arg5)) * _arg2) * _arg4);
_arg1.curveTo((_arg6 + _local12), (_arg7 + _local13), (_arg6 + _local10), (_arg7 + _local11));
_local12 = ((Math.cos(((Number((_local15 + 0.75)) * _local14) + _arg5)) * _arg2) * _arg4);
_local13 = ((Math.sin(((Number((_local15 + 0.75)) * _local14) + _arg5)) * _arg2) * _arg4);
_arg1.curveTo((_arg6 + _local12), (_arg7 + _local13), (_arg6 + _local8), (_arg7 + _local9));
_local15++;
};
}
public static function drawCurvyLine(_arg1:Graphics, _arg2:Object, _arg3:Array, _arg4:Object, _arg5:Number=0.25){
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Object;
var _local10:Object;
var _local11:Object;
var _local12:Object;
var _local13:Object;
var _local14:Object;
var _local15:Object;
_local7 = _arg3.length;
_local8 = (_local7 - 1);
if (_arg2 == null){
_arg2 = _arg3[0];
};
if (_arg4 == null){
_arg4 = _arg3[_local8];
};
_local11 = new Object();
_local12 = new Object();
_local6 = 1;
while (_local6 < _local7) {
_local13 = _arg3[(_local6 - 1)];
_local14 = _arg3[_local6];
if (_local6 < _local8){
getLinePoint2(_local11, _local13, _local14, _arg3[(_local6 + 1)]);
_local9 = _local11;
} else {
_local9 = _arg4;
};
if (_local6 > 1){
getLinePoint2(_local12, _arg3[(_local6 - 2)], _local13, _local14);
_local10 = _local12;
} else {
_local10 = _arg2;
};
drawConnection(_arg1, _local13, _local14, _local10, _local9, _arg5);
_local6++;
};
}
public static function drawPolygon(_arg1:Array, _arg2:Graphics){
var _local3:int;
_arg2.moveTo(_arg1[0].x, _arg1[0].y);
_local3 = 1;
while (_local3 < _arg1.length) {
_arg2.lineTo(_arg1[_local3].x, _arg1[_local3].y);
_local3++;
};
}
public static function controlPointIntersect(_arg1:Object, _arg2:Object, _arg3:Object, _arg4:Object):Object{
var _local5:Object;
var _local6:Object;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local5 = Geometry.intersectLines(_arg1.x, _arg1.y, _arg2.x, _arg2.y, _arg3.x, _arg3.y, _arg4.x, _arg4.y);
if (!_local5){
return (null);
};
_local6 = {x:((_arg2.x + _arg3.x) * 0.5), y:((_arg2.y + _arg3.y) * 0.5)};
_local7 = (_arg3.x - _arg2.x);
_local8 = (_arg3.y - _arg2.y);
_local9 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local10 = (_local5.x - _local6.x);
_local11 = (_local5.y - _local6.y);
_local12 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
if (_local12 > _local9){
return (null);
};
return ({x:(_local6.x + ((_local5.x - _local6.x) * 0.5)), y:(_local6.y + ((_local5.y - _local6.y) * 0.5))});
}
public static function drawStar(_arg1:Graphics, _arg2:Number, _arg3:uint, _arg4:Number, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0){
var _local8:int;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local8 = 0;
if (!_arg3){
return;
};
_local9 = (_arg2 * _arg4);
_local10 = (Math.PI / _arg3);
_local11 = ((-(Math.PI) * 0.5) + _arg5);
_arg3 = (_arg3 << 1);
_local8 = 0;
while (_local8 <= _arg3) {
if ((_local8 % 2)){
_local12 = (_arg6 + (Math.cos(_local11) * _local9));
_local13 = (_arg7 + (Math.sin(_local11) * _local9));
} else {
_local12 = (_arg6 + (Math.cos(_local11) * _arg2));
_local13 = (_arg7 + (Math.sin(_local11) * _arg2));
};
if (!_local8){
_arg1.moveTo(_local12, _local13);
} else {
_arg1.lineTo(_local12, _local13);
};
_local11 = (_local11 + _local10);
_local8++;
};
}
public static function drawClosedCurve(_arg1:Array, _arg2:Graphics):Array{
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Array;
var _local8:int;
var _local9:Object;
if (_arg1.length < 3){
return ([]);
};
_local7 = new Array();
_arg2.moveTo(_arg1[0].x, _arg1[0].y);
_local8 = 0;
while (_local8 < _arg1.length) {
_local3 = _arg1[_local8];
_local4 = _arg1[(int(((_arg1.length + _local8) - 1)) % _arg1.length)];
_local5 = _arg1[(int((_local8 + 1)) % _arg1.length)];
_local6 = _arg1[(int((_local8 + 2)) % _arg1.length)];
_local9 = controlPointIntersect(_local4, _local3, _local5, _local6);
if (_local9 == null){
_arg2.lineTo(_local5.x, _local5.y);
} else {
_local7.push(_local9);
_arg2.curveTo(_local9.x, _local9.y, _local5.x, _local5.y);
};
_local8++;
};
return (_local7);
}
}
}//package as3
Section 3
//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 4
//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 5
//SoftBlob (as3.SoftBlob)
package as3 {
import flash.display.*;
import flash.geom.*;
import fl.motion.*;
import flash.events.*;
public class SoftBlob extends Sprite {
private var _points:Array;
private var _darkAlpha:Number;
private var _darkColor:uint;
private var _light:Shape;
private var _blobRadius:Number;
private var _normalizedBasePoints:Array;
private var _lineAlpha:Number;
private var _lineColor:uint;
private var _friction:Number;
private var _lineCaps:String;
private var _coverRotation:Number;
private var _deformFactor:Number;
private var _blobYRadius:Number;
private var _dark:Shape;
private var _blobPoints:Array;
private var _lightFlatness:Number;
private var _coverYRadius:Number;
private var _blobEggFactor:Number;
private var _baseYRadius:Number;
private var _topLevel:DisplayObject;
private var _coverY:Number;
private var _offsetUpdated:Boolean;
private var _lineMaskZone:Sprite;
private var _coverX:Number;
private var _basePoints:Array;
private var _pushFactor:Number;
private var _cover:Shape;
private var _darkFlatness:Number;
private var _lineScaleMode:String;
private var _line:Sprite;
private var _offsetX:Number;
private var _offsetY:Number;
private var _lineMiterLimit:Number;
private var _averageDistance:Number;
private var _destX:Number;
private var _lightAngle:Number;
private var _destY:Number;
private var _attached:Array;
private var _gravityAngle:Number;
private var _linePixelHinting:Boolean;
private var _numBlobPoints:int;
private var _lightDistance:Number;
private var _blobXRadius:Number;
private var _lightSin:Number;
private var _numBasePoints:int;
private var _darkRadius:Number;
private var _speed:int;
private var _coverXRadius:Number;
private var _baseXRadius:Number;
private var _darkDistance:Number;
private var _multiplier:Number;
private var _coverRadius:Number;
private var _lightAlpha:Number;
private var _lightRadius:Number;
private var _baseAlpha:Number;
private var _baseColor:uint;
private var _lightColor:uint;
private var _masked:Sprite;
private var _base:Shape;
private var _mask:Sprite;
private var _bounceFactor:Number;
private var _invPushFactor:Number;
private var _lineJoints:String;
private var _lineThickness:Number;
private var _baseEggFactor:Number;
private var _lightMaskZone:Sprite;
private var _oldY:Number;
private var _lightCos:Number;
private var _x:Array;
private var _y:Array;
private var _oldX:Number;
public static const ATTACHED_DEFORM:int = 1;
public static const ATTACHED_ITEM:int = 0;
public static const ATTACHED_OFFSET_X:int = 4;
public static const ATTACHED_OFFSET_Y:int = 5;
public static const ATTACHED_NORMAL_OFFSET_X:int = 7;
public static const ATTACHED_NORMAL_OFFSET_Y:int = 8;
private static const RAD_TO_DEG:Number = 57.2957795130823;
public static const ATTACHED_OFFSET_DIST:int = 6;
public static const ATTACHED_X:int = 2;
public static const ATTACHED_Y:int = 3;
public function SoftBlob(_arg1:uint, _arg2:uint){
var _local3:int;
var _local4:Number;
var _local5:Number;
super();
_cover = new Shape();
_base = new Shape();
_dark = new Shape();
_light = new Shape();
_line = new Sprite();
_mask = new Sprite();
_masked = new Sprite();
_masked.addChild(_base);
_masked.addChild(_light);
_masked.mask = _mask;
addChild(_dark);
addChild(_masked);
addChild(_mask);
addChild(_line);
_line.addChild(_cover);
_line.blendMode = BlendMode.LAYER;
_cover.blendMode = BlendMode.ERASE;
_x = [0, 0, 0];
_y = [0, 0, 0];
_offsetX = 0;
_offsetY = 0;
_offsetUpdated = false;
_numBasePoints = _arg1;
_numBlobPoints = _arg2;
_blobPoints = new Array(_numBlobPoints);
_basePoints = new Array(_numBasePoints);
_attached = [];
_normalizedBasePoints = new Array(_numBasePoints);
_local5 = ((Math.PI * 2) / _numBlobPoints);
_local4 = 0;
_local3 = 0;
while (_local3 < _numBlobPoints) {
_blobPoints[_local3] = new Point();
_local4 = (_local4 + _local5);
_local3++;
};
_local5 = ((Math.PI * 2) / _numBasePoints);
_local4 = 0;
_local3 = 0;
while (_local3 < _numBasePoints) {
_basePoints[_local3] = new Point();
_normalizedBasePoints[_local3] = new Point(Math.cos(_local4), Math.sin(_local4));
_local4 = (_local4 + _local5);
_local3++;
};
_points = _basePoints.concat(_blobPoints);
_oldX = (_oldY = 0);
_destX = (_destY = 0);
_lightColor = 0xFFFFFF;
_baseColor = 0xCCCCCC;
_darkColor = 0x999999;
_lightAlpha = (_baseAlpha = (_darkAlpha = 1));
_lineThickness = 1;
_lineColor = 0;
_lineAlpha = 1;
_linePixelHinting = false;
_lineScaleMode = LineScaleMode.NORMAL;
_lineCaps = null;
_lineJoints = null;
_lineMiterLimit = 3;
_lightAngle = (-(Math.PI) * 0.75);
_lightRadius = 0;
_lightDistance = 0;
_lightFlatness = 1;
_darkRadius = 0;
_darkDistance = 0;
_darkFlatness = 1;
_lightCos = Math.cos(_lightAngle);
_lightSin = Math.sin(_lightAngle);
_baseXRadius = (_baseYRadius = 1);
_baseEggFactor = 1;
_blobRadius = (_blobXRadius = (_blobYRadius = 1));
_blobEggFactor = 1;
_coverX = (_coverY = 0);
_coverRadius = (_coverXRadius = (_coverYRadius = 0));
_coverRotation = 0;
_topLevel = null;
_friction = 0.5;
_multiplier = 0.5;
_speed = 1;
_bounceFactor = 1;
_deformFactor = 0.5;
_pushFactor = 0.2;
_invPushFactor = (1 - _pushFactor);
_gravityAngle = (Math.PI * 0.5);
_averageDistance = 0;
updateBasePoints();
updateBlobPoints();
lightColor = _lightColor;
baseColor = _baseColor;
darkColor = _darkColor;
updateLight();
updateDark();
updateCover();
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, removedFromStage, false, 0, true);
}
private function redrawCover(){
var _local1:Graphics;
_local1 = _cover.graphics;
_local1.clear();
_local1.beginFill(0xFF0000);
_local1.drawCircle(0, 0, 1);
_local1.endFill();
}
private function updateDark(){
_base.x = ((_x[0] + ((_x[1] * _deformFactor) * 0.5)) + (_lightCos * _darkDistance));
_base.y = ((_y[0] + ((_y[1] * _deformFactor) * 0.5)) + (_lightSin * _darkDistance));
_base.scaleX = (_darkFlatness * _darkRadius);
_base.scaleY = _darkRadius;
_base.rotation = (_lightAngle * RAD_TO_DEG);
}
public function set friction(_arg1:Number){
_friction = (isNaN(_arg1)) ? 0 : _arg1;
}
public function set lineMiterLimit(_arg1:Number){
_lineMiterLimit = ((((_arg1 < 0)) || (isNaN(_arg1)))) ? 0 : _arg1;
}
public function set lineCaps(_arg1:String){
_lineCaps = _arg1;
}
public function get lineThickness():Number{
return (_lineThickness);
}
public function get destY():Number{
return (_destY);
}
public function set pushFactor(_arg1:Number){
if (isNaN(_arg1)){
_arg1 = 0;
};
_pushFactor = ((_arg1)<0) ? 0 : _arg1;
_invPushFactor = (1 - _pushFactor);
}
public function set baseAlpha(_arg1:Number){
var _local2:Graphics;
_baseAlpha = _arg1;
_local2 = _base.graphics;
_local2.clear();
_local2.beginFill(_baseColor, _baseAlpha);
_local2.drawCircle(0, 0, 1);
_local2.endFill();
}
public function set bounceFactor(_arg1:Number){
if (isNaN(_arg1)){
_arg1 = 0;
};
_bounceFactor = ((_arg1)<0) ? 0 : _arg1;
}
public function set baseColor(_arg1:uint){
var _local2:Graphics;
_baseColor = _arg1;
_local2 = _base.graphics;
_local2.clear();
_local2.beginFill(_baseColor, _baseAlpha);
_local2.drawCircle(0, 0, 1);
_local2.endFill();
}
public function get offsetX():Number{
return (_offsetX);
}
public function get blobYRadius():Number{
return (_blobYRadius);
}
public function set blobYRadius(_arg1:Number){
_blobYRadius = (isNaN(_arg1)) ? 0 : _arg1;
_blobRadius = ((_blobXRadius + _blobYRadius) * 0.5);
}
public function get offsetY():Number{
return (_offsetY);
}
public function set baseXRadius(_arg1:Number){
_baseXRadius = (isNaN(_arg1)) ? 0 : _arg1;
updateBasePoints();
}
public function hitTestBlob(_arg1:Number, _arg2:Number):Boolean{
var _local3:Point;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local3 = globalToLocal(new Point(_arg1, _arg2));
_local4 = ((_destX + _offsetX) - _x[0]);
_local5 = ((_destY + _offsetY) - _y[0]);
_local6 = _x[1];
_local7 = _y[1];
_local8 = Math.atan2(_local7, _local6);
_local9 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local10 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
_local11 = ((_deformFactor * (_local10 - _local9)) / _blobRadius);
if (_local11 > _deformFactor){
_local11 = _deformFactor;
};
if (_local11 < -(_deformFactor)){
_local11 = -(_deformFactor);
};
_local3.x = (_local3.x - _x[0]);
_local3.y = (_local3.y - _y[0]);
_local3.x = (_local3.x / _blobXRadius);
_local3.y = (_local3.y / _blobYRadius);
_local3.x = (_local3.x / (1 + ((1 - _blobEggFactor) * _local3.y)));
return (pointWithinEllipse(_local3, 0, 0, (1 - _local11), (1 + _local11), _local8));
}
public function get lineJoints():String{
return (_lineJoints);
}
private function addedToStage(_arg1:Event){
var _local2:Point;
if (!_topLevel){
_topLevel = stage;
};
_local2 = _topLevel.globalToLocal(localToGlobal(new Point()));
_oldX = _local2.x;
_oldY = _local2.y;
}
public function set offsetY(_arg1:Number){
_offsetY = (isNaN(_arg1)) ? 0 : _arg1;
_offsetUpdated = true;
}
public function set coverRadius(_arg1:Number){
_coverRadius = (_coverXRadius = (_coverYRadius = (isNaN(_arg1)) ? 0 : _arg1));
updateCover();
}
public function get speed():int{
return (_speed);
}
public function get baseYRadius():Number{
return (_baseYRadius);
}
public function set lightDistance(_arg1:Number){
_lightDistance = (isNaN(_arg1)) ? 0 : _arg1;
updateLight();
}
public function get innerMask():Sprite{
return (_mask);
}
public function set averageDistance(_arg1:Number){
_averageDistance = (isNaN(_arg1)) ? 0 : _arg1;
_destX = (Math.cos(_gravityAngle) * _averageDistance);
_destY = (Math.sin(_gravityAngle) * _averageDistance);
}
private function updateCover(){
_cover.x = _coverX;
_cover.y = _coverY;
_cover.rotation = (_coverRotation * RAD_TO_DEG);
_cover.scaleX = _coverXRadius;
_cover.scaleY = _coverYRadius;
redrawCover();
}
public function stabilize():void{
var _local1:Point;
if (!_topLevel){
return;
};
_x[0] = _destX;
_x[1] = (_x[2] = 0);
_y[0] = _destY;
_y[1] = (_y[2] = 0);
_local1 = _topLevel.globalToLocal(localToGlobal(new Point()));
_oldX = _local1.x;
_oldY = _local1.y;
update(null);
}
public function get deformFactor():Number{
return (_deformFactor);
}
public function get coverRotation():Number{
return (_coverRotation);
}
public function get lineScaleMode():String{
return (_lineScaleMode);
}
public function set gravityAngle(_arg1:Number){
_gravityAngle = (isNaN(_arg1)) ? 0 : _arg1;
_destX = (Math.cos(_gravityAngle) * _averageDistance);
_destY = (Math.sin(_gravityAngle) * _averageDistance);
}
public function get lightFlatness():Number{
return (_lightFlatness);
}
public function get blobRadius():Number{
return (_blobRadius);
}
public function hasAttachedItem(_arg1:DisplayObject):Boolean{
var _local2:int;
var _local3:int;
var _local4:Array;
_local3 = _attached.length;
_local2 = 0;
while (_local2 < _local3) {
_local4 = _attached[_local2];
if (_local4[ATTACHED_ITEM] == _arg1){
return (true);
};
_local2++;
};
return (false);
}
public function get blobEggFactor():Number{
return (_blobEggFactor);
}
public function get masked():Sprite{
return (_masked);
}
public function set lightRadius(_arg1:Number){
_lightRadius = (isNaN(_arg1)) ? 0 : _arg1;
updateLight();
}
public function set offsetX(_arg1:Number){
_offsetX = (isNaN(_arg1)) ? 0 : _arg1;
_offsetUpdated = true;
}
public function get linePixelHinting():Boolean{
return (_linePixelHinting);
}
public function set lightAngle(_arg1:Number){
_lightAngle = (isNaN(_arg1)) ? 0 : _arg1;
_lightCos = Math.cos(_lightAngle);
_lightSin = Math.sin(_lightAngle);
updateLight();
updateDark();
}
private function updateBasePoints(){
var _local1:int;
var _local2:Point;
var _local3:Point;
_local1 = 0;
while (_local1 < _numBasePoints) {
_local2 = _basePoints[_local1];
_local3 = _normalizedBasePoints[_local1];
_local2.x = ((_local3.x * _baseXRadius) * (1 + ((1 - _baseEggFactor) * _local3.y)));
_local2.y = (_local3.y * _baseYRadius);
_local1++;
};
}
public function set topLevel(_arg1:DisplayObject){
var _local2:Point;
_topLevel = _arg1;
_local2 = _topLevel.globalToLocal(localToGlobal(new Point()));
_oldX = _local2.x;
_oldY = _local2.y;
}
public function set coverRotation(_arg1:Number){
_coverRotation = (isNaN(_arg1)) ? 0 : _arg1;
updateCover();
}
public function get coverYRadius():Number{
return (_coverYRadius);
}
public function update(_arg1:Event=null){
var _local2:Point;
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:Array;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:DisplayObject;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Matrix;
var _local20:Number;
var _local21:Number;
_local2 = _topLevel.globalToLocal(localToGlobal(new Point()));
_x[0] = (_x[0] - ((_local2.x - _oldX) * _bounceFactor));
_y[0] = (_y[0] - ((_local2.y - _oldY) * _bounceFactor));
Physics.balancePoint(_x, _friction, (_destX + _offsetX), _multiplier, _speed);
Physics.balancePoint(_y, _friction, (_destY + _offsetY), _multiplier, _speed);
_local4 = _attached.length;
_local8 = _x[0];
_local9 = _y[0];
_local10 = _x[1];
_local11 = _y[1];
_local15 = Math.atan2(_local11, _local10);
if (_local15 >= (0.5 * Math.PI)){
_local15 = (_local15 - Math.PI);
};
if (_local15 < (-0.5 * Math.PI)){
_local15 = (_local15 + Math.PI);
};
_local15 = (_local15 * 2);
_local16 = ((_deformFactor * 0.5) * Math.min(Math.sqrt(((_local10 * _local10) + (_local11 * _local11))), 1));
_local17 = Math.abs((Math.cos(_local15) * _local16));
_local18 = (Math.sin(_local15) * _local16);
_local19 = new Matrix((1 - (_local17 * _local16)), (-(_local18) * _local16), (-(_local18) * _local16), (1 + (_local17 * _local16)));
_local3 = 0;
while (_local3 < _local4) {
_local5 = _attached[_local3];
_local14 = _local5[ATTACHED_ITEM];
_local6 = _local5[ATTACHED_X];
_local7 = _local5[ATTACHED_Y];
_local20 = _local6[0];
_local21 = _local7[0];
_local12 = (_local8 + _local6[3]);
_local13 = (_local9 + _local7[3]);
_local6[1] = (_local12 - _local20);
_local7[1] = (_local13 - _local21);
_local6[0] = _local12;
_local7[0] = _local13;
_local14.x = _local6[0];
_local14.y = _local7[0];
if (_local5[ATTACHED_DEFORM]){
_local19.tx = _local14.x;
_local19.ty = _local14.y;
_local14.transform.matrix = _local19;
};
_local3++;
};
updateBlobPoints();
_oldX = _local2.x;
_oldY = _local2.y;
if (_offsetUpdated){
_offsetUpdated = false;
} else {
_offsetX = (_offsetX * _invPushFactor);
_offsetY = (_offsetY * _invPushFactor);
};
}
public function get lineMiterLimit():Number{
return (_lineMiterLimit);
}
public function set baseYRadius(_arg1:Number){
_baseYRadius = (isNaN(_arg1)) ? 0 : _arg1;
updateBasePoints();
}
public function get blobXRadius():Number{
return (_blobXRadius);
}
private function updateBlobPoints(){
var _local1:int;
var _local2:Point;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local3 = ((_destX + _offsetX) - _x[0]);
_local4 = ((_destY + _offsetY) - _y[0]);
_local5 = _x[1];
_local6 = _y[1];
_local7 = Math.atan2(_local6, _local5);
_local8 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
_local9 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
_local10 = ((_deformFactor * (_local9 - _local8)) / _blobRadius);
if (_local10 > _deformFactor){
_local10 = _deformFactor;
};
if (_local10 < -(_deformFactor)){
_local10 = -(_deformFactor);
};
mapPointsToEllipse(_blobPoints, _numBlobPoints, 0, (Math.PI * 2), 0, 0, (1 - _local10), (1 + _local10), _local7);
_local1 = 0;
while (_local1 < _numBlobPoints) {
_local2 = _blobPoints[_local1];
_local2.x = (_x[0] + ((_local2.x * _blobXRadius) * (1 + ((1 - _blobEggFactor) * _local2.y))));
_local2.y = (_y[0] + (_local2.y * _blobYRadius));
_local1++;
};
}
public function set lineJoints(_arg1:String){
_lineJoints = _arg1;
}
public function set deformFactor(_arg1:Number){
if (isNaN(_arg1)){
_arg1 = 0;
};
_deformFactor = ((_arg1)<0) ? 0 : _arg1;
}
public function get points():Array{
return (_blobPoints);
}
public function get darkFlatness():Number{
return (_darkFlatness);
}
public function set speed(_arg1:int){
if (isNaN(_arg1)){
_arg1 = 0;
};
_speed = ((_arg1)<0) ? 0 : _arg1;
}
public function get lineCaps():String{
return (_lineCaps);
}
public function set lineScaleMode(_arg1:String){
_lineScaleMode = _arg1;
}
public function get friction():Number{
return (_friction);
}
public function interpolate(_arg1:SoftBlob, _arg2:SoftBlob, _arg3:Number):void{
lightColor = Color.interpolateColor(_arg1.lightColor, _arg2.lightColor, _arg3);
baseColor = Color.interpolateColor(_arg1.baseColor, _arg2.baseColor, _arg3);
darkColor = Color.interpolateColor(_arg1.darkColor, _arg2.darkColor, _arg3);
lightAlpha = (_arg1.lightAlpha + ((_arg2.lightAlpha - _arg1.lightAlpha) * _arg3));
baseAlpha = (_arg1.baseAlpha + ((_arg2.baseAlpha - _arg1.baseAlpha) * _arg3));
darkAlpha = (_arg1.darkAlpha + ((_arg2.darkAlpha - _arg1.darkAlpha) * _arg3));
lineThickness = (_arg1.lineThickness + ((_arg2.lineThickness - _arg1.lineThickness) * _arg3));
lineColor = Color.interpolateColor(_arg1.lineColor, _arg2.lineColor, _arg3);
lineAlpha = (_arg1.lineAlpha + ((_arg2.lineAlpha - _arg1.lineAlpha) * _arg3));
linePixelHinting = ((_arg3)>0.5) ? _arg2.linePixelHinting : _arg1.linePixelHinting;
lineScaleMode = ((_arg3)>0.5) ? _arg2.lineScaleMode : _arg1.lineScaleMode;
lineCaps = ((_arg3)>0.5) ? _arg2.lineCaps : _arg1.lineCaps;
lineJoints = ((_arg3)>0.5) ? _arg2.lineJoints : _arg1.lineJoints;
lineMiterLimit = (_arg1.lineMiterLimit + ((_arg2.lineMiterLimit - _arg1.lineMiterLimit) * _arg3));
lightAngle = (_arg1.lightAngle + ((_arg2.lightAngle - _arg1.lightAngle) * _arg3));
lightRadius = (_arg1.lightRadius + ((_arg2.lightRadius - _arg1.lightRadius) * _arg3));
lightDistance = (_arg1.lightDistance + ((_arg2.lightDistance - _arg1.lightDistance) * _arg3));
lightFlatness = (_arg1.lightFlatness + ((_arg2.lightFlatness - _arg1.lightFlatness) * _arg3));
darkRadius = (_arg1.darkRadius + ((_arg2.darkRadius - _arg1.darkRadius) * _arg3));
darkDistance = (_arg1.darkDistance + ((_arg2.darkDistance - _arg1.darkDistance) * _arg3));
darkFlatness = (_arg1.darkFlatness + ((_arg2.darkFlatness - _arg1.darkFlatness) * _arg3));
baseXRadius = (_arg1.baseXRadius + ((_arg2.baseXRadius - _arg1.baseXRadius) * _arg3));
baseYRadius = (_arg1.baseYRadius + ((_arg2.baseYRadius - _arg1.baseYRadius) * _arg3));
blobXRadius = (_arg1.blobXRadius + ((_arg2.blobXRadius - _arg1.blobXRadius) * _arg3));
blobYRadius = (_arg1.blobYRadius + ((_arg2.blobYRadius - _arg1.blobYRadius) * _arg3));
baseEggFactor = (_arg1.baseEggFactor + ((_arg2.blobEggFactor - _arg1.baseEggFactor) * _arg3));
blobEggFactor = (_arg1.blobEggFactor + ((_arg2.blobEggFactor - _arg1.blobEggFactor) * _arg3));
coverX = (_arg1.coverX + ((_arg2.coverX - _arg1.coverX) * _arg3));
coverY = (_arg1.coverY + ((_arg2.coverY - _arg1.coverY) * _arg3));
coverXRadius = (_arg1.coverXRadius + ((_arg2.coverXRadius - _arg1.coverXRadius) * _arg3));
coverYRadius = (_arg1.coverYRadius + ((_arg2.coverYRadius - _arg1.coverYRadius) * _arg3));
coverRotation = (_arg1.coverRotation + ((_arg2.coverRotation - _arg1.coverRotation) * _arg3));
friction = (_arg1.friction + ((_arg2.friction - _arg1.friction) * _arg3));
multiplier = (_arg1.multiplier + ((_arg2.multiplier - _arg1.multiplier) * _arg3));
speed = Math.round((_arg1.speed + ((_arg2.speed - _arg1.speed) * _arg3)));
bounceFactor = (_arg1.bounceFactor + ((_arg2.bounceFactor - _arg1.bounceFactor) * _arg3));
deformFactor = (_arg1.deformFactor + ((_arg2.deformFactor - _arg1.deformFactor) * _arg3));
gravityAngle = (_arg1.gravityAngle + ((_arg2.gravityAngle - _arg1.gravityAngle) * _arg3));
averageDistance = (_arg1.averageDistance + ((_arg2.averageDistance - _arg1.averageDistance) * _arg3));
}
public function get yValues():Array{
return (_y);
}
public function get numBlobPoints():int{
return (_numBlobPoints);
}
public function get pushFactor():Number{
return (_pushFactor);
}
public function get baseAlpha():Number{
return (_baseAlpha);
}
public function set darkAlpha(_arg1:Number){
_darkAlpha = _arg1;
}
public function set coverX(_arg1:Number){
_coverX = (isNaN(_arg1)) ? 0 : _arg1;
updateCover();
}
public function set lightFlatness(_arg1:Number){
_lightFlatness = (isNaN(_arg1)) ? 0 : _arg1;
updateLight();
}
public function get baseColor():uint{
return (_baseColor);
}
public function set darkColor(_arg1:uint){
_darkColor = _arg1;
}
public function set blobRadius(_arg1:Number){
_blobRadius = (_blobXRadius = (_blobYRadius = (isNaN(_arg1)) ? 0 : _arg1));
}
public function get baseXRadius():Number{
return (_baseXRadius);
}
public function get gravityAngle():Number{
return (_gravityAngle);
}
public function get lightDistance():Number{
return (_lightDistance);
}
public function set darkDistance(_arg1:Number){
_darkDistance = (isNaN(_arg1)) ? 0 : _arg1;
updateDark();
}
public function get topLevel():DisplayObject{
return (_topLevel);
}
public function set coverY(_arg1:Number){
_coverY = (isNaN(_arg1)) ? 0 : _arg1;
updateCover();
}
public function get averageDistance():Number{
return (_averageDistance);
}
public function get coverRadius():Number{
return (_coverRadius);
}
public function set blobEggFactor(_arg1:Number){
_blobEggFactor = (isNaN(_arg1)) ? 0 : _arg1;
}
public function attachItem(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Boolean=true){
var _local5:int;
var _local6:int;
var _local7:Array;
var _local8:Number;
_local6 = _attached.length;
_local8 = Math.sqrt(((_arg2 * _arg2) + (_arg3 * _arg3)));
_local5 = 0;
while (_local5 < _local6) {
_local7 = _attached[_local5];
if (_local7[ATTACHED_ITEM] == _arg1){
_local7[ATTACHED_DEFORM] = _arg4;
_local7[ATTACHED_X][0] = (_local7[ATTACHED_X][3] = _arg2);
_local7[ATTACHED_Y][0] = (_local7[ATTACHED_Y][3] = _arg3);
_local7[ATTACHED_OFFSET_DIST] = _local8;
_local7[ATTACHED_NORMAL_OFFSET_X] = (_arg2 / _local8);
_local7[ATTACHED_NORMAL_OFFSET_Y] = (_arg3 / _local8);
return;
};
_local5++;
};
_local7 = [_arg1, _arg4, [_arg2, 0, 0, _arg2], [_arg3, 0, 0, _arg3], _local8, (_arg2 / _local8), (_arg3 / _local8)];
_attached[_local6] = _local7;
addChild(_arg1);
_arg1.x = (_x + _arg2);
_arg1.y = (_y + _arg3);
}
public function draw(_arg1:Event=null){
var _local2:Array;
var _local3:Graphics;
var _local4:Number;
var _local5:Number;
_local2 = Geometry.getOuterPoints(_points);
_local2[_local2.length] = _local2[0];
_local4 = _local2[0].x;
_local5 = _local2[0].y;
_local3 = _dark.graphics;
_local3.clear();
_local3.beginFill(_darkColor, _darkAlpha);
_local3.moveTo(_local2[0].x, _local2[0].y);
Drawing.drawCurvyLine(_local3, _local2[(_local2.length - 1)], _local2, _local2[0]);
_local3.endFill();
_local3 = _line.graphics;
_local3.clear();
_local3.lineStyle(_lineThickness, _lineColor, _lineAlpha, _linePixelHinting, _lineScaleMode, _lineCaps, _lineJoints, _lineMiterLimit);
_local3.moveTo(_local2[0].x, _local2[0].y);
Drawing.drawCurvyLine(_local3, _local2[(_local2.length - 1)], _local2, _local2[0]);
_local3.endFill();
_local3 = _mask.graphics;
_local3.clear();
_local3.beginFill(0, 1);
_local3.moveTo(_local4, _local5);
_local3.moveTo(_local2[0].x, _local2[0].y);
Drawing.drawCurvyLine(_local3, _local2[(_local2.length - 1)], _local2, _local2[0]);
_local3.endFill();
updateLight();
updateDark();
}
public function detachItem(_arg1:DisplayObject):void{
var _local2:int;
var _local3:int;
var _local4:Array;
_local3 = _attached.length;
_local2 = 0;
while (_local2 < _local3) {
_local4 = _attached[_local2];
if (_local4[ATTACHED_ITEM] == _arg1){
removeChild(_arg1);
_attached.splice(_local2, 1);
return;
};
_local2++;
};
}
public function get lightRadius():Number{
return (_lightRadius);
}
public function get lightAngle():Number{
return (_lightAngle);
}
public function set darkRadius(_arg1:Number){
_darkRadius = (isNaN(_arg1)) ? 0 : _arg1;
updateDark();
}
public function clone():SoftBlob{
var _local1:SoftBlob;
_local1 = new SoftBlob(_numBasePoints, _numBlobPoints);
_local1.lightColor = _lightColor;
_local1.baseColor = _baseColor;
_local1.darkColor = _darkColor;
_local1.lightAlpha = _lightAlpha;
_local1.baseAlpha = _baseAlpha;
_local1.darkAlpha = _darkAlpha;
_local1.lineThickness = _lineThickness;
_local1.lineColor = _lineColor;
_local1.lineAlpha = _lineAlpha;
_local1.linePixelHinting = _linePixelHinting;
_local1.lineScaleMode = _lineScaleMode;
_local1.lineCaps = _lineCaps;
_local1.lineJoints = _lineJoints;
_local1.lineMiterLimit = _lineMiterLimit;
_local1.lightAngle = _lightAngle;
_local1.lightRadius = _lightRadius;
_local1.lightDistance = _lightDistance;
_local1.lightFlatness = _lightFlatness;
_local1.darkRadius = _darkRadius;
_local1.darkDistance = _darkDistance;
_local1.darkFlatness = _darkFlatness;
_local1.baseXRadius = _baseXRadius;
_local1.baseYRadius = _baseYRadius;
_local1.blobXRadius = _blobXRadius;
_local1.blobYRadius = _blobYRadius;
_local1.blobEggFactor = _blobEggFactor;
_local1.coverX = _coverX;
_local1.coverY = _coverY;
_local1.coverXRadius = _coverXRadius;
_local1.coverYRadius = _coverYRadius;
_local1.coverRotation = _coverRotation;
_local1.topLevel = _topLevel;
_local1.friction = _friction;
_local1.multiplier = _multiplier;
_local1.speed = _speed;
_local1.bounceFactor = _bounceFactor;
_local1.deformFactor = _deformFactor;
_local1.gravityAngle = _gravityAngle;
_local1.averageDistance = _averageDistance;
_local1.updateBasePoints();
_local1.updateBlobPoints();
return (_local1);
}
public function get numBasePoints():int{
return (_numBasePoints);
}
public function set linePixelHinting(_arg1:Boolean){
_linePixelHinting = _arg1;
}
public function set coverYRadius(_arg1:Number){
_coverYRadius = (isNaN(_arg1)) ? 0 : _arg1;
_coverRadius = ((_coverXRadius + _coverYRadius) * 0.5);
updateCover();
}
private function removedFromStage(_arg1:Event){
}
public function get coverXRadius():Number{
return (_coverXRadius);
}
public function set coverXRadius(_arg1:Number){
_coverXRadius = (isNaN(_arg1)) ? 0 : _arg1;
_coverRadius = ((_coverXRadius + _coverYRadius) * 0.5);
updateCover();
}
public function get coverX():Number{
return (_coverX);
}
public function get coverY():Number{
return (_coverY);
}
public function get darkDistance():Number{
return (_darkDistance);
}
public function get darkAlpha():Number{
return (_darkAlpha);
}
public function set multiplier(_arg1:Number){
_multiplier = (isNaN(_arg1)) ? 0 : _arg1;
}
public function set baseRadius(_arg1:Number){
_baseXRadius = (_baseYRadius = (isNaN(_arg1)) ? 0 : _arg1);
updateBasePoints();
}
public function get darkColor():uint{
return (_darkColor);
}
public function set lineColor(_arg1:uint){
_lineColor = _arg1;
}
public function set blobXRadius(_arg1:Number){
_blobXRadius = (isNaN(_arg1)) ? 0 : _arg1;
_blobRadius = ((_blobXRadius + _blobYRadius) * 0.5);
}
public function get darkRadius():Number{
return (_darkRadius);
}
public function get cover():Shape{
return (_cover);
}
public function get xValues():Array{
return (_x);
}
public function set lineThickness(_arg1:Number){
_lineThickness = ((((_arg1 < 0)) || (isNaN(_arg1)))) ? 0 : _arg1;
}
public function get multiplier():Number{
return (_multiplier);
}
public function get lineAlpha():Number{
return (_lineAlpha);
}
public function set lineAlpha(_arg1:Number){
_lineAlpha = ((((_arg1 < 0)) || (isNaN(_arg1)))) ? 0 : _arg1;
}
public function get lineColor():uint{
return (_lineColor);
}
public function set lightAlpha(_arg1:Number){
var _local2:Graphics;
_lightAlpha = _arg1;
_local2 = _light.graphics;
_local2.clear();
_local2.beginFill(_lightColor, _lightAlpha);
_local2.drawCircle(0, 0, 1);
_local2.endFill();
}
public function set darkFlatness(_arg1:Number){
_darkFlatness = (isNaN(_arg1)) ? 0 : _arg1;
updateDark();
}
private function updateLight(){
_light.x = ((_x[0] + (_x[1] * _deformFactor)) + (_lightCos * _lightDistance));
_light.y = ((_y[0] + (_y[1] * _deformFactor)) + (_lightSin * _lightDistance));
_light.scaleX = (_lightFlatness * _lightRadius);
_light.scaleY = _lightRadius;
_light.rotation = (_lightAngle * RAD_TO_DEG);
}
public function set baseEggFactor(_arg1:Number){
_baseEggFactor = (isNaN(_arg1)) ? 0 : _arg1;
updateBasePoints();
}
public function set lightColor(_arg1:uint){
var _local2:Graphics;
_lightColor = _arg1;
_local2 = _light.graphics;
_local2.clear();
_local2.beginFill(_lightColor, _lightAlpha);
_local2.drawCircle(0, 0, 1);
_local2.endFill();
}
public function get baseEggFactor():Number{
return (_baseEggFactor);
}
public function get lightAlpha():Number{
return (_lightAlpha);
}
public function get lightColor():uint{
return (_lightColor);
}
public function get destX():Number{
return (_destX);
}
public function get bounceFactor():Number{
return (_bounceFactor);
}
public static function pointWithinEllipse(_arg1:Point, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Boolean{
var _local7:Point;
var _local8:Point;
var _local9:Number;
var _local10:Number;
_local7 = new Point((_arg1.x - _arg2), (_arg1.y - _arg3));
_local8 = rotate(_arg6, _local7);
_local9 = (_arg4 / _arg5);
_local8.x = (_local8.x * _local9);
_local10 = Math.sqrt(((_local8.x * _local8.x) + (_local8.y * _local8.y)));
if (_local10 <= _arg4){
return (true);
};
return (false);
}
public static function mapPointsToEllipse(_arg1:Array, _arg2:int, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8, _arg9:Number):Array{
var _local10:Number;
var _local11:Number;
var _local12:int;
var _local13:Point;
var _local14:Point;
if (!_arg1){
_arg1 = [];
};
_local10 = (_arg4 / _arg2);
_local11 = _arg3;
_local12 = 0;
while (_local12 < _arg2) {
_local14 = getEllipsePointFromAngle(_local11, _arg7, _arg8, _arg9);
_local14 = rotate(_arg9, _local14);
_local13 = _arg1[_local12];
if (_local13){
_local13.x = (_arg5 + _local14.x);
_local13.y = (_arg6 + _local14.y);
} else {
_arg1[_local12] = new Point((_arg5 + _local14.x), (_arg6 + _local14.y));
};
_local11 = (_local11 + _local10);
_local12++;
};
return (_arg1);
}
public static function rotate(_arg1:Number, _arg2:Point, _arg3:Point=null){
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (!_arg3){
_arg3 = new Point();
};
_local4 = (_arg2.x - _arg3.x);
_local5 = (_arg2.y - _arg3.y);
_local6 = Math.cos(_arg1);
_local7 = Math.sin(_arg1);
return (new Point(((_arg3.x + (_local4 * _local6)) - (_local5 * _local7)), ((_arg3.y + (_local4 * _local7)) + (_local5 * _local6))));
}
public static function joinEllipses(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:int, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:int):Array{
var _local13:Point;
var _local14:Number;
var _local15:Number;
var _local16:Point;
var _local17:Point;
var _local18:Array;
var _local19:Array;
_local13 = Point.interpolate(new Point(_arg1, _arg2), new Point(_arg7, _arg8), 0.5);
_local14 = ((((_arg3 + _arg9) + _arg4) + _arg10) * 0.25);
_local15 = (Math.atan2((_arg8 - _arg2), (_arg7 - _arg1)) - (Math.PI * 0.5));
_local16 = new Point((_local13.x + (Math.cos(_local15) * _local14)), (_local13.y + (Math.sin(_local15) * _local14)));
_local17 = new Point((_local13.x - (Math.cos(_local15) * _local14)), (_local13.y - (Math.sin(_local15) * _local14)));
_local18 = mapPointsToEllipse(null, _arg6, (_local15 + Math.PI), Math.PI, _arg1, _arg2, _arg3, _arg4, _arg5);
_local19 = mapPointsToEllipse(null, _arg12, _local15, Math.PI, _arg7, _arg8, _arg9, _arg10, _arg11);
if (((((((pointWithinEllipse(_local16, _arg1, _arg2, _arg3, _arg4, _arg5)) || (pointWithinEllipse(_local17, _arg1, _arg2, _arg3, _arg4, _arg5)))) || (pointWithinEllipse(_local16, _arg7, _arg8, _arg9, _arg10, _arg11)))) || (pointWithinEllipse(_local17, _arg7, _arg8, _arg9, _arg10, _arg11)))){
return (Geometry.getOuterPoints(_local18.concat(_local19)));
};
_local18[_local18.length] = _local16;
_local19[_local19.length] = _local17;
_local19[_local19.length] = _local18[0];
return (_local18.concat(_local19));
}
public static function getEllipsePointFromAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Point{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local5 = (_arg2 * _arg2);
_local6 = (_arg3 * _arg3);
_arg1 = (_arg1 - _arg4);
_local7 = Math.tan(_arg1);
_local8 = (Math.tan(_arg1) * _local7);
_local9 = (_arg2 * _arg3);
_local10 = (1 / Math.sqrt((_local6 + (_local5 * _local8))));
_local11 = (_local9 * _local10);
_local12 = ((_local9 * _local7) * _local10);
if (Math.cos(_arg1) >= 0){
return (new Point(_local11, _local12));
};
return (new Point(-(_local11), -(_local12)));
}
public static function intersectEllipses(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:int=100):Array{
var _local12:Array;
var _local13:Array;
var _local14:Array;
_local12 = mapPointsToEllipse(null, _arg11, 0, (Math.PI * 2), _arg1, _arg2, _arg3, _arg4, _arg5);
_local13 = mapPointsToEllipse(null, _arg11, 0, (Math.PI * 2), _arg6, _arg7, _arg8, _arg9, _arg10);
_local14 = Geometry.intersectPolygons(_local12, _local13);
return (_local14);
}
}
}//package as3
Section 6
//SoftBlobContainer (as3.SoftBlobContainer)
package as3 {
import flash.geom.*;
import flash.utils.*;
public class SoftBlobContainer {
private var _interactions:Dictionary;
public function SoftBlobContainer(){
trace("FUTURE: Account for SoftBlob transformation when applying push and flatten.");
_interactions = new Dictionary();
}
public function setFlattenFactors(_arg1:SoftBlob, _arg2:SoftBlob, _arg3:Number, _arg4:Number){
var _local5:Dictionary;
var _local6:Object;
_local5 = _interactions[_arg1];
if (_local5){
_local6 = _local5[_arg2];
if (_local6){
_local6.flattenFactor1 = _arg3;
_local6.flattenFactor2 = _arg4;
};
} else {
_local5 = _interactions[_arg2];
if (_local5){
_local6 = _local5[_arg1];
if (_local6){
_local6.flattenFactor1 = _arg4;
_local6.flattenFactor2 = _arg3;
};
};
};
}
public function setPushFactors(_arg1:SoftBlob, _arg2:SoftBlob, _arg3:Number, _arg4:Number){
var _local5:Dictionary;
var _local6:Object;
_local5 = _interactions[_arg1];
if (_local5){
_local6 = _local5[_arg2];
if (_local6){
_local6.pushFactor1 = _arg3;
_local6.pushFactor2 = _arg4;
};
} else {
_local5 = _interactions[_arg2];
if (_local5){
_local6 = _local5[_arg1];
if (_local6){
_local6.pushFactor1 = _arg4;
_local6.pushFactor2 = _arg3;
};
};
};
}
public function update(){
var _local1:Dictionary;
var _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:SoftBlob;
var _local9:SoftBlob;
var _local10:Matrix;
var _local11:Matrix;
var _local12:Matrix;
var _local13:Matrix;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Array;
var _local19:Array;
var _local20:Array;
var _local21:Object;
var _local22:Point;
var _local23:Point;
var _local24:Point;
var _local25:Point;
var _local26:Point;
var _local27:Point;
var _local28:Point;
var _local29:Point;
var _local30:Point;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Array;
var _local44:Array;
var _local45:Array;
var _local46:Array;
var _local47:Array;
var _local48:Array;
var _local49:Number;
var _local50:Number;
var _local51:Number;
var _local52:Number;
var _local53:Number;
var _local54:Number;
_local18 = [];
_local19 = [];
for (_local3 in _interactions) {
_local8 = (_local3 as SoftBlob);
if (!_local8){
throw (("Expected SoftBlob, found " + _local3.constructor));
};
_local43 = _local8.xValues;
_local45 = _local8.yValues;
_local27 = _local8.localToGlobal(new Point(_local43[0], _local45[0]));
_local47 = _local8.points;
_local10 = _local8.transform.concatenatedMatrix;
_local1 = _interactions[_local3];
for (_local4 in _local1) {
_local9 = (_local4 as SoftBlob);
if (!_local9){
throw (("Expected SoftBlob, found " + _local3.constructor));
};
_local44 = _local9.xValues;
_local46 = _local9.yValues;
_local28 = _local9.localToGlobal(new Point(_local44[0], _local46[0]));
_local48 = _local9.points;
_local11 = _local9.transform.concatenatedMatrix;
_local13 = _local10.clone();
_local13.invert();
_local12 = _local11.clone();
_local12.concat(_local13);
_local13 = _local12.clone();
_local13.invert();
_local2 = _local1[_local4];
_local15 = _local2.pushFactor1;
_local17 = _local2.pushFactor2;
_local14 = _local2.flattenFactor1;
_local16 = _local2.flattenFactor2;
_local18.length = (_local19.length = 0);
_local7 = _local8.numBlobPoints;
_local5 = 0;
while (_local5 < _local7) {
_local18[_local5] = _local8.localToGlobal(_local47[_local5]);
_local5++;
};
_local7 = _local9.numBlobPoints;
_local5 = 0;
while (_local5 < _local7) {
_local19[_local5] = _local9.localToGlobal(_local48[_local5]);
_local5++;
};
_local20 = Geometry.intersectPolygons(_local18, _local19);
_local7 = _local20.length;
if (_local20.length < 2){
} else {
_local23 = null;
_local22 = _local23;
_local32 = -1;
_local31 = _local32;
_local34 = (_local28.x - _local27.x);
_local35 = (_local28.y - _local27.y);
_local36 = Math.atan2(_local35, _local34);
_local37 = Math.sqrt(((_local34 * _local34) + (_local35 * _local35)));
_local40 = (_local27.x + _local37);
_local49 = ((((_local8.blobRadius * (_local10.a + _local10.d)) * 0.5) + ((_local9.blobRadius * (_local11.a + _local11.d)) * 0.5)) - _local37);
_local38 = (Math.sin(_local36) * _local49);
_local39 = (Math.cos(_local36) * _local49);
if (_local15){
_local8.offsetX = (_local8.offsetX + (((-(_local39) * _local15) - _local8.offsetX) * _local8.pushFactor));
_local8.offsetY = (_local8.offsetY + (((-(_local38) * _local15) - _local8.offsetY) * _local8.pushFactor));
};
if (_local17){
_local9.offsetX = (_local9.offsetX + (((_local39 * _local17) - _local9.offsetX) * _local9.pushFactor));
_local9.offsetY = (_local9.offsetY + (((_local38 * _local17) - _local9.offsetY) * _local9.pushFactor));
};
_local5 = 0;
while (_local5 < _local7) {
_local29 = SoftBlob.rotate(-(_local36), _local20[_local5], _local27);
_local33 = Math.abs((_local29.x - _local40));
if ((((_local33 < _local31)) || (!(_local22)))){
_local32 = _local31;
_local23 = _local22;
_local31 = _local33;
_local22 = _local20[_local5];
} else {
if ((((_local33 < _local32)) || (!(_local23)))){
_local32 = _local33;
_local23 = _local20[_local5];
};
};
_local5++;
};
_local25 = _local8.globalToLocal(_local22);
_local26 = _local8.globalToLocal(_local23);
_local7 = _local8.numBlobPoints;
_local41 = (_local25.x - _local26.x);
_local42 = (_local25.y - _local26.y);
if (Math.abs(_local41) > Math.abs(_local42)){
_local50 = (_local42 / _local41);
_local51 = -1;
_local52 = (_local25.y - (_local50 * _local25.x));
} else {
_local50 = -1;
_local51 = (_local41 / _local42);
_local52 = (_local25.x - (_local51 * _local25.y));
};
_local54 = (((_local50 * _local43[0]) + (_local51 * _local45[0])) + _local52);
if (((!((_local26.x == _local25.x))) || (!((_local26.y == _local25.y))))){
_local5 = 0;
while (_local5 < _local7) {
_local24 = _local47[_local5];
_local21 = Geometry.projectPointOnLine(_local24.x, _local24.y, _local25.x, _local25.y, _local26.x, _local26.y);
_local29 = new Point(_local21.x, _local21.y);
_local53 = (((_local50 * _local24.x) + (_local51 * _local24.y)) + _local52);
if ((_local53 * _local54) < 0){
_local30 = Point.interpolate(_local24, _local29, (1 - _local14));
_local24.x = _local30.x;
_local24.y = _local30.y;
};
_local5++;
};
};
_local25 = _local9.globalToLocal(_local22);
_local26 = _local9.globalToLocal(_local23);
_local7 = _local9.numBlobPoints;
_local41 = (_local25.x - _local26.x);
_local42 = (_local25.y - _local26.y);
if (Math.abs(_local41) > Math.abs(_local42)){
_local50 = (_local42 / _local41);
_local51 = -1;
_local52 = (_local25.y - (_local50 * _local25.x));
} else {
_local50 = -1;
_local51 = (_local41 / _local42);
_local52 = (_local25.x - (_local51 * _local25.y));
};
_local54 = (((_local50 * _local44[0]) + (_local51 * _local46[0])) + _local52);
if (((!((_local26.x == _local25.x))) || (!((_local26.y == _local25.y))))){
_local5 = 0;
while (_local5 < _local7) {
_local24 = _local48[_local5];
_local21 = Geometry.projectPointOnLine(_local24.x, _local24.y, _local25.x, _local25.y, _local26.x, _local26.y);
_local29 = new Point(_local21.x, _local21.y);
_local53 = (((_local50 * _local24.x) + (_local51 * _local24.y)) + _local52);
if ((_local53 * _local54) < 0){
_local30 = Point.interpolate(_local24, _local29, (1 - _local16));
_local24.x = _local30.x;
_local24.y = _local30.y;
};
_local5++;
};
};
};
};
};
}
public function setPushFactor(_arg1:SoftBlob, _arg2:SoftBlob, _arg3:Number){
var _local4:Dictionary;
var _local5:Object;
_local4 = _interactions[_arg1];
if (_local4){
_local5 = _local4[_arg2];
if (_local5){
_local5.pushFactor1 = _arg3;
};
} else {
_local4 = _interactions[_arg2];
if (_local4){
_local5 = _local4[_arg1];
if (_local5){
_local5.pushFactor2 = _arg3;
};
};
};
}
public function removeBlobInteraction(_arg1:SoftBlob, _arg2:SoftBlob){
var _local3:Object;
var _local4:Object;
var _local5:Dictionary;
var _local6:Object;
var _local7:Boolean;
_local7 = true;
_local5 = _interactions[_arg1];
if (_local5){
delete _local5[_arg2];
for (_local3 in _local5) {
_local7 = false;
break;
};
if (_local7){
delete _interactions[_arg1];
};
} else {
_local5 = _interactions[_arg2];
if (_local5){
delete _local5[_arg1];
for (_local3 in _local5) {
_local7 = false;
break;
};
if (_local7){
delete _interactions[_arg2];
};
};
};
}
public function addBlobInteraction(_arg1:SoftBlob, _arg2:Number, _arg3:Number, _arg4:SoftBlob, _arg5:Number, _arg6:Number){
var _local7:Dictionary;
var _local8:Object;
var _local9:SoftBlob;
if (_arg1 == _arg4){
return;
};
_local7 = _interactions[_arg1];
if (!_local7){
_local7 = _interactions[_arg4];
if (!_local7){
_local7 = (_interactions[_arg1] = new Dictionary());
_local9 = _arg4;
} else {
_local7 = _interactions[_arg4];
_local9 = _arg1;
};
} else {
_local7 = _interactions[_arg1];
_local9 = _arg4;
};
if (!_local7[_local9]){
_local8 = new Object();
_local7[_local9] = _local8;
} else {
_local8 = _local7[_local9];
};
if (_local9 == _arg4){
_local8["flattenFactor1"] = _arg2;
_local8["flattenFactor2"] = _arg5;
_local8["pushFactor1"] = _arg3;
_local8["pushFactor2"] = _arg6;
} else {
_local8["flattenFactor1"] = _arg5;
_local8["flattenFactor2"] = _arg2;
_local8["pushFactor1"] = _arg6;
_local8["pushFactor2"] = _arg3;
};
}
public function getFlattenFactors(_arg1:SoftBlob, _arg2:SoftBlob):Array{
var _local3:Dictionary;
var _local4:Object;
_local3 = _interactions[_arg1];
if (_local3){
_local4 = _local3[_arg2];
if (_local4){
return ([_local4.flattenFactor1, _local4.flattenFactor2]);
};
} else {
_local3 = _interactions[_arg2];
if (_local3){
_local4 = _local3[_arg1];
if (_local4){
return ([_local4.flattenFactor2, _local4.flattenFactor1]);
};
};
};
return ([]);
}
public function setFlattenFactor(_arg1:SoftBlob, _arg2:SoftBlob, _arg3:Number){
var _local4:Dictionary;
var _local5:Object;
_local4 = _interactions[_arg1];
if (_local4){
_local5 = _local4[_arg2];
if (_local5){
_local5.flattenFactor1 = _arg3;
};
} else {
_local4 = _interactions[_arg2];
if (_local4){
_local5 = _local4[_arg1];
if (_local5){
_local5.flattenFactor2 = _arg3;
};
};
};
}
public function get setBlobInteraction():Function{
return (addBlobInteraction);
}
public function getPushFactors(_arg1:SoftBlob, _arg2:SoftBlob):Array{
var _local3:Dictionary;
var _local4:Object;
_local3 = _interactions[_arg1];
if (_local3){
_local4 = _local3[_arg2];
if (_local4){
return ([_local4.pushFactor1, _local4.pushFactor2]);
};
} else {
_local3 = _interactions[_arg2];
if (_local3){
_local4 = _local3[_arg1];
if (_local4){
return ([_local4.pushFactor2, _local4.pushFactor1]);
};
};
};
return ([]);
}
public function getFlattenFactor(_arg1:SoftBlob, _arg2:SoftBlob):Number{
var _local3:Dictionary;
var _local4:Object;
_local3 = _interactions[_arg1];
if (_local3){
_local4 = _local3[_arg2];
if (_local4){
return (_local4.flattenFactor1);
};
} else {
_local3 = _interactions[_arg2];
if (_local3){
_local4 = _local3[_arg1];
if (_local4){
return (_local4.flattenFactor2);
};
};
};
return (NaN);
}
public function getPushFactor(_arg1:SoftBlob, _arg2:SoftBlob):Number{
var _local3:Dictionary;
var _local4:Object;
_local3 = _interactions[_arg1];
if (_local3){
_local4 = _local3[_arg2];
if (_local4){
return (_local4.pushFactor1);
};
} else {
_local3 = _interactions[_arg2];
if (_local3){
_local4 = _local3[_arg1];
if (_local4){
return (_local4.pushFactor2);
};
};
};
return (NaN);
}
}
}//package as3
Section 7
//breast1_23 (cuteExpansion_fla.breast1_23)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class breast1_23 extends MovieClip {
public var center:MovieClip;
public var circle:MovieClip;
}
}//package cuteExpansion_fla
Section 8
//breast2_20 (cuteExpansion_fla.breast2_20)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class breast2_20 extends MovieClip {
public var center:MovieClip;
public var circle:MovieClip;
}
}//package cuteExpansion_fla
Section 9
//clothes_18 (cuteExpansion_fla.clothes_18)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class clothes_18 extends MovieClip {
public var a6:MovieClip;
public var a4:MovieClip;
public var a5:MovieClip;
public var c1:MovieClip;
public var c3:MovieClip;
public var c4:MovieClip;
public var c5:MovieClip;
public var c6:MovieClip;
public var c2:MovieClip;
public var a2:MovieClip;
public var a3:MovieClip;
public var a1:MovieClip;
}
}//package cuteExpansion_fla
Section 10
//eye1_28 (cuteExpansion_fla.eye1_28)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class eye1_28 extends MovieClip {
public var iris:MovieClip;
public function eye1_28(){
addFrameScript(1, frame2, 3, frame4, 5, frame6, 7, frame8, 9, frame10, 12, frame13, 14, frame15, 16, frame17, 18, frame19, 20, frame21, 27, frame28);
}
function frame10(){
this.gotoAndPlay(this.currentLabel);
}
function frame6(){
this.gotoAndPlay(this.currentLabel);
}
function frame8(){
this.gotoAndPlay(this.currentLabel);
}
function frame19(){
this.gotoAndPlay(this.currentLabel);
}
function frame13(){
this.gotoAndPlay(this.currentLabel);
}
function frame17(){
this.gotoAndPlay(this.currentLabel);
}
function frame4(){
this.gotoAndPlay(this.currentLabel);
}
function frame21(){
this.gotoAndPlay(this.currentLabel);
}
function frame2(){
this.gotoAndPlay(this.currentLabel);
}
function frame15(){
this.gotoAndPlay(this.currentLabel);
}
function frame28(){
this.gotoAndPlay(this.currentLabel);
}
}
}//package cuteExpansion_fla
Section 11
//eye2_31 (cuteExpansion_fla.eye2_31)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class eye2_31 extends MovieClip {
public var iris:MovieClip;
public function eye2_31(){
addFrameScript(1, frame2, 3, frame4, 5, frame6, 7, frame8, 9, frame10, 12, frame13, 14, frame15, 16, frame17, 18, frame19, 20, frame21, 27, frame28);
}
function frame10(){
this.gotoAndPlay(this.currentLabel);
}
function frame6(){
this.gotoAndPlay(this.currentLabel);
}
function frame8(){
this.gotoAndPlay(this.currentLabel);
}
function frame19(){
this.gotoAndPlay(this.currentLabel);
}
function frame13(){
this.gotoAndPlay(this.currentLabel);
}
function frame17(){
this.gotoAndPlay(this.currentLabel);
}
function frame4(){
this.gotoAndPlay(this.currentLabel);
}
function frame21(){
this.gotoAndPlay(this.currentLabel);
}
function frame2(){
this.gotoAndPlay(this.currentLabel);
}
function frame15(){
this.gotoAndPlay(this.currentLabel);
}
function frame28(){
this.gotoAndPlay(this.currentLabel);
}
}
}//package cuteExpansion_fla
Section 12
//head_25 (cuteExpansion_fla.head_25)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class head_25 extends MovieClip {
public var mouth_fur:MovieClip;
public var eye2:MovieClip;
public var diamond:MovieClip;
public var face:MovieClip;
public var eye1:MovieClip;
public var hair2:MovieClip;
public var hair1:MovieClip;
public var ear1:MovieClip;
public var ear2:MovieClip;
public var mouth:MovieClip;
public var nose:MovieClip;
}
}//package cuteExpansion_fla
Section 13
//iris_29 (cuteExpansion_fla.iris_29)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class iris_29 extends MovieClip {
public var pupil:MovieClip;
}
}//package cuteExpansion_fla
Section 14
//machine_40 (cuteExpansion_fla.machine_40)
package cuteExpansion_fla {
import flash.display.*;
import flash.text.*;
public dynamic class machine_40 extends MovieClip {
public var _green:MovieClip;
public var _l1:MovieClip;
public var _light:MovieClip;
public var _right:MovieClip;
public var _clip:MovieClip;
public var _blue:MovieClip;
public var _center:MovieClip;
public var _down:MovieClip;
public var _yellow:MovieClip;
public var _up:MovieClip;
public var _blue_slider:MovieClip;
public var _b2:MovieClip;
public var _b3:MovieClip;
public var _txt:TextField;
public var _b1:MovieClip;
public var _white_slider:MovieClip;
public var _b4:MovieClip;
public var _red:MovieClip;
public var _l2:MovieClip;
public var _left:MovieClip;
public var _l3:MovieClip;
public var _l4:MovieClip;
public var _red_slider:MovieClip;
}
}//package cuteExpansion_fla
Section 15
//MainTimeline (cuteExpansion_fla.MainTimeline)
package cuteExpansion_fla {
import as3.*;
import flash.display.*;
import flash.geom.*;
import fl.motion.*;
import flash.events.*;
import expansion.*;
import flash.text.*;
import flash.utils.*;
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.xml.*;
public dynamic class MainTimeline extends MovieClip {
public const MAX_KICK_LIFE:int = 30;
public const B2_B1_PUSH_LIM:int = 13;
public const B_CENTER_OFFSETX_FACTOR_LIM:int = 19;
public const GLOW_COLORS:Array;
public const CLOTHES_COLOR:uint = 16751001;
public const INV_BREAST_SCALE:Number = 2;
public const TOP_LENGTH1_2:Number = 150;
public const TOP_LENGTH1_4:Number = 75;
public const SLIDER_Y:Number = 35;
public const MIN_HEAD_XSCALE:Number = 0.9;
public const BREAST2_POS:int = 1;
public const MAX_Z_ANGLE:Number = 15;
public const KICK_RADIUS_RANGE:Number = 0.22;
public const RED_SLIDER_X:Number = -36;
public const MAX_TOP_OFFSET:Number = 50;
public const INV_TOP_SPRING_MULTIPLIER:Number = 0.1;
public const B2_CENTERY_LIM:int = 7;
public const B_CENTER_SCALE_LIM:int = 16;
public const SLIDER_WIDTH:Number = 8;
public const MAX_CLOTHES_SIZE:Number = 0.1;
public const TOP_SPRING_FORCE:Number = 0.8;
public const MIN_H_ANGLE:Number = -0.125663706143592;
public const MAX_KICK_MOVE:Number = 0.2;
public const BREAST1_POS:int = 0;
public const B_FLATTEN_LIM:int = 17;
public const GLOW_LIGHTS:Array;
public const MIN_HEAD_YSCALE:Number = 0.5;
public const TOP_LENGTH1_4_SQUARE:Number = 5625;
public const B2_CIRCLEY_LIM:int = 5;
public const MACHINE_SCREEN_WIDTH:Number = 196;
public const TOP_LENGTH:Number = 300;
public const B2_CENTERX_LIM:int = 6;
public const KICK_HEIGHT_RANGE:Number = 0.75;
public const CIRCLE_SCALEY_LIM:int = 9;
public const B2_B1_FLATTEN_LIM:int = 12;
public const EXPANSION_SCALE:Number = 0.005;
public const B_CENTER_OFFSETY_FACTOR_LIM:int = 20;
public const B2_CIRCLEX_LIM:int = 4;
public const KICK_LIFE_RANGE:int = 20;
public const TOP_SPRING_FRICTION:Number = 0.15;
public const CIRCLE_SCALEX_LIM:int = 8;
public const B_CENTERY_LIM:int = 15;
public const GLOW_LENGTH:int;
public const MAX_H_ANGLE:Number = 0.125663706143592;
public const MACHINE_CORNER_X:Number = -110;
public const MACHINE_CORNER_Y:Number = -175;
public const BELLYWHITE_POS:int = 3;
public const MAX_KICK_DISTANCE:Number = 0.7;
public const B1_B2_FLATTEN_LIM:int = 10;
public const MIN_KICK_RADIUS:Number = 0.03;
public const BELLY_POS:int = 2;
public const MAX_KICK_RADIUS:Number = 0.25;
public const B1_CENTERY_LIM:int = 3;
public const SLIDER_HEIGHT:Number = 80;
public const B_CENTERX_LIM:int = 14;
public const MACHINE_SCREEN_X:Number = -97.6;
public const MACHINE_SCREEN_Y:Number = -165.1;
public const MIN_HAIR1_XSCALE:Number = 0.75;
public const MOUTH_MAX_YSCALE:Number;
public const INV_SLIDER_HEIGHT:Number = 0.0125;
public const MACHINE_SCREEN_HEIGHT:Number = 128;
public const MIN_V_ANGLE:Number = -0.219911485751286;
public const RINA_GLOW:Number = 4;
public const TOP_SPRING_MULTIPLIER:Number = 0.9;
public const B1_CIRCLEY_LIM:int = 1;
public const MIN_KICK_HEIGHT:Number = 0.25;
public const BREAST_SCALE:Number = 0.5;
public const B1_CENTERX_LIM:int = 2;
public const MAX_KICK_HEIGHT:Number = 1;
public const BLUE_SLIDER_X:Number = -83;
public const B1_B2_PUSH_LIM:int = 11;
public const MIN_HAIR1_YSCALE:Number = 0.75;
public const B1_CIRCLEX_LIM:int = 0;
public const MOUTH_START_YANGLE:Number = 0.471238898038469;
public const MIN_MOUTH_FUR_XSCALE:Number = 0.65;
public const B_PUSH_LIM:int = 18;
public const MIN_HAIR2_XSCALE:Number = 0.75;
public const MOUTH_FRAMES:int = 18;
public const MIN_Z_ANGLE:Number = -15;
public const MAX_V_ANGLE:Number = 0.314159265358979;
public const MIN_KICK_LIFE:int = 10;
public const INV_MAX_CLOTHES_SIZE:Number = 10;
public const MIN_MOUTH_FUR_YSCALE:Number = 0.25;
public const MIN_HAIR2_YSCALE:Number = 0.5;
public const WHITE_SLIDER_X:Number;
public var TOP_RIGHT2:int;
public var TOP_RIGHT3:int;
public var kickLightMC:Sprite;
public var BED_Y:Number;
public var DIAMOND_X:Number;
public var DIAMOND_Y:Number;
public var DIAMOND_Z:Number;
public var SCREEN_DRAG_ENABLED:Boolean;
public var breathHistory:Array;
public var limits:Array;
public var EYE1_X:Number;
public var EYE1_Y:Number;
public var EYE1_Z:Number;
public var TOP_LEFT_POINTS:Array;
public var DEST_BED_Y:Number;
public var OLD_X:Number;
public var HEAD_V_ANGLE:Number;
public var MIN_HAIR3_XSCALE:Number;
public var OLD_Y:Number;
public var screen1Text:TextField;
public var HAIR3_POINT:Point;
public var INFINITE_EXPANSION:Boolean;
public var CONTROL1X:Number;
public var CONTROL1Y:Number;
public var machine:MovieClip;
public var b2Limits:Array;
public var DEST_BED_X:Number;
public var rinaNoiseID:int;
public var HAIR3_YDIST:Number;
public var clothes:MovieClip;
public var screenMode:int;
public var CONTROL2X:Number;
public var CONTROL2Y:Number;
public var HAIR2_X:Number;
public var HAIR2_Y:Number;
public var HAIR2_Z:Number;
public var breastGrowth:Number;
public var blobs:Array;
public var BREAST_DETAIL:int;
public var container:SoftBlobContainer;
public var b2Center:MovieClip;
public var NAOMI_BED_Y:Number;
public var EAR2_X:Number;
public var EAR2_Y:Number;
public var EAR2_Z:Number;
public var historyLength:int;
public var HEAD_Z_SPEED:Number;
public var HEAD_DIST:Number;
public var HAIR1_X:Number;
public var HAIR1_Y:Number;
public var NAOMI_BED_X:Number;
public var bWLimits:Array;
public var HAIR1_Z:Number;
public var b2Template:MovieClip;
public var breast2Glow:Shape;
public var rinaPerlinCTrans:ColorTransform;
public var MAX_BELLY_SIZE:Number;
public var bedHistoryPos:int;
public var MIN_HAIR3_YSCALE:Number;
public var HAIR3_XDIST:Number;
public var BREAST_COLOR:uint;
public var EAR1_Y:Number;
public var EAR1_X:Number;
public var DEST_NAOMI_Y:Number;
public var EAR1_Z:Number;
public var expandPhrases:Array;
public var speech:Speech;
public var bedHistory:Array;
public var bellySize:Number;
public var breatheOffset:Number;
public var b2Circle:MovieClip;
public var BELLY_DETAIL:int;
public var b1Limits:Array;
public var RINA_DISPLAYED:Boolean;
public var __A_NOTE:String;
public var DEST_NAOMI_X:Number;
public var rinaBmpD:BitmapData;
public var machineScreenMask:Shape;
public var curPhrase:int;
public var R_MOUTH_ID:int;
public var kickObject:Object;
public var HEAD_Z_ANGLE:Number;
public var ORIG_ENVIRON_X:Number;
public var ORIG_ENVIRON_Y:Number;
public var breast1Glow:Shape;
public var bellyGrowth:Number;
public var rinaPerlinY:Number;
public var b1Center:MovieClip;
public var whiteControl:Boolean;
public var breastHistoryPos:int;
public var top:MovieClip;
public var kicked:Boolean;
public var kickDarkMC:Sprite;
public var NAOMI_X:Number;
public var historyInterval:Number;
public var TOP_LEFT2:int;
public var breast2:SoftBlob;
public var TOP_LEFT3:int;
public var breast1:SoftBlob;
public var TOP_LEFT1:int;
public var EYE1_ID:int;
public var bellyHistoryPos:int;
public var NAOMI_Y:Number;
public var CONTROL_CENTERX:Number;
public var _bHist:int;
public var breathHistoryPos:int;
public var PUPIL_Z:Number;
public var ENVIRON_Y:Number;
public var b1Template:MovieClip;
public var ENVIRON_X:Number;
public var HEAD_X:Number;
public var HEAD_Y:Number;
public var HEAD_Z:Number;
public var nTmp:Array;
public var b1Circle:MovieClip;
public var CONTROL_CENTERY_OFFSET:Number;
public var bedReaction:int;
public var bedHistoryLength:Number;
public var glowPosition:Number;
public var P2CX:Number;
public var EYE2_ID:int;
public var CLOTHES_INDEX:int;
public var P2CY:Number;
public var CONTROL_CENTERY:Number;
public var bellyWhite:SoftBlob;
public var breastSize:Number;
public var invMaxHistoryHeight:Number;
public var ORIG_ENVIRON_SCALE:Number;
public var expRina:Expression;
public var speech_mc:MovieClip;
public var P1CX:Number;
public var P1CY:Number;
public var HEAD_H_SPEED:Number;
public var TOP_BROKEN:Boolean;
public var rubPhrase:Boolean;
public var rina:Rina;
public var MAX_BREAST_SIZE:Number;
public var _nC:MovieClip;
public var PUPIL1_ID:int;
public var ATTACH_LIST:Array;
public var LIMITS_DETAIL:int;
public var lcd_stolen_bg:MovieClip;
public var kickLineMC:Sprite;
public var TOP_LEFT_SPRINGS:Array;
public var bellyGlow:Shape;
public var R_EYE1_ID:int;
public var CONTROLX_OFFSET:Number;
public var HEAD_H_ANGLE:Number;
public var bedPhrase:Boolean;
public var rinaMatrix:Matrix;
public var PUPIL2_ID:int;
public var BREAST_LIGHT:uint;
public var bounds:Rectangle;
public var p1X:Number;
public var p1Y:Number;
public var MOUTH_Y:Number;
public var MOUTH_Z:Number;
public var MOUTH_X:Number;
public var energy:Boolean;
public var p2X:Number;
public var p2Y:Number;
public var MOUTH_FUR_X:Number;
public var MOUTH_FUR_Y:Number;
public var MOUTH_FUR_Z:Number;
public var rinaCTrans:ColorTransform;
public var OLD_MX:Number;
public var OLD_MY:Number;
public var NOSE_X:Number;
public var NOSE_Y:Number;
public var NOSE_Z:Number;
public var modifier:int;
public var tempA:Array;
public var tempB:SoftBlob;
public var rinaVisible:Number;
public var rinaBmp:Bitmap;
public var rinaNoise:BitmapData;
public var bLimits:Array;
public var R_EYE2_ID:int;
public var rinaPerlin:BitmapData;
public var IRIS_Z:Number;
public var TOP_RIGHT_SPRINGS:Array;
public var rinaNoiseCTrans:ColorTransform;
public var I2CY:Number;
public var I2CX:Number;
public var otherLimits:Array;
public var clothesPoints:Array;
public var TOP_RIGHT_POINTS:Array;
public var bCenter:MovieClip;
public var rTmp:Array;
public var machineScreenText:TextField;
public var rinaNoiseMatrix:Matrix;
public var mScreenTF:TextFormat;
public var bedClip:MovieClip;
public var I1CX:Number;
public var rinaBmpRect:Rectangle;
public var I1CY:Number;
public var breastHistory:Array;
public var CONTROLY_OFFSET:Number;
public var HAIR3_DOWN:Number;
public var machineScreen:MovieClip;
public var maxSize:Number;
public var MOUTH_FUR_DIST:Number;
public var BREAST_SHADE:uint;
public var anglePerVY:Number;
public var sliderX:Number;
public var HEAD_V_SPEED:Number;
public var expNaomi:Expression;
public var mTF:TextFormat;
public var selectedMachineButton:MovieClip;
public var zAnglePerVX:Number;
public var lcd_stolen_item:MovieClip;
public var MOUTH_ID:int;
public var naomi:MovieClip;
public var OLD_BED_X:Number;
public var OLD_BED_Y:Number;
public var anglePerVX:Number;
public var TOP_SPRINGS_GENERATED:Boolean;
public var INIT_BREAST_RADIUS:Number;
public var belly:SoftBlob;
public var maxHistoryHeight:Number;
public var lcd_stolen:String;
public var EYE2_X:Number;
public var EYE2_Y:Number;
public var bellyHistory:Array;
public var EYE2_Z:Number;
public var ELASTIC_LIST:Array;
public var bedReactions:Array;
public var rinaHeight:int;
public var BED_X:Number;
public var TOP_RIGHT1:int;
public function MainTimeline(){
MOUTH_MAX_YSCALE = (1 / Math.cos(MOUTH_START_YANGLE));
GLOW_COLORS = [0xFF0000, 0xFFFF00, 0xFF00, 0xFFFF, 0xFF, 0xFF00FF, 0xFF0000];
GLOW_LIGHTS = [16764108, 16777164, 13434828, 13434879, 13421823, 16764159, 16764108];
GLOW_LENGTH = GLOW_COLORS.length;
WHITE_SLIDER_X = ((RED_SLIDER_X + BLUE_SLIDER_X) * 0.5);
super();
addFrameScript(0, frame1);
}
public function eFrame(_arg1:Event){
updatePosition();
updateExpansion();
updateBlobs();
updateHead();
updateKick();
updateClothes();
Physics.updateAttached(ATTACH_LIST);
updateExpression();
updateZoom();
machineUpdate();
}
public function dropScreen(_arg1:Event){
stage.removeEventListener(MouseEvent.MOUSE_MOVE, moveScreen, false);
stage.removeEventListener(MouseEvent.MOUSE_UP, dropScreen, false);
}
public function updateZoom(){
if (!rinaBmp.visible){
if ((machine._down.currentFrame - 1)){
naomi.scaleX = (naomi.scaleX - 0.02);
if (naomi.scaleX < 0.24){
naomi.scaleX = 0.24;
};
} else {
if ((machine._up.currentFrame - 1)){
naomi.scaleX = (naomi.scaleX + 0.02);
if (naomi.scaleX > 1){
naomi.scaleX = 1;
};
};
};
naomi.scaleY = naomi.scaleX;
Algorithms.adjustScreen(naomi, naomi.background);
};
}
public function updateExpression(){
var _local1:Number;
breatheOffset = (breatheOffset + ((expNaomi.offset - breatheOffset) * 0.75));
_local1 = (((Math.sin(expNaomi.angle) * 0.5) + 0.5) * breatheOffset);
naomi.head.mouth.gotoAndStop(naomi.head.mouth.currentLabel);
naomi.head.mouth.gotoAndStop((naomi.head.mouth.currentFrame + int((_local1 * MOUTH_FRAMES))));
breast1.y = (breast1.y - (_local1 * 10));
breast2.y = (breast2.y - (_local1 * 10));
breast1.x = (breast1.x - (_local1 * 2));
breast2.x = (breast2.x + (_local1 * 2));
HEAD_V_ANGLE = ((_local1 * -0.2) * MAX_V_ANGLE);
}
public function generateTopSprings(){
var _local1:Array;
var _local2:Array;
_local1 = TOP_LEFT_POINTS;
_local2 = TOP_LEFT_SPRINGS;
_local2.length = 0;
_local2[0] = createSpring(_local1, 0, 1);
_local2[1] = createSpring(_local1, 1, 2);
_local2[2] = createSpring(_local1, 2, 3);
_local2[3] = createSpring(_local1, 3, 4);
_local2[4] = createSpring(_local1, 4, 5);
_local2[5] = createSpring(_local1, 5, 6);
_local2[6] = createSpring(_local1, 6, 0);
_local2[7] = createSpring(_local1, 0, 2);
_local2[8] = createSpring(_local1, 2, 4);
_local2[9] = createSpring(_local1, 5, 0);
_local2[10] = createSpring(_local1, 0, 4);
_local2[11] = createSpring(_local1, 2, 5);
_local2[12] = createSpring(_local1, 3, 6);
_local2[13] = createSpring(_local1, 1, 4);
_local2[14] = createSpring(_local1, 1, 5);
_local2[15] = createSpring(_local1, 3, 5);
_local2[16] = createSpring(_local1, 4, 6);
_local1 = TOP_RIGHT_POINTS;
_local2 = TOP_RIGHT_SPRINGS;
_local2.length = 0;
_local2[0] = createSpring(_local1, 0, 1);
_local2[1] = createSpring(_local1, 1, 2);
_local2[2] = createSpring(_local1, 2, 3);
_local2[3] = createSpring(_local1, 3, 4);
_local2[4] = createSpring(_local1, 4, 5);
_local2[5] = createSpring(_local1, 5, 6);
_local2[6] = createSpring(_local1, 6, 0);
_local2[7] = createSpring(_local1, 0, 2);
_local2[8] = createSpring(_local1, 2, 4);
_local2[9] = createSpring(_local1, 5, 0);
_local2[10] = createSpring(_local1, 0, 4);
_local2[11] = createSpring(_local1, 2, 5);
_local2[12] = createSpring(_local1, 3, 6);
_local2[13] = createSpring(_local1, 1, 4);
_local2[14] = createSpring(_local1, 1, 5);
_local2[15] = createSpring(_local1, 3, 5);
_local2[16] = createSpring(_local1, 4, 6);
}
public function rotateHeadHorizontal(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Point;
var _local7:Point;
if (_arg1 > MAX_H_ANGLE){
_arg1 = MAX_H_ANGLE;
};
if (_arg1 < MIN_H_ANGLE){
_arg1 = MIN_H_ANGLE;
};
naomi.head.rotationY = _arg1;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
naomi.head.face.x = rotateHeadPart(HEAD_X, HEAD_Z, _arg1);
_local4 = (naomi.head.face.x - HEAD_X);
_local5 = 1.5;
naomi.head.nose.x = (_local4 + rotateHeadPart(NOSE_X, (NOSE_Z * _local5), _arg1));
naomi.head.eye1.x = (_local4 + rotateHeadPart(EYE1_X, (EYE1_Z * _local5), _arg1));
naomi.head.eye2.x = (_local4 + rotateHeadPart(EYE2_X, (EYE2_Z * _local5), _arg1));
naomi.head.ear1.x = (_local4 + rotateHeadPart(EAR1_X, (EAR1_Z * _local5), _arg1));
naomi.head.ear2.x = (_local4 + rotateHeadPart(EAR2_X, (EAR2_Z * _local5), _arg1));
naomi.head.hair1.x = (_local4 + rotateHeadPart(HAIR1_X, (HAIR1_Z * _local5), _arg1));
naomi.head.hair2.x = (_local4 + rotateHeadPart(HAIR2_X, HAIR2_Z, _arg1));
naomi.head.diamond.x = (_local4 + rotateHeadPart(DIAMOND_X, (DIAMOND_Z * _local5), _arg1));
naomi.head.mouth_fur.x = (_local4 + rotateHeadPart(MOUTH_FUR_X, MOUTH_FUR_Z, _arg1));
naomi.head.mouth.x = (_local4 + rotateHeadPart(MOUTH_X, (MOUTH_Z * _local5), _arg1));
naomi.head.eye1.scaleX = (naomi.head.eye2.scaleX = (naomi.head.ear1.scaleX = (naomi.head.ear2.scaleX = (naomi.head.diamond.scaleX = (naomi.head.mouth.scaleX = _local2)))));
naomi.head.mouth_fur.scaleX = (1 + ((MIN_MOUTH_FUR_XSCALE - 1) * Math.abs(_local3)));
naomi.head.hair1.scaleX = (1 + ((MIN_HAIR1_XSCALE - 1) * Math.abs(_local3)));
naomi.head.hair2.scaleX = (1 + ((MIN_HAIR2_XSCALE - 1) * Math.abs(_local3)));
naomi.head.face.scaleX = (1 + ((MIN_HEAD_XSCALE - 1) * Math.abs(_local3)));
_local6 = new Point(HAIR3_POINT.x, HAIR3_POINT.y);
new Point(HAIR3_POINT.x, HAIR3_POINT.y).x = (_local6.x - (_local3 * HAIR3_XDIST));
_local7 = naomi.globalToLocal(naomi.head.localToGlobal(_local6));
naomi.hair3.x = _local7.x;
naomi.hair3.scaleX = (1 + ((MIN_HAIR3_XSCALE - 1) * Math.abs(_local3)));
}
public function rotateHeadPart(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
var _local5:Number;
_local4 = Math.atan2(-(_arg2), _arg1);
_local5 = Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2)));
return ((Math.cos((_arg3 + _local4)) * _local5));
}
public function updateSize(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Array;
var _local10:Array;
var _local11:Array;
var _local12:Array;
var _local13:SoftBlob;
var _local14:SoftBlob;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local2 = 4;
_local3 = int(breastSize);
_local4 = _local3;
_local5 = int(bellySize);
_local6 = _local5;
_local9 = null;
_local10 = null;
_local11 = null;
_local12 = null;
_local13 = null;
_local14 = null;
if (_local3 < (otherLimits.length - 1)){
_local4++;
_local7 = (breastSize - _local3);
} else {
_local4 = (otherLimits.length - 1);
_local3 = (_local4 - 1);
if (_local3 < 0){
_local3 = 0;
};
_local7 = (breastSize - _local3);
};
if (_local5 < (otherLimits.length - 1)){
_local6++;
_local8 = (bellySize - _local5);
} else {
_local6 = (otherLimits.length - 1);
_local5 = (_local6 - 1);
if (_local5 < 0){
_local5 = 0;
};
_local8 = (bellySize - _local5);
};
_local9 = otherLimits[_local3];
_local10 = otherLimits[_local4];
_local11 = otherLimits[_local5];
_local12 = otherLimits[_local6];
breast1.interpolate(b1Limits[_local3], b1Limits[_local4], _local7);
breast2.interpolate(b2Limits[_local3], b2Limits[_local4], _local7);
belly.interpolate(bLimits[_local5], bLimits[_local6], _local8);
bellyWhite.interpolate(bWLimits[_local5], bWLimits[_local6], _local8);
breast1.attachItem(b1Circle, (_local9[B1_CIRCLEX_LIM] + ((_local10[B1_CIRCLEX_LIM] - _local9[B1_CIRCLEX_LIM]) * _local7)), (_local9[B1_CIRCLEY_LIM] + ((_local10[B1_CIRCLEY_LIM] - _local9[B1_CIRCLEY_LIM]) * _local7)), false);
breast1.attachItem(b1Center, (_local9[B1_CENTERX_LIM] + ((_local10[B1_CENTERX_LIM] - _local9[B1_CENTERX_LIM]) * _local7)), (_local9[B1_CENTERY_LIM] + ((_local10[B1_CENTERY_LIM] - _local9[B1_CENTERY_LIM]) * _local7)), false);
breast2.attachItem(b2Circle, (_local9[B2_CIRCLEX_LIM] + ((_local10[B2_CIRCLEX_LIM] - _local9[B2_CIRCLEX_LIM]) * _local7)), (_local9[B2_CIRCLEY_LIM] + ((_local10[B2_CIRCLEY_LIM] - _local9[B2_CIRCLEY_LIM]) * _local7)), false);
breast2.attachItem(b2Center, (_local9[B2_CENTERX_LIM] + ((_local10[B2_CENTERX_LIM] - _local9[B2_CENTERX_LIM]) * _local7)), (_local9[B2_CENTERY_LIM] + ((_local10[B2_CENTERY_LIM] - _local9[B2_CENTERY_LIM]) * _local7)), false);
if (_local8 < 1){
_local15 = (_local11[B_CENTER_OFFSETX_FACTOR_LIM] + ((_local12[B_CENTER_OFFSETX_FACTOR_LIM] - _local11[B_CENTER_OFFSETX_FACTOR_LIM]) * _local8));
_local16 = (_local11[B_CENTER_OFFSETY_FACTOR_LIM] + ((_local12[B_CENTER_OFFSETY_FACTOR_LIM] - _local11[B_CENTER_OFFSETY_FACTOR_LIM]) * _local8));
} else {
_local15 = _local12[B_CENTER_OFFSETX_FACTOR_LIM];
_local16 = _local12[B_CENTER_OFFSETY_FACTOR_LIM];
};
bellyWhite.attachItem(bCenter, ((_local11[B_CENTERX_LIM] + ((_local12[B_CENTERX_LIM] - _local11[B_CENTERX_LIM]) * _local8)) + (bellyWhite.xValues[0] * _local15)), ((_local11[B_CENTERY_LIM] + ((_local12[B_CENTERY_LIM] - _local11[B_CENTERY_LIM]) * _local8)) + (bellyWhite.yValues[0] * _local16)), false);
b1Circle.scaleX = (b2Circle.scaleX = (_local9[CIRCLE_SCALEX_LIM] + ((_local10[CIRCLE_SCALEX_LIM] - _local9[CIRCLE_SCALEX_LIM]) * _local7)));
b1Circle.scaleY = (b1Center.scaleX = (b1Center.scaleY = (b2Circle.scaleY = (b2Center.scaleX = (b2Center.scaleY = (_local9[CIRCLE_SCALEY_LIM] + ((_local10[CIRCLE_SCALEY_LIM] - _local9[CIRCLE_SCALEY_LIM]) * _local7)))))));
bCenter.scaleX = (bCenter.scaleY = (_local11[B_CENTER_SCALE_LIM] + ((_local12[B_CENTER_SCALE_LIM] - _local11[B_CENTER_SCALE_LIM]) * _local8)));
if (_local7 > 1){
_local13 = limits[BREAST1_POS][_local4];
_local14 = blobs[BREAST1_POS];
_local14.deformFactor = _local13.deformFactor;
_local14.friction = _local13.friction;
_local14.multiplier = _local13.multiplier;
_local14.speed = _local13.speed;
_local14.blobEggFactor = _local13.blobEggFactor;
_local14.baseEggFactor = _local13.baseEggFactor;
_local14.bounceFactor = _local13.bounceFactor;
_local14.gravityAngle = _local13.gravityAngle;
_local14.lightFlatness = _local13.lightFlatness;
_local14.darkFlatness = _local13.darkFlatness;
_local13 = limits[BREAST2_POS][_local4];
_local14 = blobs[BREAST2_POS];
_local14.deformFactor = _local13.deformFactor;
_local14.friction = _local13.friction;
_local14.multiplier = _local13.multiplier;
_local14.speed = _local13.speed;
_local14.blobEggFactor = _local13.blobEggFactor;
_local14.baseEggFactor = _local13.baseEggFactor;
_local14.bounceFactor = _local13.bounceFactor;
_local14.gravityAngle = _local13.gravityAngle;
_local14.lightFlatness = _local13.lightFlatness;
_local14.darkFlatness = _local13.darkFlatness;
container.addBlobInteraction(breast1, _local10[B1_B2_FLATTEN_LIM], _local10[B1_B2_PUSH_LIM], breast2, _local10[B2_B1_FLATTEN_LIM], _local10[B2_B1_PUSH_LIM]);
} else {
container.addBlobInteraction(breast1, (_local9[B1_B2_FLATTEN_LIM] + ((_local10[B1_B2_FLATTEN_LIM] - _local9[B1_B2_FLATTEN_LIM]) * _local7)), (_local9[B1_B2_PUSH_LIM] + ((_local10[B1_B2_PUSH_LIM] - _local9[B1_B2_PUSH_LIM]) * _local7)), breast2, (_local9[B2_B1_FLATTEN_LIM] + ((_local10[B2_B1_FLATTEN_LIM] - _local9[B2_B1_FLATTEN_LIM]) * _local7)), (_local9[B2_B1_PUSH_LIM] + ((_local10[B2_B1_PUSH_LIM] - _local9[B2_B1_PUSH_LIM]) * _local7)));
};
if (_local8 > 1){
_local13 = limits[BELLY_POS][_local6];
_local14 = blobs[BELLY_POS];
_local14.deformFactor = _local13.deformFactor;
_local14.friction = _local13.friction;
_local14.multiplier = _local13.multiplier;
_local14.speed = _local13.speed;
_local14.blobEggFactor = _local13.blobEggFactor;
_local14.baseEggFactor = _local13.baseEggFactor;
_local14.bounceFactor = _local13.bounceFactor;
_local14.gravityAngle = _local13.gravityAngle;
_local14.lightFlatness = _local13.lightFlatness;
_local14.darkFlatness = _local13.darkFlatness;
_local13 = limits[BELLYWHITE_POS][_local6];
_local14 = blobs[BELLYWHITE_POS];
_local14.deformFactor = _local13.deformFactor;
_local14.friction = _local13.friction;
_local14.multiplier = _local13.multiplier;
_local14.speed = _local13.speed;
_local14.blobEggFactor = _local13.blobEggFactor;
_local14.baseEggFactor = _local13.baseEggFactor;
_local14.bounceFactor = _local13.bounceFactor;
_local17 = _local12[B_FLATTEN_LIM];
_local18 = _local12[B_PUSH_LIM];
if (breastSize < 1){
_local18 = (_local18 * (0.2 + ((1 - 0.2) * breastSize)));
};
if (modifier == 2){
_local18 = (_local18 * 1.5);
_local17 = (_local17 * 0.2);
} else {
if (modifier == 3){
_local18 = (_local18 * 1.2);
_local17 = (_local17 * 0.8);
};
};
container.addBlobInteraction(bellyWhite, 0, 0, breast1, _local17, _local18);
container.addBlobInteraction(bellyWhite, 0, 0, breast2, _local17, _local18);
} else {
_local17 = (_local11[B_FLATTEN_LIM] + ((_local12[B_FLATTEN_LIM] - _local11[B_FLATTEN_LIM]) * _local8));
_local18 = (_local11[B_PUSH_LIM] + ((_local12[B_PUSH_LIM] - _local11[B_PUSH_LIM]) * _local8));
if (breastSize < 1){
_local18 = (_local18 * (0.2 + ((1 - 0.2) * breastSize)));
};
if (modifier == 2){
_local18 = (_local18 * 1.5);
_local17 = (_local17 * 0.2);
} else {
if (modifier == 3){
_local18 = (_local18 * 1.2);
_local17 = (_local17 * 0.8);
};
};
container.addBlobInteraction(bellyWhite, 0, 0, breast1, _local17, _local18);
container.addBlobInteraction(bellyWhite, 0, 0, breast2, _local17, _local18);
};
}
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;
};
__A_NOTE = "The breast and belly physics you see in this animation will never be replicated anywhere else on Deviantart. If it ever does, feel free to call me out. Now get out of my source code. There is nothing here for you.\n\nIf you find this message offensive, remember this: You came here looking for it. You did this to yourself. Ideally, nobody should know this message exists.";
ATTACH_LIST = [];
Physics.attach(ATTACH_LIST, naomi.front, naomi.body);
Physics.attach(ATTACH_LIST, naomi.head, naomi.body);
Physics.attach(ATTACH_LIST, naomi.arm1, naomi.body);
Physics.attach(ATTACH_LIST, naomi.arm2, naomi.body);
Physics.attach(ATTACH_LIST, naomi.breast_mc1, naomi.body);
Physics.attach(ATTACH_LIST, naomi.breast_mc2, naomi.body);
Physics.attach(ATTACH_LIST, naomi.top_mc, naomi.body);
Physics.attach(ATTACH_LIST, naomi.clothes_mc, naomi.body);
Physics.attach(ATTACH_LIST, naomi.leg1, naomi.body);
Physics.attach(ATTACH_LIST, naomi.leg2, naomi.body);
Physics.attach(ATTACH_LIST, naomi.tail, naomi.body);
ELASTIC_LIST = [];
Physics.setElastic(ELASTIC_LIST, naomi, naomi.arm1, ["scaleY", "skewX"], [0.25, 0.3], [1, 0], [0.3, 0.3], [6, 6], [0.6, 0.9]);
Physics.setElastic(ELASTIC_LIST, naomi, naomi.arm2, ["scaleY", "skewX"], [0.25, 0.3], [1, 0], [0.3, 0.3], [6, 6], [0.6, 0.9]);
Physics.setElastic(ELASTIC_LIST, naomi, naomi.leg1, ["scaleY", "skewX"], [0.2, 0.2], [1, 0], [0.2, 0.2], [6, 6], [0.6, 0.9]);
Physics.setElastic(ELASTIC_LIST, naomi, naomi.leg2, ["scaleY", "skewX"], [0.2, 0.2], [1, 0], [0.2, 0.2], [6, 6], [0.6, 0.9]);
Physics.setElastic(ELASTIC_LIST, naomi, naomi.hair3, ["skewX"], [0.3], [0], [0.5], [2], [0.75]);
Physics.setElastic(ELASTIC_LIST, naomi, naomi.head.hair2, ["skewX"], [0.3], [0], [0.5], [2], [1]);
Physics.setElastic(ELASTIC_LIST, naomi, naomi.head.hair1, ["skewX"], [0.3], [0], [0.5], [2], [0.5]);
Physics.setElastic(ELASTIC_LIST, naomi, naomi.head.ear1, ["skewX", "skewY"], [0.3, 0.3], [0, 0], [0.45, 0.45], [6, 6], [0.5, 0.5]);
Physics.setElastic(ELASTIC_LIST, naomi, naomi.head.ear2, ["skewX", "skewY"], [0.3, 0.3], [0, 0], [0.45, 0.45], [6, 6], [0.5, 0.5]);
naomi.head.rotationY = (naomi.head.rotationX = (naomi.head.rotationZ = 0));
EYE1_X = naomi.head.eye1.x;
EYE1_Y = naomi.head.eye1.y;
EYE1_Z = Math.abs(naomi.head.eye1.y);
EYE2_X = naomi.head.eye2.x;
EYE2_Y = naomi.head.eye2.y;
EYE2_Z = EYE1_Z;
DIAMOND_X = naomi.head.diamond.x;
DIAMOND_Y = naomi.head.diamond.y;
DIAMOND_Z = (EYE1_Z + 10);
NOSE_X = naomi.head.nose.x;
NOSE_Y = naomi.head.nose.y;
NOSE_Z = (EYE1_Z + 30);
MOUTH_X = naomi.head.mouth.x;
MOUTH_Y = naomi.head.mouth.y;
MOUTH_Z = (NOSE_Z * Math.SQRT1_2);
MOUTH_FUR_X = naomi.head.mouth_fur.x;
MOUTH_FUR_Y = naomi.head.mouth_fur.y;
MOUTH_FUR_Z = MOUTH_Z;
MOUTH_FUR_DIST = 30;
HAIR1_X = naomi.head.hair1.x;
HAIR1_Y = naomi.head.hair1.y;
HAIR1_Z = EYE1_Z;
HAIR2_X = naomi.head.hair2.x;
HAIR2_Y = naomi.head.hair2.y;
HAIR2_Z = EYE1_Z;
HEAD_X = naomi.head.face.x;
HEAD_Y = naomi.head.face.y;
HEAD_Z = 10;
HEAD_DIST = 10;
EAR1_X = naomi.head.ear1.x;
EAR1_Y = naomi.head.ear1.y;
EAR1_Z = (EYE1_Z * 0.5);
EAR2_X = naomi.head.ear2.x;
EAR2_Y = naomi.head.ear2.y;
EAR2_Z = (EYE1_Z * 0.5);
HAIR3_XDIST = 20;
HAIR3_YDIST = 50;
HAIR3_DOWN = (HAIR3_YDIST * 0.5);
MIN_HAIR3_YSCALE = 0.75;
MIN_HAIR3_XSCALE = 0.75;
HAIR3_POINT = naomi.head.globalToLocal(naomi.hair3.localToGlobal(new Point()));
HEAD_H_ANGLE = 0;
HEAD_V_ANGLE = 0;
HEAD_Z_ANGLE = 0;
HEAD_H_SPEED = 0.75;
HEAD_V_SPEED = 0.75;
HEAD_Z_SPEED = 0.75;
I1CX = naomi.head.eye1.iris.x;
I1CY = naomi.head.eye1.iris.y;
I2CX = naomi.head.eye2.iris.x;
I2CY = naomi.head.eye2.iris.y;
P1CX = naomi.head.eye1.iris.pupil.x;
P1CY = naomi.head.eye1.iris.pupil.y;
P2CX = naomi.head.eye2.iris.pupil.x;
P2CY = naomi.head.eye2.iris.pupil.y;
IRIS_Z = 20;
PUPIL_Z = IRIS_Z;
p1X = P1CX;
p1Y = P1CY;
p2X = P2CX;
p2Y = P2CY;
naomi.y = (naomi.y - 200);
naomi.scaleY = (naomi.scaleX = 0.5);
ORIG_ENVIRON_X = naomi.x;
ORIG_ENVIRON_Y = naomi.y;
ORIG_ENVIRON_SCALE = naomi.scaleX;
SCREEN_DRAG_ENABLED = true;
container = new SoftBlobContainer();
b1Template = naomi.breast_mc1;
b2Template = naomi.breast_mc2;
naomi.breast_mc1.visible = (naomi.breast_mc2.visible = (naomi.top_mc.visible = (naomi.clothes_mc.visible = false)));
b1Limits = [];
b2Limits = [];
bLimits = [];
bWLimits = [];
otherLimits = [];
BREAST_DETAIL = 30;
BELLY_DETAIL = 30;
LIMITS_DETAIL = 1;
INIT_BREAST_RADIUS = (b1Template.width * 0.5);
BREAST_LIGHT = 0xFFFFFF;
BREAST_COLOR = 16774886;
BREAST_SHADE = 16764023;
tempB = (b1Limits[0] = new SoftBlob(LIMITS_DETAIL, LIMITS_DETAIL));
tempB.blobRadius = (tempB.baseRadius = (tempB.coverRadius = INIT_BREAST_RADIUS));
tempB.x = (b1Template.x + 15);
tempB.y = (b1Template.y + 20);
tempB.coverXRadius = (tempB.coverXRadius * 0.8);
tempB.coverYRadius = (tempB.coverYRadius * 0.8);
tempB.baseXRadius = (tempB.baseXRadius * 0.8);
tempB.baseXRadius = (tempB.baseXRadius - 2);
tempB.baseYRadius = (tempB.baseYRadius * 0.8);
tempB.baseYRadius = (tempB.baseYRadius - 2);
tempB.lineThickness = 0.1;
tempB.lineColor = 0;
tempB.lineAlpha = 1;
tempB.lightColor = BREAST_LIGHT;
tempB.darkColor = BREAST_SHADE;
tempB.baseColor = BREAST_COLOR;
tempB.lightAngle = (-(Math.PI) * 0.55);
tempB.lightDistance = 30;
tempB.darkDistance = 50;
tempB.darkRadius = (INIT_BREAST_RADIUS + 10);
tempB.lightRadius = (INIT_BREAST_RADIUS * 0.7);
tempB.lightFlatness = 0.65;
tempB.darkFlatness = 1.1;
tempB.topLevel = naomi;
tempB.gravityAngle = (Math.PI * (0.5 + 0.1));
tempB.averageDistance = 20;
tempB.multiplier = 0.5;
tempB.friction = 0.3;
tempB.speed = 4;
tempB.deformFactor = 0.5;
tempB.blobEggFactor = 0.9;
tempB.pushFactor = 0.2;
tempB.bounceFactor = 1;
tempB = (b2Limits[0] = b1Limits[0].clone());
tempB.x = (naomi.breast_mc2.x - 5);
tempB.y = (naomi.breast_mc2.y + 20);
tempB.gravityAngle = (Math.PI * (0.5 - 0.1));
tempB = (bLimits[0] = b1Limits[0].clone());
tempB.x = (((b1Limits[0].x + b2Limits[0].x) * 0.5) + 0.5);
tempB.y = ((b1Limits[0].y + 150) + 60);
tempB.blobEggFactor = 0.8;
tempB.blobXRadius = 90;
tempB.blobYRadius = 130;
tempB.baseXRadius = 90;
tempB.baseYRadius = 130;
tempB.coverXRadius = 95;
tempB.coverYRadius = 135;
tempB.darkColor = 0xDD8800;
tempB.baseColor = 16762655;
tempB.lightColor = 16763938;
tempB.lightAlpha = 0.2;
tempB.darkAlpha = 1;
tempB.darkRadius = (tempB.baseYRadius + 20);
tempB.lightRadius = (tempB.darkRadius - 10);
tempB.bounceFactor = 0;
tempB.gravityAngle = (Math.PI * 0.5);
tempB.averageDistance = 0;
tempB.lineThickness = (tempB.lineColor = (tempB.lineAlpha = NaN));
tempB.lightAlpha = 0.5;
tempB.baseAlpha = (tempB.darkAlpha = 1);
tempB = (bWLimits[0] = bLimits[0].clone());
tempB.x = bLimits[0].x;
tempB.y = bLimits[0].y;
tempB.darkColor = 16764023;
tempB.baseColor = 16774886;
tempB.lightColor = 0xFFFFFF;
tempB.baseYRadius = (tempB.baseYRadius - 20);
tempB.baseEggFactor = 0.95;
tempB.coverRadius = 0;
tempB.y = (tempB.y + 16);
tempB.x = (tempB.x + 2);
tempB.coverRadius = (tempB.coverRadius * 0.5);
tempB.lightRadius = (tempB.darkRadius = 0);
tempB.blobXRadius = tempB.baseXRadius;
tempB.blobYRadius = tempB.baseYRadius;
tempB.blobEggFactor = tempB.baseEggFactor;
tempB.lightRadius = (tempB.blobRadius + 30);
tempB.darkRadius = (tempB.blobRadius + 30);
tempA = (otherLimits[0] = []);
tempA[B1_CIRCLEX_LIM] = -10;
tempA[B1_CIRCLEY_LIM] = 0;
tempA[B1_CENTERX_LIM] = -12;
tempA[B1_CENTERY_LIM] = 0;
tempA[B2_CIRCLEX_LIM] = 10;
tempA[B2_CIRCLEY_LIM] = 0;
tempA[B2_CENTERX_LIM] = 12;
tempA[B2_CENTERY_LIM] = 0;
tempA[CIRCLE_SCALEX_LIM] = 1;
tempA[CIRCLE_SCALEY_LIM] = 1;
tempA[B1_B2_FLATTEN_LIM] = 0.9;
tempA[B1_B2_PUSH_LIM] = 1;
tempA[B2_B1_FLATTEN_LIM] = 0.9;
tempA[B2_B1_PUSH_LIM] = 1;
tempA[B_CENTERX_LIM] = 0;
tempA[B_CENTERY_LIM] = 0;
tempA[B_CENTER_SCALE_LIM] = 1;
tempA[B_FLATTEN_LIM] = 0;
tempA[B_PUSH_LIM] = 0;
tempA[B_CENTER_OFFSETX_FACTOR_LIM] = 0.8;
tempA[B_CENTER_OFFSETY_FACTOR_LIM] = 0.8;
tempB = (b1Limits[1] = b1Limits[0].clone());
tempB.blobXRadius = (tempB.blobXRadius * 4);
tempB.blobYRadius = (tempB.blobYRadius * 4);
tempB.darkRadius = (tempB.darkRadius * 4);
tempB.lightRadius = (tempB.lightRadius * 6);
tempB.lightDistance = (tempB.lightDistance * 2);
tempB.darkDistance = (tempB.darkDistance * 2);
tempB.blobEggFactor = 1;
tempB.averageDistance = (tempB.averageDistance * 7);
tempB.gravityAngle = (Math.PI * (0.5 + 0.15));
tempB.bounceFactor = 0.75;
tempB.multiplier = (tempB.multiplier * 0.7);
tempB.friction = (tempB.friction * 0.9);
tempB.speed = 3;
tempB.deformFactor = 0.4;
tempB = (b2Limits[1] = b1Limits[1].clone());
tempB.gravityAngle = (Math.PI * (0.5 - 0.15));
tempB = (bLimits[1] = bLimits[0].clone());
tempB.lineThickness = 1;
tempB.lineColor = tempB.darkColor;
tempB.lineAlpha = 1;
tempB.blobXRadius = (tempB.blobXRadius * 2);
tempB.blobYRadius = (tempB.blobYRadius * 1.5);
tempB.darkRadius = (tempB.darkRadius * 1.5);
tempB.darkFlatness = 0.7;
tempB.lightRadius = (tempB.lightRadius * 1.2);
tempB.lightFlatness = 1;
tempB.lightDistance = (tempB.lightDistance * 2.5);
tempB.darkDistance = (tempB.darkDistance * 1.5);
tempB.blobEggFactor = 0.9;
tempB.averageDistance = (tempB.averageDistance + 10);
tempB.bounceFactor = 0.333;
tempB.multiplier = (tempB.multiplier * 0.8);
tempB.friction = (tempB.friction * 1);
tempB.speed = 3;
tempB.deformFactor = 0.1;
tempB = (bWLimits[1] = bLimits[1].clone());
tempB.lightColor = bWLimits[0].lightColor;
tempB.baseColor = bWLimits[0].baseColor;
tempB.darkColor = bWLimits[0].darkColor;
tempB.lineThickness = (tempB.lineColor = (tempB.lineAlpha = 0));
tempB.averageDistance = (tempB.averageDistance - 10);
tempA = (otherLimits[1] = []);
tempA[B1_CIRCLEX_LIM] = -100;
tempA[B1_CIRCLEY_LIM] = -24;
tempA[B1_CENTERX_LIM] = -108;
tempA[B1_CENTERY_LIM] = -28;
tempA[B2_CIRCLEX_LIM] = 100;
tempA[B2_CIRCLEY_LIM] = -24;
tempA[B2_CENTERX_LIM] = 108;
tempA[B2_CENTERY_LIM] = -28;
tempA[CIRCLE_SCALEX_LIM] = 2.5;
tempA[CIRCLE_SCALEY_LIM] = 3;
tempA[B1_B2_FLATTEN_LIM] = 0.7;
tempA[B1_B2_PUSH_LIM] = 0.95;
tempA[B2_B1_FLATTEN_LIM] = 0.7;
tempA[B2_B1_PUSH_LIM] = 0.95;
tempA[B_CENTERX_LIM] = 0;
tempA[B_CENTERY_LIM] = 50;
tempA[B_CENTER_SCALE_LIM] = 3;
tempA[B_FLATTEN_LIM] = 0.5;
tempA[B_PUSH_LIM] = 1;
tempA[B_CENTER_OFFSETX_FACTOR_LIM] = 0.8;
tempA[B_CENTER_OFFSETY_FACTOR_LIM] = 0.8;
tempB = (b1Limits[2] = b1Limits[1].clone());
tempB.blobXRadius = (tempB.blobXRadius * 2);
tempB.blobYRadius = (tempB.blobYRadius * 2);
tempB.lightRadius = (tempB.lightRadius * 1.5);
tempB.darkRadius = (tempB.darkRadius * 2);
tempB.lightDistance = (tempB.lightDistance * 2.5);
tempB.darkDistance = (tempB.darkDistance * 1.5);
tempB.lightFlatness = 1;
tempB.darkFlatness = 1;
tempB.gravityAngle = (Math.PI * (0.5 + 0.25));
tempB.averageDistance = (tempB.averageDistance * 2);
tempB = (b2Limits[2] = b1Limits[2].clone());
tempB.gravityAngle = (Math.PI * (0.5 - 0.25));
tempB = (bLimits[2] = bLimits[1].clone());
tempB.blobXRadius = (tempB.blobXRadius * 2);
tempB.blobYRadius = (tempB.blobYRadius * 1.8);
tempB.lightRadius = (tempB.lightRadius * 1.6);
tempB.darkRadius = (tempB.darkRadius * 1.8);
tempB.lightDistance = (tempB.lightDistance * 1.8);
tempB.darkDistance = (tempB.darkDistance * 1.8);
tempB.lightFlatness = 0.8;
tempB.blobEggFactor = 0.95;
tempB.averageDistance = (tempB.averageDistance + 150);
tempB.bounceFactor = 0.25;
tempB.multiplier = (tempB.multiplier * 0.95);
tempB.friction = (tempB.friction * 0.95);
tempB.speed = 2;
tempB.deformFactor = 0;
tempB = (bWLimits[2] = bLimits[2].clone());
tempB.lightColor = bWLimits[0].lightColor;
tempB.baseColor = bWLimits[0].baseColor;
tempB.darkColor = bWLimits[0].darkColor;
tempB.lineThickness = (tempB.lineColor = (tempB.lineAlpha = 0));
tempA = (otherLimits[2] = []);
tempA[B1_CIRCLEX_LIM] = -255;
tempA[B1_CIRCLEY_LIM] = -10;
tempA[B1_CENTERX_LIM] = -265;
tempA[B1_CENTERY_LIM] = -10;
tempA[B2_CIRCLEX_LIM] = 0xFF;
tempA[B2_CIRCLEY_LIM] = -10;
tempA[B2_CENTERX_LIM] = 265;
tempA[B2_CENTERY_LIM] = -10;
tempA[CIRCLE_SCALEX_LIM] = 4;
tempA[CIRCLE_SCALEY_LIM] = 5;
tempA[B1_B2_FLATTEN_LIM] = 0.7;
tempA[B1_B2_PUSH_LIM] = 0.95;
tempA[B2_B1_FLATTEN_LIM] = 0.7;
tempA[B2_B1_PUSH_LIM] = 0.95;
tempA[B_CENTERX_LIM] = 0;
tempA[B_CENTERY_LIM] = 50;
tempA[B_CENTER_SCALE_LIM] = 4;
tempA[B_FLATTEN_LIM] = 0.5;
tempA[B_PUSH_LIM] = 2;
tempA[B_CENTER_OFFSETX_FACTOR_LIM] = 0.8;
tempA[B_CENTER_OFFSETY_FACTOR_LIM] = 0.5;
breast1 = new SoftBlob(BREAST_DETAIL, BREAST_DETAIL);
breast2 = new SoftBlob(BREAST_DETAIL, BREAST_DETAIL);
belly = new SoftBlob(BREAST_DETAIL, BREAST_DETAIL);
bellyWhite = new SoftBlob(BREAST_DETAIL, BREAST_DETAIL);
b1Circle = naomi.breast_mc1.circle;
b1Center = naomi.breast_mc1.center;
b2Circle = naomi.breast_mc2.circle;
b2Center = naomi.breast_mc2.center;
bCenter = naomi.belly;
blobs = [breast1, breast2, belly, bellyWhite];
limits = [b1Limits, b2Limits, bLimits, bWLimits];
bellyGlow = new Shape();
breast1Glow = new Shape();
breast2Glow = new Shape();
glowPosition = 1;
breast1.x = b1Limits[0].x;
breast1.y = b1Limits[0].y;
breast2.x = b2Limits[0].x;
breast2.y = b2Limits[0].y;
belly.x = bLimits[0].x;
belly.y = bLimits[0].y;
bellyWhite.x = bWLimits[0].x;
bellyWhite.y = bWLimits[0].y;
breast1.topLevel = (breast2.topLevel = (belly.topLevel = (bellyWhite.topLevel = naomi)));
bellyWhite.attachItem(bCenter, 0, 0, false);
naomi.addChildAt(belly, naomi.getChildIndex(naomi.front));
naomi.addChild(bellyWhite);
naomi.addChild(breast1);
naomi.addChild(breast2);
Physics.attach(ATTACH_LIST, breast1, naomi.body);
Physics.attach(ATTACH_LIST, breast2, naomi.body);
Physics.attach(ATTACH_LIST, belly, naomi.body);
Physics.attach(ATTACH_LIST, bellyWhite, naomi.body);
belly.stabilize();
bellyWhite.stabilize();
breast1.stabilize();
breast2.stabilize();
MAX_BREAST_SIZE = 1;
MAX_BELLY_SIZE = 2;
INFINITE_EXPANSION = false;
maxSize = 1;
breastSize = 0;
bellySize = 0;
breastGrowth = 0;
bellyGrowth = 0;
kickLightMC = new Sprite();
kickDarkMC = new Sprite();
kickLineMC = new Sprite();
kickObject = null;
bellyWhite.addChild(kickLightMC);
bellyWhite.addChild(kickDarkMC);
bellyWhite.addChild(kickLineMC);
_nC = naomi.clothes_mc;
clothes = new MovieClip();
clothesPoints = [_nC.a1, _nC.c1, _nC.a2, _nC.c2, _nC.a3, _nC.c3, _nC.a4, _nC.c4, _nC.a5, _nC.c5, _nC.a6, _nC.c6];
clothes.x = _nC.x;
clothes.y = _nC.y;
naomi.addChildAt(clothes, (naomi.getChildIndex(bellyWhite) + 1));
Physics.attach(ATTACH_LIST, clothes, naomi.body);
CLOTHES_INDEX = 1;
CONTROL1X = _nC.c2.x;
CONTROL1Y = _nC.c2.y;
CONTROL2X = _nC.c4.x;
CONTROL2Y = _nC.c4.y;
CONTROL_CENTERX = _nC.c6.x;
CONTROL_CENTERY = _nC.c6.y;
CONTROLX_OFFSET = 20;
CONTROLY_OFFSET = 20;
CONTROL_CENTERY_OFFSET = 150;
trace("Work on fixing top later (Forget it, it's too complicated)");
TOP_RIGHT1 = (BREAST_DETAIL - 1);
TOP_RIGHT2 = 0;
TOP_RIGHT3 = 1;
TOP_LEFT2 = (BREAST_DETAIL >> 1);
TOP_LEFT1 = (TOP_LEFT2 - 1);
TOP_LEFT3 = (TOP_LEFT2 + 1);
TOP_BROKEN = false;
TOP_SPRINGS_GENERATED = false;
TOP_LEFT_POINTS = [];
TOP_LEFT_SPRINGS = [];
TOP_RIGHT_POINTS = [];
TOP_RIGHT_SPRINGS = [];
top = new MovieClip();
naomi.addChildAt(top, (naomi.getChildIndex(breast2) + 1));
selectedMachineButton = null;
machineScreenMask = new Shape();
machineScreen = new MovieClip();
machineScreenText = new TextField();
screen1Text = new TextField();
mScreenTF = new TextFormat();
mTF = new TextFormat();
whiteControl = false;
screenMode = 0;
modifier = 0;
historyLength = 64;
historyInterval = (MACHINE_SCREEN_WIDTH / (historyLength - 1));
bellyHistory = [];
breastHistory = [];
breathHistory = [];
bellyHistoryPos = 0;
breastHistoryPos = 0;
breathHistoryPos = 0;
maxHistoryHeight = 4;
invMaxHistoryHeight = (1 / maxHistoryHeight);
_bHist = 0;
while (_bHist < historyLength) {
bellyHistory[_bHist] = (breastHistory[_bHist] = (breathHistory[_bHist] = 0));
_bHist++;
};
machine.tabEnabled = (machine.tabChildren = false);
machineScreen.addChild(machine._txt);
mTF = machine._txt.defaultTextFormat;
mTF.size = 11;
mTF.bold = false;
mTF.font = "_typewriter";
mTF.color = 0xFF00;
mTF.letterSpacing = 0;
mTF.leading = -3;
machine._txt.x = (machine._txt.y = 0);
machine._txt.wordWrap = (machine._txt.multiline = true);
machine._txt.defaultTextFormat = mTF;
machine._txt.text = "Interactive Naomi Multi-Expansion.\nDrawn, animated and programmed by Doom the wolf.\nhttp://doom-the-wolf.deviantart.com";
machine._txt.selectable = false;
machine._txt.visible = false;
machine.x = (stage.stageWidth - MACHINE_CORNER_X);
machine._red.gotoAndStop(1);
machine._green.gotoAndStop(1);
machine._yellow.gotoAndStop(1);
machine._blue.gotoAndStop(1);
machine._up.gotoAndStop(1);
machine._down.gotoAndStop(1);
machine._left.gotoAndStop(1);
machine._right.gotoAndStop(1);
machine._center.gotoAndStop(1);
machine._l1.gotoAndStop(1);
machine._l2.gotoAndStop(1);
machine._l3.gotoAndStop(1);
machine._l4.gotoAndStop(1);
machine._b1.gotoAndStop(1);
machine._b2.gotoAndStop(1);
machine._b3.gotoAndStop(1);
machine._b4.gotoAndStop(1);
machine._light.gotoAndStop(1);
machine._red_slider.x = (RED_SLIDER_X + (SLIDER_WIDTH * 0.5));
machine._red_slider.y = (SLIDER_Y + (SLIDER_HEIGHT * 0.5));
machine._blue_slider.x = (BLUE_SLIDER_X + (SLIDER_WIDTH * 0.5));
machine._blue_slider.y = (SLIDER_Y + (SLIDER_HEIGHT * 0.5));
machine._white_slider.x = (WHITE_SLIDER_X + (SLIDER_WIDTH * 0.5));
machine._white_slider.y = (SLIDER_Y + (SLIDER_HEIGHT * 0.5));
machine._clip.gotoAndStop(1);
machineScreenMask.x = (machineScreen.x = MACHINE_SCREEN_X);
machineScreenMask.y = (machineScreen.y = MACHINE_SCREEN_Y);
machineScreenMask.graphics.beginFill(0);
machineScreenMask.graphics.drawRect(0, 0, MACHINE_SCREEN_WIDTH, MACHINE_SCREEN_HEIGHT);
machineScreenMask.graphics.endFill();
machine.addChild(machineScreen);
machine.addChild(machineScreenMask);
machineScreen.mask = machineScreenMask;
mScreenTF.font = "_typewriter";
mScreenTF.color = 0xFF00;
mScreenTF.align = TextFormatAlign.RIGHT;
machineScreenText.defaultTextFormat = mScreenTF;
machineScreenText.text = "Mjg";
machineScreenText.mouseEnabled = false;
machineScreenText.selectable = false;
machineScreenText.width = MACHINE_SCREEN_WIDTH;
machineScreenText.height = (machineScreenText.textHeight + 5);
machineScreenText.y = (MACHINE_SCREEN_HEIGHT - machineScreenText.height);
machineScreenText.x = 0;
machineScreenText.text = "";
machineScreen.addChild(machineScreenText);
screen1Text.defaultTextFormat = mScreenTF;
screen1Text.text = "Mjg";
screen1Text.width = MACHINE_SCREEN_WIDTH;
screen1Text.height = (screen1Text.textHeight + 5);
screen1Text.text = "";
screen1Text.visible = false;
NAOMI_X = naomi.body.x;
NAOMI_Y = naomi.body.y;
DEST_NAOMI_X = NAOMI_X;
DEST_NAOMI_Y = NAOMI_Y;
BED_X = naomi.bed.x;
BED_Y = naomi.bed.y;
DEST_BED_X = BED_X;
DEST_BED_Y = BED_Y;
NAOMI_BED_X = (NAOMI_X - BED_X);
NAOMI_BED_Y = (NAOMI_Y - BED_Y);
anglePerVX = (MAX_H_ANGLE * 0.25);
anglePerVY = (MAX_V_ANGLE * 0.15);
zAnglePerVX = (MAX_Z_ANGLE * 0.05);
OLD_BED_X = naomi.bed.x;
OLD_BED_Y = naomi.bed.y;
bedHistoryLength = 6;
bedHistoryPos = 0;
bedHistory = [0, 0, 0, 0, 0, 0];
bedReactions = ["", "move1", "move2", "move3"];
bedReaction = 0;
bedClip = new MovieClip();
Physics.attach(ATTACH_LIST, naomi.blanket1, naomi.bed);
Physics.attach(ATTACH_LIST, naomi.blanket2, naomi.bed);
naomi.tabEnabled = (naomi.tabChildren = false);
expNaomi = new Expression(stage);
breatheOffset = 0;
EYE1_ID = expNaomi.addPart(naomi.head.eye1, Expression.ANIMATED, true);
EYE2_ID = expNaomi.addPart(naomi.head.eye2, Expression.ANIMATED, true);
MOUTH_ID = expNaomi.addPart(naomi.head.mouth);
PUPIL1_ID = expNaomi.addPart(naomi.head.eye1.iris);
PUPIL2_ID = expNaomi.addPart(naomi.head.eye2.iris);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.1, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "big");
expNaomi.addPartToState(nTmp, EYE2_ID, "big");
expNaomi.addPartToState(nTmp, MOUTH_ID, "closed");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 30);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 30);
expNaomi.addState("normal", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.1, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "medium");
expNaomi.addPartToState(nTmp, EYE2_ID, "medium");
expNaomi.addPartToState(nTmp, MOUTH_ID, "happy");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 10);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 10);
expNaomi.addState("relaxed", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.1, 1);
expNaomi.addPartToState(nTmp, EYE1_ID, "open");
expNaomi.addPartToState(nTmp, EYE2_ID, "open");
expNaomi.addPartToState(nTmp, MOUTH_ID, "small");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 50);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 50);
expNaomi.addState("expand1", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.35, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "sadbig");
expNaomi.addPartToState(nTmp, EYE2_ID, "sadbig");
expNaomi.addPartToState(nTmp, MOUTH_ID, "open");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 50);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 50);
expNaomi.addState("expand2", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.25, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "sad");
expNaomi.addPartToState(nTmp, EYE2_ID, "sad");
expNaomi.addPartToState(nTmp, MOUTH_ID, "teeth");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 50);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 50);
expNaomi.addState("expand3", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.25, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "sadsmall");
expNaomi.addPartToState(nTmp, EYE2_ID, "sadsmall");
expNaomi.addPartToState(nTmp, MOUTH_ID, "tired");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 50);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 50);
expNaomi.addState("over", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.25, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "open");
expNaomi.addPartToState(nTmp, EYE2_ID, "open");
expNaomi.addPartToState(nTmp, MOUTH_ID, "nervous");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 50);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 50);
expNaomi.addState("nervous", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.4, 0.6);
expNaomi.addPartToState(nTmp, EYE1_ID, "open");
expNaomi.addPartToState(nTmp, EYE2_ID, "open");
expNaomi.addPartToState(nTmp, MOUTH_ID, "medium");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 30);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 30);
expNaomi.addState("worried", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.2, 0.75);
expNaomi.addPartToState(nTmp, EYE1_ID, "medium");
expNaomi.addPartToState(nTmp, EYE2_ID, "medium");
expNaomi.addPartToState(nTmp, MOUTH_ID, "small");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 0);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 0);
expNaomi.addState("revert1", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.2, 0.75);
expNaomi.addPartToState(nTmp, EYE1_ID, "medium");
expNaomi.addPartToState(nTmp, EYE2_ID, "medium");
expNaomi.addPartToState(nTmp, MOUTH_ID, "medium");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 30);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 30);
expNaomi.addState("revert2", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.2, 0.75);
expNaomi.addPartToState(nTmp, EYE1_ID, "sad");
expNaomi.addPartToState(nTmp, EYE2_ID, "sad");
expNaomi.addPartToState(nTmp, MOUTH_ID, "closed");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 60);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 60);
expNaomi.addState("confused", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.2, 0.75);
expNaomi.addPartToState(nTmp, EYE1_ID, "sadbig");
expNaomi.addPartToState(nTmp, EYE2_ID, "sadsmall");
expNaomi.addPartToState(nTmp, MOUTH_ID, "happy");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 60);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 60);
expNaomi.addState("confusion", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.2, 0.75);
expNaomi.addPartToState(nTmp, EYE1_ID, "sad");
expNaomi.addPartToState(nTmp, EYE2_ID, "sad");
expNaomi.addPartToState(nTmp, MOUTH_ID, "small2");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 60);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 60);
expNaomi.addState("notice", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, true, 0.2, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "sad");
expNaomi.addPartToState(nTmp, EYE2_ID, "sad");
expNaomi.addPartToState(nTmp, MOUTH_ID, "happy");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 30);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 30);
expNaomi.addState("embarassed", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.2, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "closed");
expNaomi.addPartToState(nTmp, EYE2_ID, "closed");
expNaomi.addPartToState(nTmp, MOUTH_ID, "smile");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 0);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 0);
expNaomi.addState("rubhead", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.2, 0.75);
expNaomi.addPartToState(nTmp, EYE1_ID, "small");
expNaomi.addPartToState(nTmp, EYE2_ID, "small");
expNaomi.addPartToState(nTmp, MOUTH_ID, "happy");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 40);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 40);
expNaomi.addState("rubbelly", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.2, 0.75);
expNaomi.addPartToState(nTmp, EYE1_ID, "small2");
expNaomi.addPartToState(nTmp, EYE2_ID, "small2");
expNaomi.addPartToState(nTmp, MOUTH_ID, "teeth");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 40);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 40);
expNaomi.addState("rubbreasts", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.2, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "shut");
expNaomi.addPartToState(nTmp, EYE2_ID, "sadsmall");
expNaomi.addPartToState(nTmp, MOUTH_ID, "teeth");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 30);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 30);
expNaomi.addState("kick1", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.2, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "sadbig");
expNaomi.addPartToState(nTmp, EYE2_ID, "sad");
expNaomi.addPartToState(nTmp, MOUTH_ID, "open");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 30);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 30);
expNaomi.addState("kick2", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.75, 0.25);
expNaomi.addPartToState(nTmp, EYE1_ID, "closed");
expNaomi.addPartToState(nTmp, EYE2_ID, "closed");
expNaomi.addPartToState(nTmp, MOUTH_ID, "teeth2");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 30);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 30);
expNaomi.addState("kick3", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.3, 1);
expNaomi.addPartToState(nTmp, EYE1_ID, "sadbig");
expNaomi.addPartToState(nTmp, EYE2_ID, "sadbig");
expNaomi.addPartToState(nTmp, MOUTH_ID, "medium");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 0);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 0);
expNaomi.addState("move1", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.3, 1);
expNaomi.addPartToState(nTmp, EYE1_ID, "sadbig");
expNaomi.addPartToState(nTmp, EYE2_ID, "sadbig");
expNaomi.addPartToState(nTmp, MOUTH_ID, "nervous");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 0);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 0);
expNaomi.addState("move2", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.3, 1);
expNaomi.addPartToState(nTmp, EYE1_ID, "medium");
expNaomi.addPartToState(nTmp, EYE2_ID, "medium");
expNaomi.addPartToState(nTmp, MOUTH_ID, "open2");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 0);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 0);
expNaomi.addState("move3", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.2, 0.5);
expNaomi.addPartToState(nTmp, EYE1_ID, "sadbig");
expNaomi.addPartToState(nTmp, EYE2_ID, "medium");
expNaomi.addPartToState(nTmp, MOUTH_ID, "small");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 0);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 0);
expNaomi.addState("wonder", nTmp);
nTmp = [];
expNaomi.addStateAttributes(nTmp, false, 0.2, 1);
expNaomi.addPartToState(nTmp, EYE1_ID, "medium");
expNaomi.addPartToState(nTmp, EYE2_ID, "medium");
expNaomi.addPartToState(nTmp, MOUTH_ID, "happy");
expNaomi.addPartToState(nTmp, PUPIL1_ID, null, NaN, NaN, 0, 0);
expNaomi.addPartToState(nTmp, PUPIL2_ID, null, NaN, NaN, 0, 0);
expNaomi.addState("warm", nTmp);
expNaomi.activate();
expNaomi.setState("normal");
speech = new Speech(speech_mc._txt);
curPhrase = 0;
expandPhrases = [];
kicked = false;
energy = false;
rubPhrase = false;
bedPhrase = false;
expandPhrases[0] = "Is it on? I feel something weird.";
expandPhrases[1] = "A-ah! I'm growing!";
expandPhrases[2] = "This feels... nice.";
expandPhrases[3] = "Huh... it's over... It feels so full.";
expandPhrases[4] = "W-what!? This is getting too big!";
speech.addEventListener("speechCleared", speechFinished);
rina = new Rina();
expRina = new Expression(stage);
rina.belly.gotoAndStop(1);
R_EYE1_ID = expRina.addPart(rina.eye1, Expression.ANIMATED, true);
R_EYE2_ID = expRina.addPart(rina.eye2, Expression.ANIMATED, true);
R_MOUTH_ID = expRina.addPart(rina.mouth, Expression.ANIMATED);
rTmp = [];
expRina.addStateAttributes(rTmp, true, 0.1, 1);
expRina.addPartToState(rTmp, R_EYE1_ID, "open");
expRina.addPartToState(rTmp, R_EYE2_ID, "open");
expRina.addPartToState(rTmp, R_MOUTH_ID, "closed");
expRina.addState("normal", rTmp);
rTmp = [];
expRina.addStateAttributes(rTmp, true, 0.1, 1);
expRina.addPartToState(rTmp, R_EYE1_ID, "open");
expRina.addPartToState(rTmp, R_EYE2_ID, "open");
expRina.addPartToState(rTmp, R_MOUTH_ID, "teeth");
expRina.addState("notice", rTmp);
rTmp = [];
expRina.addStateAttributes(rTmp, true, 0.1, 1);
expRina.addPartToState(rTmp, R_EYE1_ID, "open");
expRina.addPartToState(rTmp, R_EYE2_ID, "open");
expRina.addPartToState(rTmp, R_MOUTH_ID, "open");
expRina.addState("surprised", rTmp);
rTmp = [];
expRina.addStateAttributes(rTmp, true, 0.1, 1);
expRina.addPartToState(rTmp, R_EYE1_ID, "small");
expRina.addPartToState(rTmp, R_EYE2_ID, "small");
expRina.addPartToState(rTmp, R_MOUTH_ID, "small");
expRina.addState("over", rTmp);
rTmp = [];
expRina.addStateAttributes(rTmp, true, 0.1, 1);
expRina.addPartToState(rTmp, R_EYE1_ID, "open");
expRina.addPartToState(rTmp, R_EYE2_ID, "open");
expRina.addPartToState(rTmp, R_MOUTH_ID, "closed");
expRina.addState("wonder", rTmp);
expRina.setState("normal");
expRina.activate();
RINA_DISPLAYED = false;
rinaBmpD = new BitmapData(MACHINE_SCREEN_WIDTH, MACHINE_SCREEN_HEIGHT, false, 0);
rinaBmp = new Bitmap(rinaBmpD);
rinaCTrans = new ColorTransform();
rinaVisible = 0;
rinaPerlin = new BitmapData(1, MACHINE_SCREEN_HEIGHT, true, 0);
rinaPerlinCTrans = new ColorTransform();
rinaNoise = new BitmapData(MACHINE_SCREEN_WIDTH, MACHINE_SCREEN_HEIGHT, false, 0);
rinaHeight = 0;
rinaMatrix = new Matrix();
rinaNoiseMatrix = new Matrix();
rinaNoiseCTrans = new ColorTransform();
rinaBmpRect = new Rectangle(0, 0, MACHINE_SCREEN_WIDTH, MACHINE_SCREEN_HEIGHT);
rinaNoiseID = 0;
rinaPerlinY = 1;
machineScreen.addChildAt(rinaBmp, 0);
rinaBmp.visible = false;
rinaNoiseCTrans.alphaMultiplier = 1;
rinaNoiseMatrix.a = MACHINE_SCREEN_WIDTH;
rinaPerlinCTrans.alphaMultiplier = 0.25;
rinaPerlin.noise(2344, 0, 0xFF, 7, true);
rinaPerlin.noise(2344, 0, 0xFF, 7, true);
rinaPerlin.copyPixels(rinaPerlin, rinaBmpRect, new Point(), rinaPerlin, new Point(), true);
rinaCTrans.redMultiplier = (rinaCTrans.greenMultiplier = (rinaCTrans.blueMultiplier = 0.95));
rinaCTrans.redOffset = (rinaCTrans.greenOffset = (rinaCTrans.blueOffset = (0xFF * 0.05)));
stage.addEventListener(Event.ENTER_FRAME, eFrame, false, 100, true);
stage.addEventListener(MouseEvent.MOUSE_DOWN, enableEventListeners, false, 0, true);
reset();
stage.addEventListener(MouseEvent.MOUSE_UP, enableScreenDragging);
breastSize = (bellySize = 0);
}
public function machineMove(_arg1:MouseEvent){
var _local2:Number;
var _local3:Number;
if (machine.mouseY < SLIDER_Y){
selectedMachineButton.y = SLIDER_Y;
} else {
if (machine.mouseY > (SLIDER_Y + SLIDER_HEIGHT)){
selectedMachineButton.y = (SLIDER_Y + SLIDER_HEIGHT);
} else {
selectedMachineButton.y = machine.mouseY;
};
};
_local2 = ((selectedMachineButton.y - SLIDER_Y) * INV_SLIDER_HEIGHT);
_local3 = (1 - (_local2 * 2));
selectedMachineButton.x = (sliderX + (SLIDER_WIDTH * _local2));
switch (selectedMachineButton){
case machine._red_slider:
breastGrowth = _local3;
break;
case machine._blue_slider:
bellyGrowth = _local3;
break;
case machine._white_slider:
bellyGrowth = (breastGrowth = _local3);
machine._red_slider.y = (machine._blue_slider.y = selectedMachineButton.y);
machine._red_slider.x = (RED_SLIDER_X + (SLIDER_WIDTH * _local2));
machine._blue_slider.x = (BLUE_SLIDER_X + (SLIDER_WIDTH * _local2));
break;
};
}
public function updateEyes(){
var _local1:Object;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Object;
var _local9:Object;
var _local10:Object;
var _local11:Object;
var _local12:Object;
var _local13:Object;
_local1 = naomi.head;
_local2 = Math.sin(_local1.rotationY);
_local3 = Math.sin(_local1.rotationX);
_local4 = (_local2 * PUPIL_Z);
_local5 = (_local3 * PUPIL_Z);
_local6 = (_local2 * IRIS_Z);
_local7 = (_local3 * IRIS_Z);
_local8 = naomi.head.eye1;
_local9 = _local8.iris;
_local10 = _local9.pupil;
_local11 = naomi.head.eye2;
_local12 = _local11.iris;
_local13 = _local12.pupil;
_local10.x = (P1CX + _local4);
_local10.y = (P1CY + _local5);
_local13.x = (P2CX + _local4);
_local13.y = (P2CY + _local5);
_local9.scaleX = _local8.scaleX;
_local9.scaleY = _local8.scaleY;
_local12.scaleX = _local11.scaleX;
_local12.scaleY = _local11.scaleY;
}
public function updateTopPhysics(){
var _local1:int;
var _local2:int;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:int;
_local1 = TOP_LEFT_SPRINGS.length;
_local2 = TOP_LEFT_POINTS.length;
_local15 = 0;
while (_local15 < _local2) {
_local3 = TOP_LEFT_POINTS[_local15];
_local3[4] = (_local3[5] = 0);
_local3 = TOP_RIGHT_POINTS[_local15];
_local3[4] = (_local3[5] = 0);
_local15++;
};
_local15 = 0;
while (_local15 < _local1) {
_local6 = TOP_LEFT_SPRINGS[_local15];
_local4 = TOP_LEFT_POINTS[_local6[0]];
_local5 = TOP_LEFT_POINTS[_local6[1]];
_local7 = _local6[2];
_local8 = (_local5[0] - _local4[0]);
_local9 = (_local5[1] - _local4[1]);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local11 = (1 / _local10);
_local12 = (TOP_SPRING_FORCE * (_local7 - _local10));
_local13 = ((_local12 * _local8) * _local11);
_local14 = ((_local12 * _local9) * _local11);
_local4[4] = (_local4[4] - _local13);
_local5[4] = (_local5[4] + _local13);
_local4[5] = (_local4[5] - _local14);
_local5[5] = (_local5[5] + _local14);
_local6 = TOP_RIGHT_SPRINGS[_local15];
_local4 = TOP_RIGHT_POINTS[_local6[0]];
_local5 = TOP_RIGHT_POINTS[_local6[1]];
_local7 = _local6[2];
_local8 = (_local5[0] - _local4[0]);
_local9 = (_local5[1] - _local4[1]);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local11 = (1 / _local10);
_local12 = (TOP_SPRING_FORCE * (_local7 - _local10));
_local13 = ((_local12 * _local8) * _local11);
_local14 = ((_local12 * _local9) * _local11);
_local4[4] = (_local4[4] - _local13);
_local5[4] = (_local5[4] + _local13);
_local4[5] = (_local4[5] - _local14);
_local5[5] = (_local5[5] + _local14);
_local15++;
};
_local15 = 0;
while (_local15 < _local2) {
_local3 = TOP_LEFT_POINTS[_local15];
_local3[0] = (_local3[0] + (_local3[2] * TOP_SPRING_FRICTION));
_local3[1] = (_local3[1] + (_local3[3] * TOP_SPRING_FRICTION));
_local3[2] = ((INV_TOP_SPRING_MULTIPLIER * _local3[2]) + (_local3[4] * TOP_SPRING_MULTIPLIER));
_local3[3] = ((INV_TOP_SPRING_MULTIPLIER * _local3[3]) + (_local3[5] * TOP_SPRING_MULTIPLIER));
_local3 = TOP_RIGHT_POINTS[_local15];
_local3[0] = (_local3[0] + (_local3[2] * TOP_SPRING_FRICTION));
_local3[1] = (_local3[1] + (_local3[3] * TOP_SPRING_FRICTION));
_local3[2] = ((INV_TOP_SPRING_MULTIPLIER * _local3[2]) + (_local3[4] * TOP_SPRING_MULTIPLIER));
_local3[3] = ((INV_TOP_SPRING_MULTIPLIER * _local3[3]) + (_local3[5] * TOP_SPRING_MULTIPLIER));
_local15++;
};
}
public function updatePosition(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:Number;
_local1 = naomi.bed.x;
_local2 = naomi.bed.y;
naomi.bed.x = (naomi.bed.x + ((DEST_BED_X - naomi.bed.x) * 0.5));
naomi.bed.y = (naomi.bed.y + ((DEST_BED_Y - naomi.bed.y) * 0.5));
_local1 = (naomi.bed.x - _local1);
_local2 = (naomi.bed.y - _local2);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
bedHistory[bedHistoryPos] = _local3;
bedHistoryPos = ((bedHistoryPos + 1) % bedHistoryLength);
_local4 = 0;
_local5 = 0;
while (_local5 < bedHistoryLength) {
_local4 = (_local4 + bedHistory[((bedHistoryPos + _local5) % bedHistoryLength)]);
_local5++;
};
if ((((_local4 > 80)) && (((!(expNaomi.reacting)) || ((expNaomi.timer < 2)))))){
if (!bedReaction){
bedReaction = (1 + Math.floor((Math.random() * 3)));
};
expNaomi.react(bedReactions[bedReaction], 10);
if (bedPhrase){
bedPhrase = false;
_local6 = Math.random();
if (_local6 < 0.333){
speech.say("Heyyy! W-what's that for?");
} else {
if (_local6 < 0.666){
speech.say("Whoahoahoahoa...");
} else {
speech.say("Uuuhhhhh... My boobs are bouncing around.");
};
};
};
} else {
if ((((_local4 == 0)) && (bedReaction))){
bedReaction = 0;
};
};
moveNaomi((((naomi.bed.x + NAOMI_BED_X) - naomi.body.x) * 0.5), (((naomi.bed.y + NAOMI_BED_Y) - naomi.body.y) * 0.5));
Physics.updateElastic(ELASTIC_LIST);
}
public function updateBlobs(){
var _local1:Number;
var _local2:Number;
var _local3:Graphics;
var _local4:Matrix;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:int;
var _local10:int;
var _local11:Number;
var _local12:Number;
var _local13:Number;
belly.update();
bellyWhite.update();
breast1.update();
breast2.update();
container.update();
belly.draw();
bellyWhite.draw();
breast1.draw();
breast2.draw();
if (modifier == 4){
bellyGlow.x = bellyWhite.xValues[0];
bellyGlow.y = bellyWhite.yValues[0];
breast1Glow.x = breast1.xValues[0];
breast1Glow.y = breast1.yValues[0];
breast2Glow.x = breast2.xValues[0];
breast2Glow.y = breast2.yValues[0];
_local4 = new Matrix();
_local9 = Math.floor(glowPosition);
_local10 = Math.ceil(glowPosition);
_local11 = (glowPosition - _local9);
_local5 = GLOW_LIGHTS[_local9];
_local6 = GLOW_LIGHTS[_local10];
_local7 = Color.interpolateColor(_local5, _local6, _local11);
_local5 = GLOW_COLORS[_local9];
_local6 = GLOW_COLORS[_local10];
_local8 = Color.interpolateColor(_local5, _local6, _local11);
_local12 = 1.25;
_local13 = (_local12 * 2);
_local3 = bellyGlow.graphics;
_local4.createGradientBox((belly.blobXRadius * _local13), (belly.blobYRadius * _local13), 0, (-(belly.blobXRadius) * _local12), (-(belly.blobYRadius) * _local12));
_local3.clear();
_local3.beginGradientFill(GradientType.RADIAL, [_local7, _local8, _local8], [(0.75 * Math.min(bellySize, 1)), (0.5 * Math.min(bellySize, 1)), 0], [64, 128, 0xFF], _local4);
_local3.drawRect((-(belly.blobXRadius) * 2), (-(belly.blobYRadius) * 2), (belly.blobXRadius * 4), (belly.blobYRadius * 4));
_local3.endFill();
_local3 = breast1Glow.graphics;
_local4.createGradientBox((breast1.blobXRadius * _local13), (breast1.blobYRadius * _local13), 0, (-(breast1.blobXRadius) * _local12), (-(breast1.blobYRadius) * _local12));
_local3.clear();
_local3.beginGradientFill(GradientType.RADIAL, [_local7, _local8, _local8], [(0.75 * Math.min(breastSize, 1)), (0.5 * Math.min(breastSize, 1)), 0], [64, 128, 0xFF], _local4);
_local3.drawRect((-(breast1.blobXRadius) * 2), (-(breast1.blobYRadius) * 2), (breast1.blobXRadius * 4), (breast1.blobYRadius * 4));
_local3.endFill();
_local3 = breast2Glow.graphics;
_local4.createGradientBox((breast2.blobXRadius * _local13), (breast2.blobYRadius * _local13), 0, (-(breast2.blobXRadius) * _local12), (-(breast2.blobYRadius) * _local12));
_local3.clear();
_local3.beginGradientFill(GradientType.RADIAL, [_local7, _local8, _local8], [(0.75 * Math.min(breastSize, 1)), (0.5 * Math.min(breastSize, 1)), 0], [64, 128, 0xFF], _local4);
_local3.drawRect((-(breast2.blobXRadius) * 2), (-(breast2.blobYRadius) * 2), (breast2.blobXRadius * 4), (breast2.blobYRadius * 4));
_local3.endFill();
};
_local1 = (breast1.xValues[1] + breast2.xValues[1]);
_local2 = 0.2;
if ((((((_local1 < -(_local2))) && ((naomi.getChildIndex(breast1) < naomi.getChildIndex(breast2))))) || ((((_local1 > _local2)) && ((naomi.getChildIndex(breast1) > naomi.getChildIndex(breast2))))))){
naomi.swapChildren(breast1, breast2);
};
}
public function machineUp(_arg1:MouseEvent){
var _local2:MovieClip;
var _local3:int;
SCREEN_DRAG_ENABLED = true;
_local2 = (_arg1.target as MovieClip);
switch (selectedMachineButton){
case machine._red:
case machine._green:
case machine._yellow:
case machine._blue:
if (_local2 == selectedMachineButton){
_local3 = _local2.currentFrame;
machine._red.gotoAndStop(1);
machine._green.gotoAndStop(1);
machine._yellow.gotoAndStop(1);
machine._blue.gotoAndStop(1);
selectedMachineButton.gotoAndStop(2);
} else {
selectedMachineButton.gotoAndStop((selectedMachineButton.currentFrame - 2));
};
break;
case machine._b1:
case machine._b2:
case machine._b3:
case machine._b4:
case machine._left:
case machine._right:
case machine._up:
case machine._down:
case machine._center:
selectedMachineButton.prevFrame();
break;
case machine._red_slider:
case machine._blue_slider:
case machine._white_slider:
stage.removeEventListener(MouseEvent.MOUSE_MOVE, machineMove);
break;
};
switch (selectedMachineButton){
case machine._center:
case machine._up:
case machine._down:
machine._l3.gotoAndStop(1);
break;
};
if (_local2 == selectedMachineButton){
switch (_local2){
case machine._center:
if (rinaBmp.visible){
rinaHeight = 0;
} else {
resetScreen();
};
break;
case machine._red:
if (modifier == 4){
bellyWhite.removeChild(bellyGlow);
breast1.removeChild(breast1Glow);
breast2.removeChild(breast2Glow);
};
rinaBmp.visible = false;
modifier = 1;
if (!screenMode){
screenMode = 1;
machine._light.gotoAndStop(2);
machine._l4.gotoAndStop((screenMode + 1));
machineScreenText.text = screenMode.toString();
};
break;
case machine._green:
if (modifier == 4){
bellyWhite.removeChild(bellyGlow);
breast1.removeChild(breast1Glow);
breast2.removeChild(breast2Glow);
};
rinaBmp.visible = false;
modifier = 2;
if (!screenMode){
screenMode = 1;
machine._light.gotoAndStop(2);
machine._l4.gotoAndStop((screenMode + 1));
machineScreenText.text = screenMode.toString();
};
break;
case machine._yellow:
if (modifier == 4){
bellyWhite.removeChild(bellyGlow);
breast1.removeChild(breast1Glow);
breast2.removeChild(breast2Glow);
};
rinaBmp.visible = false;
modifier = 3;
if (!screenMode){
screenMode = 1;
machine._light.gotoAndStop(2);
machine._l4.gotoAndStop((screenMode + 1));
machineScreenText.text = screenMode.toString();
};
break;
case machine._blue:
if (modifier != 4){
bellyWhite.addChild(bellyGlow);
breast1.addChild(breast1Glow);
breast2.addChild(breast2Glow);
bellyGlow.x = bellyWhite.xValues[0];
bellyGlow.y = bellyWhite.yValues[0];
breast1Glow.x = breast1.xValues[0];
breast1Glow.y = breast1.yValues[0];
breast2Glow.x = breast2.xValues[0];
breast2Glow.y = breast2.yValues[0];
};
if (glowPosition == RINA_GLOW){
rinaBmp.visible = true;
};
modifier = 4;
if (!screenMode){
screenMode = 1;
machine._light.gotoAndStop(2);
machine._l4.gotoAndStop((screenMode + 1));
machineScreenText.text = screenMode.toString();
};
break;
case machine._b1:
if (modifier){
rinaBmp.visible = false;
screenMode = 1;
machine._l4.gotoAndStop((screenMode + 1));
machineScreenText.text = screenMode.toString();
machine._txt.visible = false;
};
break;
case machine._b2:
if (modifier){
rinaBmp.visible = false;
screenMode = 2;
machine._l4.gotoAndStop((screenMode + 1));
machineScreenText.text = screenMode.toString();
machine._txt.visible = false;
};
break;
case machine._b3:
if (modifier){
rinaBmp.visible = false;
screenMode = 3;
machine._l4.gotoAndStop((screenMode + 1));
machineScreenText.text = screenMode.toString();
machine._txt.visible = true;
};
break;
case machine._b4:
if (modifier){
machine._txt.visible = false;
if ((((glowPosition == RINA_GLOW)) && ((modifier == 4)))){
rinaBmp.visible = true;
};
screenMode = 4;
machine._l4.gotoAndStop((screenMode + 1));
machineScreenText.text = screenMode.toString();
};
break;
};
};
selectedMachineButton = null;
stage.removeEventListener(MouseEvent.MOUSE_UP, machineUp);
}
public function reset(){
bellySize = (breastSize = 0);
updateSize();
belly.stabilize();
bellyWhite.stabilize();
breast1.stabilize();
breast2.stabilize();
expNaomi.setState("normal");
}
public function drawTop(){
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Graphics;
_local7 = top.graphics;
_local7.clear();
_local7.lineStyle(0.1);
_local1 = TOP_LEFT_POINTS;
_local7.beginFill(CLOTHES_COLOR);
_local2 = _local1[0];
_local7.moveTo(_local2[0], _local2[1]);
_local3 = _local1[1];
_local4 = _local1[2];
_local5 = ((_local2[0] + _local4[0]) * 0.5);
_local6 = ((_local2[1] + _local4[1]) * 0.5);
_local7.curveTo(_local3[0], _local3[1], _local4[0], _local4[1]);
_local2 = _local4;
_local3 = _local1[3];
_local4 = _local1[4];
_local5 = ((_local2[0] + _local4[0]) * 0.5);
_local6 = ((_local2[1] + _local4[1]) * 0.5);
_local7.curveTo(_local3[0], _local3[1], _local4[0], _local4[1]);
_local2 = _local1[5];
_local7.lineTo(_local2[0], _local2[1]);
_local3 = _local1[6];
_local4 = _local1[0];
_local5 = ((_local2[0] + _local4[0]) * 0.5);
_local6 = ((_local2[1] + _local4[1]) * 0.5);
_local7.curveTo(_local3[0], _local3[1], _local4[0], _local4[1]);
_local7.endFill();
_local1 = TOP_RIGHT_POINTS;
_local7.beginFill(CLOTHES_COLOR);
_local2 = _local1[0];
_local7.moveTo(_local2[0], _local2[1]);
_local3 = _local1[1];
_local4 = _local1[2];
_local5 = ((_local2[0] + _local4[0]) * 0.5);
_local6 = ((_local2[1] + _local4[1]) * 0.5);
_local7.curveTo(_local3[0], _local3[1], _local4[0], _local4[1]);
_local2 = _local4;
_local3 = _local1[3];
_local4 = _local1[4];
_local5 = ((_local2[0] + _local4[0]) * 0.5);
_local6 = ((_local2[1] + _local4[1]) * 0.5);
_local7.curveTo(_local3[0], _local3[1], _local4[0], _local4[1]);
_local2 = _local1[5];
_local7.lineTo(_local2[0], _local2[1]);
_local3 = _local1[6];
_local4 = _local1[0];
_local5 = ((_local2[0] + _local4[0]) * 0.5);
_local6 = ((_local2[1] + _local4[1]) * 0.5);
_local7.curveTo(_local3[0], _local3[1], _local4[0], _local4[1]);
_local7.endFill();
}
public function rubUp(_arg1:Event){
HEAD_V_ANGLE = (HEAD_H_ANGLE = 0);
stage.removeEventListener(Event.ENTER_FRAME, rubFrame, false);
stage.removeEventListener(MouseEvent.MOUSE_UP, rubUp, false);
}
public function enableEventListeners(_arg1:Event){
stage.removeEventListener(MouseEvent.MOUSE_DOWN, enableEventListeners, false);
expNaomi.react("wonder", -1);
speech.say("Umm... I'm not supposed to move, right? W-what are you going to do to me?");
stage.addEventListener(MouseEvent.MOUSE_DOWN, dragScreen, false, -100, true);
machine.addEventListener(MouseEvent.MOUSE_DOWN, machineDown);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mDown, false, 100, true);
}
public function machineDown(_arg1:MouseEvent){
var _local2:MovieClip;
_local2 = (_arg1.target as MovieClip);
if (!_local2){
return;
};
switch (_local2){
case machine._red:
case machine._green:
case machine._yellow:
case machine._blue:
_local2.gotoAndStop((_local2.currentFrame + 2));
break;
case machine._b1:
case machine._b2:
case machine._b3:
case machine._b4:
case machine._left:
case machine._right:
case machine._up:
case machine._down:
case machine._center:
_local2.nextFrame();
break;
case machine._clip:
_local2.gotoAndStop((3 - _local2.currentFrame));
break;
case machine._red_slider:
sliderX = RED_SLIDER_X;
stage.addEventListener(MouseEvent.MOUSE_MOVE, machineMove);
whiteControl = false;
break;
case machine._blue_slider:
sliderX = BLUE_SLIDER_X;
stage.addEventListener(MouseEvent.MOUSE_MOVE, machineMove);
whiteControl = false;
break;
case machine._white_slider:
sliderX = WHITE_SLIDER_X;
stage.addEventListener(MouseEvent.MOUSE_MOVE, machineMove);
whiteControl = true;
break;
};
switch (_local2){
case machine._up:
machine._l3.gotoAndStop(2);
break;
case machine._down:
machine._l3.gotoAndStop(5);
break;
case machine._center:
machine._l3.gotoAndStop(4);
break;
case machine._light:
if (screenMode == 3){
if (!INFINITE_EXPANSION){
if (rina.belly.currentFrame == rina.belly.totalFrames){
INFINITE_EXPANSION = true;
machine._light.gotoAndStop(3);
};
} else {
INFINITE_EXPANSION = false;
machine._light.gotoAndStop(2);
};
};
break;
};
SCREEN_DRAG_ENABLED = false;
selectedMachineButton = _local2;
stage.addEventListener(MouseEvent.MOUSE_UP, machineUp);
}
public function updateExpansion(){
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = false;
_local2 = 0;
_local3 = 0;
if (!modifier){
bellyGrowth = 0;
breastGrowth = 0;
return;
};
if (((breastGrowth) && (!(rinaBmp.visible)))){
_local4 = breastSize;
breastSize = (breastSize + ((breastGrowth * EXPANSION_SCALE) * BREAST_SCALE));
if (breastSize < 0){
breastSize = 0;
} else {
if ((((breastSize > MAX_BREAST_SIZE)) && (!(INFINITE_EXPANSION)))){
breastSize = MAX_BREAST_SIZE;
};
};
if (_local4 != breastSize){
_local2 = (breastSize - _local4);
};
};
if (((bellyGrowth) && (!(rinaBmp.visible)))){
_local4 = bellySize;
bellySize = (bellySize + (bellyGrowth * EXPANSION_SCALE));
if (bellySize < 0){
bellySize = 0;
} else {
if ((((bellySize > MAX_BELLY_SIZE)) && (!(INFINITE_EXPANSION)))){
bellySize = MAX_BELLY_SIZE;
};
};
if (_local4 != bellySize){
_local3 = (bellySize - _local4);
};
};
if (((((((!(energy)) && (!(speech.speaking)))) && (!(expNaomi.reacting)))) && ((((bellySize > 0.333)) || ((breastSize > 0.333)))))){
expNaomi.react("warm", -1);
speech.say("Oh! This feels really warm!");
energy = true;
};
if ((_local2 * _local3) < 0){
_local5 = (Math.max(bellySize, (breastSize * INV_BREAST_SCALE)) / MAX_BELLY_SIZE);
expNaomi.setState("confusion");
} else {
if ((((_local2 > 0)) || ((_local3 > 0)))){
_local5 = (Math.max(bellySize, (breastSize * INV_BREAST_SCALE)) / MAX_BELLY_SIZE);
if ((((((_local5 > 1)) && ((curPhrase <= 4)))) && (!(expNaomi.reacting)))){
speech.say(expandPhrases[4]);
curPhrase = 5;
};
if ((((((_local5 >= 1)) && ((curPhrase <= 3)))) && (!(expNaomi.reacting)))){
speech.say(expandPhrases[3]);
curPhrase = 4;
};
if ((((((_local5 > 0.666)) && ((curPhrase <= 2)))) && (!(expNaomi.reacting)))){
speech.say(expandPhrases[2]);
curPhrase = 3;
};
if ((((((_local5 > 0.333)) && ((curPhrase <= 1)))) && (!(expNaomi.reacting)))){
speech.say(expandPhrases[1]);
curPhrase = 2;
};
if ((((((_local5 > 0.01)) && ((curPhrase <= 0)))) && (!(expNaomi.reacting)))){
speech.say(expandPhrases[0]);
curPhrase = 1;
};
switch (true){
case (_local5 < 0.333):
expNaomi.setState("expand1");
break;
case (_local5 < 0.666):
expNaomi.setState("expand2");
break;
case (_local5 < 1):
expNaomi.setState("expand3");
break;
case (_local5 == 1):
expNaomi.setState("over");
break;
case (_local5 > 1):
expNaomi.setState("worried");
break;
};
} else {
if ((((_local2 < 0)) || ((_local3 < 0)))){
_local5 = (Math.max(bellySize, (breastSize * INV_BREAST_SCALE)) / MAX_BELLY_SIZE);
switch (true){
case (_local5 < 0.01):
expNaomi.setState("normal");
break;
case (_local5 < 0.5):
expNaomi.setState("revert1");
break;
case (_local5 >= 0.5):
expNaomi.setState("revert2");
break;
};
} else {
_local5 = (Math.min(bellySize, (breastSize * INV_BREAST_SCALE)) / MAX_BELLY_SIZE);
switch (true){
case (_local5 < 0.01):
expNaomi.setState("normal");
break;
case (_local5 < 0.333):
expNaomi.setState("confused");
break;
case (_local5 < 0.666):
expNaomi.setState("notice");
break;
case (_local5 < 1):
expNaomi.setState("embarassed");
break;
case (_local5 == 1):
if ((((((curPhrase == 3)) && (!(speech.speaking)))) && (!(expNaomi.reacting)))){
speech.say(expandPhrases[3]);
curPhrase++;
};
expNaomi.setState("over");
break;
case (_local5 > 1):
expNaomi.setState("nervous");
break;
};
};
};
};
updateSize();
if (_local2){
if (_local3){
machine._l1.gotoAndStop(4);
if (_local3 < 0){
if (_local2 < 0){
machine._l2.gotoAndStop(5);
} else {
machine._l2.gotoAndStop(4);
};
} else {
if (_local2 < 0){
machine._l2.gotoAndStop(4);
} else {
machine._l2.gotoAndStop(2);
};
};
} else {
machine._l1.gotoAndStop(2);
if (_local2 < 0){
machine._l2.gotoAndStop(5);
} else {
machine._l2.gotoAndStop(2);
};
};
} else {
if (_local3){
machine._l1.gotoAndStop(5);
if (_local3 < 0){
machine._l2.gotoAndStop(5);
} else {
machine._l2.gotoAndStop(2);
};
} else {
machine._l1.gotoAndStop(1);
machine._l2.gotoAndStop(1);
bellyGrowth = (breastGrowth = 0);
};
};
_local6 = Math.min(bellySize, 1);
_local7 = Math.min(breastSize, 1);
switch (modifier){
case 1:
break;
case 2:
belly.deformFactor = (((1 - _local6) * belly.deformFactor) + (_local6 * 0));
belly.bounceFactor = (((1 - _local6) * belly.bounceFactor) + ((_local6 * belly.bounceFactor) * 0.1));
belly.blobEggFactor = (((1 - _local6) * belly.blobEggFactor) + (_local6 * 1));
belly.speed++;
bellyWhite.deformFactor = belly.deformFactor;
bellyWhite.bounceFactor = belly.bounceFactor;
bellyWhite.blobEggFactor = belly.blobEggFactor;
bellyWhite.speed = belly.speed;
breast1.deformFactor = (breast2.deformFactor = (((1 - _local7) * breast1.deformFactor) + (_local7 * 0)));
breast1.bounceFactor = (breast2.bounceFactor = (((1 - _local7) * breast1.bounceFactor) + ((_local7 * breast1.bounceFactor) * 0.1)));
breast1.blobEggFactor = (breast2.blobEggFactor = (((1 - _local7) * breast1.blobEggFactor) + (_local7 * 1)));
breast1.speed++;
breast2.speed = breast1.speed;
break;
case 3:
belly.deformFactor = (((1 - _local6) * belly.deformFactor) + (_local6 * 0.75));
belly.bounceFactor = (((1 - _local6) * belly.bounceFactor) + (_local6 * 0.5));
belly.multiplier = (((1 - _local6) * belly.multiplier) + ((_local6 * belly.multiplier) * 1.2));
bellyWhite.deformFactor = belly.deformFactor;
bellyWhite.bounceFactor = belly.bounceFactor;
bellyWhite.multiplier = belly.multiplier;
breast1.multiplier = (breast1.multiplier * 1.1);
breast2.multiplier = breast1.multiplier;
breast1.deformFactor = (breast2.deformFactor = (((1 - _local7) * breast1.deformFactor) + (_local7 * 0.75)));
break;
case 4:
break;
};
}
public function rotateRoundObject(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Number){
_arg1.y = ((_arg2 + _arg3) - (Math.cos(_arg4) * _arg3));
}
public function createSpring(_arg1:Array, _arg2:int, _arg3:int):Array{
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:Number;
_local4 = _arg1[_arg2];
_local5 = _arg1[_arg3];
_local6 = (_local4[0] - _local5[0]);
_local7 = (_local4[1] - _local5[1]);
return ([_arg2, _arg3, Math.sqrt(((_local6 * _local6) + (_local7 * _local7)))]);
}
public function rubFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Boolean;
var _local11:Number;
var _local12:Number;
_local2 = stage.mouseX;
_local3 = stage.mouseY;
_local4 = naomi.mouseX;
_local5 = naomi.mouseY;
_local10 = false;
_local11 = (2 + (3 * breastSize));
if (breast1.hitTestBlob(_local2, _local3)){
_local6 = (((breast1.x + breast1.destX) - _local4) / breast1.blobXRadius);
_local7 = (((breast1.y + breast1.destY) - _local5) / breast1.blobYRadius);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local9 = (_local11 / _local8);
breast1.xValues[1] = (breast1.xValues[1] + (_local6 * _local9));
breast1.yValues[1] = (breast1.yValues[1] + (_local7 * _local9));
if (!_local10){
_local10 = true;
if (((!(expNaomi.reacting)) || ((expNaomi.timer < 2)))){
expNaomi.react("rubbreasts", 10);
if (rubPhrase){
speech.say("Heh, heh... You like this?");
rubPhrase = false;
};
};
};
};
if (breast2.hitTestBlob(_local2, _local3)){
_local6 = (((breast2.x + breast2.destX) - _local4) / breast2.blobXRadius);
_local7 = (((breast2.y + breast2.destY) - _local5) / breast2.blobYRadius);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local9 = (_local11 / _local8);
breast2.xValues[1] = (breast2.xValues[1] + (_local6 * _local9));
breast2.yValues[1] = (breast2.yValues[1] + (_local7 * _local9));
if (!_local10){
_local10 = true;
if (((!(expNaomi.reacting)) || ((expNaomi.timer < 2)))){
expNaomi.react("rubbreasts", 10);
if (rubPhrase){
speech.say("Heh, heh... You like this?");
rubPhrase = false;
};
};
};
};
if (((!(_local10)) && (((naomi.head.hitTestPoint(_local2, _local3, true)) || (naomi.hair3.hitTestPoint(_local2, _local3, true)))))){
_local6 = (naomi.head.x - _local4);
_local7 = ((naomi.head.y - _local5) - 100);
_local12 = (1 / 700);
HEAD_H_ANGLE = (_local6 * _local12);
HEAD_V_ANGLE = (_local7 * _local12);
if (!_local10){
_local10 = true;
if (((!(expNaomi.reacting)) || ((expNaomi.timer < 2)))){
expNaomi.react("rubhead", 10);
if (rubPhrase){
speech.say("Mmm Hmmm...");
rubPhrase = false;
};
};
};
} else {
HEAD_H_ANGLE = 0;
};
if (belly.hitTestBlob(_local2, _local3)){
_local6 = (((belly.x + belly.destX) - _local4) / belly.blobXRadius);
_local7 = (((belly.y + belly.destY) - _local5) / belly.blobYRadius);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local9 = ((5 * bellySize) / _local8);
belly.xValues[1] = (belly.xValues[1] + (_local6 * _local9));
belly.yValues[1] = (belly.yValues[1] + (_local7 * _local9));
bellyWhite.xValues[1] = (bellyWhite.xValues[1] + (_local6 * _local9));
bellyWhite.yValues[1] = (bellyWhite.yValues[1] + (_local7 * _local9));
if (!_local10){
_local10 = true;
if (((!(expNaomi.reacting)) || ((expNaomi.timer < 2)))){
expNaomi.react("rubbelly", 10);
if (rubPhrase){
if (bellySize < 0.5){
speech.say("Ahh, that feels nice.");
} else {
if (Math.random() < 0.5){
speech.say("I like this experiment.");
} else {
speech.say("Rubbing my big belly feels nice.");
};
};
rubPhrase = false;
};
};
};
};
}
public function updateHead(){
var _local1:Number;
naomi.head.rotationY = (naomi.head.rotationY + ((HEAD_H_ANGLE - naomi.head.rotationY) * HEAD_H_SPEED));
naomi.head.rotationX = (naomi.head.rotationX + ((HEAD_V_ANGLE - naomi.head.rotationX) * HEAD_V_SPEED));
naomi.head.rotationZ = (naomi.head.rotationZ + ((HEAD_Z_ANGLE - naomi.head.rotationZ) * HEAD_Z_SPEED));
_local1 = naomi.head.rotationZ;
if (_local1 > MAX_Z_ANGLE){
_local1 = MAX_Z_ANGLE;
};
if (_local1 < MIN_Z_ANGLE){
_local1 = MAX_Z_ANGLE;
};
naomi.head.rotation = (naomi.head.rotationZ = _local1);
naomi.hair3.rotation = (naomi.head.rotation * 0.75);
rotateHeadHorizontal(naomi.head.rotationY);
rotateHeadVertical(naomi.head.rotationX);
updateEyes();
}
public function kick(){
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:Number;
var _local10:Number;
var _local11:Number;
var _local12:int;
var _local13:Number;
var _local14:Number;
if (kickObject){
return;
};
if (!kicked){
kicked = true;
speech.say("Uh... oh! I feel moving inside me!");
};
if (Math.random() < (1 / 3)){
expNaomi.react("kick1", 10);
} else {
if (Math.random() < (2 / 3)){
expNaomi.react("kick2", 10);
} else {
expNaomi.react("kick3", 10);
};
};
_local1 = (Math.random() * MAX_KICK_DISTANCE);
_local2 = ((Math.random() * 2) * Math.PI);
_local3 = (Math.cos(_local2) * _local1);
_local4 = (Math.sin(_local2) * _local1);
_local5 = ((Math.random() * Math.PI) * 2);
_local6 = (Math.random() * MAX_KICK_MOVE);
_local7 = (_local3 + (Math.cos(_local5) * _local6));
_local8 = (_local4 + (Math.sin(_local5) * _local6));
_local9 = Math.atan2(_local8, _local7);
_local10 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
if ((_local9 - _local2) > Math.PI){
_local9 = (_local9 - (2 * Math.PI));
} else {
if ((_local2 - _local9) >= Math.PI){
_local2 = (_local2 - (2 * Math.PI));
};
};
if (_local10 > MAX_KICK_DISTANCE){
_local10 = MAX_KICK_DISTANCE;
};
_local11 = (MIN_KICK_HEIGHT + (Math.random() * KICK_HEIGHT_RANGE));
_local12 = (MIN_KICK_LIFE + (Math.random() * KICK_LIFE_RANGE));
_local13 = (MIN_KICK_RADIUS + (Math.random() * KICK_RADIUS_RANGE));
_local14 = Math.min(bellySize, 1);
belly.xValues[1] = (belly.xValues[1] + (((Math.cos(_local2) * 20) * _local11) * _local14));
belly.yValues[1] = (belly.yValues[1] + (((Math.sin(_local2) * 20) * _local11) * _local14));
bellyWhite.xValues[1] = (bellyWhite.xValues[1] + (((Math.cos(_local2) * 20) * _local11) * _local14));
bellyWhite.yValues[1] = (bellyWhite.yValues[1] + (((Math.sin(_local2) * 20) * _local11) * _local14));
kickObject = {startAngle:_local2, startDistance:_local1, endAngle:_local9, endDistance:_local10, maxHeight:_local11, maxLife:_local12, maxRadius:_local13, life:0};
}
public function rotateHeadVertical(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Point;
var _local8:Point;
if (_arg1 > MAX_V_ANGLE){
_arg1 = MAX_V_ANGLE;
};
if (_arg1 < MIN_V_ANGLE){
_arg1 = MIN_V_ANGLE;
};
naomi.head.rotationX = _arg1;
_local3 = Math.sin(_arg1);
_local4 = Math.cos(_arg1);
_local5 = (Math.sin((_arg1 + MOUTH_START_YANGLE)) * MOUTH_MAX_YSCALE);
_local6 = (Math.cos((_arg1 + MOUTH_START_YANGLE)) * MOUTH_MAX_YSCALE);
rotateRoundObject(naomi.head.face, HEAD_Y, HEAD_DIST, _arg1);
rotateRoundObject(naomi.head.mouth_fur, MOUTH_FUR_Y, MOUTH_FUR_DIST, _arg1);
naomi.head.mouth.y = rotateHeadPart(MOUTH_Y, MOUTH_Z, _arg1);
naomi.head.nose.y = rotateHeadPart(NOSE_Y, NOSE_Z, _arg1);
naomi.head.eye1.y = rotateHeadPart(EYE1_Y, EYE1_Z, _arg1);
naomi.head.eye2.y = rotateHeadPart(EYE2_Y, EYE2_Z, _arg1);
naomi.head.hair1.y = rotateHeadPart(HAIR1_Y, HAIR1_Z, _arg1);
naomi.head.hair2.y = rotateHeadPart(HAIR2_Y, HAIR2_Z, _arg1);
naomi.head.diamond.y = rotateHeadPart(DIAMOND_Y, DIAMOND_Z, _arg1);
naomi.head.ear1.y = rotateHeadPart(EAR1_Y, EAR1_Z, _arg1);
naomi.head.ear2.y = rotateHeadPart(EAR2_Y, EAR2_Z, _arg1);
naomi.head.eye1.scaleY = (naomi.head.eye2.scaleY = (naomi.head.ear1.scaleY = (naomi.head.ear2.scaleY = (naomi.head.diamond.scaleY = _local4))));
naomi.head.mouth_fur.scaleY = (1 + ((MIN_MOUTH_FUR_YSCALE - 1) * _local3));
naomi.head.hair1.scaleY = (1 + ((MIN_HAIR1_YSCALE - 1) * Math.max(_local3, 0)));
naomi.head.hair2.scaleY = (1 + ((MIN_HAIR2_YSCALE - 1) * Math.abs(_local3)));
naomi.head.face.scaleY = (1 + ((MIN_HEAD_YSCALE - 1) * Math.max(_local3, 0)));
naomi.head.mouth.scaleY = _local6;
naomi.head.mouth.visible = (naomi.head.mouth.scaleY > 0);
_local7 = new Point(HAIR3_POINT.x, HAIR3_POINT.y);
if (_local3 > 0){
_local7.y = (_local7.y + (_local3 * HAIR3_DOWN));
};
if (_local3 < 0){
_local7.y = (_local7.y + (-(_local3) * HAIR3_YDIST));
};
_local8 = naomi.globalToLocal(naomi.head.localToGlobal(_local7));
naomi.hair3.y = _local8.y;
naomi.hair3.scaleY = (1 + ((MIN_HAIR3_YSCALE - 1) * Math.max(_local3, 0)));
}
public function moveNaomi(_arg1:Number, _arg2:Number){
naomi.head.rotationX = (naomi.head.rotationX - (anglePerVY * _arg2));
naomi.head.rotationY = (naomi.head.rotationY - (anglePerVX * _arg1));
naomi.head.rotationZ = (naomi.head.rotationZ - (zAnglePerVX * _arg1));
naomi.body.x = (naomi.body.x + _arg1);
naomi.body.y = (naomi.body.y + _arg2);
Physics.updateAttached(ATTACH_LIST);
}
public function enableScreenDragging(_arg1:Event){
SCREEN_DRAG_ENABLED = true;
}
public function screenDraggable():Boolean{
if (machine.x < (stage.stageWidth - 10)){
return (false);
};
if (!SCREEN_DRAG_ENABLED){
return (false);
};
return (true);
}
public function resetScreen(){
naomi.x = ORIG_ENVIRON_X;
naomi.y = ORIG_ENVIRON_Y;
naomi.scaleX = (naomi.scaleY = ORIG_ENVIRON_SCALE);
}
public function updateRina(){
var _local1:Number;
var _local2:Number;
if ((machine._down.currentFrame - 1)){
rinaHeight = (rinaHeight - 2);
if (rinaHeight < (MACHINE_SCREEN_HEIGHT - rina.height)){
rinaHeight = (MACHINE_SCREEN_HEIGHT - rina.height);
};
if (!RINA_DISPLAYED){
RINA_DISPLAYED = true;
machine._txt.appendText("\nSecondary target: Rina the hedgehog");
};
} else {
if ((machine._up.currentFrame - 1)){
rinaHeight = (rinaHeight + 2);
if (rinaHeight > 0){
rinaHeight = 0;
};
if (!RINA_DISPLAYED){
RINA_DISPLAYED = true;
machine._txt.appendText("\nSecondary target: Rina the hedgehog");
};
};
};
_local1 = (SLIDER_Y + (SLIDER_HEIGHT * 0.5));
_local2 = rina.belly.currentFrame;
if (machine._blue_slider.y < (_local1 - 1)){
if (_local2 < rina.belly.totalFrames){
if (_local2 < (rina.belly.totalFrames * 0.1)){
expRina.setState("normal");
} else {
if (_local2 < (rina.belly.totalFrames * 0.333)){
expRina.setState("notice");
} else {
expRina.setState("surprised");
};
};
rina.belly.nextFrame();
if (rina.belly.currentFrame == rina.belly.totalFrames){
};
if (!RINA_DISPLAYED){
RINA_DISPLAYED = true;
machine._txt.appendText("\nSecondary target: Rina the hedgehog");
};
} else {
expRina.setState("over");
};
} else {
if (machine._blue_slider.y > (_local1 + 1)){
if (_local2 > 1){
rina.belly.prevFrame();
expRina.setState("over");
} else {
expRina.setState("normal");
};
} else {
expRina.setState("wonder");
};
};
if (rinaVisible < 0.8){
rinaVisible = (rinaVisible + 0.03125);
if (rinaVisible >= 0.8){
rinaVisible = 0.8;
};
rinaNoiseCTrans.alphaMultiplier = (1 - rinaVisible);
};
rinaMatrix.ty = rinaHeight;
rinaBmpD.fillRect(rinaBmpRect, 0);
rinaBmpD.draw(rina, rinaMatrix, rinaCTrans);
rinaNoise.noise(rinaNoiseID++, 0, 0xFF, 7, true);
rinaBmpD.draw(rinaNoise, null, rinaNoiseCTrans);
rinaPerlinY = (rinaPerlinY + 1);
if (rinaPerlinY > MACHINE_SCREEN_HEIGHT){
rinaPerlinY = (rinaPerlinY - MACHINE_SCREEN_HEIGHT);
};
rinaNoiseMatrix.ty = rinaPerlinY;
rinaBmpD.draw(rinaPerlin, rinaNoiseMatrix, rinaPerlinCTrans);
rinaNoiseMatrix.ty = (rinaPerlinY - MACHINE_SCREEN_HEIGHT);
rinaBmpD.draw(rinaPerlin, rinaNoiseMatrix, rinaPerlinCTrans);
}
public function updateKick(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (!kickObject){
_local6 = (1 / (20 * 5));
if ((((((modifier == 1)) && ((bellySize > 0.2)))) && ((Math.random() < _local6)))){
kick();
};
return;
};
if (kickObject.life > kickObject.maxLife){
kickObject = null;
return;
};
_local1 = (kickObject.life / kickObject.maxLife);
_local2 = (kickObject.startAngle + (_local1 * (kickObject.endAngle - kickObject.startAngle)));
_local3 = (kickObject.startDistance + (_local1 * (kickObject.endDistance - kickObject.startDistance)));
if (_local1 < 0.5){
_local4 = ((kickObject.maxHeight * _local1) * 2);
_local5 = ((kickObject.maxRadius * _local1) * 2);
} else {
_local4 = ((kickObject.maxHeight * (1 - _local1)) * 2);
_local5 = ((kickObject.maxRadius * (1 - _local1)) * 2);
};
_local5 = (_local5 * Math.min(bellyWhite.blobXRadius, bellyWhite.blobYRadius));
kickObject.life++;
kickLightMC.graphics.clear();
kickDarkMC.graphics.clear();
kickLineMC.graphics.clear();
kickDarkMC.graphics.beginFill(BREAST_SHADE, 0.75);
kickLineMC.graphics.lineStyle(0.2);
Drawing.drawKick(kickLightMC.graphics, kickDarkMC.graphics, kickLineMC.graphics, bellyWhite.xValues[0], bellyWhite.yValues[0], bellyWhite.blobXRadius, bellyWhite.blobYRadius, 0, (bellyWhite.xValues[0] + ((Math.cos(_local2) * _local3) * bellyWhite.blobXRadius)), (bellyWhite.yValues[0] + ((Math.sin(_local2) * _local3) * bellyWhite.blobYRadius)), _local5, _local4, BREAST_LIGHT, 16751001, 0.5, 0.5);
kickDarkMC.graphics.endFill();
}
public function mDown(_arg1:Event){
var _local2:Number;
var _local3:Number;
_local2 = stage.mouseX;
OLD_MX = _local2;
_local3 = stage.mouseY;
OLD_MY = _local3;
if ((((((machine.x < (stage.stageWidth - 20))) && ((machine._clip.currentFrame == 1)))) || (!(SCREEN_DRAG_ENABLED)))){
} else {
if (((((((belly.hitTestBlob(_local2, _local3)) || (breast1.hitTestBlob(_local2, _local3)))) || (breast2.hitTestBlob(_local2, _local3)))) || (naomi.head.hitTestPoint(_local2, _local3, true)))){
SCREEN_DRAG_ENABLED = false;
rubPhrase = true;
stage.addEventListener(Event.ENTER_FRAME, rubFrame, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, rubUp, false, 100, true);
} else {
if (((((((((((naomi.body.hitTestPoint(_local2, _local3, true)) || (naomi.leg1.hitTestPoint(_local2, _local3, true)))) || (naomi.leg2.hitTestPoint(_local2, _local3, true)))) || (naomi.arm1.hitTestPoint(_local2, _local3, true)))) || (naomi.arm2.hitTestPoint(_local2, _local3, true)))) || (naomi.tail.hitTestPoint(_local2, _local3, true)))){
SCREEN_DRAG_ENABLED = false;
} else {
if (naomi.bed.hitTestPoint(_local2, _local3, true)){
SCREEN_DRAG_ENABLED = false;
OLD_X = naomi.bed.x;
OLD_Y = naomi.bed.y;
stage.addChild(bedClip);
bedClip.x = stage.mouseX;
bedClip.y = stage.mouseY;
stage.addEventListener(MouseEvent.MOUSE_MOVE, bedMove, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, bedUp, false, 100, true);
bedPhrase = true;
};
};
};
};
}
public function dragScreen(_arg1:Event){
if (screenDraggable()){
OLD_MX = stage.mouseX;
OLD_MY = stage.mouseY;
ENVIRON_X = naomi.x;
ENVIRON_Y = naomi.y;
stage.addEventListener(MouseEvent.MOUSE_MOVE, moveScreen, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, dropScreen, false, 0, true);
};
}
public function bedUp(_arg1:Event){
naomi.body.stopDrag();
SCREEN_DRAG_ENABLED = true;
DEST_BED_X = BED_X;
DEST_BED_Y = BED_Y;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, bedMove, false);
stage.removeEventListener(MouseEvent.MOUSE_UP, bedUp, false);
stage.removeChild(bedClip);
}
public function updateClothes(){
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:Matrix;
var _local5:Matrix;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:Number;
var _local18:Number;
var _local19:Object;
var _local20:Graphics;
var _local21:Object;
var _local22:Object;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
_local1 = bellyWhite.points;
_local4 = bellyWhite.transform.concatenatedMatrix;
_local5 = clothes.transform.concatenatedMatrix;
_local5.invert();
_local4.concat(_local5);
_local6 = _local4.a;
_local7 = _local4.b;
_local8 = _local4.c;
_local9 = _local4.d;
_local10 = _local4.tx;
_local11 = _local4.ty;
_local20 = clothes.graphics;
_local20.clear();
_local20.lineStyle(0.1, 0);
_local20.beginFill(CLOTHES_COLOR);
_local13 = clothesPoints.length;
_local14 = (_local13 - 1);
if (bellySize < MAX_CLOTHES_SIZE){
_local23 = (bellySize * INV_MAX_CLOTHES_SIZE);
if (!CLOTHES_INDEX){
CLOTHES_INDEX = 1;
naomi.swapChildren(clothes, bellyWhite);
};
} else {
_local23 = 1;
if (CLOTHES_INDEX){
CLOTHES_INDEX = 0;
naomi.swapChildren(clothes, bellyWhite);
};
};
_nC.c2.x = (CONTROL1X - (_local23 * CONTROLX_OFFSET));
_nC.c2.y = (CONTROL1Y + (_local23 * CONTROLY_OFFSET));
_nC.c4.x = (CONTROL2X + (_local23 * CONTROLX_OFFSET));
_nC.c4.y = (CONTROL2Y + (_local23 * CONTROLY_OFFSET));
_nC.c6.y = (CONTROL_CENTERY + (_local23 * CONTROL_CENTERY_OFFSET));
_local2 = [];
_local3 = [];
_local12 = _local1.length;
_local24 = _nC.a1.x;
_local25 = _nC.c6.x;
_local26 = _nC.a6.x;
_local27 = _nC.a1.y;
_local28 = _nC.c6.y;
_local29 = _nC.a6.y;
_local30 = (_local25 - _local24);
_local31 = (_local26 - _local25);
_local32 = (_local28 - _local27);
_local33 = (_local29 - _local28);
_local34 = (_local31 - _local30);
_local35 = (2 * _local30);
_local2[0] = (_local3[0] = _nC.a6);
_local15 = 1;
_local16 = 0;
while (_local16 < _local12) {
_local19 = _local1[_local16];
_local19 = {x:(((_local6 * _local19.x) + (_local7 * _local19.y)) + _local10), y:(((_local8 * _local19.x) + (_local9 * _local19.y)) + _local11)};
if ((((((_local19.y > _local27)) && ((_local19.x > _local24)))) && ((_local19.x < _local26)))){
_local2[_local15] = _local19;
_local38 = _local19.x;
_local36 = (_local24 - _local38);
if (_local34 == 0){
_local37 = ((_local38 - _local24) / (_local26 - _local24));
} else {
_local37 = ((-(_local35) + Math.sqrt(((_local35 * _local35) - ((4 * _local34) * _local36)))) / (2 * _local34));
};
_local40 = (_local27 + (_local37 * _local32));
_local41 = (_local28 + (_local37 * _local33));
_local39 = (_local40 + (_local37 * (_local41 - _local40)));
if (_local19.y >= _local39){
_local3[_local15] = {x:_local38, y:(_local39 + (_local23 * (_local19.y - _local39)))};
} else {
_local3[_local15] = {x:_local38, y:_local39};
};
_local15++;
};
_local16++;
};
_local20.moveTo(clothesPoints[0].x, clothesPoints[0].y);
_local2[_local15] = (_local3[_local15] = _nC.a1);
_local15++;
_local16 = 1;
while (_local16 < _local14) {
_local22 = clothesPoints[_local16];
_local21 = clothesPoints[((_local16 + 1) % _local13)];
_local20.curveTo(_local22.x, _local22.y, _local21.x, _local21.y);
_local16 = (_local16 + 2);
};
if (_local23 < 1){
Drawing.drawCurvyLine(_local20, _local3[1], _local3, _local3[(_local15 - 2)]);
} else {
_local20.curveTo(_nC.c6.x, _nC.c6.y, _nC.a1.x, _nC.a1.y);
};
_local20.endFill();
}
public function speechFinished(_arg1:Event){
expNaomi.endReact();
}
public function moveScreen(_arg1:Event){
naomi.x = (ENVIRON_X + (stage.mouseX - OLD_MX));
naomi.y = (ENVIRON_Y + (stage.mouseY - OLD_MY));
Algorithms.adjustScreen(naomi, naomi.background);
}
public function updateTop(){
var _local1:Graphics;
var _local2:Matrix;
var _local3:Matrix;
var _local4:Matrix;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Object;
var _local18:Array;
var _local19:Array;
var _local20:Object;
var _local21:Object;
var _local22:Object;
var _local23:Object;
var _local24:Object;
var _local25:Object;
var _local26:Object;
var _local27:Object;
var _local28:Array;
var _local29:Number;
var _local30:Number;
var _local31:Object;
var _local32:Object;
var _local33:Object;
var _local34:Object;
var _local35:Boolean;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
_local1 = top.graphics;
_local1.clear();
_local2 = breast1.transform.concatenatedMatrix;
_local3 = breast2.transform.concatenatedMatrix;
_local4 = top.transform.concatenatedMatrix;
_local4.invert();
_local2.concat(_local4);
_local3.concat(_local4);
_local5 = _local2.a;
_local6 = _local2.b;
_local7 = _local2.c;
_local8 = _local2.d;
_local9 = _local2.tx;
_local10 = _local2.ty;
_local11 = _local3.a;
_local12 = _local3.b;
_local13 = _local3.c;
_local14 = _local3.d;
_local15 = _local3.tx;
_local16 = _local3.ty;
_local18 = breast1.points;
_local19 = breast2.points;
if (TOP_BROKEN){
_local17 = _local19[TOP_RIGHT1];
_local20 = {x:((_local15 + (_local11 * _local17.x)) + (_local12 * _local17.y)), y:((_local16 + (_local13 * _local17.x)) + (_local14 * _local17.y))};
_local17 = _local19[TOP_RIGHT2];
_local21 = {x:((_local15 + (_local11 * _local17.x)) + (_local12 * _local17.y)), y:((_local16 + (_local13 * _local17.x)) + (_local14 * _local17.y))};
_local17 = _local19[TOP_RIGHT3];
_local22 = {x:((_local15 + (_local11 * _local17.x)) + (_local12 * _local17.y)), y:((_local16 + (_local13 * _local17.x)) + (_local14 * _local17.y))};
_local17 = _local18[TOP_LEFT1];
_local23 = {x:((_local9 + (_local5 * _local17.x)) + (_local6 * _local17.y)), y:((_local10 + (_local7 * _local17.x)) + (_local8 * _local17.y))};
_local17 = _local18[TOP_LEFT2];
_local24 = {x:((_local9 + (_local5 * _local17.x)) + (_local6 * _local17.y)), y:((_local10 + (_local7 * _local17.x)) + (_local8 * _local17.y))};
_local17 = _local18[TOP_LEFT3];
_local25 = {x:((_local9 + (_local5 * _local17.x)) + (_local6 * _local17.y)), y:((_local10 + (_local7 * _local17.x)) + (_local8 * _local17.y))};
updateTopPhysics();
_local28 = TOP_LEFT_POINTS[0];
_local28[0] = _local23.x;
_local28[1] = _local23.y;
_local28 = TOP_LEFT_POINTS[1];
_local28[0] = _local24.x;
_local28[1] = _local24.y;
_local28 = TOP_LEFT_POINTS[2];
_local28[0] = _local25.x;
_local28[1] = _local25.y;
_local28 = TOP_RIGHT_POINTS[0];
_local28[0] = _local20.x;
_local28[1] = _local20.y;
_local28 = TOP_RIGHT_POINTS[1];
_local28[0] = _local21.x;
_local28[1] = _local21.y;
_local28 = TOP_RIGHT_POINTS[2];
_local28[0] = _local22.x;
_local28[1] = _local22.y;
drawTop();
} else {
_local17 = _local19[TOP_RIGHT1];
_local20 = {x:((_local15 + (_local11 * _local17.x)) + (_local12 * _local17.y)), y:((_local16 + (_local13 * _local17.x)) + (_local14 * _local17.y))};
_local17 = _local19[TOP_RIGHT2];
_local21 = {x:((_local15 + (_local11 * _local17.x)) + (_local12 * _local17.y)), y:((_local16 + (_local13 * _local17.x)) + (_local14 * _local17.y))};
_local17 = _local19[TOP_RIGHT3];
_local22 = {x:((_local15 + (_local11 * _local17.x)) + (_local12 * _local17.y)), y:((_local16 + (_local13 * _local17.x)) + (_local14 * _local17.y))};
_local17 = _local18[TOP_LEFT1];
_local23 = {x:((_local9 + (_local5 * _local17.x)) + (_local6 * _local17.y)), y:((_local10 + (_local7 * _local17.x)) + (_local8 * _local17.y))};
_local17 = _local18[TOP_LEFT2];
_local24 = {x:((_local9 + (_local5 * _local17.x)) + (_local6 * _local17.y)), y:((_local10 + (_local7 * _local17.x)) + (_local8 * _local17.y))};
_local17 = _local18[TOP_LEFT3];
_local25 = {x:((_local9 + (_local5 * _local17.x)) + (_local6 * _local17.y)), y:((_local10 + (_local7 * _local17.x)) + (_local8 * _local17.y))};
_local26 = {x:((_local22.x + _local23.x) * 0.5), y:((_local22.y + _local23.y) * 0.5)};
_local27 = {x:((_local20.x + _local25.x) * 0.5), y:((_local20.y + _local25.y) * 0.5)};
_local29 = ((_local20.x - _local25.x) * 0.25);
_local30 = Math.sqrt((TOP_LENGTH1_4_SQUARE - (_local29 * _local29)));
if (isNaN(_local30)){
_local30 = 0;
};
if (_local30 > MAX_TOP_OFFSET){
_local30 = MAX_TOP_OFFSET;
};
_local31 = {x:((_local26.x + _local22.x) * 0.5), y:(((_local26.y + _local22.y) * 0.5) + _local30)};
_local32 = {x:((_local27.x + _local20.x) * 0.5), y:(((_local27.y + _local20.y) * 0.5) - _local30)};
_local33 = {x:((_local26.x + _local23.x) * 0.5), y:(((_local26.y + _local23.y) * 0.5) + _local30)};
_local34 = {x:((_local27.x + _local25.x) * 0.5), y:(((_local27.y + _local25.y) * 0.5) - _local30)};
_local35 = ((_local22.x - _local23.x) > TOP_LENGTH);
if (((_local35) || (!(TOP_SPRINGS_GENERATED)))){
TOP_LEFT_POINTS.length = 0;
TOP_LEFT_POINTS[TOP_LEFT_POINTS.length] = [_local23.x, _local23.y, 0, 0, 0, 0];
TOP_LEFT_POINTS[TOP_LEFT_POINTS.length] = [_local24.x, _local24.y, 0, 0, 0, 0];
TOP_LEFT_POINTS[TOP_LEFT_POINTS.length] = [_local25.x, _local25.y, 0, 0, 0, 0];
TOP_LEFT_POINTS[TOP_LEFT_POINTS.length] = [_local34.x, _local34.y, 0, 0, 0, 0];
TOP_LEFT_POINTS[TOP_LEFT_POINTS.length] = [_local27.x, _local27.y, 0, 0, 0, 0];
TOP_LEFT_POINTS[TOP_LEFT_POINTS.length] = [_local26.x, _local26.y, 0, 0, 0, 0];
TOP_LEFT_POINTS[TOP_LEFT_POINTS.length] = [_local33.x, _local33.y, 0, 0, 0, 0];
TOP_RIGHT_POINTS.length = 0;
TOP_RIGHT_POINTS[TOP_RIGHT_POINTS.length] = [_local20.x, _local20.y, 0, 0, 0, 0];
TOP_RIGHT_POINTS[TOP_RIGHT_POINTS.length] = [_local21.x, _local21.y, 0, 0, 0, 0];
TOP_RIGHT_POINTS[TOP_RIGHT_POINTS.length] = [_local22.x, _local22.y, 0, 0, 0, 0];
TOP_RIGHT_POINTS[TOP_RIGHT_POINTS.length] = [_local31.x, _local31.y, 0, 0, 0, 0];
TOP_RIGHT_POINTS[TOP_RIGHT_POINTS.length] = [_local26.x, _local26.y, 0, 0, 0, 0];
TOP_RIGHT_POINTS[TOP_RIGHT_POINTS.length] = [_local27.x, _local27.y, 0, 0, 0, 0];
TOP_RIGHT_POINTS[TOP_RIGHT_POINTS.length] = [_local32.x, _local32.y, 0, 0, 0, 0];
if (_local35){
TOP_BROKEN = true;
} else {
generateTopSprings();
TOP_SPRINGS_GENERATED = true;
};
};
_local36 = ((_local23.x + _local25.x) * 0.5);
_local37 = ((_local23.y + _local25.y) * 0.5);
_local38 = ((_local20.x + _local22.x) * 0.5);
_local39 = ((_local20.y + _local22.y) * 0.5);
_local1.lineStyle(0.1, 0);
_local1.beginFill(CLOTHES_COLOR);
_local1.moveTo(_local20.x, _local20.y);
_local1.curveTo(((2 * _local21.x) - _local38), ((2 * _local21.y) - _local39), _local22.x, _local22.y);
_local1.curveTo(_local31.x, _local31.y, _local26.x, _local26.y);
_local1.lineTo(_local27.x, _local27.y);
_local1.curveTo(_local32.x, _local32.y, _local20.x, _local20.y);
_local1.endFill();
_local1.beginFill(CLOTHES_COLOR);
_local1.moveTo(_local23.x, _local23.y);
_local1.curveTo(((2 * _local24.x) - _local36), ((2 * _local24.y) - _local37), _local25.x, _local25.y);
_local1.curveTo(_local34.x, _local34.y, _local27.x, _local27.y);
_local1.lineTo(_local26.x, _local26.y);
_local1.curveTo(_local33.x, _local33.y, _local23.x, _local23.y);
_local1.endFill();
};
}
public function bedMove(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = (stage.mouseX - OLD_MX);
_local3 = (stage.mouseY - OLD_MY);
_local4 = 50;
_local5 = (50 * _local4);
DEST_BED_X = (OLD_X + _local2);
DEST_BED_Y = (OLD_Y + _local3);
_local2 = (DEST_BED_X - BED_X);
_local3 = (DEST_BED_Y - BED_Y);
_local6 = ((_local2 * _local2) + (_local3 * _local3));
if (_local6 > _local5){
_local6 = (1 / Math.sqrt(_local6));
DEST_BED_X = (BED_X + ((_local4 * _local2) * _local6));
DEST_BED_Y = (BED_Y + ((_local4 * _local3) * _local6));
};
bedClip.graphics.clear();
bedClip.graphics.lineStyle(4, 39423, 0.5);
bedClip.graphics.drawCircle(0, 0, 50);
bedClip.graphics.lineStyle(4, 0xFF);
bedClip.graphics.drawCircle(0, 0, 5);
bedClip.graphics.lineStyle(2, 6737151);
bedClip.graphics.moveTo(0, 0);
bedClip.graphics.lineTo(bedClip.mouseX, bedClip.mouseY);
}
public function machineUpdate(){
var _local1:Rectangle;
var _local2:Number;
var _local3:Graphics;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:Matrix;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:int;
var _local13:int;
var _local14:Number;
var _local15:Point;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local1 = machine.getRect(stage);
if (((((machine.hitTestPoint(stage.mouseX, stage.mouseY, false)) || (selectedMachineButton))) || ((machine._clip.currentFrame == 2)))){
machine.x = (machine.x + ((stage.stageWidth - _local1.right) * 0.5));
machine.y = (machine.y + ((stage.stageHeight - _local1.bottom) * 0.5));
} else {
_local15 = machine.localToGlobal(new Point(MACHINE_CORNER_X, MACHINE_CORNER_Y));
machine.x = (machine.x + ((stage.stageWidth - _local15.x) * 0.5));
machine.y = (machine.y + ((stage.stageHeight - _local1.bottom) * 0.5));
};
if (!selectedMachineButton){
_local16 = ((machine._red_slider.y - SLIDER_Y) * INV_SLIDER_HEIGHT);
_local17 = ((machine._blue_slider.y - SLIDER_Y) * INV_SLIDER_HEIGHT);
_local18 = ((machine._white_slider.y - SLIDER_Y) * INV_SLIDER_HEIGHT);
if ((((((((((_local18 > 0)) && ((_local18 < 1)))) || ((((((((((bellySize == MAX_BELLY_SIZE)) && ((breastSize == MAX_BREAST_SIZE)))) && ((_local18 == 0)))) && (!(rinaBmp.visible)))) && (!(INFINITE_EXPANSION)))))) || ((((((((bellySize == 0)) && ((breastSize == 0)))) && ((_local18 == 1)))) && (!(rinaBmp.visible)))))) || ((modifier == 0)))){
machine._white_slider.y = (machine._white_slider.y + (((SLIDER_Y + (SLIDER_HEIGHT * 0.5)) - machine._white_slider.y) * 0.5));
_local18 = ((machine._white_slider.y - SLIDER_Y) * INV_SLIDER_HEIGHT);
machine._white_slider.x = (WHITE_SLIDER_X + (SLIDER_WIDTH * _local18));
};
if (whiteControl){
machine._blue_slider.y = (machine._red_slider.y = machine._white_slider.y);
machine._red_slider.x = (RED_SLIDER_X + (_local18 * SLIDER_WIDTH));
machine._blue_slider.x = (BLUE_SLIDER_X + (_local18 * SLIDER_WIDTH));
if (Math.abs((_local18 - 0.5)) < 0.01){
_local18 = 0.5;
};
breastGrowth = (bellyGrowth = (1 - (_local18 * 2)));
} else {
if ((((((((((_local16 > 0)) && ((_local16 < 1)))) || ((((((((breastSize == MAX_BREAST_SIZE)) && ((_local16 == 0)))) && (!(rinaBmp.visible)))) && (!(INFINITE_EXPANSION)))))) || ((((((breastSize == 0)) && ((_local16 == 1)))) && (!(rinaBmp.visible)))))) || ((modifier == 0)))){
machine._red_slider.y = (machine._red_slider.y + (((SLIDER_Y + (SLIDER_HEIGHT * 0.5)) - machine._red_slider.y) * 0.5));
_local16 = ((machine._red_slider.y - SLIDER_Y) * INV_SLIDER_HEIGHT);
if (Math.abs((_local16 - 0.5)) < 0.01){
_local16 = 0.5;
};
machine._red_slider.x = (RED_SLIDER_X + (SLIDER_WIDTH * _local16));
breastGrowth = (1 - (_local16 * 2));
};
if ((((((((((_local17 > 0)) && ((_local17 < 1)))) || ((((((((bellySize == MAX_BELLY_SIZE)) && ((_local17 == 0)))) && (!(rinaBmp.visible)))) && (!(INFINITE_EXPANSION)))))) || ((((((bellySize == 0)) && ((_local17 == 1)))) && (!(rinaBmp.visible)))))) || ((modifier == 0)))){
machine._blue_slider.y = (machine._blue_slider.y + (((SLIDER_Y + (SLIDER_HEIGHT * 0.5)) - machine._blue_slider.y) * 0.5));
_local17 = ((machine._blue_slider.y - SLIDER_Y) * INV_SLIDER_HEIGHT);
if (Math.abs((_local17 - 0.5)) < 0.01){
_local17 = 0.5;
};
machine._blue_slider.x = (BLUE_SLIDER_X + (SLIDER_WIDTH * _local17));
bellyGrowth = (1 - (_local17 * 2));
};
};
};
if (modifier == 4){
if ((machine._left.currentFrame - 1)){
if (glowPosition == RINA_GLOW){
rinaBmp.visible = false;
rinaVisible = 0;
};
glowPosition = (glowPosition - 0.0625);
glowPosition = ((glowPosition)<0) ? (GLOW_LENGTH - 1.0625) : glowPosition;
if (glowPosition == RINA_GLOW){
rinaBmp.visible = true;
};
} else {
if ((machine._right.currentFrame - 1)){
if (glowPosition == RINA_GLOW){
rinaBmp.visible = false;
rinaVisible = 0;
};
glowPosition = (glowPosition + 0.0625);
glowPosition = ((glowPosition)>=(GLOW_LENGTH - 1)) ? 0 : glowPosition;
if (glowPosition == RINA_GLOW){
rinaBmp.visible = true;
};
};
};
};
bellyHistory[bellyHistoryPos] = bellySize;
bellyHistoryPos = ((bellyHistoryPos + 1) % historyLength);
breastHistory[breastHistoryPos] = breastSize;
breastHistoryPos = ((breastHistoryPos + 1) % historyLength);
_local2 = ((Math.sin(expNaomi.angle) * breatheOffset) * 0.5);
breathHistory[breathHistoryPos] = _local2;
breathHistoryPos = ((breathHistoryPos + 1) % historyLength);
_local3 = machineScreen.graphics;
_local3.clear();
switch (screenMode){
case 1:
_local3.beginFill(0);
_local3.drawRect(0, 0, MACHINE_SCREEN_WIDTH, MACHINE_SCREEN_HEIGHT);
_local3.endFill();
_local3.lineStyle(1, 0xFF00);
_local3.moveTo(0, (MACHINE_SCREEN_HEIGHT * 0.5));
_local3.lineTo(MACHINE_SCREEN_WIDTH, (MACHINE_SCREEN_HEIGHT * 0.5));
_local3.lineStyle(1, 0xFF);
_local4 = 0;
_local5 = 0;
while (_local4 < historyLength) {
_local6 = (bellyHistory[((_local4 + bellyHistoryPos) % historyLength)] * invMaxHistoryHeight);
if (_local6 > 1){
_local6 = 1;
};
if (_local4){
_local3.lineTo(_local5, ((1 - _local6) * MACHINE_SCREEN_HEIGHT));
} else {
_local3.moveTo(_local5, ((1 - _local6) * MACHINE_SCREEN_HEIGHT));
};
_local4++;
_local5 = (_local5 + historyInterval);
};
_local3.lineStyle(1, 0xFF0000);
_local4 = 0;
_local5 = 0;
while (_local4 < historyLength) {
_local6 = ((breastHistory[((_local4 + breastHistoryPos) % historyLength)] * invMaxHistoryHeight) * INV_BREAST_SCALE);
if (_local6 > 1){
_local6 = 1;
};
if (_local4){
_local3.lineTo(_local5, ((1 - _local6) * MACHINE_SCREEN_HEIGHT));
} else {
_local3.moveTo(_local5, ((1 - _local6) * MACHINE_SCREEN_HEIGHT));
};
_local4++;
_local5 = (_local5 + historyInterval);
};
break;
case 2:
_local3.beginFill(0);
_local3.drawRect(0, 0, MACHINE_SCREEN_WIDTH, MACHINE_SCREEN_HEIGHT);
_local3.endFill();
_local3.lineStyle(1, 0x999999);
_local3.moveTo(MACHINE_SCREEN_WIDTH, (MACHINE_SCREEN_HEIGHT * 0.5));
_local3.lineTo(0, (MACHINE_SCREEN_HEIGHT * 0.5));
_local3.lineStyle(1, 0xFF00);
_local4 = 0;
_local5 = 0;
while (_local4 < historyLength) {
_local6 = (-(breathHistory[((_local4 + breathHistoryPos) % historyLength)]) * invMaxHistoryHeight);
if (_local6 > 0.5){
_local6 = 0.5;
};
if (_local6 < -0.5){
_local6 = -0.5;
};
if (_local4){
_local3.lineTo(_local5, ((MACHINE_SCREEN_HEIGHT * 0.5) + (_local6 * MACHINE_SCREEN_HEIGHT)));
} else {
_local3.moveTo(_local5, ((MACHINE_SCREEN_HEIGHT * 0.5) + (_local6 * MACHINE_SCREEN_HEIGHT)));
};
_local4++;
_local5 = (_local5 + historyInterval);
};
break;
case 3:
_local3.beginFill(0);
_local3.drawRect(0, 0, MACHINE_SCREEN_WIDTH, MACHINE_SCREEN_HEIGHT);
_local3.endFill();
break;
case 4:
_local12 = Math.floor(glowPosition);
_local13 = Math.ceil(glowPosition);
_local14 = (glowPosition - _local12);
_local8 = GLOW_LIGHTS[_local12];
_local9 = GLOW_LIGHTS[_local13];
_local10 = Color.interpolateColor(_local8, _local9, _local14);
_local8 = GLOW_COLORS[_local12];
_local9 = GLOW_COLORS[_local13];
_local11 = Color.interpolateColor(_local8, _local9, _local14);
_local7 = new Matrix();
_local7.createGradientBox(MACHINE_SCREEN_HEIGHT, MACHINE_SCREEN_HEIGHT, 0, ((MACHINE_SCREEN_WIDTH - MACHINE_SCREEN_HEIGHT) * 0.5), 0);
_local3.clear();
if ((((glowPosition == RINA_GLOW)) && ((modifier == 4)))){
updateRina();
} else {
_local3.beginFill(0);
_local3.drawRect(0, 0, MACHINE_SCREEN_WIDTH, MACHINE_SCREEN_HEIGHT);
_local3.endFill();
_local3.beginGradientFill(GradientType.RADIAL, [_local10, _local11, _local11], [0.75, 0.5, 0], [64, 128, 0xFF], _local7);
_local3.drawRect(0, 0, MACHINE_SCREEN_WIDTH, MACHINE_SCREEN_HEIGHT);
_local3.endFill();
};
break;
};
}
}
}//package cuteExpansion_fla
Section 16
//naomi_1 (cuteExpansion_fla.naomi_1)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class naomi_1 extends MovieClip {
public var leg1:MovieClip;
public var leg2:MovieClip;
public var front:NaomiFront;
public var background:MovieClip;
public var tail:MovieClip;
public var windowShine:MovieClip;
public var arm2:MovieClip;
public var breast_mc1:MovieClip;
public var breast_mc2:MovieClip;
public var arm1:MovieClip;
public var bed:MovieClip;
public var hair3:MovieClip;
public var blanket1:MovieClip;
public var body:MovieClip;
public var table:MovieClip;
public var blanket2:MovieClip;
public var belly:MovieClip;
public var head:MovieClip;
public var clothes_mc:MovieClip;
public var top_mc:MovieClip;
public var window:MovieClip;
}
}//package cuteExpansion_fla
Section 17
//rina_eye1_67 (cuteExpansion_fla.rina_eye1_67)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class rina_eye1_67 extends MovieClip {
public function rina_eye1_67(){
addFrameScript(1, frame2, 3, frame4, 5, frame6, 7, frame8, 19, frame20);
}
function frame6(){
this.gotoAndPlay(this.currentLabel);
}
function frame8(){
this.gotoAndPlay(this.currentLabel);
}
function frame4(){
this.gotoAndPlay(this.currentLabel);
}
function frame20(){
this.gotoAndPlay(this.currentLabel);
}
function frame2(){
this.gotoAndPlay(this.currentLabel);
}
}
}//package cuteExpansion_fla
Section 18
//rina_eye2_65 (cuteExpansion_fla.rina_eye2_65)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class rina_eye2_65 extends MovieClip {
public function rina_eye2_65(){
addFrameScript(1, frame2, 3, frame4, 5, frame6, 7, frame8, 19, frame20);
}
function frame6(){
this.gotoAndPlay(this.currentLabel);
}
function frame8(){
this.gotoAndPlay(this.currentLabel);
}
function frame4(){
this.gotoAndPlay(this.currentLabel);
}
function frame20(){
this.gotoAndPlay(this.currentLabel);
}
function frame2(){
this.gotoAndPlay(this.currentLabel);
}
}
}//package cuteExpansion_fla
Section 19
//rina_mouth_68 (cuteExpansion_fla.rina_mouth_68)
package cuteExpansion_fla {
import flash.display.*;
public dynamic class rina_mouth_68 extends MovieClip {
public function rina_mouth_68(){
addFrameScript(1, frame2, 3, frame4, 5, frame6, 7, frame8);
}
function frame6(){
this.gotoAndPlay(this.currentLabel);
}
function frame8(){
this.gotoAndPlay(this.currentLabel);
}
function frame4(){
this.gotoAndPlay(this.currentLabel);
}
function frame2(){
this.gotoAndPlay(this.currentLabel);
}
}
}//package cuteExpansion_fla
Section 20
//speech_mc_57 (cuteExpansion_fla.speech_mc_57)
package cuteExpansion_fla {
import flash.display.*;
import flash.text.*;
public dynamic class speech_mc_57 extends MovieClip {
public var _txt:TextField;
}
}//package cuteExpansion_fla
Section 21
//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 22
//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 23
//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 24
//Speech (expansion.Speech)
package expansion {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class Speech extends EventDispatcher {
private var _contained:Boolean;
private var _textSpeed:int;
private var _checkpoints:Array;
private var _txt:TextField;
private var _events:Array;
private var _interruptible:Boolean;
private var _letter:int;
private var _timer:int;
private var _mouth:MovieClip;
private var _phrase:String;
private var _paused:int;
private var _pauseTime:int;
private var _expansion:Expansion;
private var _interruptionText:String;
private var _pauseCharacter:String;
public function Speech(_arg1:TextField, _arg2:Boolean=true){
_txt = _arg1;
_mouth = null;
_contained = _arg2;
_textSpeed = 1;
_timer = 0;
_letter = 0;
_phrase = "";
_expansion = null;
_events = [];
_checkpoints = [];
if (!_txt){
throw ("ERROR: No TextField object found!");
};
_interruptionText = "--";
_interruptible = false;
_pauseCharacter = "";
_paused = -1;
_pauseTime = 10;
_txt.visible = false;
_txt.text = "";
if (((_contained) && (_txt.parent))){
_txt.parent.visible = _txt.visible;
};
}
public function destroy(){
var _local1:int;
_local1 = 0;
while (_local1 < _events.length) {
_events[_local1].object.removeEventListener(_events[_local1].type, _event);
_local1++;
};
_events = [];
_local1 = 0;
while (_local1 < _checkpoints.length) {
delete _checkpoints[_local1];
_local1++;
};
_checkpoints = [];
listenTo(null);
clearSpeech();
if (((_contained) && (_txt.parent))){
_txt.parent.visible = true;
};
_txt.visible = true;
_txt = null;
}
public function set mouth(_arg1:MovieClip){
_mouth = _arg1;
}
public function get interruptionText():String{
return (_interruptionText);
}
public function clearCheckPoint(_arg1:MovieClip, _arg2:int, _arg3:int=1){
var _local4:int;
_local4 = 0;
while (_local4 < _checkpoints.length) {
if ((((((_checkpoints[_local4].part == _arg1)) && ((_checkpoints[_local4].size == _arg2)))) && ((_checkpoints[_local4].direction == _arg3)))){
_checkpoints.splice(_local4, 1);
return;
};
_local4++;
};
}
public function clearSpeech(){
_letter = 0;
_phrase = "";
_txt.removeEventListener("enterFrame", _speaking);
_txt.text = "";
if (((_contained) && (_txt.parent))){
_txt.parent.visible = false;
};
_txt.visible = false;
}
public function get textSpeed():int{
return (_textSpeed);
}
private function _event(_arg1:Event){
var _local2:Object;
_local2 = getEvent((_arg1.target as EventDispatcher), _arg1.type);
if (!_local2){
return;
};
say(_local2.phrase, _local2.time);
}
public function set interruptionText(_arg1:String){
_interruptionText = _arg1;
}
public function set pauseCharacter(_arg1:String){
_pauseCharacter = _arg1;
}
private function _checkpoint(_arg1:ExpansionEvent){
var _local2:Object;
_local2 = getCheckPoint(_arg1.expandable, _arg1.size, _arg1.direction);
if (!_local2){
return;
};
say(_local2.phrase, _local2.time);
}
public function get position():int{
return (_letter);
}
private function _speaking(_arg1:Event){
var _local2:String;
var _local3:int;
if (_paused > 0){
_paused--;
} else {
if (_letter < _phrase.length){
_local3 = 0;
while ((((_local3 < _textSpeed)) && ((_letter < _phrase.length)))) {
_local2 = _phrase.charAt(_letter++);
if (_local2 == _pauseCharacter){
_paused = _pauseTime;
if (_mouth != null){
_mouth.gotoAndStop("_m");
};
return;
};
_txt.appendText(_local2);
_txt.scrollV = _txt.maxScrollV;
_local3++;
};
if (_mouth != null){
_local2 = _local2.toLowerCase();
if ((((((((((((((((((_local2 == "k")) || ((_local2 == "t")))) || ((_local2 == "y")))) || ((_local2 == "s")))) || ((_local2 == "q")))) || ((_local2 == "d")))) || ((_local2 == "g")))) || ((_local2 == "j")))) || ((_local2 == "z")))){
_local2 = "i";
};
if ((((_local2 == "w")) || ((_local2 == "r")))){
_local2 = "u";
};
if (_local2 == "h"){
_local2 = "a";
};
if ((((_local2 == "l")) || ((_local2 == "d")))){
_local2 = "o";
};
switch (_local2){
case "a":
case "e":
case "i":
case "o":
case "u":
_mouth.gotoAndStop(("_" + _local2));
break;
default:
_mouth.gotoAndStop("_m");
};
};
if (_letter >= _phrase.length){
if (_mouth != null){
_mouth.gotoAndStop("_m");
};
dispatchEvent(new Event("speechFinished"));
};
} else {
if (_timer > 0){
_timer--;
} else {
clearSpeech();
dispatchEvent(new Event("speechCleared"));
};
};
};
}
public function set textSpeed(_arg1:int){
if (_arg1 < 0){
_arg1 = 0;
};
_textSpeed = _arg1;
}
public function get interruptible():Boolean{
return (_interruptible);
}
public function get phrase():String{
return (_phrase);
}
public function listenTo(_arg1:Expansion){
if (_expansion){
_expansion.removeEventListener("checkpoint", _checkpoint);
_expansion = null;
};
if (!_arg1){
return;
};
_expansion = _arg1;
_expansion.addEventListener("checkpoint", _checkpoint, false, 0, true);
}
public function get timer():int{
return (_timer);
}
public function get mouth():MovieClip{
return (_mouth);
}
public function get speaking():Boolean{
return (((_txt.visible) && ((_letter < _phrase.length))));
}
public function get pauseCharacter():String{
return (_pauseCharacter);
}
public function set pauseTime(_arg1:int){
_pauseTime = _arg1;
}
public function getCheckPoint(_arg1:MovieClip, _arg2:int, _arg3:int=1):Object{
var _local4:int;
_local4 = 0;
while (_local4 < _checkpoints.length) {
if ((((((_checkpoints[_local4].part == _arg1)) && ((_checkpoints[_local4].size == _arg2)))) && ((_checkpoints[_local4].direction == _arg3)))){
return (_checkpoints[_local4]);
};
_local4++;
};
return (null);
}
public function get pauseTime():int{
return (_pauseTime);
}
public function get textField():TextField{
return (_txt);
}
public function set contained(_arg1:Boolean){
if (((_contained) && (_txt.parent))){
if (!_arg1){
_txt.parent.visible = true;
} else {
_txt.parent.visible = _txt.visible;
};
};
_contained = _arg1;
}
public function setEvent(_arg1:EventDispatcher, _arg2:String, _arg3:String, _arg4:int=-1){
var _local5:Object;
if (((((!(_arg1)) || (!(_arg2)))) || (!(_arg2.length)))){
return;
};
_local5 = getEvent(_arg1, _arg2);
if (_local5 != null){
_local5.phrase = phrase;
_local5.time = _arg4;
return;
};
_events.push({object:_arg1, type:_arg2, phrase:_arg3, time:_arg4});
_arg1.addEventListener(_arg2, _event, false, 5, true);
}
public function set interruptible(_arg1:Boolean){
_interruptible = _arg1;
}
public function clearEvent(_arg1:EventDispatcher, _arg2:String){
var _local3:int;
_local3 = 0;
while (_local3 < _events.length) {
if ((((_events[_local3].object == _arg1)) && ((_events[_local3].type == _arg2)))){
_arg1.removeEventListener(_arg2, _event);
_events.splice(_local3, 1);
return;
};
_local3++;
};
}
public function get contained():Boolean{
return (_contained);
}
public function setCheckPoint(_arg1:MovieClip, _arg2:int, _arg3:int=1, _arg4:String="", _arg5:int=-1){
var _local6:Object;
if (!_arg1){
return;
};
_local6 = getCheckPoint(_arg1, _arg2, _arg3);
if (_local6 != null){
_local6.phrase = _arg4;
_local6.time = _arg5;
return;
};
_checkpoints.push({part:_arg1, size:_arg2, direction:_arg3, phrase:_arg4, time:_arg5});
}
public function say(_arg1:String, _arg2:int=-1){
var _local3:String;
var _local4:String;
if (((speaking) && (!(_interruptible)))){
return;
};
_paused = -1;
if (!_txt){
throw ("ERROR: No TextField object found!");
};
if (_txt.length > 0){
_local3 = _phrase.charAt((_letter - 1));
_local4 = _phrase.charAt(_letter);
if ((((((((_letter > 0)) && ((_letter < _phrase.length)))) && (isLetter(_local3)))) && (isLetter(_local4)))){
_txt.appendText(_interruptionText);
};
_txt.appendText("\n\n");
_txt.scrollV = _txt.maxScrollV;
};
if (((_contained) && (_txt.parent))){
_txt.parent.visible = true;
};
if (_arg2 < 0){
_arg2 = (_arg1.length + 20);
};
_phrase = _arg1;
_letter = 0;
_timer = _arg2;
_txt.visible = true;
_txt.addEventListener("enterFrame", _speaking);
}
public function getEvent(_arg1:EventDispatcher, _arg2:String):Object{
var _local3:int;
_local3 = 0;
while (_local3 < _events.length) {
if ((((_events[_local3].object == _arg1)) && ((_events[_local3].type == _arg2)))){
return (_events[_local3]);
};
_local3++;
};
return (null);
}
public static function isLetter(_arg1:String){
var _local2:int;
var _local3:Array;
var _local4:int;
_local2 = _arg1.charCodeAt(0);
if ((((_local2 >= "a".charCodeAt(0))) && ((_local2 <= "z".charCodeAt(0))))){
return (true);
};
if ((((_local2 >= "A".charCodeAt(0))) && ((_local2 <= "Z".charCodeAt(0))))){
return (true);
};
if ((((_local2 >= "0".charCodeAt(0))) && ((_local2 <= "9".charCodeAt(0))))){
return (true);
};
_local3 = ["á", "é", "í", "ó", "ú", "Á", "É", "Í", "Ó", "Ú", "à", "è", "ì", "ò", "ù", "À", "È", "Ì", "Ò", "Ù", "ä", "ë", "ï", "ö", "ü", "Ä", "Ë", "Ï", "Ö", "Ü", "â", "ê", "î", "ô", "û", "Â", "Ê", "Î", "Ô", "Û", "ñ", "Ñ"];
_local4 = 0;
while (_local4 < _local3.length) {
if (_local3[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
}
}//package expansion
Section 25
//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 26
//Hand (Hand)
package {
import flash.display.*;
public dynamic class Hand extends MovieClip {
public var wrist_mc:MovieClip;
public var glove_mc:MovieClip;
public var thumb_mc:MovieClip;
}
}//package
Section 27
//NaomiFront (NaomiFront)
package {
import flash.display.*;
public dynamic class NaomiFront extends MovieClip {
public var ellipse:MovieClip;
}
}//package
Section 28
//Rina (Rina)
package {
import flash.display.*;
public dynamic class Rina extends MovieClip {
public var leg1:MovieClip;
public var leg2:MovieClip;
public var eye2:MovieClip;
public var eye1:MovieClip;
public var tail:MovieClip;
public var arm2:MovieClip;
public var arm1:MovieClip;
public var body:MovieClip;
public var chair:MovieClip;
public var mouth:MovieClip;
public var hair1:MovieClip;
public var belly:MovieClip;
public var head:MovieClip;
}
}//package