Frame 1
Application.main(this);
Symbol 20480 MovieClip [__Packages.Logo] Frame 0
#initclip
if (!Logo) {
//(_global.Logo = function () {
super();
}) extends MovieClip
var _local1 = (_global.Logo /* register */).prototype;
_local1.render = function () {
this.lineStyle(4, this.lineColor);
this.beginFill(this.fillColor, 0);
com.abowman.graphics.Draw.drawOval(this, -13, 30, 10, 7);
com.abowman.graphics.Draw.drawOval(this, 13, 30, 10, 7);
com.abowman.graphics.Draw.drawOval(this, 0, 43, 7, 10);
this.endFill();
this.moveTo(0, 30);
this.curveTo(1, 16, -6, 9);
this.moveTo(0, 30);
this.curveTo(1, 16, -10, 13);
this.moveTo(-6, 9);
this.lineTo(-10, 13);
this._rotation = -45;
};
(_global.Logo /* register */).create = function (parent, depth, color, fillColor) {
var _local6 = Logo(parent.attachMovie(Logo.symbolName, "Logo" + depth, depth));
_local6.init(color, fillColor);
return(_local6);
};
_local1.init = function (color, fillColor) {
if (color != null) {
this.lineColor = color;
}
if (fillColor != null) {
this.fillColor = fillColor;
}
this.render();
};
ASSetPropFlags(_local1, null, 1);
(_global.Logo /* register */).symbolName = "__Packages.Logo";
(_global.Logo /* register */).symbolLinked = Object.registerClass(Logo.symbolName, Logo);
_local1.lineColor = 8421504 /* 0x808080 */;
_local1.fillColor = 16777215 /* 0xFFFFFF */;
}
#endinitclip
Symbol 20481 MovieClip [__Packages.Limb] Frame 0
#initclip
if (!Limb) {
//(_global.Limb = function () {
super();
}) extends MovieClip
var _local1 = (_global.Limb /* register */).prototype;
_local1.init = function () {
this.easer = new com.abowman.motion.EaseInOut();
this.toes = new Array();
this.toes.push(new com.abowman.motion.EaseInOut());
this.toes.push(new com.abowman.motion.EaseInOut());
this.toes.push(new com.abowman.motion.EaseInOut());
};
_local1.move = function () {
if (this.easer.isMoving()) {
this.easer.update();
this.x = this.easer.x;
this.y = this.easer.y;
var _local2 = 0;
for ( ; _local2 < this.toes.length ; _local2++) {
this.toes[_local2].update();
}
}
};
_local1.setTarPos = function (speed, angle, framesPerStep) {
var _local5 = (this.dist * speed) + this.startPos;
var _local6 = this.movePoint.x + (Math.cos(angle) * _local5);
var _local7 = this.movePoint.y + (Math.sin(angle) * _local5);
var _local8 = _local6 + (this.side * (Math.sin(angle) * this.wSpan));
var _local9 = _local7 - (this.side * (Math.cos(angle) * this.wSpan));
this.easer.init(this.x, _local8, this.y, _local9, framesPerStep);
this.setToeTars(angle, _local8, _local9, framesPerStep);
};
_local1.render = function () {
};
_local1.setJoints = function () {
};
_local1.renderFoot = function () {
var _local2 = 0;
for ( ; _local2 < this.toes.length ; _local2++) {
this.lineStyle(6, this.footColor);
this.moveTo(this.fhX, this.fhY);
this.lineTo(this.toes[_local2].x, this.toes[_local2].y);
this.lineStyle(10, this.footColor);
this.lineTo(this.toes[_local2].x + 1, this.toes[_local2].y);
}
};
_local1.setToeTars = function (angle, tarX, tarY, framesPerStep) {
angle = angle - (Math.PI / 2);
var _local6 = 0;
for ( ; _local6 < this.toes.length ; _local6++) {
this.toes[_local6].init(this.toes[_local6].x, tarX + (Math.cos(angle) * this.toeLen), this.toes[_local6].y, tarY + (Math.sin(angle) * this.toeLen), framesPerStep);
angle = angle + (Math.PI / 2);
}
};
_local1.setToes = function (angle) {
angle = angle - (Math.PI / 2);
var _local3 = 0;
for ( ; _local3 < this.toes.length ; _local3++) {
this.toes[_local3].y = this.y + (Math.sin(angle) * this.toeLen);
this.toes[_local3].x = this.x + (Math.cos(angle) * this.toeLen);
angle = angle + (Math.PI / 2);
}
};
ASSetPropFlags(_local1, null, 1);
_local1.toeLen = 15;
}
#endinitclip
Symbol 20482 MovieClip [__Packages.Leg] Frame 0
#initclip
if (!Leg) {
//(_global.Leg = function () {
super();
}) extends Limb
var _local1 = (_global.Leg /* register */).prototype;
(_global.Leg /* register */).createMovie = function (parent, base, movePoint, len, side, depth) {
var _local8 = Leg(parent.attachMovie(Leg.symbolName, "Leg" + depth, depth));
_local8.init(base, movePoint, len, side);
return(_local8);
};
_local1.init = function (base, movePoint, len, side) {
super.init();
this.side = side;
this.base = base;
this.movePoint = movePoint;
this.len = len;
this.wSpan = len * 1.2;
this.startPos = this._parent.legStWalk;
this.dist = 110;
this.dist = 120;
};
_local1.render = function (color) {
this.clear();
this.renderFoot();
this.moveTo(this.base.x, this.base.y);
this.lineStyle(10, color);
this.lineTo(this.jX2, this.jY2);
this.lineStyle(9, color);
this.lineTo(this.jX, this.jY);
this.lineStyle(8, color);
this.lineTo(this.fhX, this.fhY);
};
_local1.setJoints = function () {
var _local2 = com.abowman.Trig.angleTo(this.base.x, this.base.y, this.x, this.y);
var _local3 = com.abowman.Trig.distTo(this.base.x, this.base.y, this.x, this.y);
var _local4 = _local3 / 2;
var _local5 = this.len / 2;
this.angle = Math.acos(Math.min(1, (((this.len * this.len) + (_local4 * _local4)) - (_local5 * _local5)) / (this.len * _local3)));
this.jX2 = this.base.x + (this.len * Math.cos((this.side * this.angle) + _local2));
this.jY2 = this.base.y + (this.len * Math.sin((this.side * this.angle) + _local2));
this.jX = this.x + (this.len * Math.sin((((-1 * this.side) * this.angle) - _local2) - (Math.PI / 2)));
this.jY = this.y + (this.len * Math.cos((((-1 * this.side) * this.angle) - _local2) - (Math.PI / 2)));
};
ASSetPropFlags(_local1, null, 1);
(_global.Leg /* register */).symbolName = "__Packages.Leg";
(_global.Leg /* register */).symbolLinked = Object.registerClass(Leg.symbolName, Leg);
}
#endinitclip
Symbol 20483 MovieClip [__Packages.TreeFrog] Frame 0
#initclip
if (!TreeFrog) {
//(_global.TreeFrog = function () {
super();
}) extends MovieClip
var _local1 = (_global.TreeFrog /* register */).prototype;
(_global.TreeFrog /* register */).createMovie = function (parent, depth, params) {
var _local5 = TreeFrog(parent.attachMovie(TreeFrog.symbolName, "TreeFrog" + depth, depth));
_local5.init(params);
return(_local5);
};
_local1.init = function (params) {
this.pattern = params.pattern;
this.patternColor = params.patternColor;
this.pos = {x:params.x, y:params.y};
this.bodyColor = params.bodyColor;
this.footColor = params.footColor;
this.tonColor = params.tongueColor;
this.eyeColor = params.eyeColor;
this.bellySize = Math.min(params.bellySize, 1);
this.duration = (this.wait = 10);
this.duration = 7;
this.wait = 8;
this.minBellySize = 10;
this.maxBellySize = 23;
this.bellySize = ((this.maxBellySize - this.minBellySize) * this.bellySize) + this.minBellySize;
this.dest = {x:params.x, y:params.y};
this.rear = {x:0, y:0};
this.lShldr = {x:0, y:0};
this.rShldr = {x:0, y:0};
this.lEye = {x:0, y:0};
this.rEye = {x:0, y:0};
this.len = 55;
this.len = 55;
this.width = this.len / 6;
this.hLen = 18;
this.dir = 1;
this.angleSpeed = 0.021;
this.angleSpeed = 0.028;
this.angle = ((Math.random() * 360) * Math.PI) / 180;
var _local3 = this.getDepth();
this.torso._x = this.pos.x;
this.torso._y = this.pos.y;
this.torso._rotation = (this.angle * 180) / Math.PI;
_local3++;
this.rLeg = Leg.createMovie(this, this.rear, this.rShldr, 50, -1, _local3);
_local3++;
this.lLeg = Leg.createMovie(this, this.rear, this.lShldr, 50, 1, _local3);
_local3++;
this.rArm = Arm.createMovie(this, this.rShldr, this.rShldr, 40, -1, _local3);
_local3++;
this.lArm = Arm.createMovie(this, this.lShldr, this.lShldr, 40, 1, _local3);
this.limbs = new Array();
this.limbs.push(this.rLeg);
this.limbs.push(this.lArm);
this.limbs.push(this.lLeg);
this.limbs.push(this.rArm);
var _local4 = 0;
for ( ; _local4 < 4 ; _local4++) {
this.limbs[_local4].footColor = this.footColor;
}
_local3++;
this.mid = this.createEmptyMovieClip("mid", _local3);
_local3++;
this.torso = this.createEmptyMovieClip("torso", _local3);
this.torsoFill = this.torso.createEmptyMovieClip("torsoFill", this.torso.getNextHighestDepth());
this.torsoMask = this.torso.createEmptyMovieClip("torsoMask", this.torso.getNextHighestDepth());
this.torsoFill.setMask(this.torsoMask);
this.drawBelly();
_local3++;
this.head = this.createEmptyMovieClip("head", _local3);
if (this.pattern == 1) {
this.headFill = this.head.createEmptyMovieClip("headFill", this.head.getNextHighestDepth());
this.headMask = this.head.createEmptyMovieClip("headMask", this.head.getNextHighestDepth());
this.headFill.lineStyle(8, this.patternColor);
this.headFill.moveTo((this.hLen * 0.9) * Math.cos((-Math.PI) / 7), (this.hLen * 0.9) * Math.sin((-Math.PI) / 7));
this.headFill.curveTo((this.hLen * 1.1) * Math.cos(0), (this.hLen * 1.1) * Math.sin(0), (this.hLen * 0.9) * Math.cos(Math.PI / 7), (this.hLen * 0.9) * Math.sin(Math.PI / 7));
this.headFill.moveTo(this.hLen * 0.2, this.hLen * 0.65);
this.headFill.curveTo((-this.hLen) * 0.1, 0, this.hLen * 0.2, (-this.hLen) * 0.65);
this.headFill.moveTo(this.hLen * 0.2, this.hLen * 0.7);
this.headFill.curveTo((-this.hLen) * 0.4, 0, this.hLen * 0.2, (-this.hLen) * 0.65);
} else if (this.pattern == 2) {
this.headFill = this.head.createEmptyMovieClip("headFill", this.head.getNextHighestDepth());
this.headFill.lineStyle(10, this.patternColor);
this.headFill.moveTo(this.hLen * 0.4, this.hLen * 0.5);
this.headFill.lineTo(this.hLen * 0.5, this.hLen * 0.5);
this.headFill.moveTo(this.hLen * 0.6, (-this.hLen) * 0.5);
this.headFill.lineTo(this.hLen * 0.7, (-this.hLen) * 0.5);
this.headFill.lineStyle(8, this.patternColor);
this.headFill.moveTo(this.hLen * 1.3, 0);
this.headFill.lineTo(this.hLen * 1.3, 1);
}
this.counter = 0;
this.limbNum = 0;
this.state = 0;
this.reset();
};
_local1.setDestination = function (dx, dy, aDist, aAng) {
this.dest.x = dx;
this.dest.y = dy;
this.aDist = aDist;
this.aAng = aAng;
};
_local1.moveTowardDest = function () {
var _local2 = com.abowman.Trig.angleTo(this.pos.x, this.pos.y, this.dest.x, this.dest.y);
var _local3 = com.abowman.Trig.fixAngle(this.angle - _local2);
this.angToTarg = _local3;
if ((_local3 > this.aAng) && (_local3 < Math.PI)) {
this.angle = this.angle - this.angleSpeed;
} else if ((_local3 < (6.28 - this.aAng)) && (_local3 > Math.PI)) {
this.angle = this.angle + this.angleSpeed;
}
};
_local1.update = function () {
var _local2 = com.abowman.Trig.distTo(this.pos.x, this.pos.y, this.dest.x, this.dest.y);
this.distToTarg = _local2;
if (_local2 < this.aDist) {
this.speed = 0;
this.rLeg.startPos = (this.lLeg.startPos = this.legStRest);
} else {
this.speed = 1;
this.rLeg.startPos = (this.lLeg.startPos = this.legStWalk);
}
this.moveTowardDest();
if (((this.counter % this.wait) == 0) && (this.state != this.LUNGING)) {
this.limbs[this.limbNum].setTarPos(this.speed, this.angle, this.duration);
((this.limbNum < 3) ? (this.limbNum++) : ((this.limbNum = 0)));
}
this.counter++;
this.moveLimbs();
this.getCenter();
this.setHead();
this.setRear();
this.setShldrs();
this.setTongue();
this.render();
this.torso._x = this.pos.x;
this.torso._y = this.pos.y;
this.torso._rotation = (this.torsoAng * 180) / Math.PI;
};
_local1.eatTarget = function () {
if ((this.eatTime + 30) < this.counter) {
this.angToTarg = Math.atan2(this.dest.y - this.pos.y, this.dest.x - this.pos.x);
this.lungeToX = this.pos.x + (Math.cos(this.angToTarg) * 30);
this.lungeToY = this.pos.y + (Math.sin(this.angToTarg) * 30);
this.state = this.LUNGING;
this.tonTarX = this.dest.x + (Math.cos(this.angToTarg) * 10);
this.tonTarY = this.dest.y + (Math.sin(this.angToTarg) * 10);
this.eatTime = this.counter;
}
};
_local1.drawBelly = function () {
this.torso.clear();
this.torso.beginFill(this.bodyColor);
com.abowman.Graphics.drawOval(this.torso, this.len / 2.2, 0, this.len / 1.8, this.bellySize);
this.torso.endFill();
if (this.pattern == 1) {
this.torsoFill.clear();
this.torsoFill.lineStyle(3, this.patternColor);
this.torsoFill.lineStyle(10, this.patternColor);
this.torsoFill.moveTo(this.len * 0.4, (-this.len) * 0.3);
this.torsoFill.curveTo(this.len * 0.6, 0, this.len * 0.4, this.len * 0.3);
this.torsoFill.lineStyle(8, this.patternColor);
this.torsoFill.moveTo(this.len * 0.3, (-this.len) * 0.25);
this.torsoFill.curveTo(this.len * 0.9, 0, this.len * 0.3, this.len * 0.25);
this.torsoFill.lineStyle(10, this.patternColor);
this.torsoFill.moveTo(this.len * 0.25, this.len * 0.02);
this.torsoFill.lineTo(this.len * 0.25, (-this.len) * 0.02);
this.torsoFill.lineStyle(14, this.patternColor);
this.torsoFill.moveTo(this.len * 0.95, 0);
this.torsoFill.lineTo(this.len, 0);
this.torsoFill.lineStyle(10, this.patternColor);
this.torsoFill.moveTo(this.len * 0.75, (-this.len) * 0.2);
this.torsoFill.lineTo(this.len * 0.75, (-this.len) * 0.25);
this.torsoFill.moveTo(this.len * 0.75, this.len * 0.2);
this.torsoFill.lineTo(this.len * 0.75, this.len * 0.25);
this.torsoMask.clear();
this.torsoMask.beginFill(0);
com.abowman.Graphics.drawOval(this.torsoMask, this.len / 2.2, 0, this.len / 1.8, this.bellySize);
this.torsoMask.endFill();
} else if (this.pattern == 2) {
this.torsoFill.clear();
this.torsoFill.lineStyle(10, this.patternColor);
this.torsoFill.moveTo(this.len * 0.2, (-this.len) * 0.2);
this.torsoFill.lineTo(this.len * 0.4, (-this.len) * 0.2);
this.torsoFill.moveTo(this.len * 0.4, this.len * 0.2);
this.torsoFill.lineTo(this.len * 0.6, this.len * 0.2);
this.torsoFill.moveTo(this.len * 0.1, this.len * 0.05);
this.torsoFill.lineTo(this.len * 0.2, this.len * 0.05);
this.torsoFill.lineStyle(12, this.patternColor);
this.torsoFill.moveTo(this.len * 0.7, (-this.len) * 0.05);
this.torsoFill.lineTo(this.len * 0.8, (-this.len) * 0.05);
this.torsoMask.clear();
this.torsoMask.beginFill(0);
com.abowman.Graphics.drawOval(this.torsoMask, this.len / 2.2, 0, this.len / 1.8, this.bellySize);
this.torsoMask.endFill();
} else if (this.pattern == 3) {
this.torsoFill.clear();
this.torsoFill.lineStyle(1, this.patternColor);
this.torsoFill.beginFill(this.patternColor);
this.torsoFill.moveTo(this.len * 0.2, (-this.len) / 2);
this.torsoFill.curveTo(this.len * 1.2, 0, this.len * 0.2, this.len / 2);
this.torsoFill.curveTo(this.len * 0.8, 0, this.len * 0.2, (-this.len) / 2);
this.torsoFill.endFill();
this.torsoMask.clear();
this.torsoMask.beginFill(0);
com.abowman.Graphics.drawOval(this.torsoMask, this.len / 2.2, 0, this.len / 1.8, this.bellySize);
this.torsoMask.endFill();
}
};
_local1.increaseBellySize = function () {
this.bellySize = Math.min((this.bellySize = this.bellySize + 0.1), this.maxBellySize);
this.drawBelly();
};
_local1.setTongue = function () {
if (this.tonTarX != null) {
var _local2 = this.tonTarX - this.tongueX;
var _local3 = this.tonTarY - this.tongueY;
this.tongueX = this.tongueX + (_local2 * 0.7);
this.tongueY = this.tongueY + (_local3 * 0.7);
this.tonLen = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
if (this.tonLen < 1) {
this.tonTarX = null;
}
} else {
this.tongueX = this.tongueX + ((this.pos.x - this.tongueX) * 0.4);
this.tongueY = this.tongueY + ((this.pos.y - this.tongueY) * 0.4);
}
};
_local1.getCenter = function () {
if (this.state == this.LUNGING) {
var _local2 = this.lungeToX - this.pos.x;
var _local3 = this.lungeToY - this.pos.y;
if (Math.sqrt((_local2 * _local2) + (_local3 * _local3)) < 1) {
this.state = 0;
}
this.pos.x = this.pos.x + (_local2 * 0.5);
this.pos.y = this.pos.y + (_local3 * 0.5);
} else {
var _local4 = ((((3 * this.lArm.x) + (3 * this.rArm.x)) + this.lLeg.x) + this.rLeg.x) / 8;
var _local5 = ((((3 * this.lArm.y) + (3 * this.rArm.y)) + this.lLeg.y) + this.rLeg.y) / 8;
this.pos.x = this.pos.x + ((_local4 - this.pos.x) * 0.5);
this.pos.y = this.pos.y + ((_local5 - this.pos.y) * 0.5);
}
};
_local1.render = function () {
this.clear();
this.lineStyle(4, this.tonColor);
this.moveTo(this.pos.x, this.pos.y);
this.lineTo(this.tongueX, this.tongueY);
this.mid.clear();
this.mid.lineStyle(14, this.eyeColor);
this.mid.moveTo(this.lEye.x, this.lEye.y);
this.mid.lineTo(this.lEye.x + 1, this.lEye.y);
this.mid.moveTo(this.rEye.x, this.rEye.y);
this.mid.lineTo(this.rEye.x + 1, this.rEye.y);
this.mid.lineStyle(12, this.bodyColor);
this.mid.beginFill(this.bodyColor);
this.mid.moveTo(this.lShldr.x, this.lShldr.y);
this.mid.lineTo(this.lEye.x, this.lEye.y);
this.mid.lineTo(this.hx, this.hy);
this.mid.lineTo(this.rEye.x, this.rEye.y);
this.mid.lineTo(this.rShldr.x, this.rShldr.y);
this.mid.lineStyle(12, this.bodyColor);
this.mid.lineTo(this.lShldr.x, this.lShldr.y);
this.mid.lineTo(this.rear.x, this.rear.y);
this.mid.lineTo(this.rShldr.x, this.rShldr.y);
this.mid.endFill();
var _local2 = 0;
for ( ; _local2 < 4 ; _local2++) {
this.limbs[_local2].render(this.bodyColor);
}
};
_local1.reset = function () {
this.resetLimbs();
this.setRear();
this.setHead();
this.tongueX = (this.torso._x = this.pos.x);
this.tongueY = (this.torso._y = this.pos.y);
this.torso._rotation = (this.torsoAng * 180) / Math.PI;
this.setShldrs();
var _local2 = 0;
for ( ; _local2 < 4 ; _local2++) {
this.limbs[_local2].setJoints();
this.limbs[_local2].fhX = (this.limbs[_local2].jX + (2 * this.limbs[_local2].x)) / 3;
this.limbs[_local2].fhY = (this.limbs[_local2].jY + (2 * this.limbs[_local2].y)) / 3;
}
};
_local1.resetLimbs = function () {
var _local4 = 0;
for ( ; _local4 < 4 ; _local4++) {
var _local2 = this.pos.x + (Math.cos(this.angle) * this.limbs[_local4].startPos);
var _local3 = this.pos.y + (Math.sin(this.angle) * this.limbs[_local4].startPos);
this.limbs[_local4].x = _local2 + (this.limbs[_local4].side * (Math.sin(this.angle) * this.limbs[_local4].wSpan));
this.limbs[_local4].y = _local3 - (this.limbs[_local4].side * (Math.cos(this.angle) * this.limbs[_local4].wSpan));
this.limbs[_local4].setToes(this.angle);
}
};
_local1.setShldrs = function () {
this.lShldr.x = this.pos.x - (Math.sin(this.torsoAng) * this.width);
this.lShldr.y = this.pos.y + (Math.cos(this.torsoAng) * this.width);
this.rShldr.x = this.pos.x - ((-Math.sin(this.torsoAng)) * this.width);
this.rShldr.y = this.pos.y + ((-Math.cos(this.torsoAng)) * this.width);
};
_local1.setRear = function () {
var _local2 = (this.lLeg.x + this.rLeg.x) / 2;
var _local3 = (this.lLeg.y + this.rLeg.y) / 2;
this.torsoAng = Math.atan2(this.pos.y - _local3, this.pos.x - _local2) + Math.PI;
this.rear.x = this.pos.x + (this.len * Math.cos(this.torsoAng));
this.rear.y = this.pos.y + (this.len * Math.sin(this.torsoAng));
};
_local1.setHead = function () {
var _local2 = 4;
var _local3 = this.angle - (Math.PI / _local2);
this.head._x = this.pos.x;
this.head._y = this.pos.y;
this.head._rotation = (this.angle * 180) / Math.PI;
this.lEye.x = this.pos.x + (this.hLen * Math.cos(_local3));
this.lEye.y = this.pos.y + (this.hLen * Math.sin(_local3));
_local3 = _local3 + (Math.PI / _local2);
this.hx = this.pos.x + ((this.hLen + 5) * Math.cos(_local3));
this.hy = this.pos.y + ((this.hLen + 5) * Math.sin(_local3));
_local3 = _local3 + (Math.PI / _local2);
this.rEye.x = this.pos.x + (this.hLen * Math.cos(_local3));
this.rEye.y = this.pos.y + (this.hLen * Math.sin(_local3));
};
_local1.moveLimbs = function () {
var _local2 = 0;
for ( ; _local2 < 4 ; _local2++) {
this.limbs[_local2].move();
this.limbs[_local2].fhX = (this.limbs[_local2].jX + (2 * this.limbs[_local2].x)) / 3;
this.limbs[_local2].fhY = (this.limbs[_local2].jY + (2 * this.limbs[_local2].y)) / 3;
this.limbs[_local2].setJoints();
}
};
ASSetPropFlags(_local1, null, 1);
(_global.TreeFrog /* register */).symbolName = "__Packages.TreeFrog";
(_global.TreeFrog /* register */).symbolLinked = Object.registerClass(TreeFrog.symbolName, TreeFrog);
_local1.legStWalk = -150;
_local1.legStRest = -60;
_local1.LUNGING = 2;
_local1.WALKING = 1;
_local1.aDist = 90;
_local1.aAng = 0.34;
_local1.eatTime = 0;
_local1.angToTarg = 0;
_local1.tonLen = 0;
_local1.tonColor = 10066329 /* 0x999999 */;
_local1.patternColor = 0;
}
#endinitclip
Symbol 20484 MovieClip [__Packages.com.abowman.motion.EaseInOut] Frame 0
class com.abowman.motion.EaseInOut
{
var x, beginX, changeX, y, beginY, changeY, targetX, targetY;
function EaseInOut () {
}
function init(beginX, targetX, beginY, targetY, duration) {
x = (this.beginX = beginX);
changeX = targetX - beginX;
y = (this.beginY = beginY);
changeY = targetY - beginY;
this.duration = duration;
time = 0;
}
function update() {
if (time < duration) {
x = easeInOutQuad(time++, beginX, changeX, duration);
y = easeInOutQuad(time, beginY, changeY, duration);
}
}
function easeInOutQuad(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
function isMoving() {
return(time < duration);
}
function setTarget(x, y) {
targetX = x;
targetY = y;
}
var time = 0;
var duration = 0;
}
Symbol 20485 MovieClip [__Packages.com.abowman.Graphics] Frame 0
class com.abowman.Graphics
{
var mc, color, thick, fill;
function Graphics (target) {
mc = target;
color = 0;
thick = 1;
fill = 6710886 /* 0x666666 */;
}
function setColor(_color) {
color = _color;
}
function setThick(_thick) {
thick = _thick;
}
function setFill(_fill) {
fill = _fill;
}
function drawLine(x1, y1, x2, y2) {
mc.lineStyle(thick, color);
mc.moveTo(x1, y1);
mc.lineTo(x2, y2);
}
function drawRoundEqTriangle(radius, centerX, centerY, rotation) {
var _local6 = 3;
var _local7 = 360 / _local6;
var _local8 = _local7 * 0.075;
var _local9 = _local7 * 0.85;
var _local10 = radius * 0.8;
var _local13 = (Math.PI / 180) * rotation;
mc.lineStyle(thick, color);
mc.moveTo(centerX + (_local10 * Math.cos(((Math.PI / 180) * _local8) + _local13)), centerY + (_local10 * Math.sin(((Math.PI / 180) * _local8) + _local13)));
var _local14 = 1;
for ( ; _local14 <= _local6 ; _local14++) {
var _local11 = ((Math.PI / 180) * ((_local8 * ((_local14 * 2) - 1)) + (_local9 * _local14))) + _local13;
var _local12 = ((Math.PI / 180) * ((_local8 * ((_local14 * 2) + 1)) + (_local9 * _local14))) + _local13;
mc.lineTo(centerX + (_local10 * Math.cos(_local11)), centerY + (_local10 * Math.sin(_local11)));
mc.curveTo(centerX + (radius * Math.cos((((Math.PI / 180) * _local7) * _local14) + _local13)), centerY + (radius * Math.sin((((Math.PI / 180) * _local7) * _local14) + _local13)), centerX + (_local10 * Math.cos(_local12)), centerY + (_local10 * Math.sin(_local12)));
}
}
function fillRoundEqTriangle(radius, centerX, centerY, rotation) {
var _local6 = 3;
var _local7 = 360 / _local6;
var _local8 = _local7 * 0.075;
var _local9 = _local7 * 0.85;
var _local10 = radius * 0.8;
var _local13 = (Math.PI / 180) * rotation;
mc.lineStyle(thick, color);
mc.moveTo(centerX + (_local10 * Math.cos(((Math.PI / 180) * _local8) + _local13)), centerY + (_local10 * Math.sin(((Math.PI / 180) * _local8) + _local13)));
mc.beginFill(fill);
var _local14 = 1;
for ( ; _local14 <= _local6 ; _local14++) {
var _local11 = ((Math.PI / 180) * ((_local8 * ((_local14 * 2) - 1)) + (_local9 * _local14))) + _local13;
var _local12 = ((Math.PI / 180) * ((_local8 * ((_local14 * 2) + 1)) + (_local9 * _local14))) + _local13;
mc.lineTo(centerX + (_local10 * Math.cos(_local11)), centerY + (_local10 * Math.sin(_local11)));
mc.curveTo(centerX + (radius * Math.cos((((Math.PI / 180) * _local7) * _local14) + _local13)), centerY + (radius * Math.sin((((Math.PI / 180) * _local7) * _local14) + _local13)), centerX + (_local10 * Math.cos(_local12)), centerY + (_local10 * Math.sin(_local12)));
}
mc.endFill();
}
function drawEqTriangle(radius, centerX, centerY, rotation) {
var _local6 = 3;
var _local7 = 360 / _local6;
mc.lineStyle(thick, color);
mc.moveTo(centerX + radius, centerY);
var _local8 = 0;
for ( ; _local8 <= _local6 ; _local8++) {
mc.lineTo(centerX + (radius * Math.cos(((Math.PI / 180) * _local7) * _local8)), centerY + (radius * Math.sin(((Math.PI / 180) * _local7) * _local8)));
}
}
function drawRect(x1, y1, width, height) {
mc.lineStyle(thick, color);
mc.moveTo(x1, y1);
mc.lineTo(x1 + width, y1);
mc.lineTo(x1 + width, y1 + height);
mc.lineTo(x1, y1 + height);
mc.lineTo(x1, y1);
}
function fillRect(x1, y1, width, height) {
mc.lineStyle(thick, color);
mc.moveTo(x1, y1);
mc.beginFill(fill);
mc.lineTo(x1 + width, y1);
mc.lineTo(x1 + width, y1 + height);
mc.lineTo(x1, y1 + height);
mc.lineTo(x1, y1);
mc.endFill();
}
function drawCurve(startX, startY, curveControlX, curveControlY, endX, endY) {
mc.lineStyle(thick, color);
mc.moveTo(startX, startY);
mc.curveTo(curveControlX, curveControlY, endX, endY);
}
static function drawOval(mc, x, y, rx, ry) {
mc.moveTo(x + rx, y);
mc.curveTo(rx + x, (0.4142 * ry) + y, (0.7071 * rx) + x, (0.7071 * ry) + y);
mc.curveTo((0.4142 * rx) + x, ry + y, x, ry + y);
mc.curveTo((-0.4142 * rx) + x, ry + y, (-0.7071 * rx) + x, (0.7071 * ry) + y);
mc.curveTo((-rx) + x, (0.4142 * ry) + y, (-rx) + x, y);
mc.curveTo((-rx) + x, (-0.4142 * ry) + y, (-0.7071 * rx) + x, (-0.7071 * ry) + y);
mc.curveTo((-0.4142 * rx) + x, (-ry) + y, x, (-ry) + y);
mc.curveTo((0.4142 * rx) + x, (-ry) + y, (0.7071 * rx) + x, (-0.7071 * ry) + y);
mc.curveTo(rx + x, (-0.4142 * ry) + y, rx + x, y);
}
function fillOval(x, y, width, height) {
var _local6 = width * 0.70711;
var _local7 = height * 0.70711;
var _local8 = _local6 - (((height - _local7) * width) / height);
var _local9 = _local7 - (((width - _local6) * height) / width);
mc.lineStyle(thick, color);
mc.moveTo(x + width, y);
mc.beginFill(fill);
mc.curveTo(x + width, y - _local9, x + _local6, y - _local7);
mc.curveTo(x + _local8, y - height, x, y - height);
mc.curveTo(x - _local8, y - height, x - _local6, y - _local7);
mc.curveTo(x - width, y - _local9, x - width, y);
mc.curveTo(x - width, y + _local9, x - _local6, y + _local7);
mc.curveTo(x - _local8, y + height, x, y + height);
mc.curveTo(x + _local8, y + height, x + _local6, y + _local7);
mc.curveTo(x + width, y + _local9, x + width, y);
mc.endFill();
}
function drawCircle(r, x, y) {
var _local5 = 22.5;
mc.moveTo(x + r, y);
mc.lineStyle(thick, color);
var _local6 = Math.tan((_local5 * Math.PI) / 180);
var _local7 = 45;
for ( ; _local7 <= 360 ; _local7 = _local7 + 45) {
var _local8 = r * Math.cos((_local7 * Math.PI) / 180);
var _local9 = r * Math.sin((_local7 * Math.PI) / 180);
var _local10 = _local8 + ((r * _local6) * Math.cos(((_local7 - 90) * Math.PI) / 180));
var _local11 = _local9 + ((r * _local6) * Math.sin(((_local7 - 90) * Math.PI) / 180));
mc.curveTo(_local10 + x, _local11 + y, _local8 + x, _local9 + y);
}
}
function fillCircle(r, x, y) {
var _local5 = 22.5;
mc.moveTo(x + r, y);
mc.lineStyle(thick, color);
mc.beginFill(fill);
var _local6 = Math.tan((_local5 * Math.PI) / 180);
var _local7 = 45;
for ( ; _local7 <= 360 ; _local7 = _local7 + 45) {
var _local8 = r * Math.cos((_local7 * Math.PI) / 180);
var _local9 = r * Math.sin((_local7 * Math.PI) / 180);
var _local10 = _local8 + ((r * _local6) * Math.cos(((_local7 - 90) * Math.PI) / 180));
var _local11 = _local9 + ((r * _local6) * Math.sin(((_local7 - 90) * Math.PI) / 180));
mc.curveTo(_local10 + x, _local11 + y, _local8 + x, _local9 + y);
}
mc.endFill();
}
function drawHelix(r, x, y, styleMaker) {
mc.moveTo(x + r, y);
mc.lineStyle(thick, color);
var _local6 = Math.tan((styleMaker * Math.PI) / 180);
var _local7 = 45;
for ( ; _local7 <= 360 ; _local7 = _local7 + 45) {
var _local8 = r * Math.cos((_local7 * Math.PI) / 180);
var _local9 = r * Math.sin((_local7 * Math.PI) / 180);
var _local10 = _local8 + ((r * _local6) * Math.cos(((_local7 - 90) * Math.PI) / 180));
var _local11 = _local9 + ((r * _local6) * Math.sin(((_local7 - 90) * Math.PI) / 180));
mc.curveTo(_local10 + x, _local11 + y, _local8 + x, _local9 + y);
}
}
function fillHelix(r, x, y, styleMaker) {
mc.moveTo(x + r, y);
mc.lineStyle(thick, color);
mc.beginFill(fill);
var _local6 = Math.tan((styleMaker * Math.PI) / 180);
var _local7 = 45;
for ( ; _local7 <= 360 ; _local7 = _local7 + 45) {
var _local8 = r * Math.cos((_local7 * Math.PI) / 180);
var _local9 = r * Math.sin((_local7 * Math.PI) / 180);
var _local10 = _local8 + ((r * _local6) * Math.cos(((_local7 - 90) * Math.PI) / 180));
var _local11 = _local9 + ((r * _local6) * Math.sin(((_local7 - 90) * Math.PI) / 180));
mc.curveTo(_local10 + x, _local11 + y, _local8 + x, _local9 + y);
}
mc.endFill();
}
}
Symbol 20486 MovieClip [__Packages.com.abowman.graphics.Draw] Frame 0
class com.abowman.graphics.Draw
{
function Draw () {
}
static function drawOval(mc, x, y, rx, ry) {
mc.moveTo(x + rx, y);
mc.curveTo(rx + x, (0.4142 * ry) + y, (0.7071 * rx) + x, (0.7071 * ry) + y);
mc.curveTo((0.4142 * rx) + x, ry + y, x, ry + y);
mc.curveTo((-0.4142 * rx) + x, ry + y, (-0.7071 * rx) + x, (0.7071 * ry) + y);
mc.curveTo((-rx) + x, (0.4142 * ry) + y, (-rx) + x, y);
mc.curveTo((-rx) + x, (-0.4142 * ry) + y, (-0.7071 * rx) + x, (-0.7071 * ry) + y);
mc.curveTo((-0.4142 * rx) + x, (-ry) + y, x, (-ry) + y);
mc.curveTo((0.4142 * rx) + x, (-ry) + y, (0.7071 * rx) + x, (-0.7071 * ry) + y);
mc.curveTo(rx + x, (-0.4142 * ry) + y, rx + x, y);
}
static function drawRect(mc, x1, y1, width, height) {
mc.moveTo(x1, y1);
mc.lineTo(x1 + width, y1);
mc.lineTo(x1 + width, y1 + height);
mc.lineTo(x1, y1 + height);
mc.lineTo(x1, y1);
}
static function drawWedge(mc, x, y, startAngle, arc, radius, yRadius) {
if (arguments.length < 5) {
return(undefined);
}
mc.moveTo(x, y);
if (yRadius == undefined) {
yRadius = radius;
}
if (Math.abs(arc) > 360) {
arc = 360;
}
var _local13 = Math.ceil(Math.abs(arc) / 45);
var _local9 = arc / _local13;
var _local10 = (-(_local9 / 180)) * Math.PI;
var _local11 = (-(startAngle / 180)) * Math.PI;
if (_local13 > 0) {
var _local14 = x + (Math.cos((startAngle / 180) * Math.PI) * radius);
var _local15 = y + (Math.sin(((-startAngle) / 180) * Math.PI) * yRadius);
mc.lineTo(_local14, _local15);
var _local20 = 0;
for ( ; _local20 < _local13 ; _local20++) {
_local11 = _local11 + _local10;
var _local12 = _local11 - (_local10 / 2);
var _local16 = x + (Math.cos(_local11) * radius);
var _local17 = y + (Math.sin(_local11) * yRadius);
var _local18 = x + (Math.cos(_local12) * (radius / Math.cos(_local10 / 2)));
var _local19 = y + (Math.sin(_local12) * (yRadius / Math.cos(_local10 / 2)));
mc.curveTo(_local18, _local19, _local16, _local17);
}
mc.lineTo(x, y);
}
}
static function drawArc(mc, x, y, radius, arc, startAngle, yRadius) {
if (arguments.length < 5) {
return(null);
}
if (yRadius == undefined) {
yRadius = radius;
}
if (Math.abs(arc) > 360) {
arc = 360;
}
var _local13 = Math.ceil(Math.abs(arc) / 45);
var _local9 = arc / _local13;
var _local10 = (-(_local9 / 180)) * Math.PI;
var _local11 = (-(startAngle / 180)) * Math.PI;
var _local14 = x - (Math.cos(_local11) * radius);
var _local15 = y - (Math.sin(_local11) * yRadius);
if (_local13 > 0) {
var _local20 = 0;
for ( ; _local20 < _local13 ; _local20++) {
_local11 = _local11 + _local10;
var _local12 = _local11 - (_local10 / 2);
var _local16 = _local14 + (Math.cos(_local11) * radius);
var _local17 = _local15 + (Math.sin(_local11) * yRadius);
var _local18 = _local14 + (Math.cos(_local12) * (radius / Math.cos(_local10 / 2)));
var _local19 = _local15 + (Math.sin(_local12) * (yRadius / Math.cos(_local10 / 2)));
mc.curveTo(_local18, _local19, _local16, _local17);
}
}
return({x:_local16, y:_local17});
}
static function calcGradient(hex, percent) {
var _local4 = hexToRGB(hex);
var _local5 = RGBToHLS(_local4.r, _local4.g, _local4.b);
_local5.l = _local5.l * (percent / 100);
if (_local5.l > 240) {
_local5.l = 240;
}
if (_local5.l < 0) {
_local5.l = 0;
}
_local4 = HLSToRGB(_local5.h, _local5.l, _local5.s);
return(RGBToHex(_local4.r, _local4.g, _local4.b));
}
static function hexToRGB(hex) {
var _local3 = new Object();
_local3.r = hex >> 16;
var _local4 = hex ^ (_local3.r << 16);
_local3.g = _local4 >> 8;
_local3.b = _local4 ^ (_local3.g << 8);
return(_local3);
}
static function RGBToHex(r, g, b) {
var _local5 = ((r << 16) ^ (g << 8)) ^ b;
return(_local5);
}
static function RGBToHLS(r, g, b) {
var _local8 = Math.max(Math.max(r, g), b) / 255;
var _local9 = Math.min(Math.min(r, g), b) / 255;
var _local10 = _local8 - _local9;
var _local6 = (_local8 + _local9) / 2;
var _local7 = ((_local8 == _local9) ? 0 : (((_local6 <= 0.5) ? ((_local10 / _local6) / 2) : (_local10 / (2 - (_local6 * 2))))));
if ((r / 255) == _local8) {
var _local5 = ((g - b) / _local10) / 255;
} else if ((g / 255) == _local8) {
var _local5 = 2 + (((b - r) / _local10) / 255);
} else if ((b / 255) == _local8) {
var _local5 = 4 + (((r - g) / _local10) / 255);
}
var _local5 = _local5 * 40;
if (_local5 < 0) {
_local5 = _local5 + 240;
}
_local5 = Math.round(_local5);
return({h:(_global.isNaN(_local5) ? 0 : (_local5)), l:Math.round(_local6 * 240), s:Math.round(_local7 * 240)});
}
static function HLSToRGB(h, l, s) {
if (s == 0) {
var _local7 = Math.round((l / 240) * 255);
var _local6 = _local7;
var _local5 = _local6;
} else {
h = h / 240;
l = l / 240;
s = s / 240;
var _local10 = ((l < 0.5) ? (l * (s + 1)) : ((l + s) - (l * s)));
var _local11 = (l * 2) - _local10;
var _local12 = 0;
for ( ; _local12 < 3 ; _local12++) {
switch (_local12) {
case 0 :
var _local9 = h + (1 / 3);
break;
case 1 :
_local9 = h;
break;
case 2 :
_local9 = h - (1 / 3);
}
if (_local9 < 0) {
_local9++;
} else if (_local9 > 1) {
_local9--;
}
if ((_local9 * 6) < 1) {
var _local8 = _local11 + (((_local10 - _local11) * 6) * _local9);
} else if ((_local9 * 2) < 1) {
var _local8 = _local10;
} else if ((_local9 * 3) < 2) {
var _local8 = _local11 + (((_local10 - _local11) * ((2 / 3) - _local9)) * 6);
} else {
var _local8 = _local11;
}
switch (_local12) {
case 0 :
var _local5 = Math.round(_local8 * 255);
break;
case 1 :
var _local6 = Math.round(_local8 * 255);
break;
case 2 :
var _local7 = Math.round(_local8 * 255);
}
}
}
return({r:_local5, g:_local6, b:_local7});
}
}
Symbol 20487 MovieClip [__Packages.com.abowman.Trig] Frame 0
class com.abowman.Trig
{
function Trig () {
}
static function angleTo(x, y, toX, toY) {
var _local6 = toX - x;
var _local7 = toY - y;
return(Math.atan2(_local7, _local6));
}
static function distTo(x, y, toX, toY) {
var _local6 = toX - x;
var _local7 = toY - y;
return(Math.sqrt((_local6 * _local6) + (_local7 * _local7)));
}
static function fixAngle(angle) {
angle = angle % (2 * Math.PI);
return(((angle < 0) ? (angle + (2 * Math.PI)) : (angle)));
}
static function angleToDeg(x1, y1, x2, y2) {
var _local6 = y2 - y1;
var _local7 = x2 - x1;
return(Math.atan2(_local6, _local7) / piBy180);
}
static var piBy180 = Math.PI / 180;
}
Symbol 20488 MovieClip [__Packages.Application] Frame 0
#initclip
if (!Application) {
//(_global.Application = function () {
super();
}) extends MovieClip
var _local1 = (_global.Application /* register */).prototype;
_local1.init = function () {
_root.bgBox = _root.createEmptyMovieClip("bgBox", -1000);
_root.bgColor = 3394611 /* 0x33CC33 */;
this.point = new Object();
this.flies = new Array();
var _local2 = new ContextMenu();
_local2.hideBuiltInItems();
var _local3 = new ContextMenuItem("Find more creatures at aBowman.com", function () {
getURL ("http://aBowman.com/google-modules/", "_top");
});
_local2.customItems.push(_local3);
_root.menu = _local2;
var _local4 = 2859049 /* 0x2BA029 */;
var _local5 = 2859049 /* 0x2BA029 */;
var _local6 = 2859049 /* 0x2BA029 */;
var _local7 = 2859049 /* 0x2BA029 */;
var _local8 = 2859049 /* 0x2BA029 */;
var _local9 = 0.5;
var _local10 = 0;
var _local11 = 0;
if ((_level0.up_pattern != null) && (_level0.up_pattern != "")) {
_local10 = _level0.up_pattern;
}
if ((_level0.up_patternColor != null) && (_level0.up_patternColor != "")) {
_local11 = _global.parseInt("0x" + _level0.up_patternColor);
}
if ((_level0.up_bodyColor != null) && (_level0.up_bodyColor != "")) {
_local4 = _global.parseInt("0x" + _level0.up_bodyColor);
}
if ((_level0.up_backgroundColor != null) && (_level0.up_backgroundColor != "")) {
_root.bgColor = _global.parseInt("0x" + _level0.up_backgroundColor);
}
if ((_level0.up_footColor != null) && (_level0.up_footColor != "")) {
_local5 = _global.parseInt("0x" + _level0.up_footColor);
}
if ((_level0.up_eyeColor != null) && (_level0.up_eyeColor != "")) {
_local6 = _global.parseInt("0x" + _level0.up_eyeColor);
}
if ((_level0.up_tongueColor != null) && (_level0.up_tongueColor != "")) {
_local8 = _global.parseInt("0x" + _level0.up_tongueColor);
}
if ((_level0.up_flyColor != null) && (_level0.up_flyColor != "")) {
this.flyColor = _global.parseInt("0x" + _level0.up_flyColor);
}
if ((_level0.up_bellySize != null) && (_level0.up_bellySize != "")) {
_local9 = _level0.up_bellySize;
}
if ((_level0.up_backgroundImage != null) && ((_level0.up_backgroundImage != "") && (_level0.up_backgroundImage != "http://"))) {
this.createBackgroundImage(_level0.up_backgroundImage);
}
_local7 = com.abowman.graphics.Draw.calcGradient(_root.bgColor, 85);
this.link = ABowmanLink.create(_root, -100, "http://aBowman.com/google-modules/tree-frog", _local7);
this.link._xscale = (this.link._yscale = 80);
this.link._y = (this.link._x = 2);
Stage.align = "LT";
Stage.scaleMode = "noScale";
_root.sw = Stage.width;
_root.sh = Stage.height;
if ((_level0.up_height != null) && (_level0.up_height != "")) {
_root.sh = _level0.up_height;
}
if ((_level0.up_width != null) && (_level0.up_width != "")) {
_root.sw = _level0.up_width;
}
this.treefrogs = new Array();
var _local12 = 0;
for ( ; _local12 < this.numTreeFrogs ; _local12++) {
this.treefrogs[_local12] = TreeFrog.createMovie(this, this.getNextHighestDepth(), {x:_root.sw / 2, y:_root.sh / 2, bodyColor:_local4, footColor:_local5, eyeColor:_local6, tongueColor:_local8, bellySize:_local9, speed:8, pattern:_local10, patternColor:_local11});
this.treefrogs[_local12]._xscale = (this.treefrogs[_local12]._yscale = 60);
}
this.drawBackground();
if ((_level0.up_releaseFly != null) && ((_level0.up_releaseFly != "") && (_level0.up_releaseFly != 0))) {
_global.setInterval(_root.Application.randomFly, 1000 * _level0.up_releaseFly);
}
};
_local1.drawBackground = function () {
var _local2 = 100;
_root.bgBox.clear();
_root.bgBox.beginFill(_root.bgColor);
com.abowman.graphics.Draw.drawRect(_root.bgBox, -_local2, -_local2, _root.sw + (2 * _local2), _root.sh + (2 * _local2));
_root.bgBox.endFill();
};
_local1.randomFly = function () {
var _local2 = _root.Application.flies;
if (_local2.length < _root.Application.maxFlies) {
_local2.push(Fly.create(_root.Application, _root.Application.getNextHighestDepth(), {x:Stage.width * Math.random(), y:1, color:_root.Application.flyColor}));
}
};
_local1.onMouseDown = function () {
if (this.flies.length < this.maxFlies) {
this.flies.push(Fly.create(this, this.getNextHighestDepth(), {x:this._xmouse, y:this._ymouse, color:this.flyColor}));
}
};
_local1.createBackgroundImage = function (path) {
_root.createEmptyMovieClip("backgroundImage", -200);
_root.backgroundImage.createEmptyMovieClip("container_mc", 0);
_root.backgroundImage.container_mc.loadMovie(path);
_root.backgroundImage.onEnterFrame = function () {
if (this.container_mc._width > 0) {
this._x = Math.max((Stage.width / 2) - (this.container_mc._width / 2), 0);
this._y = Math.max((Stage.height / 2) - (this.container_mc._height / 2), 0);
delete this.onEnterFrame;
}
};
};
_local1.onMouseMove = function () {
if ((_root._xmouse > 15) && ((_root._xmouse < (Stage.width - 15)) && ((_root._ymouse > 15) && (_root._ymouse < (Stage.height - 15))))) {
this.getMouseAng = true;
} else {
this.getMouseAng = false;
}
};
_local1.findFly = function (frog) {
var _local3 = new Object();
var _local4 = this.flies.length;
var _local5 = frog.pos.x;
var _local6 = frog.pos.y;
var _local8 = 2000000 /* 0x1E8480 */;
var _local9 = 0;
var _local10 = 0;
for ( ; _local10 < _local4 ; _local10++) {
_local3.x = this.flies[_local10]._x;
_local3.y = this.flies[_local10]._y;
frog.globalToLocal(_local3);
_local9 = Math.abs(_local3.y - _local6) + Math.abs(_local3.x - _local5);
if (_local9 < _local8) {
_local8 = _local9;
var _local7 = _local10;
}
}
return(_local7);
};
_local1.onEnterFrame = function () {
var _local2 = this.flies.length;
var _local3 = 0;
for ( ; _local3 < _local2 ; _local3++) {
this.flies[_local3].moveRandom();
this.flies[_local3].update();
}
var _local4 = 0;
for ( ; _local4 < this.treefrogs.length ; _local4++) {
this.keepOnScreen(this.treefrogs[_local4]);
if (_local2 > 0) {
var _local5 = this.flies[this.curFly];
if ((this.treefrogs[_local4].distToTarg < 140) && ((this.treefrogs[_local4].distToTarg > 10) && ((this.treefrogs[_local4].angToTarg < 0.2) || (this.treefrogs[_local4].angToTarg > 6.1)))) {
this.treefrogs[_local4].eatTarget();
}
if (this.treefrogs[_local4].tonLen > 5) {
if ((Math.abs(this.treefrogs[_local4].tongueX - this.point.x) < 8) && (Math.abs(this.treefrogs[_local4].tongueY - this.point.y) < 8)) {
_local5.removeMovieClip();
this.flies.splice(this.curFly, 1);
this.treefrogs[_local4].increaseBellySize();
}
}
this.curFly = this.findFly(this.treefrogs[_local4]);
if (this.curFly != null) {
this.point.x = _local5._x;
this.point.y = _local5._y;
this.treefrogs[_local4].globalToLocal(this.point);
this.treefrogs[_local4].setDestination(this.point.x, this.point.y, 150, 0.1);
}
} else if (this.getMouseAng) {
this.treefrogs[_local4].setDestination(this.treefrogs[_local4]._xmouse, this.treefrogs[_local4]._ymouse, 90, 0.3);
}
this.treefrogs[_local4].update();
}
};
_local1.keepOnScreen = function (f) {
if (f.pos.x > ((Stage.width + _root.buffer) * (100 / _root.scale))) {
f.pos.x = (-(_root.buffer / 2)) * (100 / _root.scale);
f.reset();
}
if (f.pos.x < ((-_root.buffer) * (100 / _root.scale))) {
f.pos.x = (Stage.width + (_root.buffer / 2)) * (100 / _root.scale);
f.reset();
}
if (f.pos.y > ((Stage.height + _root.buffer) * (100 / _root.scale))) {
f.pos.y = (-(_root.buffer / 2)) * (100 / _root.scale);
f.reset();
}
if (f.pos.y < ((-_root.buffer) * (100 / _root.scale))) {
f.pos.y = (Stage.height + (_root.buffer / 2)) * (100 / _root.scale);
f.reset();
}
};
(_global.Application /* register */).createMovie = function (parent, depth) {
var _local4 = Application(parent.attachMovie(Application.symbolName, "Application", depth));
_local4.init();
return(_local4);
};
(_global.Application /* register */).main = function (mc) {
Application.createMovie(_root, _root.getNextHighestDepth());
};
ASSetPropFlags(_local1, null, 1);
(_global.Application /* register */).symbolName = "__Packages.Application";
(_global.Application /* register */).symbolLinked = Object.registerClass(Application.symbolName, Application);
_local1.numTreeFrogs = 1;
_local1.getMouseAng = false;
_local1.margin = -150;
_local1.maxFlies = 10;
_local1.curFly = 0;
_local1.flyColor = 2859049 /* 0x2BA029 */;
}
#endinitclip
Symbol 20489 MovieClip [__Packages.Arm] Frame 0
#initclip
if (!Arm) {
//(_global.Arm = function () {
super();
}) extends Limb
var _local1 = (_global.Arm /* register */).prototype;
(_global.Arm /* register */).createMovie = function (parent, base, movePoint, len, side, depth) {
var _local8 = Arm(parent.attachMovie(Arm.symbolName, "Arm" + depth, depth));
_local8.init(base, movePoint, len, side);
return(_local8);
};
_local1.init = function (base, movePoint, len, side) {
super.init();
this.side = side;
this.base = base;
this.movePoint = movePoint;
this.len = len;
this.wSpan = len;
this.startPos = 20;
this.dist = 63;
this.dist = 70;
};
_local1.render = function (color) {
this.clear();
this.renderFoot();
this.moveTo(this.base.x, this.base.y);
this.lineStyle(9, color);
this.lineTo(this.jX, this.jY);
this.lineStyle(7, color);
this.lineTo(this.fhX, this.fhY);
};
_local1.setJoints = function () {
var _local2 = com.abowman.Trig.angleTo(this.base.x, this.base.y, this.x, this.y);
var _local3 = com.abowman.Trig.distTo(this.base.x, this.base.y, this.x, this.y);
var _local4 = Math.asin(Math.min(1, (_local3 / 2) / this.len));
this.jY = this.base.y + ((Math.cos((((-this.side) * _local4) - _local2) - (this.side * Math.PI)) * this.side) * this.len);
this.jX = this.base.x + ((Math.sin((((-this.side) * _local4) - _local2) - (this.side * Math.PI)) * this.side) * this.len);
};
ASSetPropFlags(_local1, null, 1);
(_global.Arm /* register */).symbolName = "__Packages.Arm";
(_global.Arm /* register */).symbolLinked = Object.registerClass(Arm.symbolName, Arm);
}
#endinitclip
Symbol 20490 MovieClip [__Packages.Fly] Frame 0
#initclip
if (!Fly) {
//(_global.Fly = function () {
super();
}) extends MovieClip
var _local1 = (_global.Fly /* register */).prototype;
(_global.Fly /* register */).create = function (parent, depth, args) {
var _local5 = Fly(parent.attachMovie(Fly.symbolName, "Fly" + depth, depth));
_local5.init(args);
return(_local5);
};
_local1.init = function (args) {
this.x = args.x;
this.y = args.y;
if (args.speed != null) {
this.speed = (Math.max(Math.min(1, args.speed), 0) * this.speedRange) + this.lowSpeed;
}
this.angle = (Math.random() * Math.PI) * 2;
this.lineStyle(3, args.color);
this.lineTo(0, 1);
};
_local1.update = function () {
this.x = this.x + (Math.cos(this.angle) * this.speed);
this.y = this.y + (Math.sin(this.angle) * this.speed);
var _local2 = 0;
var _local3 = 0;
var _local4 = Stage.width;
var _local5 = Stage.height;
((this.x < _local2) ? ((this.x = _local2)) : null);
((this.x > _local4) ? ((this.x = _local4)) : null);
((this.y > _local5) ? ((this.y = _local5)) : null);
((this.y < _local3) ? ((this.y = _local3)) : null);
this._x = this.x;
this._y = this.y;
};
_local1.moveRandom = function () {
var _local2 = int(Math.random() * 50);
if ((_local2 % 5) == 4) {
((((Math.random() * 2) - 1) < 0) ? ((this.hDir = this.hDir * -1)) : null);
}
this.angle = this.angle + (this.hDir * this.angleSpeed);
this.angle = this.angle % 6.28318531;
if (this.angle < 0) {
this.angle = this.angle + 6.28318531;
}
};
ASSetPropFlags(_local1, null, 1);
(_global.Fly /* register */).symbolName = "__Packages.Fly";
(_global.Fly /* register */).symbolLinked = Object.registerClass(Fly.symbolName, Fly);
_local1.hDir = 1;
_local1.speed = 2;
_local1.angle = 0;
_local1.angleSpeed = 0.087;
_local1.lowSpeed = 2;
_local1.speedRange = 1.5;
}
#endinitclip
Symbol 20491 MovieClip [__Packages.ABowmanLink] Frame 0
#initclip
if (!ABowmanLink) {
//(_global.ABowmanLink = function () {
super();
}) extends MovieClip
var _local1 = (_global.ABowmanLink /* register */).prototype;
(_global.ABowmanLink /* register */).create = function (parent, depth, url, color) {
var _local6 = ABowmanLink(parent.attachMovie(ABowmanLink.symbolName, "Link" + depth, depth));
_local6.init(color, url);
return(_local6);
};
_local1.init = function (color, url) {
this.url = url;
this.aBowmanCon = this.createEmptyMovieClip("aBowmanCon", this.getNextHighestDepth());
this.aBowman = this.aBowmanCon.createEmptyMovieClip("aBowman", this.aBowmanCon.getNextHighestDepth());
this.aBowmanMask = this.aBowmanCon.createEmptyMovieClip("aBowmanMask", this.aBowmanCon.getNextHighestDepth());
this.aBowman.onRollOver = function () {
this._parent.aBowmanMask.onEnterFrame = this._parent.aBowmanMask.expand;
};
this.aBowman.onRollOut = function () {
this._parent.aBowmanMask.onEnterFrame = this._parent.aBowmanMask.shrink;
};
this.aBowman.onRelease = function () {
getURL (url, "_top");
};
this.aBowmanMask.maxWidth = (this.tw + this.padding) * 7;
this.aBowmanMask.minWidth = (this.tw + this.padding) * 2;
this.aBowmanMask.height = this.th * 2;
this.aBowmanMask.width = this.aBowmanMask.minWidth;
this.aBowmanMask.boxX = -2;
this.aBowman.beginFill(0, 0);
com.abowman.graphics.Draw.drawRect(this.aBowman, this.aBowmanMask.boxX, -this.th, this.aBowmanMask.maxWidth, this.aBowmanMask.height);
this.aBowman.endFill();
this.aBowmanMask.expand = function () {
this.width = this.width + ((this.maxWidth - this.width) * 0.2);
if ((this.maxWidth - this.width) < 0.1) {
delete this.onEnterFrame;
}
this.render();
};
this.aBowmanMask.shrink = function () {
this.width = this.width - ((this.width - this.minWidth) * 0.2);
if ((this.width - this.minWidth) < 0.1) {
delete this.onEnterFrame;
}
this.render();
};
this.aBowmanMask.render = function () {
this.clear();
this.beginFill(0);
this.lineTo(this.boxX, (-this.height) * 0.6);
this.lineTo(this.boxX + this.width, (-this.height) * 0.6);
this.lineTo(this.boxX + this.width, this.height * 0.6);
this.lineTo(this.boxX, this.height * 0.6);
this.lineTo(this.boxX, 0);
this.endFill();
};
this.aBowmanMask.render();
this.aBowman.setMask(this.aBowmanMask);
this.aBowmanCon._y = this.th;
var _local3 = 0;
this.aBowman.lineStyle(3, color);
com.abowman.graphics.Draw.drawOval(this.aBowman, _local3 + (this.tw * 0.5), this.tw * 0.5, this.tw * 0.5, this.tw * 0.5);
with (this.aBowman) {
moveTo(_local3 + this.tw, 0);
lineTo(_local3 + this.tw, this.th);
_local3 = this.tw + this.padding;
moveTo(_local3, (-this.th) * 0.5);
lineTo(_local3, this.th);
lineTo(_local3, this.th * 0.5);
com.abowman.graphics.Draw.drawArc(this.aBowman, _local3, this.th * 0.5, this.tw * 0.5, 270, 180);
lineTo(_local3, 0);
lineTo(_local3 + (this.tw * 0.4), 0);
com.abowman.graphics.Draw.drawArc(this.aBowman, _local3 + (this.tw * 0.4), 0, this.tw * 0.4, 270, 270);
}
_local3 = 2 * (this.tw + this.padding);
com.abowman.graphics.Draw.drawOval(this.aBowman, _local3 + (this.tw / 2), this.tw / 2, this.tw / 2, this.tw / 2);
with (this.aBowman) {
_local3 = 3 * (this.tw + this.padding);
moveTo(_local3, 0);
lineTo(_local3 + (this.tw * 0.25), this.th);
lineTo(_local3 + (this.tw * 0.5), 0);
lineTo(_local3 + (this.tw * 0.75), this.th);
lineTo(_local3 + this.tw, 0);
_local3 = 4 * (this.tw + this.padding);
moveTo(_local3, 0);
lineTo(_local3, this.th);
lineTo(_local3, this.th * 0.25);
com.abowman.graphics.Draw.drawArc(this.aBowman, _local3, this.th * 0.25, this.tw * 0.25, -180, 180);
lineTo(_local3 + (this.tw * 0.5), this.th);
lineTo(_local3 + (this.tw * 0.5), this.th * 0.25);
com.abowman.graphics.Draw.drawArc(this.aBowman, _local3 + (this.tw * 0.5), this.th * 0.25, this.tw * 0.25, -180, 180);
lineTo(_local3 + this.tw, this.th);
}
_local3 = 5 * (this.tw + this.padding);
com.abowman.graphics.Draw.drawOval(this.aBowman, _local3 + (this.tw * 0.5), this.tw / 2, this.tw / 2, this.tw / 2);
with (this.aBowman) {
moveTo(_local3 + this.tw, 0);
lineTo(_local3 + this.tw, this.th);
_local3 = 6 * (this.tw + this.padding);
moveTo(_local3, 0);
lineTo(_local3, this.th);
lineTo(_local3, this.th * 0.5);
com.abowman.graphics.Draw.drawArc(this.aBowman, _local3, this.th * 0.5, this.tw * 0.5, -180, 180);
lineTo(_local3 + this.tw, this.th);
}
};
ASSetPropFlags(_local1, null, 1);
(_global.ABowmanLink /* register */).symbolName = "__Packages.ABowmanLink";
(_global.ABowmanLink /* register */).symbolLinked = Object.registerClass(ABowmanLink.symbolName, ABowmanLink);
_local1.tw = 10;
_local1.th = 10;
_local1.padding = 4;
}
#endinitclip