Frame 1
function grow() {
if (size < foxi.belly._totalframes) {
size++;
if (size > 423) {
foxi.belly.gotoAndStop(size + Math.round((Math.cos(size * 0.25) * 5) + 5));
foxi.breast1.gotoAndStop(size + Math.round((Math.cos(size * 0.25) * 5) + 5));
foxi.breast2.gotoAndStop(size + Math.round((Math.cos(size * 0.25) * 5) + 5));
} else {
if (foxi.mouth._currentlabel != "inflate") {
condition = "";
delete _root.onEnterFrame;
}
foxi.belly.gotoAndStop(size);
foxi.breast1.gotoAndStop(size);
foxi.breast2.gotoAndStop(size);
}
}
}
function revert() {
if (size > 1) {
if (size == 423) {
size = 400;
} else {
size--;
}
foxi.belly.gotoAndStop(size);
foxi.breast1.gotoAndStop(size);
foxi.breast2.gotoAndStop(size);
} else {
growth = 0;
}
}
function timeout_fn() {
if (!timer) {
condition = "";
setState(curState.state);
delete _root.onEnterFrame;
}
timer--;
}
function setState(str) {
if (condition != "") {
return(undefined);
}
if (state != str) {
curState.state = str;
state = str;
curState.state = state;
for (var _local2 in states[str]) {
curState[_local2] = states[str][_local2];
}
foxi.eyes.gotoAndPlay(curState.eyes);
foxi.mouth.gotoAndPlay(curState.mouth);
foxi.eyes.pupil1._x = p1X + curState.p1X;
foxi.eyes.pupil1._y = p1Y + curState.p1Y;
foxi.eyes.pupil2._x = p2X + curState.p2X;
foxi.eyes.pupil2._y = p2Y + curState.p2Y;
canBlink = curState.canBlink;
}
}
function p_fn() {
foxi.coin.startDrag();
}
function r_fn() {
foxi.coin.stopDrag();
var _local2 = 1;
while (_local2 < 5) {
if (this.hitTest(this._parent["m" + _local2].coin)) {
this._parent["m" + _local2].red.onPress = function () {
dispatchCan("red", this._parent);
};
this._parent["m" + _local2].green.onPress = function () {
dispatchCan("green", this._parent);
};
this._parent["m" + _local2].yellow.onPress = function () {
dispatchCan("yellow", this._parent);
};
this._parent["m" + _local2].orange.onPress = function () {
dispatchCan("orange", this._parent);
};
this._parent["m" + _local2].grey.onPress = function () {
dispatchCan("grey", this._parent);
};
this.removeMovieClip();
}
_local2++;
}
if (this._y < coinY) {
this.vY = 0;
this.onEnterFrame = function () {
if (this._y < coinY) {
this.vY++;
this._y = this._y + this.vY;
} else {
this.vY = 0;
delete this.onEnterFrame;
}
};
}
}
function dispatchCan(color, m) {
var _local2 = m.box;
delete m.red.onPress;
delete m.green.onPress;
delete m.yellow.onPress;
delete m.orange.onPress;
delete m.grey.onPress;
_local2.setMask(m.boxcover);
_local2.attachMovie(color + "can", "can", 10, {_y:-_local2._height, _x:0});
_local2.can.vY = 0;
_local2.can.onEnterFrame = function () {
if (this._y < (this._parent._height * 0.25)) {
this._y = this._y + this.vY;
this.vY++;
trace(this._y);
} else {
trace(this._y + " *");
this._y = this._parent._height * 0.25;
this.vY = 0;
this.onPress = function () {
this.removeMovieClip();
foxi.attachMovie("coin", "coin", 20, {_x:coinX, _y:coinY});
foxi.coin.onRelease = r_fn;
foxi.coin.onPress = p_fn;
};
delete this.onEnterFrame;
}
};
}
_level0.bgColor = 13421772 /* 0xCCCCCC */;
_level0.flashWidth = 800;
_level0.flashHeight = 600;
var state = "";
var condition = "";
var states = new Array();
var size = 1;
var growth = 0;
var curState = new Object();
var canBlink = false;
var blinking = false;
var p1X = foxi.eyes.pupil1._x;
var p1Y = foxi.eyes.pupil1._y;
var p2X = foxi.eyes.pupil2._x;
var p2Y = foxi.eyes.pupil2._y;
foxi.belly.stop();
foxi.breast1.stop();
foxi.breast2.stop();
foxi.top.stop();
foxi.arm1.stop();
foxi.arm2.stop();
states.resting = {eyes:"open", mouth:"smile", canBlink:true, p1X:-7, p1Y:0, p2X:-7, p2Y:0};
states.inflate = {eyes:"closed", mouth:"inflate", canBlink:false, p1X:0, p1Y:0, p2X:0, p2Y:0};
states.bigger = {eyes:"small", mouth:"inflate", canBlink:true, p1X:7, p1Y:0, p2X:7, p2Y:0};
states.relaxed = {eyes:"open", mouth:"happy", canBlink:true, p1X:0, p1Y:0, p2X:0, p2Y:0};
states.over = {eyes:"small", mouth:"happy", canBlink:true, p1X:0, p1Y:0, p2X:0, p2Y:0};
states.full = {eyes:"wide", mouth:"full", canBlink:true, p1X:0, p1Y:0, p2X:0, p2Y:0};
states.big = {eyes:"small", mouth:"full2", canBlink:true, p1X:0, p1Y:0, p2X:0, p2Y:0};
states.deflate = {eyes:"small", mouth:"open", canBlink:true, p1X:5, p1Y:0, p2X:5, p2Y:0};
setState("deflate");
foxi.onEnterFrame = function () {
if (canBlink && (Math.random() > 0.99)) {
foxi.eyes.gotoAndPlay("blink");
foxi.eyes.pupil1._x = p1X + curState.p1X;
foxi.eyes.pupil1._y = p1Y + curState.p1Y;
foxi.eyes.pupil2._x = p2X + curState.p2X;
foxi.eyes.pupil2._y = p2Y + curState.p2Y;
blinking = true;
}
if (blinking && (foxi.eyes._currentlabel == "endblink")) {
foxi.eyes.gotoAndPlay(curState.eyes);
foxi.eyes.pupil1._x = p1X + curState.p1X;
foxi.eyes.pupil1._y = p1Y + curState.p1Y;
foxi.eyes.pupil2._x = p2X + curState.p2X;
foxi.eyes.pupil2._y = p2Y + curState.p2Y;
blinking = false;
}
if (growth == 1) {
grow();
switch (true) {
case size < 200 :
setState("inflate");
break;
case size == 200 :
setState("relaxed");
growth = 0;
break;
case size < 400 :
setState("bigger");
break;
case size == 400 :
setState("over");
growth = 0;
break;
case size == foxi.belly._totalframes :
setState("big");
}
} else if (growth == -1) {
revert();
switch (true) {
case size == 1 :
setState("resting");
break;
default :
setState("deflate");
}
} else {
switch (true) {
case size == 1 :
setState("resting");
break;
case size <= 200 :
setState("relaxed");
break;
case size <= 400 :
setState("over");
break;
default :
setState("big");
}
}
if (foxi.top._currentframe < 150) {
foxi.top.gotoAndStop(size);
foxi.arm2.gotoAndStop(size);
foxi.arm1.gotoAndStop(size);
} else {
if (foxi.top._currentframe == foxi.top._totalframes) {
foxi.top.gotoAndStop(foxi.top._totalframes);
} else {
foxi.top.play();
}
if (foxi.arm2._currentframe == foxi.arm2._totalframes) {
foxi.arm2.gotoAndStop(foxi.arm2._totalframes);
foxi.arm1.gotoAndStop(foxi.arm2._totalframes);
} else {
foxi.arm2.play();
foxi.arm1.play();
}
}
};
var reset = false;
_panel._plus._txt.text = "+";
_panel._minus._txt.text = "-";
_panel._expand._txt.text = "Expand";
_panel._revert._txt.text = "Revert";
_panel._info.text = "Foxi Coke inflation. Drawn and programmed by Doom the wolf (http://doom-the-wolf.deviantart.com).";
_panel._cont_txt.text = "continuous";
_panel.onEnterFrame = function () {
if (_panel.hitTest(_root._xmouse, _root._ymouse)) {
if (Math.abs(_panel._y - 500) > 1) {
_panel._y = _panel._y + ((500 - _panel._y) * 0.4);
}
} else if (Math.abs(_panel._y - 600) > 1) {
_panel._y = _panel._y + ((600 - _panel._y) * 0.4);
}
if (growth && (_panel._cont._currentframe == 2)) {
_panel._cont_txt.text = "stop";
} else {
_panel._cont_txt.text = "continuous";
}
if (size < 200) {
_panel._expand._txt.text = "Expand";
} else if (size < 400) {
_panel._expand._txt.text = "Bigger";
} else {
_panel._expand._txt.text = "Reset";
}
};
_panel._cont.onRelease = function () {
if ((growth == -1) || (size < 400)) {
growth = 0;
}
_panel._cont.gotoAndStop(3 - _panel._cont._currentframe);
};
_panel._plus.onPress = function () {
_panel._plus.onEnterFrame = function () {
foxi._xscale = (foxi._yscale = foxi._xscale + 2);
};
};
_panel._minus.onPress = function () {
_panel._minus.onEnterFrame = function () {
if (foxi._xscale > 2) {
foxi._xscale = (foxi._yscale = foxi._xscale - 2);
} else {
delete _panel._minus.onEnterFrame;
}
};
};
_panel.onMouseUp = function () {
delete _panel._plus.onEnterFrame;
delete _panel._minus.onEnterFrame;
if ((_panel._cont._currentframe == 1) && (size < 400)) {
growth = 0;
}
};
_panel._expand.onPress = function () {
if (size >= 400) {
growth = 0;
reset = true;
} else {
growth = 1;
}
};
_panel._expand.onRelease = function () {
if (reset) {
growth = 0;
size = 1;
foxi.belly.gotoAndStop(1);
foxi.breast1.gotoAndStop(1);
foxi.breast2.gotoAndStop(1);
foxi.arm1.gotoAndStop(1);
foxi.arm2.gotoAndStop(1);
foxi.top.gotoAndStop(1);
condition = "";
timer = 0;
delete _root.onEnterFrame;
setState("sleeping");
reset = false;
}
};
_panel._expand.onReleaseOutside = function () {
reset = false;
};
_panel._revert.onPress = function () {
if ((size <= 400) || (size > 423)) {
growth = -1;
}
};
foxi.onMouseDown = function () {
if (_panel._y > 550) {
foxi.startDrag();
}
};
foxi.onMouseUp = function () {
foxi.stopDrag();
};
foxi.belly.onPress = function () {
if (size == 400) {
setState("full");
growth = 1;
} else if (condition == "") {
canBlink = false;
condition = "poke";
state = "special";
if (size < 400) {
if (growth < 1) {
foxi.mouth.gotoAndPlay("open2");
}
foxi.eyes.gotoAndPlay("mad");
} else {
foxi.mouth.gotoAndPlay("full3");
foxi.eyes.gotoAndPlay("shut");
}
timer = 30;
_root.onEnterFrame = timeout_fn;
}
};
foxi.breast1.onPress = (foxi.breast2.onPress = foxi.belly.onPress);
var coinY = 1240;
var coinX = -560;
foxi.attachMovie("coin", "coin", 20, {_x:coinX, _y:coinY});
foxi.coin.onRelease = r_fn;
foxi.coin.onPress = p_fn;
Symbol 86 MovieClip Frame 1
_currentlabel = "open";
Symbol 86 MovieClip Frame 2
gotoAndPlay(_currentlabel);
Symbol 86 MovieClip Frame 3
_currentlabel = "wide";
Symbol 86 MovieClip Frame 4
gotoAndPlay(_currentlabel);
Symbol 86 MovieClip Frame 5
_currentlabel = "small";
Symbol 86 MovieClip Frame 6
gotoAndPlay(_currentlabel);
Symbol 86 MovieClip Frame 7
_currentlabel = "closed";
Symbol 86 MovieClip Frame 8
gotoAndPlay(_currentlabel);
Symbol 86 MovieClip Frame 9
_currentlabel = "blink";
Symbol 86 MovieClip Frame 13
_currentlabel = "endblink";
Symbol 86 MovieClip Frame 14
gotoAndPlay(_currentlabel);
Symbol 86 MovieClip Frame 15
_currentlabel = "shut";
Symbol 86 MovieClip Frame 16
gotoAndPlay(_currentlabel);
Symbol 86 MovieClip Frame 17
_currentlabel = "mad";
Symbol 86 MovieClip Frame 18
gotoAndPlay(_currentlabel);
Symbol 101 MovieClip Frame 1
_currentlabel = "smile";
Symbol 101 MovieClip Frame 2
gotoAndPlay(_currentlabel);
Symbol 101 MovieClip Frame 3
_currentlabel = "full";
Symbol 101 MovieClip Frame 4
gotoAndPlay(_currentlabel);
Symbol 101 MovieClip Frame 5
_currentlabel = "inflate";
Symbol 101 MovieClip Frame 22
gotoAndPlay(_currentlabel);
Symbol 101 MovieClip Frame 23
_currentlabel = "happy";
Symbol 101 MovieClip Frame 24
gotoAndPlay(_currentlabel);
Symbol 101 MovieClip Frame 25
_currentlabel = "full2";
Symbol 101 MovieClip Frame 26
gotoAndPlay(_currentlabel);
Symbol 101 MovieClip Frame 27
_currentlabel = "open";
Symbol 101 MovieClip Frame 28
gotoAndPlay(_currentlabel);
Symbol 101 MovieClip Frame 29
_currentlabel = "open2";
Symbol 101 MovieClip Frame 30
gotoAndPlay(_currentlabel);
Symbol 101 MovieClip Frame 31
_currentlabel = "full3";
Symbol 101 MovieClip Frame 32
gotoAndPlay(_currentlabel);
Symbol 155 MovieClip Frame 1
stop();