Frame 1
MochiAd.showPreGameAd({id:"c16bf4e8429ad82d", res:"780x400"});
Frame 2
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("f98bd5fb", this, 10301, true);
Frame 3
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("f98bd5fb", this, 10301, true);
function btnRollOver() {
this._width = this._width + 12;
this._height = this._height + 12;
this._rotation = this._rotation - 8;
}
function btnRollOut() {
this._width = this._width - 12;
this._height = this._height - 12;
this._rotation = this._rotation + 8;
}
backgroundMusic = new Sound(_root);
backgroundMusic.attachSound("music");
backgroundMusic.start(0, 9999);
playGame.onRelease = function () {
backgroundMusic.stop();
gotoAndPlay (9);
};
playGame.onRollOver = btnRollOver;
playGame.onRollOut = btnRollOut;
playGame.onDragOut = btnRollOut;
instructions.onRelease = function () {
gotoAndStop (8);
};
instructions.onRollOver = btnRollOver;
instructions.onRollOut = btnRollOut;
instructions.onDragOut = btnRollOut;
playMore.onRollOver = btnRollOver;
playMore.onRollOut = btnRollOut;
playMore.onDragOut = btnRollOut;
playMore.onRelease = function () {
getURL ("http://www.urbaniacs.com", "_blank");
};
stop();
Frame 7
gotoAndPlay (9);
Frame 8
playGame.onRelease = function () {
backgroundMusic.stop();
gotoAndPlay (9);
};
playGame.onRollOut = btnRollOut;
playGame.onRollOver = btnRollOver;
playGame.onDragOut = btnRollOut;
Frame 9
function stopStretch() {
stretch.stop();
delete stretch;
removeMovieClip(stretchHolder);
}
function playStretch() {
createEmptyMovieClip("stretchHolder", 2);
stretch = new Sound(stretchHolder);
stretch.attachSound("pullBack");
stretch.setVolume(75);
stretchHolder.waitFrame = 70;
stretchHolder.counter = stretchHolder.waitFrame;
stretchHolder.onEnterFrame = function () {
if (this.counter < this.waitFrame) {
this.counter++;
} else {
stretch.start(0, 0);
this.counter = 0;
}
};
}
function listenForAngle() {
meters.angleMeter.meter.play();
angleListener = new Object();
angleListener.onKeyDown = function () {
if (Key.getCode() == 32) {
meters.angleMeter.meter.stop();
setAngle();
meters.play();
}
};
Key.addListener(angleListener);
}
function listenForPower() {
powerListener = new Object();
powerListener.onKeyDown = function () {
if (Key.getCode() == 32) {
meters.powerMeter.meter.stop();
meters.powerMeter.meter.arrow.gotoAndPlay(2);
setPower();
}
};
Key.addListener(powerListener);
}
function setPower() {
Key.removeListener(powerListener);
stopStretch();
delete meters.powerMeter.pickPowerBtn.onPress;
var _local1 = meters.powerMeter.meter._currentframe - 1;
launchPower = minPower + ((_local1 / 17) * (maxPower - minPower));
launchJohnny();
}
function setAngle() {
Key.removeListener(angleListener);
delete meters.angleMeter.pickAngleBtn.onPress;
var _local1 = meters.angleMeter.meter._currentframe;
if (_local1 <= 12) {
_local1 = _local1 - 2;
launchDegrees = minAngle + ((_local1 / 10) * (maxAngle - minAngle));
} else {
_local1 = _local1 - 13;
launchDegrees = (maxAngle * 0.9) - ((_local1 / 9) * (maxAngle - minAngle));
}
launchRadians = (launchDegrees * Math.PI) / 180;
}
function playFling() {
johnnyFlingHolder = createEmptyMovieClip("johnnyFlingHolder", 3);
johnnyFling = new Sound(johnnyFlingHolder);
johnnyFling.attachSound(String("fling" + (random(4) + 1)));
johnnyFling.start(0, 0);
}
function launchJohnny() {
if (launchPower < (minPower + ((maxPower - minPower) / 3))) {
johnny.gotoAndPlay("low");
} else if (launchDegrees <= highAngle) {
johnny.gotoAndPlay("high");
} else if (launchDegrees <= mediumAngle) {
johnny.gotoAndPlay("medium");
} else {
johnny.gotoAndPlay("low");
}
}
Key.removeListener(keyListener_obj);
var launchDegrees = 0;
var launchRadians = 0;
var launchPower = 0;
var maxAngle = -58;
var minAngle = -10;
var maxPower = 130;
var minPower = 50;
var mediumAngle = (minAngle + ((maxAngle - minAngle) * 0.333333333333333));
var highAngle = (minAngle + ((maxAngle - minAngle) * 0.666666666666667));
var mouseListener = new Object();
var step = "";
mouseListener.onMouseDown = function () {
switch (step) {
case "angle" :
step = "";
meters.angleMeter.meter.stop();
setAngle();
meters.play();
return;
case "power" :
step = "";
stopStretch();
meters.powerMeter.meter.stop();
meters.powerMeter.meter.arrow.gotoAndPlay(2);
setPower();
Mouse.removeListener(mouseListener);
}
};
Mouse.addListener(mouseListener);
Frame 16
playStretch();
stop();
Frame 20
gotoAndStop (21);
Frame 21
var fireSuit = new Object();
fireSuit.pieces = new Array(johnny.fire_suit, johnny.fire_sleeve, johnny.fire_hat);
var bondageSuit = new Object();
bondageSuit.pieces = new Array(johnny.bondage_strap, johnny.bondage_suit);
var jacketSuit = new Object();
jacketSuit.pieces = new Array(johnny.suit_sleeve, johnny.suit_suit);
var muscleShirt = new Object();
muscleShirt.pieces = new Array(johnny.muscleshirt);
var pedora = new Object();
pedora.pieces = new Array(johnny.pedora);
var parachute = new Object();
parachute.pieces = new Array(johnny.parachute);
var hammerPants = new Object();
hammerPants.pieces = new Array(johnny.hammerpants);
var flintstone = new Object();
flintstone.pieces = new Array(johnny.flintstone);
var ballarina = new Object();
ballarina.pieces = new Array(johnny.ballarina);
var madonnaBra = new Object();
madonnaBra.pieces = new Array(johnny.bra);
var bopeep = new Object();
bopeep.pieces = new Array(johnny.bopeep_shoulder, johnny.bopeep_hat, johnny.bopeep_suit);
var redJacket = new Object();
redJacket.pieces = new Array(johnny.red_jacket, johnny.red_sleeve);
var moomoo = new Object();
moomoo.pieces = new Array(johnny.moomoo);
var allClothes = new Array();
allClothes.push(fireSuit);
allClothes.push(jacketSuit);
allClothes.push(muscleShirt);
allClothes.push(pedora);
allClothes.push(parachute);
allClothes.push(hammerPants);
allClothes.push(flintstone);
allClothes.push(ballarina);
allClothes.push(madonnaBra);
allClothes.push(bopeep);
allClothes.push(redJacket);
allClothes.push(moomoo);
allClothes.push(bondageSuit);
johnny.swapDepths(100);
meter.swapDepths(105);
meterBackground.swapDepths(104);
crackDepth = 20;
obstacleDepth = 30;
hitSounds = new Array("hammer", "punch");
johnnyClothes = new Array();
otherObjects = new Array();
shakeObjects = new Array(johnny, wall.graphic, city.graphic, buildings.graphic);
minObstacleSpace = 700;
maxObstacleSpace = 850;
nextDistance = 1000;
obstacles = new Array("hydrant", "manhole", "trampoline", "glass", "lowrider", "lowrider2", "seesaw");
var obstacleIndex = 0;
var paces = 10;
var vx = 0;
var vy = 0;
var gravity = 1.8;
var ground = 270;
var bounce = -0.6;
var friction = 0.5;
var height = 0;
var distance = 0;
var score = 0;
var peakHeight = -1400;
var flapsLeft = 10;
var lock = false;
var hitGlass;
var skidding = false;
var waitTime = 24;
stop();
function gameOver() {
mc = _root.createEmptyMovieClip("gameOverWait", 80);
mc.onEnterFrame = function () {
if (waitTime > 0) {
waitTime--;
} else {
Key.removeListener(flapListener);
removeMovieClip(johnny);
removeMovieClip(placer);
removeMovieClip(collider);
removeMovieClip(shaker);
removeMovieClip(meter);
removeMovieClip(meterBackground);
for (x in otherObjects) {
removeMovieClip(otherObjects[x]);
}
removeMovieClip(this);
gotoAndPlay (22);
}
};
}
function playJohnnyClothes(gag) {
if (gag) {
johnnyClothesSound.attachSound("outfitSound8");
} else {
johnnyClothesSound.attachSound(String("outfitSound" + (random(7) + 1)));
}
johnnyClothesSound.start(0, 0);
}
function playGroundHit() {
var _local1 = hitSounds[random(hitSounds.length)];
groundHit.attachSound(_local1);
groundHit.start(0, 0);
playJohnnySound();
}
function playJohnnySound() {
johnnySound.attachSound(String("hit" + (random(20) + 1)));
johnnySound.start(0, 0);
}
function playCarHit() {
carHit.start(0, 0);
}
function playGlassHit() {
glassHit.start(0, 0);
}
function johnnyFly() {
height = height + vy;
distance = distance + vx;
skidding = false;
if (height < -3200) {
if (johnny._y < -62) {
showUpMeter();
}
johnny._y = johnny._y + (vy / 3);
moveEnvironment(-vx, 0);
} else {
johnny._y = johnny._y + (vy / 20);
moveEnvironment(-vx, -vy);
}
if ((vy > 0) && (height > 0)) {
if (playingWind) {
if (vx < 70) {
playingWind = false;
wind.stop("wind");
}
}
playGroundHit();
setStartHeights();
height = 0;
magnitude = Math.sqrt((vx * vx) + (vy * vy));
if (magnitude > 25) {
vy = vy * bounce;
vx = vx * (-bounce);
locked = false;
johnny.gotoAndStop("bounce");
johnny.body.play();
clearJohnny();
crackCement();
shake(7, magnitude / 8);
} else {
shake(7, 5);
lock = true;
skidding = true;
johnny.gotoAndStop("skid");
onEnterFrame = johnnySkid;
}
}
if (vx < 30) {
johnny.arm.armShake.gotoAndStop(1);
johnny.body.armShake.gotoAndStop(1);
}
vy = vy + gravity;
johnny._rotation = (Math.atan2(vy, vx) * 57.2957795130823) / 4;
}
function checkHits() {
for (var _local4 in otherObjects) {
if (johnny.hit.hitTest(otherObjects[_local4].hit)) {
itemName = otherObjects[_local4].itemName;
if (itemName) {
item = otherObjects[_local4];
switch (itemName) {
case "clothesLine" :
if (!item.touched) {
_root.clhits++;
floop.start(0, 0);
hideClothes();
johnny.gotoAndStop("bounce");
johnny.body.gotoAndPlay("spin");
flapsLeft = flapsLeft + 2;
updateFlaps();
var _local3 = giveClothes();
if (random(2)) {
var _local2 = giveClothes();
} else {
var _local2 = 0;
}
if ((_local3 == 12) || (_local2 == 12)) {
playJohnnyClothes(true);
} else {
playJohnnyClothes(false);
}
}
break;
case "hydrant" :
if (!item.touched) {
if (!skidding) {
boingHit.start(0, 0);
} else {
vx = 0;
}
flapsLeft = flapsLeft + 2;
updateFlaps();
clearJohnny();
item.onEnterFrame = waterAction;
}
break;
case "glass" :
wind.stop("wind");
playGlassHit();
clearJohnny();
johnny.gotoAndStop("smash");
shake(7, 5);
johnny._x = item._x - 52;
johnny._rotation = 0;
hitGlass = item;
onEnterFrame = johnnyGlass;
lock = true;
vy = 0;
gravity = 0;
vx = 0;
break;
case "lowrider" :
if (((!skidding) && (!locked)) && (!item.touched)) {
playCarHit();
clearJohnny();
if (vy > 0) {
vy = vy * -1;
}
vy = vy - 26;
vx = vx + 12;
flapsLeft = flapsLeft + 2;
updateFlaps();
johnny.gotoAndStop("bounce");
}
break;
case "lowrider2" :
wind.stop("wind");
if (johnny.hit.hitTest(item.hit2)) {
if (!item.touched) {
playCarHit();
clearJohnny();
item.touched = true;
shake(5, 4);
item.car.carTop.play();
johnny._x = item._x + 88;
johnny._y = item._y - 127;
johnny.gotoAndStop("smash2");
vy = -6;
vx = 27;
}
} else if (skidding) {
if (!item.touched) {
playCarHit();
}
vx = 0;
} else if (!item.touched) {
playCarHit();
johnny.gotoAndStop("bounce");
if (item._currentframe == 1) {
item.gotoAndPlay(2);
}
clearJohnny();
vy = -18;
vx = 18;
}
break;
case "manhole" :
wind.stop("wind");
if ((!item.touched) && (vy > 0)) {
johnny._visible = false;
vx = 0;
vy = 0;
gravitiy = 0;
lock = true;
waitTime = 40;
gameOver();
}
break;
case "seesaw" :
if (!item.touched) {
if (skidding) {
vx = 0;
} else {
boingHit.start(0, 0);
flapsLeft = flapsLeft + 2;
updateFlaps();
johnny.gotoAndStop("bounce");
clearJohnny();
if (vy > 0) {
vy = vy * -1;
}
vy = vy - 20;
vx = vx + 20;
locked = false;
}
}
break;
case "trampoline" :
if (item.touched) {
break;
}
locked = false;
boingHit.start(0, 0);
if (skidding) {
skidding = false;
onEnterFrame = johnnyFly;
}
flapsLeft = flapsLeft + 2;
updateFlaps();
clearJohnny();
if (vy > 0) {
vy = vy * -1;
}
johnny.gotoAndStop("bounce");
vy = vy - 13;
vx = vx + 6;
}
item.touched = true;
}
}
}
}
function showUpMeter() {
if (upMeter._currentframe == 1) {
upMeter.gotoAndPlay(2);
upMeter.onEnterFrame = function () {
if (johnny._y > -62) {
this.gotoAndPlay("hide");
delete this.onEnterFrame;
} else {
this.meter.distance.text = (Math.floor((62 - johnny._y) / 40) - 2) + " FEET";
}
};
}
}
function checkForRecovery() {
if (johnny._currentframe == 10) {
if (johnny.body._currentframe == this.lastFrame) {
this.count++;
if (this.count > 0) {
johnny.body.play();
this.count = 0;
}
}
this.lastFrame = johnny.body._currentframe;
}
}
function giveClothes() {
var _local1 = random(allClothes.length);
johnnyClothes.push(allClothes[_local1]);
return(_local1);
}
function keepScore() {
score = Math.floor(distance / 100);
this.displayScore.text = score + " FEET";
}
function showClothes() {
for (var _local2 in johnnyClothes) {
for (var _local1 in johnnyClothes[_local2].pieces) {
johnnyClothes[_local2].pieces[_local1]._visible = true;
}
}
}
function hideClothes() {
for (var _local2 in johnnyClothes) {
for (var _local1 in johnnyClothes[_local2].pieces) {
johnnyClothes[_local2].pieces[_local1]._visible = false;
}
}
}
function setStartHeights() {
wall.graphic._y = wall.startY;
city.graphic._y = city.startY;
buildings.graphic._y = buildings.startY;
sky.graphic._y = sky.startY;
clouds.graphic._y = clouds.startY;
johnny._y = johnny.startY;
for (var _local1 in otherObjects) {
otherObjects[_local1]._y = otherObjects[_local1].startY;
}
}
function johnnySkid() {
if (vx > 0) {
moveEnvironment(-vx, 0);
distance = distance + vx;
johnny._x = johnny._x - (vx / 3);
vx = vx - friction;
} else {
delete onEnterFrame;
gameOver();
}
}
function updateFlaps() {
meter.displayFlaps.text = flapsLeft;
}
function johnnyGlass() {
if ((johnny._y - hitGlass._y) < 60) {
vy = vy - 0.2;
moveEnvironment(0, vy);
} else {
johnny.body.play();
johnny._y = hitGlass._y + 60;
vy = 0;
gameOver();
delete onEnterFrame;
}
}
function waterAction() {
if (johnny.hit.hitTest(this.hit)) {
var _local2 = this._y - johnny._y;
if (_local2 < 53) {
if (vy > 0) {
vy = vy * -1;
}
vy = vy - 27;
vx = vx + 12;
this.waterY = 172;
this.waterX = 42;
} else if (_local2 > 313) {
this.waterY = 0;
this.waterX = 0;
} else {
var _local3 = 1 - ((_local2 - 53) / 260);
this.waterY = 172 * _local3;
this.waterX = 42 * _local3;
}
} else {
this.waterY = 0;
this.waterX = 0;
}
ease(this.water, this.waterX, this.waterY, 0.5);
}
function flapArms() {
swoosh.start(0, 0);
for (var _local2 in johnnyClothes) {
for (var _local1 in johnnyClothes[_local2].pieces) {
johnnyClothes[_local2].pieces[_local1].gotoAndPlay(2);
}
}
johnny.body.gotoAndPlay(2);
johnny.arm.gotoAndPlay(2);
vy = vy + -7.6;
}
function placeObstacles() {
if (distance >= nextDistance) {
nextDistance = nextDistance + randRange(minObstacleSpace, maxObstacleSpace);
if ((height > -1000) && (vy > 0)) {
var _local3 = false;
itemName = obstacles[random(7)];
item = attachMovie(itemName, "item" + obstacleIndex, obstacleDepth);
obstacleDepth++;
if (obstacleDepth > 45) {
obstacleDepth = 30;
}
obstacleIndex++;
var _local2 = 0;
var _local1 = 0;
item.itemName = itemName;
switch (itemName) {
case "hydrant" :
_local2 = 901;
_local1 = 264;
item._xscale = (item._yscale = 32);
_local3 = true;
break;
case "glass" :
_local2 = 914;
_local1 = 183;
break;
case "lowrider" :
_local2 = 1189;
_local1 = 231;
_local3 = true;
break;
case "lowrider2" :
_local2 = 1166;
_local1 = 217;
break;
case "manhole" :
_local2 = 891;
_local1 = 295;
item._xscale = (item._yscale = 63);
break;
case "seesaw" :
_local2 = 931;
_local1 = 228;
item._xscale = (item._yscale = 46);
_local3 = true;
break;
case "trampoline" :
_local2 = 944;
_local1 = 272;
_local3 = true;
}
item._x = _local2;
item._y = _local1 - height;
item.startY = _local1;
addToObjects(item, -item._width);
if (_local3) {
if (random(3) > 0) {
line = attachMovie("clothesLine", "clothes" + obstacleIndex, obstacleDepth);
obstacleDepth++;
obstacleIndex++;
line._x = item._x + 400;
line._y = (-172 - random(200)) - height;
line.itemName = "clothesLine";
addToObjects(line, -line._width);
}
}
}
}
}
function clearJohnny() {
for (var _local2 in allClothes) {
for (var _local1 in allClothes[_local2].pieces) {
allClothes[_local2].pieces[_local1]._visible = false;
}
}
johnnyClothes = new Array();
}
function moveEnvironment(x, y) {
wall.graphic._x = wall.graphic._x + x;
wall.graphic._y = wall.graphic._y + y;
buildings.graphic._x = buildings.graphic._x + x;
buildings.graphic._y = buildings.graphic._y + y;
sky.graphic._x = sky.graphic._x + (x / 6);
sky.graphic._y = sky.graphic._y + (y / 6);
clouds.graphic._x = clouds.graphic._x + (x / 9);
clouds.graphic._y = clouds.graphic._y + (y / 6);
city.graphic._x = city.graphic._x + (x / 2);
city.graphic._y = city.graphic._y + (y / 2);
for (var _local4 in otherObjects) {
otherObjects[_local4]._x = otherObjects[_local4]._x + x;
otherObjects[_local4]._y = otherObjects[_local4]._y + y;
if (otherObjects[_local4]._x < otherObjects[_local4].removeX) {
otherObjects[_local4].del = true;
}
}
var _local3 = new Array();
for (var _local4 in otherObjects) {
if (!otherObjects[_local4].del) {
_local3.push(otherObjects[_local4]);
} else {
removeMovieClip(otherObjects[_local4]);
}
}
otherObjects = _local3;
}
function crackCement() {
var _local1 = attachMovie("crack", "crack" + crackDepth, crackDepth);
_local1._x = johnny._x + 10;
_local1._y = johnny._y + 50;
if (crackDepth == 25) {
crackDepth = 20;
} else {
crackDepth++;
}
addToObjects(_local1, -100);
}
function addToObjects(mc, removeX) {
shakeObjects.push(mc);
otherObjects.push(mc);
mc.shakeIndex = shakeObjects.length - 1;
mc.objectsIndex = otherObjects.length - 1;
mc.removeX = removeX;
}
function wrapGraphic() {
if (this.graphic._x < this.wrapLine) {
this.graphic._x = this.startX + (this.graphic._x - this.wrapLine);
}
}
function shake(numOfShakes, dist) {
var shakeX = 0;
var shakeY = 0;
var shakes = numOfShakes;
var setBack = false;
shaker.onEnterFrame = function () {
if (shakes == 0) {
delete this.onEnterFrame;
} else {
shakes--;
}
if (setBack) {
shakeX = shakeX * -1;
shakeY = shakeY * -1;
setBack = false;
} else {
shakeX = randRange(-dist, dist);
shakeY = randRange(-dist, dist);
setBack = true;
}
johnny._x = johnny._x + shakeX;
johnny._y = johnny._y + shakeY;
wall.graphic._x = wall.graphic._x + shakeX;
wall.graphic._y = wall.graphic._y + shakeY;
city.graphic._x = city.graphic._x + shakeX;
city.graphic._y = city.graphic._y + shakeY;
buildings.graphic._x = buildings.graphic._x + shakeX;
buildings.graphic._y = buildings.graphic._y + shakeY;
for (var _local2 in otherObjects) {
otherObjects[_local2]._x = otherObjects[_local2]._x + shakeX;
otherObjects[_local2]._y = otherObjects[_local2]._y + shakeY;
}
};
}
function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function ease(mc, x, y, easer) {
mc._x = mc._x + ((x - mc._x) * easer);
mc._y = mc._y + ((y - mc._y) * easer);
}
_root.onMouseUp = function () {
if (((!lock) && (flapsLeft > 0)) && (johnny._currentframe == 1)) {
flapArms();
flapsLeft--;
updateFlaps();
}
trace("hello");
};
function init() {
clearJohnny();
_root.clhits = 0;
vx = launchPower * Math.cos(launchRadians);
vy = launchPower * Math.sin(launchRadians);
tempvy = vy;
johnny.body.stop();
johnny.arm.stop();
buildings.startX = buildings.graphic._x;
buildings.startY = buildings.graphic._y;
city.startX = city.graphic._x;
city.startY = city.graphic._y;
sky.startX = sky.graphic._x;
sky.startY = sky.graphic._y;
clouds.startX = clouds.graphic._x;
clouds.startY = clouds.graphic._y;
wall.startX = wall.graphic._x;
wall.startY = wall.graphic._y;
johnny.startY = johnny._y;
johnny.startX = johnny._x;
groundHit = new Sound(_root);
johnnySound = new Sound(_root);
johnnyClothesSound = new Sound(_root);
carHit = new Sound(_root);
carHit.attachSound("metalHit");
glassHit = new Sound(_root);
glassHit.attachSound("glassBreak");
boingHit = new Sound(_root);
boingHit.attachSound("boingHit1");
swoosh = new Sound(_root);
swoosh.attachSound("swoosh");
floop = new Sound(_root);
floop.attachSound("floop");
wind = new Sound(_root);
wind.attachSound("wind");
wind.start(0, 99);
playingWind = true;
buildings.wrapLine = buildings.startX - 4153;
wall.wrapLine = wall.startX - 2180;
city.wrapLine = city.startX - 3103;
sky.wrapLine = sky.startX - 3100;
clouds.wrapLine = clouds.startX - 3094;
height = 0;
updateFlaps();
createEmptyMovieClip("shaker", 5);
createEmptyMovieClip("placer", 6);
createEmptyMovieClip("collider", 7);
createEmptyMovieClip("recover", 8);
onEnterFrame = johnnyFly;
buildings.onEnterFrame = wrapGraphic;
wall.onEnterFrame = wrapGraphic;
city.onEnterFrame = wrapGraphic;
sky.onEnterFrame = wrapGraphic;
clouds.onEnterFrame = wrapGraphic;
placer.onEnterFrame = placeObstacles;
collider.onEnterFrame = checkHits;
meter.onEnterFrame = keepScore;
recover.onEnterFrame = checkForRecovery;
recover.lastFrame = 0;
recover.count = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = 0;
while (paces > 0) {
height = height + vy;
distance = distance + vx;
_local2 = _local2 + vy;
_local4 = _local4 + vx;
vy = vy + gravity;
_local3 = _local3 + gravity;
paces--;
}
moveEnvironment(0, -_local2);
flapListener = new Object();
flapListener.onKeyDown = function () {
if (((!lock) && (flapsLeft > 0)) && (johnny._currentframe == 1)) {
if (Key.getCode() == 32) {
flapArms();
flapsLeft--;
updateFlaps();
}
}
};
Key.addListener(flapListener);
}
init();
Frame 22
playAgain.onRollOver = btnRollOver;
playAgain.onRollOut = btnRollOut;
playAgain.onDragOut = btnRollOut;
playAgain.onRelease = function () {
Key.removeListener(keyListener_obj);
gotoAndPlay ("playPOV");
};
_root.onMouseUp = null;
var keyListener_obj = new Object();
keyListener_obj.onKeyDown = function () {
if (!(Key.getCode() === 32)) {
} else {
trace("space pressed");
gotoAndPlay ("playPOV");
Key.removeListener(keyListener_obj);
}
};
Key.addListener(keyListener_obj);
Instance of Symbol 508 MovieClip "scoreText" in Frame 22
onClipEvent (load) {
displayScore.text = _root.score;
}
Frame 50
playMore.onRollOver = btnRollOver;
playMore.onRollOut = btnRollOut;
playMore.onDragOut = btnRollOut;
playMore.onRelease = function () {
getURL ("http://www.urbaniacs.com", "_blank");
};
Frame 112
stop();
Symbol 53 MovieClip [glass] Frame 1
crack._visible = false;
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 10
stop();
Symbol 82 MovieClip Frame 1
stop();
Symbol 84 MovieClip [lowrider2] Frame 1
stop();
Symbol 84 MovieClip [lowrider2] Frame 18
stop();
Symbol 103 MovieClip [lowrider] Frame 77
gotoAndPlay ("bounce");
Symbol 509 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.2");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
}
Symbol 170 MovieClip Frame 2
stop();
Symbol 170 MovieClip Frame 70
gotoUrb_btn.onRelease = function () {
getURL ("http://www.urbaniacs.com", "_blank");
};
Symbol 170 MovieClip Frame 165
_root.play();
stop();
Symbol 180 MovieClip Frame 1
if (_root.getBytesLoaded() != _root.getBytesTotal()) {
_root.stop();
progress_bar._xscale = Math.ceil((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
} else {
_root.bumper.play();
this._y = 5000;
}
visitUrb_btn.onRelease = function () {
getURL ("http://www.urbaniacs.com", "_blank");
};
Instance of Symbol 140 MovieClip in Symbol 201 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Symbol 281 MovieClip Frame 15
stop();
Symbol 281 MovieClip Frame 18
_root.playFling();
Symbol 281 MovieClip Frame 32
stop();
undefined / _root.play();
Symbol 281 MovieClip Frame 41
_root.playFling();
Symbol 281 MovieClip Frame 53
stop();
_root.play();
Symbol 281 MovieClip Frame 62
_root.playFling();
Symbol 281 MovieClip Frame 75
stop();
_root.play();
Symbol 299 MovieClip Frame 1
stop();
Symbol 299 MovieClip Frame 22
gotoAndPlay (2);
Symbol 311 MovieClip Frame 1
stop();
Symbol 311 MovieClip Frame 6
stop();
Symbol 316 MovieClip Frame 13
_root.listenForAngle();
_root.step = "angle";
stop();
Symbol 316 MovieClip Frame 22
_root.listenForPower();
_root.step = "power";
stop();
Symbol 357 MovieClip Frame 1
stop();
Instance of Symbol 346 MovieClip "armShake" in Symbol 357 MovieClip Frame 1
onClipEvent (load) {
gotoAndPlay (3);
}
Symbol 361 MovieClip Frame 1
stop();
Symbol 364 MovieClip Frame 1
stop();
Symbol 367 MovieClip Frame 1
stop();
Symbol 370 MovieClip Frame 1
stop();
Symbol 374 MovieClip Frame 1
stop();
Symbol 378 MovieClip Frame 1
stop();
Symbol 382 MovieClip Frame 1
stop();
Symbol 386 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 1
stop();
Symbol 393 MovieClip Frame 1
stop();
Symbol 396 MovieClip Frame 1
stop();
Symbol 400 MovieClip Frame 1
stop();
Symbol 404 MovieClip Frame 1
stop();
Symbol 408 MovieClip Frame 1
stop();
Symbol 411 MovieClip Frame 1
stop();
Symbol 415 MovieClip Frame 1
stop();
Symbol 419 MovieClip Frame 1
stop();
Symbol 423 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 1
stop();
Symbol 431 MovieClip Frame 1
stop();
Symbol 435 MovieClip Frame 1
stop();
Symbol 442 MovieClip Frame 9
_root.johnny.gotoAndStop(1);
Symbol 458 MovieClip Frame 4
stop();
Symbol 466 MovieClip Frame 2
stop();
Symbol 466 MovieClip Frame 13
stop();
Symbol 473 MovieClip Frame 10
_root.johnny.gotoAndStop(1);
stop();
Symbol 474 MovieClip Frame 1
arm.stop();
body.stop();
_root.showClothes();
stop();
Symbol 474 MovieClip Frame 10
stop();
Symbol 474 MovieClip Frame 20
stop();
Symbol 487 MovieClip Frame 1
stop();
Symbol 487 MovieClip Frame 5
stop();
Instance of Symbol 502 MovieClip in Symbol 503 MovieClip Frame 1
onClipEvent (enterFrame) {
play();
}