Frame 1
total = this.getBytesTotal();
loaded = this.getBytesLoaded();
loader.percent._xscale = int((loaded / total) * 100);
if (loaded >= total) {
loader.fade._alpha = loader.fade._alpha - ((loader.fade._alpha - 100) * 0.4);
if (Math.abs(loader.fade._alpha - 100) < 1) {
loader.fade._alpha = 100;
gotoAndPlay (3);
}
}
Frame 2
gotoAndPlay (1);
Frame 3
stop();
fadeout._alpha = 0;
playbtn.onRelease = function () {
fadeout.onEnterFrame = function () {
targetAlpha = 100;
alphaBlend = 0.3;
this._alpha = this._alpha - ((this._alpha - targetAlpha) * alphaBlend);
if (Math.abs(this._alpha - targetAlpha) < 5) {
this._alpha = 0;
delete this.onEnterFrame;
gotoAndStop (4);
}
};
};
Instance of Symbol 30 MovieClip "fadeout" in Frame 3
/* no clip actions */
Instance of Symbol 31 MovieClip "IMfade" in Frame 3
onClipEvent (enterFrame) {
targetAlpha = 0;
alphaBlend = 0.3;
this._alpha = this._alpha - ((this._alpha - targetAlpha) * alphaBlend);
if (Math.abs(this._alpha - targetAlpha) < 1) {
this._alpha = 0;
this._visible = false;
delete this.onEnterFrame;
}
}
Frame 4
stopAllSounds();
gotoAndStop (5);
Frame 5
stop();
playbtn.onRelease = function () {
fadeout.onEnterFrame = function () {
this.swapDepths(2600);
targetAlpha = 100;
alphaBlend = 0.3;
this._alpha = this._alpha - ((this._alpha - targetAlpha) * alphaBlend);
if (Math.abs(this._alpha - targetAlpha) < 5) {
this._alpha = 0;
delete this.onEnterFrame;
gotoAndStop (6);
}
};
};
Instance of Symbol 30 MovieClip "fadein" in Frame 5
onClipEvent (enterFrame) {
targetAlpha = 0;
alphaBlend = 0.3;
this._alpha = this._alpha - ((this._alpha - targetAlpha) * alphaBlend);
if (Math.abs(this._alpha - targetAlpha) < 1) {
this._alpha = 0;
this._visible = false;
delete this.onEnterFrame;
}
}
Frame 6
stopAllSounds();
gotoAndStop (7);
Frame 7
stop();
_quality = "high";
_global.score = 0;
hud.score = 0;
var distance = 0;
var fallAngle = 75;
var controlType = "mouse";
var keyStep = 2.8;
var keyDelta = 0;
var keyDecay = 1;
clown.state = "alive";
flash._alpha = 0;
volumeLevel = new Sound();
volumeLevel.setVolume(100);
var volumeFade = 100;
gasp1 = new Sound();
gasp1.attachSound("gasp1");
gasp2 = new Sound();
gasp2.attachSound("gasp2");
splat = new Sound();
splat.attachSound("splat");
camera = new Sound();
camera.attachSound("camera");
crowd = new Sound();
crowd.attachSound("crowd");
laugh = new Sound();
laugh.attachSound("laugh");
var ang = 0;
var da = 0;
var wobble = 100;
var range = 180;
var offset = 0;
var bgSpeed = 6;
pieLeft.gotoAndStop(22);
pieRight.gotoAndStop(22);
_root.onEnterFrame = function () {
if (clown.state == "alive") {
distance++;
hud.score = int(distance / 10) * 10;
if ((distance % 100) == 0) {
}
if (controlType == "mouse") {
offset = _root._xmouse - (Stage.width / 2);
if (Key.isDown(37) || (Key.isDown(39))) {
controlType = "keyboard";
}
} else if (controlType == "keyboard") {
if (Key.isDown(37)) {
if (keyRight) {
offset = -20;
keyDelta = 0;
keyRight = false;
}
keyLeft = true;
keyDelta = keyDelta - keyStep;
} else if (Key.isDown(39)) {
if (keyLeft) {
offset = 20;
keyDelta = 0;
keyLeft = false;
}
keyRight = true;
keyDelta = keyDelta + keyStep;
}
if (keyLeft || (keyRight)) {
offset = offset + keyDelta;
}
if (keyDelta > 0) {
keyDelta = keyDelta - keyDecay;
} else if (keyDelta < 0) {
keyDelta = keyDelta + keyDecay;
}
}
tempAng = ((offset / Stage.width) / 2) * range;
angDiff = ang - tempAng;
ang = tempAng;
wobble = ((100 - (distance / 25)) + random(5)) - random(5);
if (wobble <= 0) {
wobble = 1;
}
da = da + ((ang - (angDiff * 2)) / wobble);
dir._rotation = dir._rotation + da;
if ((dir._rotation < fallAngle) && (dir._rotation > 0)) {
cFrame = Math.floor((dir._rotation / fallAngle) * 60);
clown.gotoAndStop(cFrame);
clown._x = 190 + cFrame;
if ((dir._rotation > (fallAngle / 2)) && (pieRight._currentframe == 9)) {
pieHit.play();
clown.gotoAndPlay("fallright");
clown.state = "fall";
pieRight.stop();
pieRight.pie.play();
flash._alpha = 100;
flash.onEnterFrame = flashout;
splat.start();
laugh.start();
}
} else if ((dir._rotation > (-fallAngle)) && (dir._rotation < 0)) {
cFrame = Math.floor(((-dir._rotation) / fallAngle) * 60) + 61;
clown.gotoAndStop(cFrame);
clown._x = 190 - (cFrame - 60);
if ((dir._rotation < ((-fallAngle) / 2)) && (pieLeft._currentframe == 11)) {
clown.gotoAndPlay("fallleft");
clown.state = "fall";
pieLeft.stop();
pieLeft.pie.play();
flash._alpha = 100;
flash.onEnterFrame = flashout;
splat.start();
laugh.start();
}
} else if (dir._rotation == 0) {
clown.gotoAndStop(1);
}
bg._x = bg._x - bgSpeed;
bgSpeed = 6 + (distance / 200);
if (Math.abs(bg._x) > (bg._width / 2)) {
bg._x = 0;
}
if (dir._rotation > fallAngle) {
clown.gotoAndPlay("fallright");
clown.state = "fall";
gasp1.start();
gasp2.start();
} else if (dir._rotation < (-fallAngle)) {
clown.gotoAndPlay("fallleft");
clown.state = "fall";
gasp1.start();
gasp2.start();
} else if (dir._rotation > (fallAngle - 20)) {
snapFreq = 25;
snapRand = random(snapFreq);
if ((flash.state != "snapshot") && (snapRand == 0)) {
flash.state = "snapshot";
flash._alpha = 100;
flash._visible = true;
flash.onEnterFrame = snapshot;
camera.start();
crowd.start();
}
} else if (dir._rotation < ((-fallAngle) + 20)) {
snapFreq = 25;
snapRand = random(snapFreq);
if ((flash.state != "snapshot") && (snapRand == 0)) {
flash.state = "snapshot";
flash._alpha = 100;
flash._visible = true;
flash.onEnterFrame = snapshot;
camera.start();
crowd.start();
}
}
if (distance > 100) {
pieFreq = int(200 - (distance / 30));
if (pieFreq < 0) {
pieFreq = 1;
}
tossPieRight = random(pieFreq);
tossPieLeft = random(pieFreq);
if (pieRight._currentframe == 22) {
if (tossPieRight == 0) {
dangerRight.play();
}
}
if (pieLeft._currentframe == 22) {
if (tossPieLeft == 0) {
dangerLeft.play();
}
}
}
} else if (clown.state == "fall") {
volumeBlend = 0.2;
volumeFade = volumeFade - (volumeFade * volumeBlend);
volumeLevel.setVolume(volumeFade);
friends.stop();
} else if (clown.state == "dead") {
volumeLevel.setVolume(0);
fadeout.onEnterFrame = function () {
_global.score = int(distance / 10) * 10;
targetAlpha = 100;
alphaBlend = 0.3;
this._alpha = this._alpha - ((this._alpha - targetAlpha) * alphaBlend);
if (Math.abs(this._alpha - targetAlpha) < 5) {
this._alpha = 0;
delete this.onEnterFrame;
gotoAndStop (8);
}
};
}
};
fadein.onEnterFrame = function () {
targetAlpha = 0;
alphaBlend = 0.3;
this._alpha = this._alpha - ((this._alpha - targetAlpha) * alphaBlend);
if (Math.abs(this._alpha - targetAlpha) < 1) {
this._alpha = 0;
this._visible = false;
delete this.onEnterFrame;
}
};
flashout = function () {
targetAlpha = 0;
alphaBlend = 0.3;
this._alpha = this._alpha - ((this._alpha - targetAlpha) * alphaBlend);
if (Math.abs(this._alpha - targetAlpha) < 1) {
this._alpha = 0;
this._visible = false;
delete this.onEnterFrame;
}
};
snapshot = function () {
targetAlpha = 0;
alphaBlend = 0.5;
this._alpha = this._alpha - ((this._alpha - targetAlpha) * alphaBlend);
if (Math.abs(this._alpha - targetAlpha) < 1) {
this.state = "dead";
this._alpha = 0;
this._visible = false;
delete this.onEnterFrame;
}
};
_root.onMouseMove = function () {
controlType = "mouse";
};
Frame 8
stop();
stopAllSounds();
gotoAndStop ("gameover");
Frame 9
volumeLevel.setVolume(100);
stop();
score.text = _global.score;
scores.text = _global.score;
fadeout._alpha = 0;
playbtn.onRelease = function () {
fadeout.onEnterFrame = function () {
targetAlpha = 100;
alphaBlend = 0.3;
this._alpha = this._alpha - ((this._alpha - targetAlpha) * alphaBlend);
if (Math.abs(this._alpha - targetAlpha) < 5) {
this._alpha = 0;
delete this.onEnterFrame;
gotoAndPlay (7);
}
};
};
fadein.onEnterFrame = function () {
targetAlpha = 0;
alphaBlend = 0.3;
this._alpha = this._alpha - ((this._alpha - targetAlpha) * alphaBlend);
if (Math.abs(this._alpha - targetAlpha) < 1) {
this._alpha = 0;
this._visible = false;
delete this.onEnterFrame;
}
};
_root.gameName = "clown";
submitBtn.onRelease = function () {
var id;
var holder = new LoadVars();
var _local5 = cypher(_global.score);
var _local4 = (("http://www.imagerymedia.com/flash/games/highscore/submit.php?game=" + _root.gameName) + "&idx=") + _local5;
holder.onLoad = function (success) {
id = holder.id;
getURL ((("http://www.imagerymedia.com/flash/games/highscore/info.php?game=" + _root.gameName) + "&id=") + id, "_blank");
};
holder.load(_local4);
delete this.onRelease;
};
cypher = function (num) {
num = num * 2;
var _local3 = new String(num);
var _local1 = new String();
i = 0;
while (i < _local3.length) {
var _local2 = Number(_local3.charAt(i));
switch (_local2) {
case 0 :
_local1 = _local1 + "x";
break;
case 1 :
_local1 = _local1 + "h";
break;
case 2 :
_local1 = _local1 + "q";
break;
case 3 :
_local1 = _local1 + "v";
break;
case 4 :
_local1 = _local1 + "s";
break;
case 5 :
_local1 = _local1 + "i";
break;
case 6 :
_local1 = _local1 + "y";
break;
case 7 :
_local1 = _local1 + "c";
break;
case 8 :
_local1 = _local1 + "g";
break;
case 9 :
_local1 = _local1 + "l";
}
i++;
}
return(_local1);
};
Instance of Symbol 30 MovieClip "fadein" in Frame 9
/* no clip actions */
Symbol 16 MovieClip Frame 1
stop();
Symbol 16 MovieClip Frame 16
stop();
gotoAndStop (1);
Symbol 92 MovieClip Frame 38
stop();
Symbol 107 MovieClip Frame 13
stop();
Symbol 108 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 15
stop();
Symbol 109 MovieClip Frame 22
stop();
Symbol 133 MovieClip Frame 24
stop();
_root.clown.state = "dead";
Symbol 134 MovieClip Frame 1
stop();
Symbol 134 MovieClip Frame 2
stop();
Symbol 134 MovieClip Frame 3
stop();
Symbol 134 MovieClip Frame 4
stop();
Symbol 134 MovieClip Frame 5
stop();
Symbol 134 MovieClip Frame 6
stop();
Symbol 134 MovieClip Frame 7
stop();
Symbol 134 MovieClip Frame 8
stop();
Symbol 134 MovieClip Frame 9
stop();
Symbol 134 MovieClip Frame 10
stop();
Symbol 134 MovieClip Frame 11
stop();
Symbol 134 MovieClip Frame 12
stop();
Symbol 134 MovieClip Frame 13
stop();
Symbol 134 MovieClip Frame 14
stop();
Symbol 134 MovieClip Frame 15
stop();
Symbol 134 MovieClip Frame 16
stop();
Symbol 134 MovieClip Frame 17
stop();
Symbol 134 MovieClip Frame 18
stop();
Symbol 134 MovieClip Frame 19
stop();
Symbol 134 MovieClip Frame 20
stop();
Symbol 134 MovieClip Frame 21
stop();
Symbol 134 MovieClip Frame 22
stop();
Symbol 134 MovieClip Frame 23
stop();
Symbol 134 MovieClip Frame 24
stop();
Symbol 134 MovieClip Frame 25
stop();
Symbol 134 MovieClip Frame 26
stop();
Symbol 134 MovieClip Frame 27
stop();
Symbol 134 MovieClip Frame 28
stop();
Symbol 134 MovieClip Frame 29
stop();
Symbol 134 MovieClip Frame 30
stop();
Symbol 134 MovieClip Frame 31
stop();
Symbol 134 MovieClip Frame 32
stop();
Symbol 134 MovieClip Frame 33
stop();
Symbol 134 MovieClip Frame 34
stop();
Symbol 134 MovieClip Frame 35
stop();
Symbol 134 MovieClip Frame 36
stop();
Symbol 134 MovieClip Frame 37
stop();
Symbol 134 MovieClip Frame 38
stop();
Symbol 134 MovieClip Frame 39
stop();
Symbol 134 MovieClip Frame 40
stop();
Symbol 134 MovieClip Frame 41
stop();
Symbol 134 MovieClip Frame 42
stop();
Symbol 134 MovieClip Frame 43
stop();
Symbol 134 MovieClip Frame 44
stop();
Symbol 134 MovieClip Frame 45
stop();
Symbol 134 MovieClip Frame 46
stop();
Symbol 134 MovieClip Frame 47
stop();
Symbol 134 MovieClip Frame 48
stop();
Symbol 134 MovieClip Frame 49
stop();
Symbol 134 MovieClip Frame 50
stop();
Symbol 134 MovieClip Frame 51
stop();
Symbol 134 MovieClip Frame 52
stop();
Symbol 134 MovieClip Frame 53
stop();
Symbol 134 MovieClip Frame 54
stop();
Symbol 134 MovieClip Frame 55
stop();
Symbol 134 MovieClip Frame 56
stop();
Symbol 134 MovieClip Frame 57
stop();
Symbol 134 MovieClip Frame 58
stop();
Symbol 134 MovieClip Frame 59
stop();
Symbol 134 MovieClip Frame 60
stop();
Symbol 134 MovieClip Frame 61
stop();
Symbol 134 MovieClip Frame 62
stop();
Symbol 134 MovieClip Frame 63
stop();
Symbol 134 MovieClip Frame 64
stop();
Symbol 134 MovieClip Frame 65
stop();
Symbol 134 MovieClip Frame 66
stop();
Symbol 134 MovieClip Frame 67
stop();
Symbol 134 MovieClip Frame 68
stop();
Symbol 134 MovieClip Frame 69
stop();
Symbol 134 MovieClip Frame 70
stop();
Symbol 134 MovieClip Frame 71
stop();
Symbol 134 MovieClip Frame 72
stop();
Symbol 134 MovieClip Frame 73
stop();
Symbol 134 MovieClip Frame 74
stop();
Symbol 134 MovieClip Frame 75
stop();
Symbol 134 MovieClip Frame 76
stop();
Symbol 134 MovieClip Frame 77
stop();
Symbol 134 MovieClip Frame 78
stop();
Symbol 134 MovieClip Frame 79
stop();
Symbol 134 MovieClip Frame 80
stop();
Symbol 134 MovieClip Frame 81
stop();
Symbol 134 MovieClip Frame 82
stop();
Symbol 134 MovieClip Frame 83
stop();
Symbol 134 MovieClip Frame 84
stop();
Symbol 134 MovieClip Frame 85
stop();
Symbol 134 MovieClip Frame 86
stop();
Symbol 134 MovieClip Frame 87
stop();
Symbol 134 MovieClip Frame 88
stop();
Symbol 134 MovieClip Frame 89
stop();
Symbol 134 MovieClip Frame 90
stop();
Symbol 134 MovieClip Frame 91
stop();
Symbol 134 MovieClip Frame 92
stop();
Symbol 134 MovieClip Frame 93
stop();
Symbol 134 MovieClip Frame 94
stop();
Symbol 134 MovieClip Frame 95
stop();
Symbol 134 MovieClip Frame 96
stop();
Symbol 134 MovieClip Frame 97
stop();
Symbol 134 MovieClip Frame 98
stop();
Symbol 134 MovieClip Frame 99
stop();
Symbol 134 MovieClip Frame 100
stop();
Symbol 134 MovieClip Frame 101
stop();
Symbol 134 MovieClip Frame 102
stop();
Symbol 134 MovieClip Frame 103
stop();
Symbol 134 MovieClip Frame 104
stop();
Symbol 134 MovieClip Frame 105
stop();
Symbol 134 MovieClip Frame 106
stop();
Symbol 134 MovieClip Frame 107
stop();
Symbol 134 MovieClip Frame 108
stop();
Symbol 134 MovieClip Frame 109
stop();
Symbol 134 MovieClip Frame 110
stop();
Symbol 134 MovieClip Frame 111
stop();
Symbol 134 MovieClip Frame 112
stop();
Symbol 134 MovieClip Frame 113
stop();
Symbol 134 MovieClip Frame 114
stop();
Symbol 134 MovieClip Frame 115
stop();
Symbol 134 MovieClip Frame 116
stop();
Symbol 134 MovieClip Frame 117
stop();
Symbol 134 MovieClip Frame 118
stop();
Symbol 134 MovieClip Frame 119
stop();
Symbol 134 MovieClip Frame 120
stop();
Symbol 134 MovieClip Frame 121
stop();
Symbol 134 MovieClip Frame 130
stop();
Symbol 135 MovieClip Frame 1
stop();
Symbol 136 MovieClip Frame 22
stop();
Symbol 146 MovieClip Frame 1
stop();
Symbol 146 MovieClip Frame 16
if (this._name == "dangerRight") {
_root.pieRight.play();
} else {
_root.pieLeft.play();
}