Frame 1
function sumbitsendToFriend(sender, senderemail, email) {
thisURL = "http://207.234.225.65/Reactor/Interface/message.aspx";
var _local2 = email;
var _local3 = sender;
var _local4 = senderemail;
var _local5 = 1;
var _local6 = 3;
trace("sendEmail: " + _local2);
trace("userName: " + sender);
sendDoc = new XML();
sendSource = ((((((((("<message><version>" + _local5) + "</version><projectID>") + _local6) + "</projectID><senderEmail>") + _local4) + "</senderEmail><senderFullName>") + _local3) + "</senderFullName><recipientEmail>") + _local2) + "</recipientEmail></message>";
sendDoc.parseXML(sendSource);
confirmDoc = new XML();
confirmDoc.ignoreWhite = true;
confirmDoc.onLoad = function (success) {
trace("recieved: " + success);
trace(confirmDoc.toString());
_root.newgame.gotoAndStop("sent");
};
sendDoc.sendAndLoad(thisURL, confirmDoc);
}
_root.card._visible = false;
_root.frame.swapDepths(15998);
_root.card.swapDepths(1000);
_root.hat.swapDepths(500);
_root.hand.swapDepths(1500);
_root.power = 0.5;
_root.throwCount = 0;
_root.flatcount = 0;
_root.level = 0;
_root.stats = [];
_root.remaining = 0;
_root.messages = [];
_root.score_per_hit = 100;
toDoubles = function (str) {
str = str.toString();
if (str.length == 1) {
return("0" + str);
}
return(str);
};
this.onEnterFrame = function () {
if (_root.mousedown) {
if ((((_root._ymouse > (Stage.height - 15)) || (_root._ymouse < 15)) || (_root._xmouse > (Stage.width - 15))) || (_root._xmouse < 15)) {
_root.thisMouseUp();
}
}
if (!game_paused) {
var _local4 = new Date();
var _local5 = _local4.getTime();
var _local3 = Math.floor((_local5 - orig_time) / 1000);
var _local2 = _root.level_time - _local3;
var _local6 = (Math.floor(_local2 / 60) + ":") + _root.toDoubles(Math.floor(_local2 % 60));
_root.tf_time.text = _local6;
if (_local2 < 1) {
_root.tf_time.text = "0:00";
_root.gameOver();
}
_root.remaining = _local2;
}
};
this.onMouseDown = function () {
if (game_paused) {
return(undefined);
}
if (!_root.throwing) {
_root.mousedown = true;
_root.power = 0.5;
hand.onEnterFrame = function () {
var _local2 = ((hand.o_h + 100) - hand._y) / 15;
hand._y = hand._y + _local2;
_root.power = _root.power + 0.025;
hand._rotation = hand._rotation + (_local2 / 4);
_root.gauge.gotoAndStop(Math.ceil(hand._y - hand.o_h));
if (hand._y > (hand.o_h + 85)) {
delete hand.onEnterFrame;
_root.thisMouseUp();
}
};
}
};
this.onMouseUp = function () {
thisMouseUp();
};
thisMouseUp = function () {
if (game_paused) {
return(undefined);
}
if ((_root.power < 0.6) && (_root.level == 1)) {
_root.messages.push("Try a longer mouse click");
}
if ((_root.hat._x < ((Stage.width / 2) - 75)) && (_root.level == 1)) {
_root.messages.push("Try panning to the left");
}
if ((_root.hat._x > ((Stage.width / 2) + 75)) && (_root.level == 1)) {
_root.messages.push("Try panning to the right");
}
if ((!_root.throwing) && (_root.mousedown)) {
hand._y = hand.o_h;
hand._rotation = 0;
hand._visible = false;
delete hand.onEnterFrame;
if (_root.power > 1.3) {
_root.power = 1.3;
}
_root.throwCard();
}
_root.mousedown = false;
};
throwCard = function () {
var _local3 = card.createEmptyMovieClip("sfx1", 11);
bg2 = new Sound(_local3);
bg2.attachSound("card_throw");
bg2.start(0, 1);
bg2.setVolume(100);
_root.throwing = true;
_root.card.swapDepths(1000);
_root.hat.swapDepths(500);
_root.card._visible = true;
card._ymove = 2.2;
scale = 100;
card.framecount = (power * 17) + 10;
card.framecount_midpoint = card.framecount / 4;
card._y_multiplier = 1;
card.reach_midpoint = false;
card.onEnterFrame = function () {
_root.moveCard(_root.card);
card._ymove = card._ymove - (0.2 * card._y_multiplier);
card._x = card._x + (_root.skyline.wind * 10);
card.card._rotation = card.card._rotation + (16 * _root.power);
card.framecount--;
if (card.card._xscale > 8) {
scale = scale * (0.85 + (_root.hat._xscale / 1500));
card.card._xscale = scale;
card.card._yscale = scale;
}
var _local2 = (((card.framecount + 2) * _root.power) * card._y_multiplier) * card._ymove;
if (card._ymove > 0) {
card.card._y = card.card._y - _local2;
} else {
card.card._y = card.card._y - (_local2 / 1.5);
}
if ((card.framecount < card.framecount_midpoint) && (!card.reach_midpoint)) {
card.reach_midpoint = true;
card._y_multiplier = -1;
_root.checkHit();
_root.card.swapDepths(500);
_root.hat.swapDepths(1000);
}
if (card.framecount < 0) {
card._x = 320;
card.count++;
card.card._rotation = 0;
card.card._xscale = 100;
card.card._yscale = 100;
card.card._y = card.orig_y;
card._y_multiplier = 1;
_root.hand._visible = true;
card._visible = false;
_root.throwing = false;
delete card.onEnterFrame;
}
};
};
_root.checkHit = function () {
if (_root.card.hitTest(_root.hat.hitarea)) {
_root.stats.push(1);
_root.hat.hit = true;
_root.hat.gotoAndPlay("hit");
_root.card._visible = false;
_root.addScore(1);
} else {
if (_root.card.hitTest(_root.hat.bouncearea)) {
createBounceCard(card._x + card.card._x, card._y + card.card._y);
} else {
createFlatCard(card._x + card.card._x, card._y + card.card._y);
}
_root.stats.push(0);
}
_root.throwCount++;
if (((_root.throwCount % 3) == 0) && (_root.level > 4)) {
_root.skyline.calcWind();
}
_root.gauge.gotoAndStop(1);
};
createBounceCard = function (tx, ty) {
_root.flatcount++;
if (_root.flatcount > 100) {
_root.flatcount = 0;
}
var _local2 = _root.attachMovie("bounce_card", "flat_" + _root.flatcount, _root.flatcount + 1000);
_local2._x = tx;
_local2._y = ty;
var _local3 = (_root.hat._y - 80) / 1.2;
var _local4 = random(2);
if (_local4) {
_local2._xscale = _local3;
} else {
_local2._xscale = -_local3;
}
_local2._yscale = _local3;
_root.card._visible = false;
};
createFlatCard = function (tx, ty) {
_root.flatcount++;
if (_root.flatcount > 50) {
_root.flatcount = 0;
}
var _local2 = _root.attachMovie("flat_card", "flat_" + _root.flatcount, _root.flatcount + 100);
_local2._x = tx;
_local2._y = ty;
var _local3 = (_local2._y - 80) / 1.2;
_local2._xscale = _local3;
_local2._yscale = _local3;
if (_root.throwing) {
_root.card._visible = false;
}
};
skyline_x = -(_root.skyline._width / 2);
skyline._y = 100;
dist_max = 328;
screen_width = Stage.width;
checkLimits = function () {
trace(_root.limit);
return(_root.limit);
};
moveMe = function (callby) {
if (game_paused) {
return(undefined);
}
var _local2 = _root._xmouse - (_root.screen_width / 2);
var _local5 = (375 - Math.abs(_root._xmouse - (_root.screen_width / 2))) / 12;
var _local3 = _local2 / _local5;
var _local10 = callby._y - 90;
var _local7 = _local10;
var _local9 = _local3;
var _local8 = 0;
var _local6 = _local9 - _local8;
var _local4 = _local6 / (dist_max - _local7);
if ((_root.limit_min && (_local2 < 0)) || (_root.limit_max && (_local2 > 0))) {
} else {
callby._x = callby._x - (_local3 * Math.abs(_local4));
}
};
moveCard = function (callby) {
var _local2 = _root._xmouse - (_root.screen_width / 2);
var _local5 = (375 - Math.abs(_root._xmouse - (_root.screen_width / 2))) / 12;
var _local3 = _local2 / _local5;
var _local10 = 0;
var _local7 = _local10;
var _local9 = _local3;
var _local8 = 0;
var _local6 = _local9 - _local8;
var _local4 = _local6 / (dist_max - _local7);
if ((_root.limit_min && (_local2 < 0)) || (_root.limit_max && (_local2 > 0))) {
} else {
callby._x = callby._x - (_local3 * Math.abs(_local4));
}
};
_root.relocateHat = function () {
hat._x = hat._x + (random(100) - 50);
var _local2 = random(130) + 20;
hat._y = 120 + _local2;
var _local1 = _local2 / 1.2;
hat._xscale = _local1;
hat._yscale = _local1;
};
addScore = function (scr) {
var _local2 = 0;
if (scr == 1) {
removeTopCard();
var _local3 = Math.floor((300 - _root.hat._y) / 3) + 1;
_local2 = Math.ceil((score_per_hit * (Math.abs(_root.skyline.wind) + 0.1)) * _local3);
var _local4 = _local2;
if ((_root.stats[_root.stats.length - 2] && (_root.stats[_root.stats.length - 3])) && (_root.stats[_root.stats.length - 4])) {
_root.messages.push("Flippin' Frenzy!!! (+5000)");
_local2 = _local2 + 5000;
} else if (_root.stats[_root.stats.length - 2] && (_root.stats[_root.stats.length - 3])) {
_root.messages.push("Three in a row!!! (+2500)");
_local2 = _local2 + 3500;
} else if (_root.stats[_root.stats.length - 2]) {
_root.messages.push("Two in a row!!! (+1000)");
_local2 = _local2 + 1000;
}
}
if (scr == 2) {
_local2 = Math.ceil(_root.level * 250);
}
_root.messages.push("+" + _local4);
_root.score = Number(_root.score) + Number(_local2);
_root.tf_score.text = _root.score;
};
_root.level_cards = [0, 3, 7, 10, 13, 14, 15, 17, 19, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21];
_root.level_times = [0, 40, 50, 60, 45, 40, 35, 30, 25, 20, 15, 10, 10, 10, 8, 6, 5, 4, 3, 2, 1];
levelUp = function () {
_root.theTime = new Date();
orig_time = theTime.getTime();
_root.skyline.calcWind();
_root.level++;
var _local5 = _root.level_cards[_root.level];
var _local6 = _root.level_times[_root.level];
_root.messages.push("Level " + _root.level);
_root.level_time = _local6 + _root.remaining;
var _local4 = _root.createEmptyMovieClip("cardstack", 11000);
_local4._x = 530;
_local4._y = 319;
var _local2 = 0;
while (_local2 < _local5) {
var _local3 = _local4.attachMovie("card_thumb", "card_" + (_local2 + 1), _local2 + 100);
_local3._x = _local2 * 2;
_local3._y = -(_local2 * 2);
_local2++;
}
_root.messages.push(("Stack: " + _local5) + " cards");
_root.messages.push(("You have " + _root.level_time) + " seconds");
_root.stack_current = _local2;
_root.stack_total = _local2;
_root.tf_stack.text = (stack_current + "/") + stack_total;
};
removeTopCard = function () {
var tcard = _root.cardstack["card_" + _root.stack_current];
tcard.onEnterFrame = function () {
tcard._x++;
tcard._x = tcard._x * 1.4;
if (tcard._x > 250) {
tcard.removeMovieClip();
}
};
_root.stack_current--;
_root.tf_stack.text = (stack_current + "/") + stack_total;
if (_root.stack_current == 0) {
levelUp();
}
};
_root.gameOver = function () {
_root.newgame._y = _root.newgame.orig;
_root.score_per_hit = 100;
_root.messages = [];
_root.game_paused = true;
_root.messages.push("Game Over");
_root.messages.push(("You reached level " + _root.level) + "");
_root.messages.push(("Final score: " + _root.score) + " points");
};
newGame = function () {
var _local2 = 0;
while (_local2 < 50) {
var _local3 = _root["flat_" + _local2];
_local3.removeMovieClip();
_local2++;
}
_root.newgame.orig = _root.newgame._y;
_root.newgame.g = 10;
_root.newgame.onEnterFrame = function () {
_root.newgame._y = _root.newgame._y - _root.newgame.g;
_root.newgame.g++;
if (_root.newgame._y < -200) {
delete _root.newgame.onEnterFrame;
}
};
_root.tf_score.text = "0";
_root.score = 0;
_root.game_paused = false;
_root.power = 0.5;
_root.throwCount = 0;
_root.flatcount = 0;
_root.level = 0;
_root.stats = [];
_root.remaining = 0;
levelUp();
};
this.createEmptyMovieClip("sounds", 15990);
sounds.loadMovie("game_sounds.swf");
_root.game_paused = true;
sendToFriend = function (sender, senderemail, email) {
if (((((email.indexOf("@") == -1) || (senderemail.indexOf("@") == -1)) || (sender.length == 0)) || (email.indexOf(".") == -1)) || (senderemail.indexOf(".") == -1)) {
return(false);
}
_root.sumbitsendToFriend(sender, senderemail, email);
return(true);
};
_root.requestSessionInfo = function (who) {
trace(who);
who.nextFrame();
};
Instance of Symbol 111 MovieClip "hand" in Frame 1
onClipEvent (load) {
this.o_h = this._y;
}
Instance of Symbol 126 MovieClip "arrow_left" in Frame 1
onClipEvent (load) {
this.swapDepths(15813);
}
Instance of Symbol 126 MovieClip "arrow_right" in Frame 1
onClipEvent (load) {
this.swapDepths(15814);
}
Instance of Symbol 131 MovieClip "gauge" in Frame 1
onClipEvent (load) {
this.swapDepths(15812);
}
Instance of Symbol 161 MovieClip "newgame" in Frame 1
onClipEvent (load) {
this.swapDepths(15701);
}
Symbol 14 MovieClip [flat_card] Frame 1
this.onEnterFrame = function () {
_root.moveMe(this);
};
gotoAndStop(random(_totalframes) + 1);
Symbol 28 MovieClip [bounce_card] Frame 1
this.onEnterFrame = function () {
_root.moveMe(this);
_root.throwing = true;
};
Symbol 28 MovieClip [bounce_card] Frame 13
stop();
_root.createFlatCard(_x + (0.6 * _xscale), _y + (0.6 * _yscale));
_root.throwing = false;
this.removeMovieClip();
Symbol 33 MovieClip [card_thumb] Frame 1
count = 0;
Symbol 33 MovieClip [card_thumb] Frame 3
count++;
if (count < this._x) {
gotoAndPlay (2);
}
Symbol 33 MovieClip [card_thumb] Frame 11
stop();
Symbol 63 MovieClip Frame 1
orig_x = _x;
depth = _y;
calcWind = function () {
wind = (random(9 + _root.level) - (3 + (_root.level / 2))) / 10;
if (wind > 1) {
wind = 1;
}
trace(_root.level);
if (_root.level < 2) {
wind = 0.01;
}
};
calcWind();
this.onEnterFrame = function () {
_root.moveMe(this);
if (_root._xmouse < (Stage.width / 2)) {
var _local6 = Math.floor((_root._xmouse / (Stage.width / 2)) * 4);
_root.arrow_left.gotoAndStop(4 - _local6);
_root.arrow_right.gotoAndStop(1);
} else {
var _local5 = Math.floor(((_root._xmouse - (Stage.width / 2)) / (Stage.width / 2)) * 4);
_root.arrow_right.gotoAndStop(_local5 + 1);
_root.arrow_left.gotoAndStop(1);
}
var _local4 = 1;
while (_local4 < 20) {
var _local3 = this["cloud_0" + _local4];
_local3._x = _local3._x + wind;
if (_local3._x > 1650) {
_local3._x = -500;
}
if (_local3._x < -600) {
_local3._x = 1600;
}
_local4++;
}
};
Symbol 87 MovieClip Frame 1
orig_x = _x;
depth = _y;
gotoAndPlay(random(_totalframes) + 1);
this.onEnterFrame = function () {
_root.moveMe(this);
};
Symbol 108 MovieClip Frame 1
orig_x = _x;
depth = _y;
dep_calc = (depth * depth) / 12250;
this.onEnterFrame = function () {
_root.moveMe(this);
if (_root.hat._x <= 0) {
_root.hat._x = 0;
_root.limit_max = true;
} else {
_root.limit_max = false;
}
if (_root.hat._x >= Stage.width) {
_root.hat._x = Stage.width;
_root.limit_min = true;
} else {
_root.limit_min = false;
}
};
Symbol 108 MovieClip Frame 5
if (!hit) {
gotoAndPlay (1);
}
Instance of Symbol 100 MovieClip in Symbol 108 MovieClip Frame 6
onClipEvent (load) {
gotoAndStop(random(_totalframes) + 1);
}
Symbol 108 MovieClip Frame 19
_root.relocateHat();
hit = false;
Symbol 114 MovieClip Frame 1
stop();
if (orig_y == undefined) {
orig_y = card._y;
}
Symbol 126 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 1
this.onEnterFrame = function () {
if ((_root.messages.length > 0) && (!playin)) {
this.playin = true;
this.msg.tf.text = _root.messages.shift();
this.gotoAndPlay(2);
}
};
playin = false;
stop();
Symbol 135 MovieClip Frame 3
var sfx1 = this.createEmptyMovieClip("sfx1", 11);
bg2 = new Sound(sfx1);
var r;
if (this.msg.tf.text.indexOf("Try") != -1) {
r = 2;
} else {
r = _root.messages.length + 1;
if (r > 4) {
r = 3;
}
}
bg2.attachSound("tzling0" + r);
bg2.start(0, 1);
bg2.setVolume(70);
Symbol 135 MovieClip Frame 26
Symbol 141 Button
on (release) {
nextFrame();
}
Symbol 144 Button
on (release) {
_root.newGame();
}
Symbol 145 Button
on (release) {
if (_root.sendToFriend(details.sender.text, details.senderemail.text, details.email.text)) {
send_btn.enabled = false;
send_btn._alpha = 60;
} else {
_root.messages.push("OOPS... please try again.");
}
}
Symbol 148 Button
on (release) {
gotoAndStop (1);
}
Symbol 158 Button
on (release) {
gotoAndStop (1);
}
Symbol 161 MovieClip Frame 1
stop();
send_btn._alpha = 100;
send_btn.enabled - true;
Symbol 161 MovieClip Frame 2
send_btn._alpha = 100;
send_btn.enabled - true;