Frame 1
kv_v = {c:439, a:0, da:["distralytics.com", "distralytics.co.uk"]};
kv_v.i = 0;
while (kv_v.i < kv_v.da.length) {
System.security.allowDomain(kv_v.da[kv_v.i], (kv_v.c + ".c.") + kv_v.da[kv_v.i], "*." + kv_v.da[kv_v.i]);
kv_v.i++;
}
kv_v.lc = function () {
var _local1 = ((("http://" + kv_v.c) + ".c.") + kv_v.da[kv_v.a % kv_v.da.length]) + kv_v.lurl;
System.security.allowDomain(_local1);
kv_v.l_mcl.loadClip(_local1, kv_v.t_mc);
};
kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_v.lurl = "/control/tracking/tracker.swf?r=" + Math.floor(Math.random() * 10000);
kv_v.t_mc = createEmptyMovieClip("kv_tracker", -16734);
kv_v.l_mcl = new MovieClipLoader();
kv_v.mcl_l = {onLoadError:function () {
kv_v.a++;
kv_v.lc();
}, onLoadStart:function (m) {
System.security.allowDomain(m._url);
}};
kv_v.l_mcl.addListener(kv_v.mcl_l);
kv_v.lc();
_global.root = this;
_global.FB_gid = 11;
Frame 3
function goToGame() {
_global.root.gotoAndStop("game");
}
function goToHowToPlay() {
_global.root.gotoAndPlay("howToPlay");
}
function goToTM() {
getURL ("http://www.tinymania.com/", "_blank");
_root.kvClick(736);
}
function goToMJ() {
getURL ("http://www.montagnejeunesse.com/static/chocolate_or_sex/index.asp", "_blank");
_root.kvClick(735);
}
function goToStartpage() {
gotoAndStop ("start");
}
function getFacebookApp() {
}
stop();
Frame 8
stop();
game.startGame(1);
Symbol 16 MovieClip Frame 100
gotoAndPlay (1);
Instance of Symbol 9 MovieClip in Symbol 17 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Symbol 17 MovieClip Frame 10
function onEnterFrame() {
var _local2 = _root.getBytesLoaded() / _root.getBytesTotal();
if (getTimer() >= (startTime + 100)) {
animDone = true;
}
if ((Math.ceil(bar._width) >= width) && (animDone)) {
stopSparks = true;
delete onEnterFrame;
gotoAndPlay ("out");
} else {
setProgress(_local2);
}
}
function fadeOut() {
setProgress(progress);
this._alpha = this._alpha - 5;
if (this._alpha <= -50) {
this._visible = false;
_parent.play();
}
}
function makeSpark() {
}
function sparkControl() {
if (!stopSparks) {
this._y = this._y + this.grav;
this._x = this._x + this.wind;
this.grav = this.grav * gravity;
this._alpha = this._alpha - this.grav;
this._rotation = this._rotation + this.spin;
if (this._alpha <= 0) {
this.removeMovieClip();
}
} else {
this.removeMovieClip();
}
}
function setProgress(p) {
bar._width = ((bar._width * 2) + (p * width)) / 3;
if (progress != 1) {
makeSpark();
}
}
width = 200;
i = 0;
gravity = 1.3;
animDone = true;
startTime = getTimer();
if (this._name == "loader_mc") {
myName = _global.language.loadingAssets;
} else {
myName = _global.language.initLevel;
}
setProgress(0);
Symbol 17 MovieClip Frame 22
stop();
Symbol 17 MovieClip Frame 28
_parent.play();
Symbol 24 MovieClip [hole] Frame 1
#initclip 27
Object.registerClass("hole", HoleMC);
#endinitclip
Symbol 28 MovieClip [cueBall] Frame 1
#initclip 21
Object.registerClass("cueBall", BallMC);
#endinitclip
stop();
Symbol 28 MovieClip [cueBall] Frame 15
stop();
_parent.ballFallenDownHole();
Symbol 28 MovieClip [cueBall] Frame 29
stop();
_parent.levelComplete();
Symbol 31 MovieClip [test eol pickup] Frame 1
#initclip 22
Object.registerClass("test eol pickup", EndOfLevelPickup);
#endinitclip
stop();
Symbol 31 MovieClip [test eol pickup] Frame 11
stop();
Symbol 36 MovieClip [chocolate pickup] Frame 1
#initclip 23
Object.registerClass("chocolate pickup", ChocolatePickup);
#endinitclip
stop();
Symbol 36 MovieClip [chocolate pickup] Frame 11
stop();
Symbol 39 MovieClip [sex pickup] Frame 1
#initclip 24
Object.registerClass("sex pickup", SexPickup);
#endinitclip
stop();
Symbol 39 MovieClip [sex pickup] Frame 11
stop();
Symbol 43 MovieClip [bumper] Frame 1
#initclip 25
Object.registerClass("bumper", Bumper);
#endinitclip
stop();
Symbol 51 Button
on (release) {
_global.root.goToMJ();
}
Symbol 56 Button
on (release) {
_global.root.goToGame();
}
Symbol 61 Button
on (release) {
_global.root.goToMJ();
}
Symbol 64 Button
on (release) {
play();
}
Symbol 67 Button
on (release) {
_global.root.goToTM();
}
Symbol 80 MovieClip [extra life pickup] Frame 1
#initclip 26
Object.registerClass("extra life pickup", ExtraLifePickup);
#endinitclip
stop();
Symbol 80 MovieClip [extra life pickup] Frame 12
stop();
Symbol 88 Button
on (release) {
_parent.play();
}
Symbol 95 MovieClip Frame 1
useHandCursor = false;
onPress = function () {
};
Symbol 96 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 5
stop();
Symbol 255 MovieClip [__Packages.BallMC] Frame 0
class BallMC extends MovieClip
{
function BallMC () {
super();
}
}
Symbol 256 MovieClip [__Packages.HoleMC] Frame 0
class HoleMC extends MovieClip
{
function HoleMC () {
super();
}
}
Symbol 257 MovieClip [__Packages.EndOfLevelPickup] Frame 0
class EndOfLevelPickup extends HoleMC
{
function EndOfLevelPickup () {
super();
}
}
Symbol 258 MovieClip [__Packages.Pickup] Frame 0
class Pickup extends MovieClip
{
var circle, _x, _y, engine, isPickedUp, gotoAndPlay;
function Pickup () {
super();
circle = new cust.geom2D.Ball(_x, _y, RADIUS, 0, 0, 10000000, 1.5);
circle.pickup = this;
}
function init(e) {
engine = e;
isPickedUp = false;
}
function isCollected(ls) {
if (!isPickedUp) {
var _local2 = ls.closestPoint(circle);
if (flash.geom.Point.distance(_local2, circle) <= (circle.r + Engine.BALL_RADIUS)) {
pickedUp();
}
}
}
function pickedUp() {
gotoAndPlay(PICKUP_UP);
isPickedUp = true;
}
static var RADIUS = 11;
static var PICKUP_UP = "pickedUp";
static var HIDDEN = "hidden";
}
Symbol 259 MovieClip [__Packages.Engine] Frame 0
class Engine extends MovieClip
{
var tableAreaMarker, tableArea, ball, initBallPos, chocolate, sex, _score, collectedPickups, isGameOver, gotoAndStop, onEnterFrame, retryLvl_mc, intro_mc, ball_mc, ballMovementLine, holes, pickups, bumpers, gravs, messages, onMouseUp, onMouseMove, aimPullback, _xmouse, _ymouse, aimDot, elapsedTime, lastTime, stoppedFrames, score_txt, _lives, lives_mc;
function Engine () {
super();
tableAreaMarker._visible = false;
tableArea = new flash.geom.Rectangle(tableAreaMarker._x, tableAreaMarker._y, tableAreaMarker._width, tableAreaMarker._height);
ball = new cust.geom2D.Ball(initBallPos._x, initBallPos._y, BALL_RADIUS, 0, 0, 1, BALL_BOUNCE_COEFFICIENT);
chocolate = 1;
sex = 1;
_score = [];
_score[0] = 0;
setScore();
lives = (INIT_LIVES);
collectedPickups = {};
}
function startGame(lvl) {
lvlNum = lvl;
lives = (INIT_LIVES);
isGameOver = false;
initLvl();
}
function initLvl() {
gotoAndStop("lvl" + lvlNum);
onEnterFrame = doInit;
}
function doInit() {
delete onEnterFrame;
retryLvl_mc.gotoAndStop("hide");
if (((lvlNum <= 2) || (lvlNum == 6)) || (lvlNum == 10)) {
intro_mc.gotoAndStop("lvl" + lvlNum);
} else {
intro_mc.gotoAndStop("hide");
}
ball_mc._x = (ball.x = initBallPos._x);
ball_mc._y = (ball.y = initBallPos._y);
ballMovementLine = new cust.geom2D.LineSegment(initBallPos._x, initBallPos._y, initBallPos._x, initBallPos._y);
ball_mc.onPress = Delegate.create(this, beginBallAim);
holes = [];
pickups = [];
bumpers = [];
gravs = [];
for (var _local2 in this) {
if (this[_local2] instanceof EndOfLevelPickup) {
holes.push(new HoleEnd(this, this[_local2]._x, this[_local2]._y));
} else if (this[_local2] instanceof HoleMC) {
holes.push(new Hole(this, this[_local2]._x, this[_local2]._y));
} else if (this[_local2] instanceof Pickup) {
pickups.push(this[_local2]);
this[_local2].init(this);
} else if (this[_local2] instanceof Bumper) {
bumpers.push(this[_local2].circle);
} else if (this[_local2] instanceof Gravity) {
gravs.push(this[_local2]);
}
}
}
function resetLvl() {
delete onEnterFrame;
retryLvl_mc.gotoAndStop("hide");
ball_mc._x = (ball.x = initBallPos._x);
ball_mc._y = (ball.y = initBallPos._y);
ballMovementLine = new cust.geom2D.LineSegment(initBallPos._x, initBallPos._y, initBallPos._x, initBallPos._y);
ball_mc.onPress = Delegate.create(this, beginBallAim);
}
function resetLvlAndHideMessage() {
resetLvl();
messages.gotoAndPlay("hide");
}
function beginBallAim() {
onMouseUp = launchBall;
onMouseMove = aimBall;
aimPullback._x = ball.x;
aimPullback._y = ball.y;
aimBall();
}
function aimBall() {
var _local4 = ball.x - _xmouse;
var _local3 = ball.y - _ymouse;
var _local2 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local5 = Math.atan2(_local3, _local4);
if (_local2 > MAX_PULLBACK_DIST) {
_local2 = MAX_PULLBACK_DIST;
}
aimDot._x = ball.x - (_local2 * Math.cos(_local5));
aimDot._y = ball.y - (_local2 * Math.sin(_local5));
aimPullback._rotation = (_local5 * 57.2957795130823) + 90;
aimPullback.inner._height = _local2;
}
function launchBall() {
intro_mc.gotoAndStop("hide");
aimDot._x = 10000;
aimPullback._x = 10000;
delete ball_mc.onPress;
delete onMouseMove;
delete onMouseUp;
var _local4 = ball.x - _xmouse;
var _local3 = ball.y - _ymouse;
var _local2 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local2 > MAX_PULLBACK_DIST) {
_local2 = MAX_PULLBACK_DIST;
}
var _local5 = Math.atan2(_local3, _local4);
ball.v.x = (_local2 * Math.cos(_local5)) * BALL_INIT_SPEED_COEFFICIENT;
ball.v.y = (_local2 * Math.sin(_local5)) * BALL_INIT_SPEED_COEFFICIENT;
elapsedTime = 0;
lastTime = getTimer();
onEnterFrame = gameLoop;
}
function gameLoop() {
var _local12 = getTimer();
var _local13 = (_local12 - lastTime) / 1000;
elapsedTime = elapsedTime + (_local12 - lastTime);
lastTime = _local12;
if ((elapsedTime > TRY_AGAIN_WAIT) && (retryLvl_mc._currentframe == 1)) {
retryLvl_mc.gotoAndPlay("show");
}
ballMovementLine.x1 = ball.x;
ballMovementLine.y1 = ball.y;
var _local9 = [].concat(bumpers);
var _local2 = 0;
while (_local2 < pickups.length) {
if (!pickups[_local2].isPickedUp) {
_local9.push(pickups[_local2].circle);
}
_local2++;
}
var _local11 = ball.collisionDetection(_local9);
if (_local11) {
ball.collisionResponse(_local11);
if (_local11.pickup) {
_local11.pickup.pickedUp();
} else if (_local11.bumper) {
_local11.bumper.hit();
}
} else {
ball.move();
}
if (ball.x < tableArea.x) {
ball.x = tableArea.x;
ball.v.x = ball.v.x * (-ball.bounce);
} else if (ball.x > tableArea.right) {
ball.x = tableArea.right;
ball.v.x = ball.v.x * (-ball.bounce);
}
if (ball.y < tableArea.y) {
ball.y = tableArea.y;
ball.v.y = ball.v.y * (-ball.bounce);
} else if (ball.y > tableArea.bottom) {
ball.y = tableArea.bottom;
ball.v.y = ball.v.y * (-ball.bounce);
}
ballMovementLine.x2 = ball.x;
ballMovementLine.y2 = ball.y;
var _local3;
var _local4;
var _local6;
var _local8;
var _local7 = Number.MAX_VALUE;
var _local10;
_local2 = 0;
while (_local2 < holes.length) {
_local3 = holes[_local2];
_local6 = ballMovementLine.closestPoint(_local3);
_local4 = flash.geom.Point.distance(_local3, _local6);
if (_local4 < _local7) {
_local7 = _local4;
_local8 = _local3;
_local10 = _local6;
}
_local2++;
}
if (_local7 < _local8.ir) {
_local8.fallenDown();
} else {
if (_local7 < _local8.r) {
var _local14 = _local8.getForce(_local10);
ball.v.x = ball.v.x + (_local14.x * _local13);
ball.v.y = ball.v.y + (_local14.y * _local13);
}
ball_mc._x = ball.x;
ball_mc._y = ball.y;
ball.v.length = ball.v.length - Math.min(ball.v.__get__length(), BALL_FRICTION_BASE);
var _local5;
_local2 = 0;
while (_local2 < gravs.length) {
_local5 = gravs[_local2].getForce(ball);
ball.v.x = ball.v.x + _local5.x;
ball.v.y = ball.v.y + _local5.y;
_local2++;
}
if (ball.v.__get__length() < (BALL_STOPPED_SPEED / 31)) {
ballStopped();
} else {
stoppedFrames = 0;
}
}
}
function restart() {
gotoAndStop("restart");
}
function levelComplete() {
delete onEnterFrame;
collectedPickups = {};
addPoints(LEVEL_COMPLETE_BONUS);
lvlNum++;
if (lvlNum > NUM_LEVELS) {
gameComplete();
} else {
setMessage(LEVEL_COMPLETE, Delegate.create(this, restart));
}
}
function ballFallingDownHole(hole) {
delete onEnterFrame;
ball_mc._x = hole.x;
ball_mc._y = hole.y;
ball_mc.gotoAndPlay(BALL_FALL_DOWN_HOLE);
}
function ballFallingDownEndHole(hole) {
delete onEnterFrame;
ball_mc._x = hole.x;
ball_mc._y = hole.y;
ball_mc.gotoAndPlay(BALL_FALL_DOWN_END_HOLE);
}
function ballFallenDownHole() {
delete onEnterFrame;
collectedPickups = {};
setLevelScore(lvlNum, 0);
if (lvlNum > 1) {
lvlNum--;
}
setLevelScore(lvlNum, 0);
lives = ((lives-1));
if (isGameOver) {
gameOver();
} else {
setMessage(FELL_DOWN_HOLE, Delegate.create(this, restart));
}
}
function ballStopped() {
if ((++stoppedFrames) >= BALL_STOPPED_TIME) {
delete onEnterFrame;
lives = ((lives-1));
if (isGameOver) {
gameOver();
} else {
setMessage(BALL_STOPPED, Delegate.create(this, resetLvl));
}
}
}
function restartLevelManually() {
delete onEnterFrame;
lives = ((lives-1));
if (isGameOver) {
gameOver();
} else {
setMessage(RESTART_LVL_MANUALLY, Delegate.create(this, resetLvlAndHideMessage));
}
}
function gameComplete() {
isGameOver = true;
setLevelScore(NUM_LEVELS + 1, REMAINING_LIVES_BONUS * lives);
_global.FB_score = score;
_global.FB_score_formatted = Format.number(score);
_global.root.score = score;
_global.root.chocolate = chocolate;
_global.root.sex = sex;
setMessage(GAME_COMPLETE);
onEndPage();
}
function gameOver() {
isGameOver = true;
_global.FB_score = score;
_global.FB_score_formatted = Format.number(score);
_global.root.score = score;
_global.root.chocolate = chocolate;
_global.root.sex = sex;
setMessage(GAME_OVER);
onEndPage();
}
function onEndPage() {
messages.message.score_txt.text = Format.number(score);
messages.message.rating = sex / (sex + chocolate);
if (sex >= chocolate) {
messages.message.rating_txt.text = Math.round(100 * (sex / (sex + chocolate))) + "%";
messages.message.chocolateOrSex.gotoAndStop(SEX);
} else {
messages.message.rating_txt.text = Math.round(100 * (chocolate / (sex + chocolate))) + "%";
messages.message.chocolateOrSex.gotoAndStop(CHOCOLATE);
}
}
function setMessage(msg, onShown, onHiding) {
messages.gotoAndPlay("show");
messages.message.gotoAndStop(msg);
messages.onShown = onShown;
if (onHiding) {
messages.onHiding = onHiding;
}
}
function scorePoints(n) {
addPoints(n);
}
function addPoints(n) {
setLevelScore(lvlNum, getLevelScore(lvlNum) + n);
setScore();
}
function setLevelScore(lvl, n) {
_score[lvl] = n;
setScore();
}
function getLevelScore(lvl) {
if (!isNaN(_score[lvl])) {
return(_score[lvl]);
}
return(0);
}
function setScore() {
score_txt.text = Format.number(score);
}
function get score() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < _score.length) {
if (!isNaN(Number(_score[_local2]))) {
_local3 = _local3 + Number(_score[_local2]);
}
_local2++;
}
return(_local3);
}
function get lives() {
return(_lives);
}
function set lives(l) {
_lives = l;
if (l <= 0) {
gameOver();
lives_mc.gotoAndStop("dead");
} else if (l > MAX_LIVES_DISPLAY) {
lives_mc.gotoAndStop(LIVES_MORE);
lives_mc.numLives_txt.text = l;
} else {
l = ((l > MAX_LIVES) ? (MAX_LIVES) : (l));
lives_mc.gotoAndStop(l);
}
//return(lives);
}
var lvlNum = 1;
static var NUM_LEVELS = 16;
static var BALL_RADIUS = 11;
static var BALL_BOUNCE_COEFFICIENT = 0.85;
static var MAX_PULLBACK_DIST = 75;
static var BALL_INIT_SPEED_COEFFICIENT = 0.4;
static var BALL_FRICTION = 0.8;
static var BALL_FRICTION_BASE = 0.05;
static var BALL_FALL_DOWN_HOLE = "downHole";
static var BALL_FALL_DOWN_END_HOLE = "downEndHole";
static var BALL_STOPPED_SPEED = 2;
static var BALL_STOPPED_TIME = 30;
static var INIT_LIVES = 3;
static var MAX_LIVES = 5;
static var SEX = "sex";
static var CHOCOLATE = "chocolate";
static var TRY_AGAIN_WAIT = 10000;
static var LEVEL_COMPLETE_BONUS = 1000;
static var PICKUP_POINTS = 200;
static var REMAINING_LIVES_BONUS = 500;
static var MAX_LIVES_DISPLAY = 5;
static var LIVES_MORE = "more";
static var LEVEL_COMPLETE = "lvlComplete";
static var BALL_STOPPED = "ballStopped";
static var RESTART_LVL_MANUALLY = "restartLvLManually";
static var FELL_DOWN_HOLE = "fellDownHole";
static var GAME_OVER = "gameOver";
static var GAME_COMPLETE = "gameComplete";
}
Symbol 260 MovieClip [__Packages.cust.geom2D.Vector] Frame 0
class cust.geom2D.Vector extends flash.geom.Point
{
var x, y;
function Vector (a, b) {
super();
x = a;
y = b;
}
function mark(mc, linestyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
mc.moveTo(x - 2, y - 2);
mc.lineTo(x + 2, y + 2);
mc.moveTo(x + 2, y - 2);
mc.lineTo(x - 2, y + 2);
}
function reflect(n) {
n.__set__length(1);
return(subtract(n.multiply(2 * dot(n))));
}
function angleBetweenVector(p) {
return(Math.acos(dot(p) / (length * p.__get__length())));
}
function angleBetweenVector2(p) {
var _local2 = Math.acos(dot(p) / (length * p.__get__length()));
var _local4 = (((p.__get__angle() - angle) + 9.42477796076938) % (Math.PI*2)) - Math.PI;
if (_local4 < 0) {
_local2 = _local2 * -1;
}
return(_local2);
}
function dot(v) {
return((x * v.x) + (y * v.y));
}
function multiply(m) {
return(new cust.geom2D.Vector(x * m, y * m));
}
function subtract(p) {
return(new cust.geom2D.Vector(x - p.x, y - p.y));
}
function toString() {
return(((("{ x:" + x) + ", y:") + y) + " }");
}
function get normal() {
var _local2 = angle;
return(new cust.geom2D.Vector(Math.cos(_local2), Math.sin(_local2)));
}
function get length() {
return(Math.sqrt((x * x) + (y * y)));
}
function set length(l) {
var _local2 = Math.atan2(y, x);
x = l * Math.cos(_local2);
y = l * Math.sin(_local2);
//return(length);
}
function get angle() {
return(Math.atan2(y, x));
}
function set angle(a) {
var _local2 = length;
x = _local2 * Math.cos(a);
y = _local2 * Math.sin(a);
//return(angle);
}
static function angleBetween(v1, v2) {
return(Math.atan2(v2.y - v1.y, v2.x - v1.x));
}
static function interpolate(p1, p2, f) {
return(new cust.geom2D.Vector(p1.x + (Math.abs(p1.x - p2.x) * f), p1.y + (Math.abs(p1.y - p2.y) * f)));
}
static function polar(l, a) {
return(new cust.geom2D.Vector(l * Math.cos(a), l * Math.sin(a)));
}
}
Symbol 261 MovieClip [__Packages.cust.geom2D.Circle] Frame 0
class cust.geom2D.Circle extends cust.geom2D.Vector
{
var x, y, subtract;
function Circle (ix, iy, ir) {
super();
x = ix;
y = iy;
r = ir;
}
function LineIntersection(l) {
var _local3 = new Array();
var _local2 = l.__get__start();
var _local4 = l.__get__end();
var _local9 = ((_local4.x - _local2.x) * (_local4.x - _local2.x)) + ((_local4.y - _local2.y) * (_local4.y - _local2.y));
var _local7 = 2 * (((_local4.x - _local2.x) * (_local2.x - x)) + ((_local4.y - _local2.y) * (_local2.y - y)));
var _local11 = (((((x * x) + (y * y)) + (_local2.x * _local2.x)) + (_local2.y * _local2.y)) - (2 * ((x * _local2.x) + (y * _local2.y)))) - (r * r);
var _local8 = (_local7 * _local7) - ((4 * _local9) * _local11);
if (_local8 < 0) {
_local3.type = "outside";
} else if (_local8 == 0) {
_local3.type = "tangent";
} else {
var _local10 = Math.sqrt(_local8);
var _local6 = ((-_local7) + _local10) / (2 * _local9);
var _local5 = ((-_local7) - _local10) / (2 * _local9);
if (((_local6 < 0) || (_local6 > 1)) && ((_local5 < 0) || (_local5 > 1))) {
if (((_local6 < 0) && (_local5 < 0)) || ((_local6 > 1) && (_local5 > 1))) {
_local3.type = "outside";
} else {
_local3.type = "inside";
}
} else {
_local3.type = "intersection";
if ((0 <= _local6) && (_local6 <= 1)) {
_local3[_local3.length] = cust.geom2D.Vector.interpolate(_local2, _local4, _local6);
}
if ((0 <= _local5) && (_local5 <= 1)) {
_local3[_local3.length] = cust.geom2D.Vector.interpolate(_local2, _local4, _local5);
}
}
}
return(_local3);
}
function isLineIntersecting(l) {
var _local3 = l.__get__start();
var _local4 = l.vector();
var _local8 = new cust.geom2D.Vector(x - _local3.x, y - _local3.y);
var _local2 = _local8.dot(_local4) / _local4.dot(_local4);
if (_local2 < 0) {
_local2 = 0;
}
if (_local2 > 1) {
_local2 = 1;
}
var _local6 = _local4.multiply(_local2);
var _local7 = new cust.geom2D.Vector(_local3.x + _local6.x, _local3.y + _local6.y);
var _local5 = subtract(_local7);
var _local9 = _local5.dot(_local5);
return(_local9 <= (r * r));
}
function xAtY(yp) {
yp = yp - y;
if ((yp <= r) && (yp >= (-r))) {
return(x + (r * Math.sin(Math.acos(y / r))));
}
return(false);
}
function isIntersecting(c) {
var _local2 = c.x - x;
var _local3 = c.y - y;
return((r + c.r) >= Math.sqrt((_local2 * _local2) + (_local3 * _local3)));
}
function pointsOfIntersection(c) {
var _local4 = c.x - x;
var _local5 = c.y - y;
var _local2 = Math.sqrt((_local4 * _local4) + (_local5 * _local5));
if (_local2 > (r + c.r)) {
return(false);
}
var _local3 = (((_local2 * _local2) + (r * r)) - (c.r * c.r)) / (2 * _local2);
return([new cust.geom2D.Vector((x + ((_local4 * _local3) / _local2)) + ((_local5 / _local2) * Math.sqrt((r * r) - (_local3 * _local3))), (y + ((_local5 * _local3) / _local2)) - ((_local4 / _local2) * Math.sqrt((r * r) - (_local3 * _local3)))), new cust.geom2D.Vector((x + ((_local4 * _local3) / _local2)) - ((_local5 / _local2) * Math.sqrt((r * r) - (_local3 * _local3))), (y + ((_local5 * _local3) / _local2)) + ((_local4 / _local2) * Math.sqrt((r * r) - (_local3 * _local3))))]);
}
function mark(mc, linestyle, fillstyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
if (fillstyle) {
mc.beginFill((fillstyle.rgb ? (fillstyle.rgb) : 0), ((fillstyle.alpha != undefined) ? (fillstyle.alpha) : 100));
}
mc.moveTo(x + r, y);
mc.curveTo(r + x, (0.414213562373095 * r) + y, (0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((0.414213562373095 * r) + x, r + y, x, r + y);
mc.curveTo((-0.414213562373095 * r) + x, r + y, (-0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((-r) + x, (0.414213562373095 * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, (-0.414213562373095 * r) + y, (-0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo((-0.414213562373095 * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((0.414213562373095 * r) + x, (-r) + y, (0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo(r + x, (-0.414213562373095 * r) + y, r + x, y);
if (fillstyle) {
mc.endFill();
}
}
function toString() {
return(((((("(x=" + x) + ", y=") + y) + ", r=") + r) + ")");
}
var r = 0;
}
Symbol 262 MovieClip [__Packages.cust.geom2D.LineSegment] Frame 0
class cust.geom2D.LineSegment
{
var x1, y1, x2, y2;
function LineSegment (ix1, iy1, ix2, iy2) {
x1 = ix1;
y1 = iy1;
x2 = ix2;
y2 = iy2;
}
function vector() {
return(new cust.geom2D.Vector(x2 - x1, y2 - y1));
}
function isPointOnLine(p) {
if (p.y == ((m * p.x) + c)) {
if (x1 >= x2) {
var _local6 = x1;
var _local4 = x2;
} else {
var _local6 = x2;
var _local4 = x1;
}
if (y1 >= y2) {
var _local5 = y1;
var _local3 = y2;
} else {
var _local5 = y2;
var _local3 = y1;
}
if (((p.x >= _local4) && (p.x <= _local6)) && ((p.y >= _local3) && (p.y <= _local5))) {
return(true);
}
}
return(false);
}
function isIntersectingRectangle(r) {
return(false);
}
function interpolate(f) {
f = (isNaN(f) ? 0.5 : (((f > 1) ? 1 : (((f < 0) ? 0 : (f))))));
return(new cust.geom2D.Vector(x1 + ((x2 - x1) * f), y1 + ((y2 - y1) * f)));
}
function offset(x, y) {
x1 = x1 + x;
x2 = x2 + x;
y1 = y1 + y;
y2 = y2 + y;
}
function offsetPoint(p) {
x1 = x1 + p.x;
x2 = x2 + p.x;
y1 = y1 + p.y;
y2 = y2 + p.y;
}
function isIntersecting(l) {
var _local4 = l.x1;
var _local6 = l.y1;
var _local11 = l.x2;
var _local10 = l.y2;
var _local2 = 0;
var _local3 = 0;
var _local7 = x2 - x1;
var _local5 = _local11 - _local4;
if (!_local7) {
if (!_local5) {
return(false);
}
_local2 = x1;
_local3 = _local6 + (((_local10 - _local6) * (x1 - _local4)) / _local5);
} else if (!_local5) {
_local2 = _local4;
_local3 = y1 + (((y2 - y1) * (_local4 - x1)) / _local7);
} else {
var _local9 = (y2 - y1) / _local7;
var _local8 = (_local10 - _local6) / _local5;
if (_local9 == _local8) {
return(false);
}
var _local14 = y1 - (_local9 * x1);
var _local13 = _local6 - (_local8 * _local4);
var _local12 = _local8 - _local9;
_local2 = (_local14 - _local13) / _local12;
_local3 = ((_local8 * _local14) - (_local9 * _local13)) / _local12;
}
if (_local7 > 0) {
if ((_local2 < x1) || (_local2 > x2)) {
return(false);
}
} else if (_local7 < 0) {
if ((_local2 > x1) || (_local2 < x2)) {
return(false);
}
} else if (((_local3 < y1) && (_local3 < y2)) || ((_local3 > y1) && (_local3 > y2))) {
return(false);
}
if (_local5 > 0) {
if ((_local2 < _local4) || (_local2 > _local11)) {
return(false);
}
} else if (_local5 < 0) {
if ((_local2 > _local4) || (_local2 < _local11)) {
return(false);
}
} else if (((_local3 < _local6) && (_local3 < _local10)) || ((_local3 > _local6) && (_local3 > _local10))) {
return(false);
}
return(true);
}
function isPointRightOf(p) {
var _local6 = p.x - x1;
var _local4 = p.y - y1;
var _local5 = x2 - p.x;
var _local3 = y2 - p.y;
return((_local6 * _local3) < (_local4 * _local5));
}
function clone() {
return(new cust.geom2D.LineSegment(x1, y1, x2, y2));
}
function closestPoint(p) {
if ((x1 == x2) && (y1 == y2)) {
return(new flash.geom.Point(x1, y1));
}
var _local7 = ((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2));
var _local6 = (((p.x - x1) * (x2 - x1)) + ((p.y - y1) * (y2 - y1))) / _local7;
var _local3 = x1 + (_local6 * (x2 - x1));
var _local2 = y1 + (_local6 * (y2 - y1));
var _local4 = Math.max;
var _local5 = Math.min;
_local3 = _local4(_local3, _local5(x1, x2));
_local3 = _local5(_local3, _local4(x1, x2));
_local2 = _local4(_local2, _local5(y1, y2));
_local2 = _local5(_local2, _local4(y1, y2));
return(new flash.geom.Point(_local3, _local2));
}
function extendStart(n) {
var _local2 = radians;
x1 = x1 - (n * Math.cos(_local2));
y1 = y1 - (n * Math.sin(_local2));
}
function extendEnd(l) {
var _local2 = radians;
x2 = x2 + (l * Math.cos(_local2));
y2 = y2 + (l * Math.sin(_local2));
}
function pointOfIntersection(l, full) {
var _local4 = l.x1;
var _local6 = l.y1;
var _local11 = l.x2;
var _local10 = l.y2;
var _local2 = 0;
var _local3 = 0;
var _local7 = x2 - x1;
var _local5 = _local11 - _local4;
if (!_local7) {
if (!_local5) {
return(false);
}
_local2 = x1;
_local3 = _local6 + (((_local10 - _local6) * (x1 - _local4)) / _local5);
} else if (!_local5) {
_local2 = _local4;
_local3 = y1 + (((y2 - y1) * (_local4 - x1)) / _local7);
} else {
var _local9 = (y2 - y1) / _local7;
var _local8 = (_local10 - _local6) / _local5;
if (_local9 == _local8) {
return(false);
}
var _local14 = y1 - (_local9 * x1);
var _local13 = _local6 - (_local8 * _local4);
var _local12 = _local8 - _local9;
_local2 = (_local14 - _local13) / _local12;
_local3 = ((_local8 * _local14) - (_local9 * _local13)) / _local12;
}
if (!full) {
if (_local7 > 0) {
if ((_local2 < x1) || (_local2 > x2)) {
return(false);
}
} else if (_local7 < 0) {
if ((_local2 > x1) || (_local2 < x2)) {
return(false);
}
} else if (((_local3 < y1) && (_local3 < y2)) || ((_local3 > y1) && (_local3 > y2))) {
return(false);
}
if (_local5 > 0) {
if ((_local2 < _local4) || (_local2 > _local11)) {
return(false);
}
} else if (_local5 < 0) {
if ((_local2 > _local4) || (_local2 < _local11)) {
return(false);
}
} else if (((_local3 < _local6) && (_local3 < _local10)) || ((_local3 > _local6) && (_local3 > _local10))) {
return(false);
}
}
return(new cust.geom2D.Vector(_local2, _local3));
}
function mark(mc, linestyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
mc.moveTo(x1, y1);
mc.lineTo(x2, y2);
}
function toString() {
return((start.toString() + ", ") + end.toString());
}
function get c() {
return(y1 - (m * x1));
}
function get m() {
return((y2 - y1) / (x2 - x1));
}
function get length() {
return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
}
function set length(l) {
var _local2 = radians;
x2 = x1 + (l * Math.cos(_local2));
y2 = y1 + (l * Math.sin(_local2));
//return(length);
}
function get radians() {
return(Math.atan2(y2 - y1, x2 - x1));
}
function set radians(r) {
var _local2 = length;
x2 = x1 + (_local2 * Math.cos(r));
y2 = y1 + (_local2 * Math.sin(r));
//return(radians);
}
function get degrees() {
return(Math.atan2(y2 - y1, x2 - x1) * rd);
}
function set degrees(d) {
var _local2 = length;
x2 = x1 + (_local2 * Math.cos(d * dr));
y2 = y1 + (_local2 * Math.sin(d * dr));
//return(degrees);
}
function get isVertical() {
var _local2 = m;
return((m == Number.POSITIVE_INFINITY) || (m == Number.NEGATIVE_INFINITY));
}
function get isHorizontal() {
return(m == 0);
}
function get start() {
return(new cust.geom2D.Vector(x1, y1));
}
function set start(p) {
x1 = p.x;
y1 = p.y;
//return(start);
}
function get end() {
return(new cust.geom2D.Vector(x2, y2));
}
function set end(p) {
x2 = p.x;
y2 = p.y;
//return(end);
}
static function fromPolar(m, a, p) {
if (p) {
var _local1 = p.x;
var _local2 = p.y;
} else {
var _local1 = 0;
var _local2 = 0;
}
return(new cust.geom2D.LineSegment(_local1, _local2, _local1 + (m * Math.cos(a)), _local2 + (m * Math.sin(a))));
}
static function fromPoints(p1, p2) {
if (p2) {
return(new cust.geom2D.LineSegment(p1.x, p1.y, p2.x, p2.y));
}
return(new cust.geom2D.LineSegment(0, 0, p1.x, p1.y));
}
static var rd = 57.2957795130823;
static var dr = (Math.PI/180);
}
Symbol 263 MovieClip [__Packages.cust.geom2D.Ball] Frame 0
class cust.geom2D.Ball extends cust.geom2D.Circle
{
var x, y, r, v;
function Ball (ix, iy, ir, vx, vy, m, b) {
super();
x = (isNaN(ix) ? 0 : (ix));
y = (isNaN(iy) ? 0 : (iy));
r = (isNaN(ir) ? 0 : (ir));
v.x = (isNaN(vx) ? 0 : (vx));
v.y = (isNaN(vy) ? 0 : (vy));
mass = (isNaN(m) ? 1 : (m));
bounce = (isNaN(b) ? 1 : (b));
v = new cust.geom2D.Vector(vx, vy);
}
function move() {
x = x + v.x;
y = y + v.y;
}
function collisionDetection(objs) {
var _local6 = objs.length;
var _local2;
var _local4 = 0;
while (_local4 < _local6) {
if (this != objs[_local4]) {
_local2 = objs[_local4];
var _local3 = r + _local2.r;
if (_local2.x < (x - _local3)) {
} else if (_local2.x > (x + _local3)) {
} else if (_local2.y < (y - _local3)) {
} else if (_local2.y > (y + _local3)) {
} else if ((r + _local2.r) > Math.sqrt(((x - _local2.x) * (x - _local2.x)) + ((y - _local2.y) * (y - _local2.y)))) {
return(_local2);
}
}
_local4++;
}
}
function collisionResponse(ball) {
var _local5 = new cust.geom2D.Vector(ball.v.x - v.x, ball.v.y - v.y);
var _local4 = new cust.geom2D.Vector((ball.x - x) - _local5.x, (ball.y - y) - _local5.y);
var _local3 = (new cust.geom2D.Circle(0, 0, r + ball.r)).LineIntersection(cust.geom2D.LineSegment.fromPoints(_local4, new cust.geom2D.Vector(_local4.x + _local5.x, _local4.y + _local5.y)));
if (_local3.length == 2) {
if (flash.geom.Point.distance(_local4, _local3[1]) < flash.geom.Point.distance(_local4, _local3[0])) {
var _local7 = _local3[1];
} else {
var _local7 = _local3[0];
}
} else if (_local3.length == 1) {
var _local7 = _local3[0];
}
if (_local7) {
var _local6 = 1 - (flash.geom.Point.distance(_local7, _local4) / _local5.__get__length());
var _local9 = v.multiply(_local6);
_local9.length = _local9.length + 0.1;
x = x - _local9.x;
y = y - _local9.y;
var _local8 = ball.v.multiply(_local6);
_local8.length = _local8.length + 0.1;
ball.x = ball.x - _local8.x;
ball.y = ball.y - _local8.y;
}
bounceOffBall(ball);
if (_local7) {
var _local14 = v.multiply(_local6);
var _local12 = ball.v.multiply(_local6);
x = x + _local14.x;
y = y + _local14.y;
ball.x = ball.x + _local12.x;
ball.y = ball.y + _local12.y;
}
var _local16 = Math.sqrt(((x - ball.x) * (x - ball.x)) + ((y - ball.y) * (y - ball.y)));
if ((r + ball.r) > _local16) {
var _local18 = (r + ball.r) - _local16;
var _local15 = v.__get__length();
var _local13 = ball.v.__get__length();
var _local17 = _local18 / (_local15 + _local13);
var _local11 = new cust.geom2D.Vector(x - ball.x, y - ball.y);
var _local10 = new cust.geom2D.Vector(ball.x - x, ball.y - y);
_local11.__set__length((_local17 * _local15) + 1);
_local10.__set__length((_local17 * _local13) + 1);
x = x + _local11.x;
y = y + _local11.y;
ball.x = ball.x + _local10.x;
ball.y = ball.y + _local10.y;
}
}
function bounceOffBall(obj) {
var _local8 = obj.x - x;
var _local7 = obj.y - y;
var _local9 = Math.atan2(_local7, _local8);
var _local4 = Math.sin(_local9);
var _local3 = Math.cos(_local9);
var _local12 = new cust.geom2D.Vector(0, 0);
var _local11 = new cust.geom2D.Vector((_local8 * _local3) + (_local7 * _local4), (_local7 * _local3) - (_local8 * _local4));
var _local5 = new cust.geom2D.Vector((v.x * _local3) + (v.y * _local4), (v.y * _local3) - (v.x * _local4));
var _local6 = new cust.geom2D.Vector((obj.v.x * _local3) + (obj.v.y * _local4), (obj.v.y * _local3) - (obj.v.x * _local4));
var _local10 = _local5.x - _local6.x;
_local5.x = (((mass - obj.mass) * _local5.x) + ((2 * obj.mass) * _local6.x)) / (mass + obj.mass);
_local6.x = _local10 + _local5.x;
_local5.length = _local5.length * ((bounce + obj.bounce) / 2);
_local6.length = _local6.length * ((bounce + obj.bounce) / 2);
v.x = (_local5.x * _local3) - (_local5.y * _local4);
v.y = (_local5.y * _local3) + (_local5.x * _local4);
obj.v.x = (_local6.x * _local3) - (_local6.y * _local4);
obj.v.y = (_local6.y * _local3) + (_local6.x * _local4);
}
function toString() {
return(((((((((("(x:" + x) + ", y:") + y) + ", r:") + r) + ", vx:") + v.x) + ", vy:") + v.y) + ")");
}
var mass = 1;
var bounce = 1;
}
Symbol 264 MovieClip [__Packages.Delegate] Frame 0
class Delegate
{
function Delegate () {
}
static function create(target, handler) {
var _local3 = arguments.slice(2);
var _local2 = function () {
return(arguments.callee.handler.apply(arguments.callee.target, arguments.concat(arguments.callee.extraArgs)));
};
_local2.extraArgs = _local3;
_local2.handler = handler;
_local2.target = target;
return(_local2);
}
}
Symbol 265 MovieClip [__Packages.Hole] Frame 0
class Hole extends cust.geom2D.Circle
{
var engine, y, x;
function Hole (e, ix, iy) {
super(ix, iy, r);
engine = e;
}
function getForce(p) {
var _local2 = flash.geom.Point.distance(this, p);
var _local5 = Math.atan2(y - p.y, x - p.x);
var _local4 = 1 - ((_local2 - ir) / (r - ir));
var _local6 = Math.sin((Math.PI/2) * _local4);
return(flash.geom.Point.polar(_local6 * MAX_FORCE, _local5));
}
function fallenDown() {
engine.ballFallingDownHole(this);
}
var ir = (Engine.BALL_RADIUS / 2) - 1.5;
var r = Engine.BALL_RADIUS + 10;
var MAX_FORCE = 100;
}
Symbol 266 MovieClip [__Packages.HoleEnd] Frame 0
class HoleEnd extends Hole
{
var engine;
function HoleEnd (e, ix, iy) {
super(e, ix, iy);
}
function fallenDown() {
engine.ballFallingDownEndHole(this);
}
var ir = (Engine.BALL_RADIUS / 2) + 5;
var r = Engine.BALL_RADIUS + 12;
}
Symbol 267 MovieClip [__Packages.Bumper] Frame 0
class Bumper extends MovieClip
{
var circle, _x, _y, _width, gotoAndPlay;
function Bumper () {
super();
circle = new cust.geom2D.Ball(_x, _y, _width / 2, 0, 0, 10000000, 1.2);
circle.bumper = this;
}
function hit() {
gotoAndPlay(HIT);
}
static var HIT = "hit";
}
Symbol 268 MovieClip [__Packages.Gravity] Frame 0
class Gravity extends MovieClip
{
var mass, _width, p, _x, _y;
function Gravity () {
super();
mass = _width;
p = new flash.geom.Point(_x, _y);
}
function getForce(t) {
var _local2 = flash.geom.Point.distance(p, t);
_local2 = Math.max(MIN, _local2);
var _local4 = Math.atan2(p.y - t.y, p.x - t.x);
var _local5 = (G * mass) * (1 / (_local2 * _local2));
return(flash.geom.Point.polar(_local5, _local4));
}
var G = 10;
var MIN = 15;
}
Symbol 269 MovieClip [__Packages.Format] Frame 0
class Format
{
function Format () {
}
static function zerofill(n, z) {
var _local2 = String(n);
var _local1 = _local2.length;
while (_local1 < z) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2);
}
static function time(t, minp, maxp) {
var _local1 = Math.round((t % 1000) / 10);
var _local2 = Math.round(Math.floor(t / 1000) % 60);
var _local4 = Math.floor(t / 60000);
var _local5 = (((_local4 + ":") + ((_local2 < 10) ? ("0" + _local2) : (_local2))) + ":") + ((_local1 < 10) ? ("0" + _local1) : (_local1));
return(_local5);
}
static function number(n, d, c, l) {
d = (isNaN(d) ? undefined : (d));
c = ((c == undefined) ? "," : (c));
var _local1 = String(n).split(".");
if (!(d === undefined)) {
if (_local1[1]) {
var _local3 = String(Math.round(Number("." + _local1[1]) * Math.pow(10, d)) * Math.pow(10, -d));
_local3 = ((_local3.indexOf(".") < 0) ? (_local3) : (_local3.split(".")[1]));
} else {
var _local3 = "";
}
var _local2 = 0;
while (_local3.length < d) {
var _local3 = _local3 + "0";
_local2++;
}
_local1[1] = _local3;
}
var _local2 = 3;
while (_local1[0].length > _local2) {
_local1[0] = (_local1[0].substring(0, _local1[0].length - _local2) + c) + _local1[0].substring(_local1[0].length - _local2);
_local2 = _local2 + 4;
}
if (!isNaN(l)) {
_local1[0] = zerofill(_local1[0], l);
}
if ((_local1.length > 1) && (d > 0)) {
return((_local1[0] + ".") + _local1[1]);
}
return(_local1[0]);
}
static function ordinal(n) {
if (((n % 100) >= 11) && ((n % 100) <= 13)) {
return("th");
}
if ((n % 10) == 1) {
return("st");
}
if ((n % 10) == 2) {
return("nd");
}
if ((n % 10) == 3) {
return("rd");
}
return("th");
}
static function truncate(s, l, r) {
l = (isNaN(l) ? 20 : (l));
r = ((r == undefined) ? "..." : (r));
if (s.length > l) {
s = s.substr(0, l - r.length);
s = s + r;
}
return(s);
}
}
Symbol 270 MovieClip [__Packages.ChocolatePickup] Frame 0
class ChocolatePickup extends Pickup
{
var engine;
function ChocolatePickup () {
super();
}
function pickedUp() {
super.pickedUp();
engine.scorePoints(Engine.PICKUP_POINTS);
engine.chocolate++;
}
}
Symbol 271 MovieClip [__Packages.SexPickup] Frame 0
class SexPickup extends Pickup
{
var engine;
function SexPickup () {
super();
}
function pickedUp() {
super.pickedUp();
engine.scorePoints(Engine.PICKUP_POINTS);
engine.sex++;
}
}
Symbol 272 MovieClip [__Packages.ExtraLifePickup] Frame 0
class ExtraLifePickup extends Pickup
{
var engine;
function ExtraLifePickup () {
super();
}
function pickedUp() {
super.pickedUp();
engine.__set__lives((engine.__get__lives()+1));
}
}
Symbol 273 MovieClip [__Packages.Base64] Frame 0
class Base64 extends Object
{
static var _CharsReverseLookup;
var _base64Str, _base64Count;
function Base64 () {
super();
}
static function Encode(str) {
var _local1 = new Base64();
return(_local1.encodeBase64(str));
}
static function Decode(str) {
var _local1 = new Base64();
return(_local1.decodeBase64(str));
}
static function StringReplaceAll(source, find, replacement) {
return(source.split(find).join(replacement));
}
static function InitReverseChars() {
_CharsReverseLookup = new Array();
var _local1 = 0;
while (_local1 < _Chars.length) {
_CharsReverseLookup[_Chars[_local1]] = _local1;
_local1++;
}
return(true);
}
static function UrlDecode(str) {
str = StringReplaceAll(str, "\\", " ");
str = unescape(str);
return(str);
}
static function UrlEncode(str) {
str = escape(str);
str = StringReplaceAll(str, "\\", "%2B");
str = StringReplaceAll(str, "%20", "+");
return(str);
}
function setBase64Str(str) {
_base64Str = str;
_base64Count = 0;
}
function readBase64() {
if (!_base64Str) {
return(_EndOfInput);
}
if (_base64Count >= _base64Str.length) {
return(_EndOfInput);
}
var _local2 = _base64Str.charCodeAt(_base64Count) & 255;
_base64Count++;
return(_local2);
}
function encodeBase64(str) {
setBase64Str(str);
var _local3 = "";
var _local2 = new Array(3);
var _local5 = 0;
var _local4 = false;
while ((!_local4) && (((_local2[0] = readBase64())) != _EndOfInput)) {
_local2[1] = readBase64();
_local2[2] = readBase64();
_local3 = _local3 + _Chars[_local2[0] >> 2];
if (_local2[1] != _EndOfInput) {
_local3 = _local3 + _Chars[((_local2[0] << 4) & 48) | (_local2[1] >> 4)];
if (_local2[2] != _EndOfInput) {
_local3 = _local3 + _Chars[((_local2[1] << 2) & 60) | (_local2[2] >> 6)];
_local3 = _local3 + _Chars[_local2[2] & 63];
} else {
_local3 = _local3 + _Chars[(_local2[1] << 2) & 60];
_local3 = _local3 + "=";
_local4 = true;
}
} else {
_local3 = _local3 + _Chars[(_local2[0] << 4) & 48];
_local3 = _local3 + "=";
_local3 = _local3 + "=";
_local4 = true;
}
_local5 = _local5 + 4;
if (_local5 >= 76) {
_local3 = _local3 + newline;
_local5 = 0;
}
}
return(_local3);
}
function readReverseBase64() {
if (!_base64Str) {
return(_EndOfInput);
}
while (true) {
if (_base64Count >= _base64Str.length) {
return(_EndOfInput);
}
var _local2 = _base64Str.charAt(_base64Count);
_base64Count++;
if (_CharsReverseLookup[_local2]) {
return(_CharsReverseLookup[_local2]);
}
if (_local2 == "A") {
return(0);
}
}
}
function ntos(n) {
var _local1 = n.toString(16);
if (_local1.length == 1) {
_local1 = "0" + _local1;
}
_local1 = "%" + _local1;
return(unescape(_local1));
}
function decodeBase64(str) {
setBase64Str(str);
var _local3 = "";
var _local2 = new Array(4);
var _local4 = false;
while (((!_local4) && (((_local2[0] = readReverseBase64())) != _EndOfInput)) && (((_local2[1] = readReverseBase64())) != _EndOfInput)) {
_local2[2] = readReverseBase64();
_local2[3] = readReverseBase64();
_local3 = _local3 + ntos(((_local2[0] << 2) & 255) | (_local2[1] >> 4));
if (_local2[2] != _EndOfInput) {
_local3 = _local3 + ntos(((_local2[1] << 4) & 255) | (_local2[2] >> 2));
if (_local2[3] != _EndOfInput) {
_local3 = _local3 + ntos(((_local2[2] << 6) & 255) | _local2[3]);
} else {
_local4 = true;
}
} else {
_local4 = true;
}
}
return(_local3);
}
function toHex(n) {
var _local4 = "";
var _local3 = true;
var _local1 = 32;
while (_local1 > 0) {
_local1 = _local1 - 4;
var _local2 = (n >> _local1) & 15;
if ((!_local3) || (_local2 != 0)) {
_local3 = false;
_local4 = _local4 + _Digits[_local2];
}
}
return(((_local4 == "") ? "0" : (_local4)));
}
function pad(str, len, pad) {
var _local2 = str;
var _local1 = str.length;
while (_local1 < len) {
_local2 = pad + _local2;
_local1++;
}
return(_local2);
}
function encodeHex(str) {
var _local4 = "";
var _local2 = 0;
while (_local2 < str.length) {
_local4 = _local4 + pad(toHex(str.charCodeAt(_local2) & 255), 2, "0");
_local2++;
}
return(_local4);
}
function decodeHex(str) {
var _local5 = "";
var _local3 = "";
var _local2 = 0;
while (_local2 < str.length) {
_local3 = _local3 + str.charAt(_local2);
if (_local3.length == 2) {
_local5 = _local5 + ntos(parseInt("0x" + _local3));
_local3 = "";
}
_local2++;
}
return(_local5);
}
static var _EndOfInput = -1;
static var _Chars = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/");
static var _CharsReverseLookupInited = InitReverseChars();
static var _Digits = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
}
Symbol 274 MovieClip [__Packages.Antigravity] Frame 0
class Antigravity extends Gravity
{
function Antigravity () {
super();
}
var G = -10;
}
Symbol 105 MovieClip [gravity] Frame 1
#initclip 30
Object.registerClass("gravity", Gravity);
#endinitclip
Symbol 108 Button
on (release) {
_parent.restartLevelManually();
}
Symbol 109 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 10
stop();
Symbol 123 MovieClip Frame 56
stop();
Symbol 124 MovieClip Frame 39
stop();
Symbol 130 MovieClip Frame 1
stop();
Symbol 136 MovieClip Frame 1
stop();
Symbol 147 Button
on (release) {
_global.root.goToMJ();
}
Symbol 167 Button
on (release) {
_global.root.goToStartpage();
}
Symbol 174 MovieClip Frame 1
stop();
Symbol 191 Button
on (release) {
_global.root.goToMJ();
}
Symbol 211 Button
on (release) {
play();
}
Symbol 222 Button
on (release) {
getURL ("http://www.tinymania.com", "_blank");
_root.kvClick(_global.mcClickId);
}
Symbol 233 Button
on (release) {
play();
}
Symbol 245 MovieClip Frame 1
function isFacebook() {
if (_root.fb_sig_user && (_root.fb_sig_session_key)) {
return(true);
}
return(false);
}
function getScoreString() {
var _local4 = "";
var _local3 = zerofill(_global.FB_gid, 10) + _global.FB_score;
var _local2 = 0;
while (_local2 < _local3.length) {
_local4 = _local4 + (String((Number(_local3.charAt(_local2)) + Number(k.charAt(_local2 % k.length))) % 10) + String(Math.floor(Math.random() * 10)));
_local2++;
}
return(_local4);
}
function zerofill(n, l) {
var _local1 = n.toString();
while (_local1.length < l) {
_local1 = "0" + _local1;
}
return(_local1);
}
function FB_submit() {
getURL ((appURL + "?s=") + getScoreString(), "_blank");
}
function FB_autoSubmit(successCBFunc, errorCBFunc) {
var _local3 = new LoadVars();
_local3.s = getScoreString();
_local3.fb_sig_user = _root.fb_sig_user;
_local3.fb_sig_session_key = _root.fb_sig_session_key;
_local3.onLoad = function (success) {
if (success) {
if (this.result == "ok") {
successCBFunc();
} else {
errorCBFunc();
for (var _local2 in this) {
}
}
} else {
errorCBFunc();
}
};
_local3.sendAndLoad(callbackURL, _local3, "GET");
}
function successCallBack() {
gotoAndStop ("autoSavingDone");
}
function errorCallBack() {
gotoAndStop ("autoSavingError");
}
appURL = "http://apps.facebook.com/tinymania/";
callbackURL = "http://www.tinymania.com/apps/facebook/ss.php";
k = "0948574731928943801";
_global.FB_autoSubmit = FB_autoSubmit;
_global.isFacebook = isFacebook;
_global.FB_submit = FB_submit;
if (isFacebook()) {
gotoAndPlay ("autoSaving");
} else {
submit_btn.onRelease = FB_submit;
stop();
}
Instance of Symbol 216 MovieClip in Symbol 245 MovieClip Frame 1
onClipEvent (load) {
function doTheThing() {
if (_global.FB_score_formatted) {
scoreDisplay.text = (scoreDisplayShadow.text = _global.FB_score_formatted);
} else {
scoreDisplay.text = (scoreDisplayShadow.text = _global.FB_score);
}
}
doTheThing();
}
onClipEvent (enterFrame) {
doTheThing();
}
Instance of Symbol 225 MovieClip in Symbol 245 MovieClip Frame 2
onClipEvent (load) {
useHandCursor = false;
onRollOver = function () {
};
}
Symbol 245 MovieClip Frame 7
stop();
Instance of Symbol 223 MovieClip in Symbol 245 MovieClip Frame 7
onClipEvent (load) {
useHandCursor = false;
onRollOver = function () {
};
}
Symbol 245 MovieClip Frame 12
gotoAndStop ("submitScore");
Instance of Symbol 216 MovieClip in Symbol 245 MovieClip Frame 16
onClipEvent (enterFrame) {
if (_global.FB_score_formatted) {
scoreDisplay.text = (scoreDisplayShadow.text = _global.FB_score_formatted);
} else {
scoreDisplay.text = (scoreDisplayShadow.text = _global.FB_score);
}
}
Symbol 245 MovieClip Frame 27
stop();
_global.FB_autoSubmit(successCallBack, errorCallBack);
Symbol 245 MovieClip Frame 30
stop();
Symbol 245 MovieClip Frame 43
stop();
Symbol 247 MovieClip Frame 1
function FB_submit() {
getURL ((appURL + "?r=") + getScoreString(), "_blank");
}
function getScoreString() {
return(Base64.Encode(rating.toString()));
}
appURL = "http://apps.facebook.com/mjcsapp/";
stop();
continue_btn.onRelease = function () {
_parent.play();
};
Symbol 247 MovieClip Frame 10
stop();
continue_btn.onRelease = function () {
_parent.play();
};
Symbol 247 MovieClip Frame 21
stop();
continue_btn.onRelease = function () {
_parent.play();
};
Symbol 247 MovieClip Frame 36
stop();
continue_btn.onRelease = function () {
_parent.play();
};
Symbol 247 MovieClip Frame 46
stop();
Symbol 250 MovieClip Frame 1
stop();
Symbol 250 MovieClip Frame 11
stop();
onShown();
delete onShown;
Symbol 250 MovieClip Frame 12
onHiding();
delete onHiding;
Symbol 253 MovieClip [antigravity] Frame 1
#initclip 28
Object.registerClass("antigravity", Antigravity);
#endinitclip
Symbol 254 MovieClip [engine] Frame 1
#initclip 29
Object.registerClass("engine", Engine);
#endinitclip
stop();
Symbol 254 MovieClip [engine] Frame 64
initLvl();