Frame 1
_global.siteurl = "http://www.toptrumps.com/play/pigs";
okToPlay = false;
if (_url.substr(0, siteurl.length) == siteurl) {
okToPlay = true;
}
loadbar.onEnterFrame = function () {
var _local3 = int(getBytesLoaded() / 1024);
var _local2 = int(getBytesTotal() / 1024);
var _local1 = int((_local3 / _local2) * 100);
loadbar.gotoAndStop(_local1);
if (_local1 == 100) {
delete loadBar.onEnterFrame;
nextFrame();
}
};
Frame 2
splashpig._x = -999;
menuActive = true;
but_instr.onRelease = function () {
if (menuActive) {
menuActive = false;
splashpig._x = -999;
var _local2 = 340;
var _local3 = {_x:_local2, _y:220};
panel = this._parent.attachMovie("instructions", "instructions", this._parent.getNextHighestDepth(), _local3);
var _local4 = new mx.transitions.Tween(panel, "_x", mx.transitions.easing.Strong.easeOut, 0, _local2, 20, false);
panel.gotoAndStop(1);
panel.done = function () {
trace("panel.but_next ");
this._parent._parent.panel.removeMovieClip();
menuActive = true;
};
}
};
but_instr.onRollOver = function () {
if (menuActive) {
var _local2 = new mx.transitions.Tween(splashpig, "_xscale", mx.transitions.easing.Bounce.easeOut, 0, 100, 10, false);
_local2 = new mx.transitions.Tween(splashpig, "_yscale", mx.transitions.easing.Bounce.easeOut, 0, 100, 10, false);
splashpig._x = 55;
splashpig._y = 310;
this.gotoAndStop(2);
}
};
but_instr.onRollOut = function () {
if (menuActive) {
var _local2 = new mx.transitions.Tween(splashpig, "_xscale", mx.transitions.easing.Regular.easeOut, 100, 0, 10, false);
_local2 = new mx.transitions.Tween(splashpig, "_yscale", mx.transitions.easing.Regular.easeOut, 100, 0, 10, false);
this.gotoAndStop(1);
}
};
but_hiscores.onRelease = function () {
if (menuActive) {
menuActive = false;
splashpig._x = -999;
tint = this._parent.attachMovie("mask", "mask", this._parent.getNextHighestDepth(), {_x:-25, _y:-25, _xscale:300, _yscale:300, _alpha:50});
var _local2 = 335;
var _local3 = {_x:_local2, _y:220};
panel = this._parent.attachMovie("GameOverPanel", "GameOverPanel", this._parent.getNextHighestDepth(), _local3);
var _local6 = new mx.transitions.Tween(panel, "_x", mx.transitions.easing.Strong.easeOut, 0, _local2, 20, false);
panel.gotoAndStop(3);
panel.done = function () {
trace(">>>");
this._parent._parent.tint.removeMovieClip();
this._parent._parent.panel.removeMovieClip();
menuActive = true;
};
}
};
but_hiscores.onRollOver = function () {
if (menuActive) {
var _local2 = new mx.transitions.Tween(splashpig, "_xscale", mx.transitions.easing.Bounce.easeOut, 0, 100, 10, false);
_local2 = new mx.transitions.Tween(splashpig, "_yscale", mx.transitions.easing.Bounce.easeOut, 0, 100, 10, false);
splashpig._x = 160;
splashpig._y = 360;
splashpig._xscale = -100;
this.gotoAndStop(2);
}
};
but_hiscores.onRollOut = function () {
if (menuActive) {
var _local2 = new mx.transitions.Tween(splashpig, "_xscale", mx.transitions.easing.Regular.easeOut, 100, 0, 10, false);
_local2 = new mx.transitions.Tween(splashpig, "_yscale", mx.transitions.easing.Regular.easeOut, 100, 0, 10, false);
this.gotoAndStop(1);
}
};
but_play.multiplayer = false;
but_play.onRelease = function () {
if (menuActive) {
_root.multiplayer = this.multiplayer;
_global.multiplayer = this.multiplayer;
trace("this.multiplayer : " + this.multiplayer);
trace("_global.multiplayer : " + _global.multiplayer);
trace("_root.multiplayer : " + _root.multiplayer);
tint.removeMovieClip();
gameOverPanel.removeMovieClip();
splashpig._visible = false;
gotoAndStop ("startGame");
}
};
but_play.onRollOver = function () {
if (menuActive) {
var _local2 = new mx.transitions.Tween(splashpig, "_xscale", mx.transitions.easing.Bounce.easeOut, 0, -100, 10, false);
_local2 = new mx.transitions.Tween(splashpig, "_yscale", mx.transitions.easing.Bounce.easeOut, 0, 100, 10, false);
splashpig._x = 420;
splashpig._y = 330;
this.gotoAndStop(2);
}
};
but_play.onRollOut = function () {
if (menuActive) {
var _local2 = new mx.transitions.Tween(splashpig, "_xscale", mx.transitions.easing.Regular.easeOut, -100, 0, 10, false);
_local2 = new mx.transitions.Tween(splashpig, "_yscale", mx.transitions.easing.Regular.easeOut, 100, 0, 10, false);
this.gotoAndStop(1);
}
};
but_play2.multiplayer = true;
but_play2.onRelease = but_play.onRelease;
but_play2.onRollOut = but_play.onRollOut;
but_play2.onRollOver = but_play.onRollOver;
splashpig._visible = true;
if (played) {
buynow._visible = true;
} else {
played = true;
buynow._visible = false;
}
gamemask._xscale = 1;
gamemask._yscale = 1;
instructions._visible = false;
stop();
Frame 3
rate = 35;
startsize = 25;
buynow._visible = false;
logo._visible = false;
ScoreBoard._visible = false;
ScoreBoard.ScoreBoardpigs._visible = false;
Controls._visible = false;
gameborder._visible = false;
gamebg._visible = false;
frameint = setInterval(function () {
gameborder._visible = true;
gamebg._visible = true;
rate2 = rate;
var _local1 = new mx.transitions.Tween(gameborder, "_xscale", mx.transitions.easing.Strong.easeOut, startsize, 100, rate2, false);
_local1 = new mx.transitions.Tween(gameborder, "_yscale", mx.transitions.easing.Strong.easeOut, startsize, 100, rate2, false);
_local1 = new mx.transitions.Tween(gamemask, "_xscale", mx.transitions.easing.Strong.easeOut, startsize, 100, rate2, false);
_local1 = new mx.transitions.Tween(gamemask, "_yscale", mx.transitions.easing.Strong.easeOut, startsize, 100, rate2, false);
clearInterval(frameint);
}, 100);
logoint = setInterval(function () {
logo._visible = true;
var _local1 = new mx.transitions.Tween(logo, "_xscale", mx.transitions.easing.Elastic.easeOut, startsize, 100, rate, false);
_local1 = new mx.transitions.Tween(logo, "_yscale", mx.transitions.easing.Elastic.easeOut, startsize, 100, rate, false);
_local1 = new mx.transitions.Tween(logo, "_rotation", mx.transitions.easing.Elastic.easeOut, startsize, 0, rate, false);
clearInterval(logoint);
}, 300);
ScoreBoardint = setInterval(function () {
ScoreBoard._visible = true;
var _local1 = new mx.transitions.Tween(ScoreBoard, "_xscale", mx.transitions.easing.Elastic.easeOut, startsize, 100, rate, false);
_local1 = new mx.transitions.Tween(ScoreBoard, "_yscale", mx.transitions.easing.Elastic.easeOut, startsize, 100, rate, false);
_local1 = new mx.transitions.Tween(ScoreBoard, "_rotation", mx.transitions.easing.Elastic.easeOut, -startsize, 0, rate, false);
clearInterval(ScoreBoardint);
}, 600);
ScoreBoardpigsint = setInterval(function () {
ScoreBoard.ScoreBoardpigs._visible = true;
var _local1 = new mx.transitions.Tween(ScoreBoard.ScoreBoardpigs, "_y", mx.transitions.easing.Elastic.easeOut, 150, 68.6, rate, false);
clearInterval(ScoreBoardpigsint);
}, 1600);
Controlsint = setInterval(function () {
Controls._visible = true;
var _local1 = new mx.transitions.Tween(Controls, "_xscale", mx.transitions.easing.Elastic.easeOut, startsize + 20, 100, rate, false);
_local1 = new mx.transitions.Tween(Controls, "_yscale", mx.transitions.easing.Elastic.easeOut, startsize + 20, 100, rate, false);
_local1 = new mx.transitions.Tween(Controls, "_rotation", mx.transitions.easing.Elastic.easeOut, (-startsize) / 2, 0, rate, false);
clearInterval(Controlsint);
}, 900);
fscommand ("allowscale", false);
var game = (new com.Game(container, this));
game.init();
if (_root.multiplayer) {
gamebg = gamebg_pub;
gamebg_pub._visible = true;
gamebg_grass._visible = false;
} else {
gamebg = gamebg_grass;
gamebg_pub._visible = false;
gamebg_grass._visible = true;
}
stop();
Symbol 4 MovieClip [Ball] Frame 1
stop();
Symbol 717 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 718 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 719 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 720 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 721 MovieClip [__Packages.mx.transitions.easing.Bounce] Frame 0
class mx.transitions.easing.Bounce
{
function Bounce () {
}
static function easeOut(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeIn(t, b, c, d) {
return((c - easeOut(d - t, 0, c, d)) + b);
}
static function easeInOut(t, b, c, d) {
if (t < (d / 2)) {
return((easeIn(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOut((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static var version = "1.1.0.52";
}
Symbol 722 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 723 MovieClip [__Packages.com.Scores] Frame 0
class com.Scores
{
function Scores () {
}
function getScores(game, type1, type2) {
var _local1 = new Object();
_local1.score1 = 0;
_local1.score2 = 0;
if (type1 == game.RAZORBACK) {
_local1.resultString = "Razorback";
_local1.score1 = 5;
}
if (type1 == game.TROTTER) {
_local1.resultString = "Trotter";
_local1.score1 = 5;
}
if (type1 == game.SNOUTER) {
_local1.resultString = "Snouter";
_local1.score1 = 10;
}
if (type1 == game.LEANING_JOWLER) {
_local1.resultString = "Leaning Jowler";
_local1.score1 = 15;
}
if (type2 == game.RAZORBACK) {
_local1.resultString = "Razorback";
_local1.score2 = 5;
}
if (type2 == game.TROTTER) {
_local1.resultString = "Trotter";
_local1.score2 = 5;
}
if (type2 == game.SNOUTER) {
_local1.resultString = "Snouter";
_local1.score2 = 10;
}
if (type2 == game.LEANING_JOWLER) {
_local1.resultString = "Leaning Jowler";
_local1.score2 = 15;
}
if (((_local1.score1 != 0) && (_local1.score2 != 0)) && (_local1.score1 != _local1.score2)) {
_local1.resultString = "Mixed Combo";
}
if ((type1 == game.RAZORBACK) && (type2 == game.RAZORBACK)) {
_local1.resultString = "Double Razorback";
_local1.score1 = 10;
_local1.score2 = 10;
}
if ((type1 == game.TROTTER) && (type2 == game.TROTTER)) {
_local1.resultString = "Double Trotter";
_local1.score1 = 10;
_local1.score2 = 10;
}
if ((type1 == game.SNOUTER) && (type2 == game.SNOUTER)) {
_local1.resultString = "Double Snouter";
_local1.score1 = 20;
_local1.score2 = 20;
}
if ((type1 == game.LEANING_JOWLER) && (type2 == game.LEANING_JOWLER)) {
_local1.resultString = "Double Leaning Jowler";
_local1.score1 = 30;
_local1.score2 = 30;
}
if ((type1 == game.SIDER) && (type2 == game.SIDER)) {
_local1.resultString = "Sider";
_local1.score1 = 1;
_local1.score2 = 0;
}
if ((type1 == game.SIDER_DOT) && (type2 == game.SIDER_DOT)) {
_local1.resultString = "Sider";
_local1.score1 = 1;
_local1.score2 = 0;
}
if (((type1 == game.SIDER) && (type2 == game.SIDER_DOT)) || ((type1 == game.SIDER_DOT) && (type2 == game.SIDER))) {
_local1.resultString = "PIG OUT";
_local1.score1 = 0;
_local1.score2 = 0;
}
return(_local1);
}
}
Symbol 724 MovieClip [__Packages.com.ScoreBoard] Frame 0
class com.ScoreBoard extends com.Scores
{
var game, timeline, totalScore, type1, type2, piggedOut, getScores, resultPanel, scores_p1, scores_p2, scores_total_p1, scores_total_p2;
function ScoreBoard () {
super();
}
function init(_game, _timeline) {
game = _game;
timeline = _timeline;
totalScore = 0;
}
function calculateScore(_type1, _type2, _makingBacon, _piggedOut) {
trace("[calculateScore] _type1 : " + _type1);
trace("[calculateScore] _type2 : " + _type2);
trace("[calculateScore] _makingBacon : " + _makingBacon);
trace("[calculateScore] _piggedOut : " + _piggedOut);
type1 = _type1;
type2 = _type2;
piggedOut = _piggedOut;
var _local2 = getScores(game, type1, type2);
var _local3 = _local2.score1 + _local2.score2;
totalScore = totalScore + _local3;
var _local6 = 0;
if (_local2.resultString == "PIG OUT") {
if (totalScore >= 30) {
game.doVoiceOver("VOPigOutGoodScore");
} else {
game.doVoiceOver("VOPigOut");
}
}
if (_local3 > 30) {
game.doVoiceOver("VOGoodThrow");
}
if (((_local3 == _local6) || (_makingBacon)) || (_piggedOut)) {
totalScore = 0;
}
if (_piggedOut) {
var _local5 = "PIGGED OUT";
} else {
var _local5 = (_local2.resultString + " : ") + _local3;
}
if (_makingBacon) {
addMakingBaconPanel();
} else {
var _local8 = "TOTAL : " + totalScore;
addResultPanel(type1, type2, _local5, _local8);
}
}
function addPanel(panelName) {
var _local2 = 395;
var _local3 = {_x:_local2, _y:220};
resultPanel.removeMovieClip();
resultPanel = timeline.container.attachMovie(panelName, panelName, timeline.container.getNextHighestDepth(), _local3);
var _local5 = new mx.transitions.Tween(resultPanel, "_x", mx.transitions.easing.Strong.easeOut, 0, _local2, 20, false);
return(resultPanel);
}
function addResultPanel(_type1, _type2, _resultString, _totalScore) {
resultPanel = addPanel("resultPanel");
resultPanel._this = this;
resultPanel.resultText.text = _resultString;
resultPanel.resultScore.text = _totalScore;
resultPanel.pigDisplay1.gotoAndStop(_type1);
resultPanel.pigDisplay2.gotoAndStop(_type2);
if (totalScore == 0) {
resultPanel.but_bank._visible = false;
}
resultPanel.but_continue.onRelease = function () {
trace("this._parent._this.totalScore : " + this._parent._this.totalScore);
if (this._parent._this.totalScore == 0) {
this._parent._this.bank();
} else {
this._parent._parent._parent.game.nextPlayer();
}
var _local2 = new mx.transitions.Tween(this._parent, "_x", mx.transitions.easing.Strong.easeOut, this._parent._x, 1000, 32, false);
};
resultPanel.but_bank.onRelease = function () {
trace("this._parent._this.totalScore : " + this._parent._this.totalScore);
if (this._parent._this.totalScore >= 30) {
this._parent._parent._parent.game.doVoiceOver("VObankedGoodScore");
} else {
this._parent._parent._parent.game.doVoiceOver("VObankedUnder30");
}
this._parent._this.bank();
var _local2 = new mx.transitions.Tween(this._parent, "_x", mx.transitions.easing.Strong.easeOut, this._parent._x, 1000, 32, false);
};
}
function addMakingBaconPanel() {
trace("[addMakingBaconPanel]");
var _local2 = 1;
while (_local2 < game.scores[game.currentPlayer].length) {
game.scores[game.currentPlayer][_local2] = 0;
_local2++;
}
displayScore(0);
resultPanel = addPanel("makingBaconPanel");
resultPanel.pigDisplay1.stop();
resultPanel.pigDisplay2.stop();
resultPanel._this = this;
new com.Hearts(resultPanel);
resultPanel.but_continue.onRelease = function () {
this._parent._this.bank();
var _local2 = new mx.transitions.Tween(this._parent, "_x", mx.transitions.easing.Strong.easeOut, this._parent._x, 1000, 32, false);
};
game.doVoiceOver("VOMakingBacon");
}
function clearScoreBoard() {
scores_p1.text = "";
scores_p2.text = "";
scores_total_p1.text = "";
scores_total_p2.text = "";
}
function displayScore(sc) {
game.scores[game.currentPlayer][game.turnNum] = sc;
this["scores_p" + game.currentPlayer].text = "";
game.score = 0;
var _local2 = 1;
while (_local2 < game.scores[game.currentPlayer].length) {
this["scores_p" + game.currentPlayer].text = this["scores_p" + game.currentPlayer].text + (game.scores[game.currentPlayer][_local2] + newline);
game.score = game.score + game.scores[game.currentPlayer][_local2];
_local2++;
}
this["scores_total_p" + game.currentPlayer].text = game.score;
if (game.currentPlayer == 1) {
game.score1 = game.score;
} else {
game.score2 = game.score;
}
}
function bank() {
displayScore(totalScore);
totalScore = 0;
trace("[bank] game : " + game);
game.doNextTurn("VObanked");
}
}
Symbol 725 MovieClip [__Packages.com.Hearts] Frame 0
class com.Hearts extends MovieClip
{
var timeline, myint;
function Hearts (_timeline) {
super();
timeline = _timeline;
pause();
}
function pause() {
myint = setInterval(function (_this) {
_this.execute();
clearInterval(_this.myint);
}, 600, this);
}
function execute() {
var _local7 = 1;
while (_local7 < 10) {
var _local4 = 300;
var _local2 = 50;
var _local6 = 0;
var _local5 = -25;
var _local3 = timeline.attachMovie("heart", "heart", timeline.getNextHighestDepth());
var _local9 = new mx.transitions.Tween(_local3, "_xscale", mx.transitions.easing.Regular.easeOut, 100, 0, _local2, false);
var _local8 = new mx.transitions.Tween(_local3, "_yscale", mx.transitions.easing.Regular.easeOut, 100, 0, _local2, false);
var _local10 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Regular.easeOut, _local6, (_local6 + random(_local4)) - (_local4 / 2), _local2, false);
_local10 = new mx.transitions.Tween(_local3, "_y", mx.transitions.easing.Regular.easeOut, _local5, _local5 - ((random(_local4) - (_local4 / 2)) / 2), _local2, false);
_local7++;
}
}
}
Symbol 726 MovieClip [__Packages.com.Controls] Frame 0
class com.Controls extends MovieClip
{
var arm1, armStartY, game, throwbut, but_reset, but_buy, but_help;
function Controls () {
super();
trace("Controls");
arm1.arm2.armblur._visible = false;
armStartY = arm1.arm2._y;
}
function init(_game) {
trace("Controls init");
game = _game;
throwbut.onPress = function () {
if (!_root.throwDone) {
_root.throwDone = true;
this._parent.armDown();
var _local3 = this._parent.arm1.arm2;
var _local4 = _local3._totalframes / 2;
if (_local3._currentframe <= _local4) {
var _local5 = _local3._currentframe / _local3._totalframes;
} else {
var _local5 = 1 - (_local3._currentframe / _local3._totalframes);
}
this._parent.game.throwPig(_local5);
this._parent.game.whichPlayerScreen.removePanel();
}
};
but_reset.onRollOver = function () {
this.resetMC.gotoAndStop(2);
};
but_reset.onRollOut = function () {
this.resetMC.gotoAndStop(1);
};
but_reset.onPress = function () {
trace("but_reset.onPress");
_root.gotoAndStop("splash");
};
but_buy.onPress = function () {
trace("but_buy.onPress");
_root.buynow._visible = true;
};
but_buy.onRollOver = function () {
this.buyMC.gotoAndStop(2);
};
but_buy.onRollOut = function () {
this.buyMC.gotoAndStop(1);
};
but_help.onPress = function () {
_root.instructions._visible = true;
_root.instructions.gotoAndStop(2);
_root.instructions.but_next._visible = true;
_root.instructions.but_close.onPress = function () {
trace("DONE");
this._parent._visible = false;
};
};
}
function armDown() {
trace("armDown");
arm1.arm2.armblur._visible = true;
arm1.pig1._visible = false;
arm1.pig2._visible = false;
var _local2 = new mx.transitions.Tween(arm1.arm2, "_y", mx.transitions.easing.Regular.easeOut, arm1.arm2._y, arm1.arm2._y + 450, 20, false);
}
function armUp() {
_root.throwDone = false;
arm1.arm2.armblur._visible = true;
var _local3 = new mx.transitions.Tween(arm1.arm2, "_y", mx.transitions.easing.Regular.easeIn, arm1.arm2._y, armStartY, 15, false);
arm1.arm2.onEnterFrame = function () {
if (this._y == this._parent._parent.armStartY) {
delete this.onEnterFrame;
this.armblur._visible = false;
this._parent.pig1._visible = true;
this._parent.pig2._visible = true;
}
};
}
}
Symbol 727 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 728 MovieClip [__Packages.com.PigTypes] Frame 0
class com.PigTypes
{
function PigTypes () {
}
var RAZORBACK = "Razorback";
var TROTTER = "Trotter";
var SNOUTER = "Snouter";
var LEANING_JOWLER = "Leaning Jowler";
var SIDER = "Sider";
var SIDER_DOT = "Sider Dot";
}
Symbol 729 MovieClip [__Packages.com.Game] Frame 0
class com.Game extends com.PigTypes
{
var timeline, container, controls, scoreboard, currentPlayer, turnNum, scores, pig1, pig2, piggedOut, makingBacon, score, whichPlayerScreen;
function Game (_container, _timeline) {
super();
timeline = _timeline;
container = _container;
controls = timeline.Controls;
scoreboard = timeline.ScoreBoard;
}
function init() {
scoreboard.clearScoreBoard();
currentPlayer = 1;
turnNum = 1;
scores = [];
scores[1] = [];
scores[2] = [];
nextPlayer();
controls.init(this);
scoreboard.init(this, timeline);
}
function clearPigs() {
pig1.removePig();
pig2.removePig();
}
function getPigType() {
var _local1 = new com.PigTypeSelector();
return(_local1.getPigType());
}
function throwPig(power) {
piggedOut = false;
power = power + 0.25;
trace("[game] power : " + power);
var _local3 = (-30 + (random(30) / 10)) * power;
var _local4 = (10 + (random(30) / 10)) * power;
var _local15 = (random(10) / 30) * power;
var _local5 = 1;
trace("xtra : " + _local5);
trace("xpower : " + _local3);
var _local6 = 50;
var _local8 = 130;
var _local7 = 250;
var _local9 = 250;
pig2 = new com.Ball(2, {type:getPigType(), startx:_local8, starty:_local9, xSpeed:_local3, ySpeed:_local4, spin:_local15, timeline:container, game:this});
pig1 = new com.Ball(1, {type:getPigType(), startx:_local6, starty:_local7, xSpeed:_local3, ySpeed:_local4, spin:_local15, timeline:container, game:this});
var _local12 = new com.ThrowingHand(container, this);
}
function ballStopped() {
trace("[game] ballStopped");
if (pig1.ballStopped && (pig2.ballStopped)) {
var _local2 = pig1.ball._x - pig2.ball._x;
var _local3 = pig1.ball._y - pig2.ball._y;
var _local4 = Math.abs(Math.sqrt((_local2 * _local2) + (_local3 * _local3)));
((_local4 < 36) ? ((makingBacon = true)) : ((makingBacon = false)));
scoreboard.calculateScore(pig1.type, pig2.type, makingBacon, piggedOut);
}
}
function nextPlayer(VO) {
trace("[game] nextPlayer");
clearPigs();
controls.armUp();
if ((pigcount++) == 5) {
pigcount = 1;
doVoiceOver("VO_5thTime");
}
}
function bounceSfx(str) {
if (str == "collide") {
timeline.sfx.gotoAndPlay("bounce1");
} else if (str == "pig") {
timeline.sfx.gotoAndPlay("bounce2");
} else {
timeline.sfx.gotoAndPlay("bounce2");
}
}
function doVoiceOver(VO) {
stopAllSounds();
if (VO == "VO_5thTime") {
trace("doVoiceOver : VO_5thTime");
var _local3 = [];
_local3.push({frm:"dyathinkhesgonigtoeollagain", txt:"Do you think he's going to roll again?"});
_local3.push({frm:"greedlittlepiggy", txt:"Greedy little piggy, ain't he!"});
var _local5 = random(_local3.length);
}
if (VO == "VObankedUnder30") {
trace("doVoiceOver : VObankedUnder30");
var _local3 = [];
_local3.push({frm:"fellalosthisbottle", txt:"Fella lost his bottle don't yer know"});
_local3.push({frm:"whataboar", txt:"what a boar!"});
var _local5 = random(_local3.length);
}
if (VO == "VObankedGoodScore") {
trace("doVoiceOver : VObankedGoodScore");
var _local3 = [];
_local3.push({frm:"allthewaytomarket", txt:"This little piggy can go all the way to market."});
var _local5 = random(_local3.length);
}
if (VO == "VOPigOutGoodScore") {
trace("doVoiceOver : VOPigOutGoodScore");
var _local3 = [];
_local3.push({frm:"sillypiggyshouldhavebanked", txt:"Silly piggy should have banked!"});
_local3.push({frm:"triedtohogallhispoints", txt:"Tried to hog all his points!"});
var _local5 = random(_local3.length);
}
if (VO == "VOPigOut") {
trace("doVoiceOver : VOPigOut");
var _local3 = [];
_local3.push({frm:"madeapigsearofthatone", txt:"Made a pigs ear of that one!"});
var _local5 = random(_local3.length);
}
if (VO == "VOMakingBacon") {
trace("doVoiceOver : VOMakingBacon");
var _local3 = [];
_local3.push({frm:"wontbebringinghomethebacon", txt:"He certainly won't be bringing home the bacon now"});
var _local5 = random(_local3.length);
}
if (VO == "VOGoodThrow") {
trace("doVoiceOver : VOGoodThrow");
var _local3 = [];
_local3.push({frm:"likethefellowsstyle", txt:"Like the fellas style."});
_local3.push({frm:"whatacorker", txt:"what an absolute porker!"});
var _local5 = random(_local3.length);
}
timeline.sfx.gotoAndStop(String(_local3[_local5].frm));
_root.pigvo = _local3[_local5].txt;
timeline.gamebg.gotoAndPlay(2);
}
function doNextTurn() {
pigcount = 1;
if (_global.multiplayer) {
if (currentPlayer == 2) {
turnNum++;
}
((currentPlayer == 1) ? ((currentPlayer = 2)) : ((currentPlayer = 1)));
scoreboard["ptitle" + currentPlayer].play();
} else {
turnNum++;
}
if (turnNum > 5) {
var _local3 = new com.GameOverScreen(container, this, score);
} else {
if (_global.multiplayer) {
whichPlayerScreen = new com.WhichPlayerScreen(this, timeline, currentPlayer);
}
nextPlayer();
}
}
var pigcount = 1;
var pigTypes = [com.PigTypes.prototype.RAZORBACK, com.PigTypes.prototype.TROTTER, com.PigTypes.prototype.SNOUTER, com.PigTypes.prototype.LEANING_JOWLER, com.PigTypes.prototype.SIDER, com.PigTypes.prototype.SIDER_DOT];
}
Symbol 730 MovieClip [__Packages.com.PigTypeSelector] Frame 0
class com.PigTypeSelector extends com.PigTypes
{
var SIDER, SIDER_DOT, RAZORBACK, TROTTER, SNOUTER, LEANING_JOWLER;
function PigTypeSelector () {
super();
}
function getPigType() {
var _local4;
var _local2;
var _local3 = random(100);
var _local6 = 28;
var _local8 = 28;
var _local7 = 14;
var _local5 = 14;
var _local9 = 10;
var _local10 = 5;
_local2 = 0;
_local4 = SIDER;
if ((_local3 >= 0) && (_local3 < (_local2 + _local6))) {
_local4 = SIDER;
}
_local2 = _local2 + _local6;
if ((_local3 >= _local2) && (_local3 < (_local2 + _local8))) {
_local4 = SIDER_DOT;
}
_local2 = _local2 + _local8;
if ((_local3 >= _local2) && (_local3 < (_local2 + _local7))) {
_local4 = RAZORBACK;
}
_local2 = _local2 + _local7;
if ((_local3 >= _local2) && (_local3 < (_local2 + _local5))) {
_local4 = TROTTER;
}
_local2 = _local2 + _local5;
if ((_local3 >= _local2) && (_local3 < (_local2 + _local9))) {
_local4 = SNOUTER;
}
_local2 = _local2 + _local9;
if ((_local3 >= _local2) && (_local3 < (_local2 + _local10))) {
_local4 = LEANING_JOWLER;
}
return(_local4);
}
}
Symbol 731 MovieClip [__Packages.com.Ball] Frame 0
class com.Ball extends MovieClip
{
var limitR, timeline, type, game, xSpeed, ySpeed, spin, ball, shad, pig, dropHit, bounceNum, isHit, otherBall, ballStopped;
function Ball (id, o) {
super();
if (_root.multiplayer) {
limitR = 450;
} else {
limitR = 550;
}
timeline = o.timeline;
type = o.type;
game = o.game;
xSpeed = o.xSpeed;
ySpeed = o.ySpeed;
spin = o.ySpeed;
var _local6 = "PIG_" + o.type;
ball = timeline.attachMovie("Ball", "ball" + id, timeline.getNextHighestDepth(), {_x:o.startx, _y:o.starty, classInstance:this});
var _local7 = timeline._parent.shadcontainer;
shad = _local7.attachMovie(_local6, "shad" + id, _local7.getNextHighestDepth(), {_x:o.startx, _y:o.starty});
pig = timeline.attachMovie(_local6, "pig" + id, timeline.getNextHighestDepth(), {_x:o.startx, _y:o.starty});
var _local9 = new Color(shad);
_local9.setRGB("0x00000");
shad._alpha = 20;
shad._yscale = 30;
shad.stop();
ball._alpha = 0;
dropHit = false;
ball.onEnterFrame = mx.utils.Delegate.create(this, OEF);
bounceNum = 0;
if (!_global.ballArr) {
_global.ballArr = [];
}
(ball ? (_global.ballArr.push(ball)) : 0);
}
function removePig() {
ball.removeMovieClip();
shad.removeMovieClip();
pig.removeMovieClip();
}
function OEF() {
var _local10 = ball._x;
ball._x = ball._x - xSpeed;
ball._y = ball._y - ySpeed;
if (xSpeed > 0) {
xSpeed = xSpeed - (startelasticity / 4);
} else if (xSpeed < 0) {
xSpeed = xSpeed + (startelasticity / 4);
} else {
xSpeed = 0;
}
ySpeed = ySpeed - gravity;
((elasticity > 0) ? ((elasticity = elasticity - elasticityIntertia)) : 0);
if (ball._y > limitB) {
isHit = false;
otherBall.classInstance.isHit = false;
ball._y = limitB;
ySpeed = -(ySpeed * elasticity);
if (Math.abs(ySpeed) < 2) {
stopBounce();
}
bounceNum++;
if (bounceNum < 4) {
if (bounceNum == (random(4) + 1)) {
game.bounceSfx("pig");
} else {
game.bounceSfx("bounce");
}
}
}
if (ball._y > 600) {
stopBounce();
}
if (ball._x > limitR) {
ball._x = limitR;
xSpeed = -(xSpeed * startelasticity);
isHit = false;
otherBall.classInstance.isHit = false;
}
if ((xSpeed >= 0) && (ball._x < limitL)) {
ball._x = limitL;
xSpeed = -(xSpeed * startelasticity);
isHit = false;
otherBall.classInstance.isHit = false;
}
shad._x = ball._x;
shad._y = (limitB - (ball._x / 2.35)) + 15;
pig._x = ball._x;
pig._y = ball._y - (ball._x / 2.35);
shad.gotoAndStop(pig._currentframe);
if (bounceNum <= 1) {
var _local8 = pig._totalframes;
var _local9 = pig._currentframe;
if (bounceNum == 0) {
_local9 = _local9 + 2;
}
if (bounceNum == 1) {
_local9 = _local9 + 1;
}
((_local9 > _local8) ? (_local9 = 1) : 0);
((_local9 < 0) ? (_local9 = _local8) : 0);
pig.gotoAndStop(_local9);
}
if (bounceNum >= 2) {
var _local9 = pig._currentframe;
if (_local9 != 1) {
pig.nextFrame();
}
}
pig.stop();
for (var _local7 in _global.ballArr) {
otherBall = _global.ballArr[_local7];
if (otherBall != ball) {
var _local3 = otherBall._x - ball._x;
var _local4 = otherBall._y - ball._y;
var _local6 = Math.abs(Math.sqrt((_local3 * _local3) + (_local4 * _local4)));
if (((xSpeed <= 0) && (otherBall.classInstance.xSpeed <= 0)) || ((xSpeed >= 0) && (otherBall.classInstance.xSpeed >= 0))) {
var _local5 = false;
} else {
var _local5 = true;
}
if ((Math.abs(_local3) < 34) && (_local5)) {
if ((!isHit) && (!otherBall.classInstance.isHit)) {
game.bounceSfx("collide");
trace("isHit : " + isHit);
isHit = true;
otherBall.classInstance.isHit = true;
xSpeed = -xSpeed;
otherBall.classInstance.xSpeed = -otherBall.classInstance.xSpeed;
}
}
}
}
}
function stopBounce() {
trace("[stopBounce]");
delete ball.onEnterFrame;
xSpeed = 0;
ySpeed = 0;
ballStopped = true;
game.ballStopped();
}
var nosOfBalls = 2;
var elasticity = 0.9;
var startelasticity = 0.9;
var elasticityIntertia = 0.005;
var gravity = 1.1;
var limitT = 0;
var limitB = 390;
var limitL = 170;
}
Symbol 732 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 733 MovieClip [__Packages.com.ThrowingHand] Frame 0
class com.ThrowingHand extends MovieClip
{
var game, timeline, hand, myint, myint2;
function ThrowingHand (_timeline, _game) {
super();
game = _game;
timeline = _timeline;
execute();
}
function execute() {
hand = timeline.attachMovie("hand_throw", "hand_throw", timeline.getNextHighestDepth());
var _local2 = new mx.transitions.Tween(hand, "_x", mx.transitions.easing.Strong.easeOut, START_X, START_X + TRAVEL_X, IN_SPEED, false);
var _local3 = new mx.transitions.Tween(hand, "_y", mx.transitions.easing.Strong.easeOut, START_Y, START_Y + TRAVEL_Y, IN_SPEED * 2, false);
hand._xscale = 120;
hand._yscale = 120;
myint = setInterval(function (_this) {
_this.armOut();
clearInterval(_this.myint);
}, 400, this);
}
function deleteArm() {
trace("[deleteArm]");
hand.removeMovieClip();
}
function armOut() {
trace("armOut");
hand.play();
var _local2 = new mx.transitions.Tween(hand, "_x", mx.transitions.easing.Strong.easeOut, hand._x, START_X - 50, IN_SPEED * 3, false);
var _local3 = new mx.transitions.Tween(hand, "_y", mx.transitions.easing.Strong.easeOut, hand._y, START_Y, IN_SPEED * 2, false);
myint2 = setInterval(function (_this) {
_this.deleteArm();
clearInterval(_this.myint2);
}, 1000, this);
}
var IN_SPEED = 10;
var START_X = -170;
var START_Y = 60;
var TRAVEL_X = 150;
var TRAVEL_Y = -100;
}
Symbol 734 MovieClip [__Packages.com.GameOverScreen] Frame 0
class com.GameOverScreen
{
var game, timeline, score, mc, gameOverPanel;
function GameOverScreen (_timeline, _game, _score) {
game = _game;
timeline = _timeline;
score = _score;
addPanel();
}
function addPanel(panelName) {
var _local4 = 385;
var _local5 = {_x:_local4, _y:190};
if (_global.multiplayer) {
mc = "GameOverPanel2player";
} else {
mc = "GameOverPanel";
}
gameOverPanel = timeline.attachMovie(mc, "GameOverPanel", timeline.getNextHighestDepth(), _local5);
var _local6 = new mx.transitions.Tween(gameOverPanel, "_x", mx.transitions.easing.Strong.easeOut, 0, _local4, 20, false);
if (!_global.multiplayer) {
gameOverPanel.score = score;
} else if (game.score1 > game.score2) {
gameOverPanel.playerid = 1;
gameOverPanel.score = game.score1;
} else {
gameOverPanel.playerid = 2;
gameOverPanel.score = game.score2;
}
gameOverPanel.but_continue.onRelease = function () {
var _local3 = new mx.transitions.Tween(this._parent, "_x", mx.transitions.easing.Strong.easeOut, this._parent._x, 1000, 32, false);
_root.gotoAndStop("splash");
};
gameOverPanel.done = function () {
var _local3 = new mx.transitions.Tween(this._parent, "_x", mx.transitions.easing.Strong.easeOut, this._parent._x, 1000, 32, false);
_root.gotoAndStop("splash");
};
}
}
Symbol 735 MovieClip [__Packages.com.WhichPlayerScreen] Frame 0
class com.WhichPlayerScreen
{
var game, timeline, playerid, whichPlayerPanel, status, myInt;
function WhichPlayerScreen (_game, _timeline, _playerid) {
game = _game;
timeline = _timeline;
playerid = _playerid;
addPanel();
}
function addPanel() {
var _local2 = 460;
var _local3 = {_x:_local2, _y:310};
whichPlayerPanel = timeline.containerNextPlayer.attachMovie("WhichPlayerScreen", "WhichPlayerScreen", timeline.containerNextPlayer.getNextHighestDepth(), _local3);
whichPlayerPanel.playerid = playerid;
new mx.transitions.Tween(whichPlayerPanel, "_x", mx.transitions.easing.Strong.easeOut, 0, _local2, 20, false);
status = true;
myInt = setInterval(function (_this) {
_this.removePanel();
}, 2000, this);
}
function removePanel() {
trace("[removePanel]");
if (status) {
status = false;
clearInterval(myInt);
new mx.transitions.Tween(whichPlayerPanel, "_x", mx.transitions.easing.Strong.easeOut, whichPlayerPanel._x, 1000, 32, false);
}
}
}
Symbol 78 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 108 MovieClip [Controls] Frame 1
#initclip 21
Object.registerClass("Controls", com.Controls);
#endinitclip
Symbol 119 MovieClip Frame 1
stop();
Symbol 134 MovieClip Frame 1
stop();
Symbol 136 MovieClip [Scoreboard] Frame 1
#initclip 20
Object.registerClass("Scoreboard", com.ScoreBoard);
#endinitclip
onEnterFrame = function () {
if (_root.multiplayer) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
};
stop();
Symbol 162 MovieClip [hand_throw] Frame 11
stop();
Symbol 162 MovieClip [hand_throw] Frame 22
stop();
Symbol 501 Button
on (press) {
offsetDo = "down";
}
on (release, releaseOutside) {
offsetDo = "none";
}
Symbol 502 Button
on (press) {
offsetDo = "up";
}
on (release, releaseOutside) {
offsetDo = "none";
}
Symbol 508 MovieClip [GameOverPanel] Frame 1
function emailValidator(emailInput) {
if ((((((((((emailInput.length < 6) || (emailInput.indexOf(",") >= 0)) || (emailInput.indexOf(";") >= 0)) || (emailInput.indexOf(":") >= 0)) || (emailInput.indexOf("/") >= 0)) || (emailInput.indexOf(" ") >= 0)) || (emailInput.indexOf("@") <= 0)) || (emailInput.indexOf("@") != emailInput.lastIndexOf("@"))) || (emailInput.lastIndexOf(".") < emailInput.indexOf("@"))) || ((emailInput.lastIndexOf(".") + 3) > emailInput.length)) {
r = false;
} else {
r = true;
}
return(r);
}
function lTrim(str) {
tstr = "";
i = 0;
while (i < str.length) {
((str.charCodeAt(i) > 10) ? ((tstr = tstr + str.charAt(i))) : 0);
i++;
}
return(tstr);
}
but_mainmenu.onRelease = done;
but_hiscores.onRelease = function () {
gotoAndStop ("highscores");
};
but_submit.onRelease = function () {
if (my_name.length > 0) {
nextFrame();
}
};
stop();
Symbol 508 MovieClip [GameOverPanel] Frame 2
((!score) ? ((score = random(50))) : 0);
lv = new LoadVars();
lv.my_name = my_name;
lv.score = score;
lv.optin = false;
lv.sendAndLoad((_global.siteurl + "/asp/register.asp?cachebuster=") + random(999999), lv, "POST");
trace(lv);
lv.onLoad = function (success) {
nextFrame();
};
stop();
Symbol 508 MovieClip [GameOverPanel] Frame 3
var theDateObj;
theDateObj = new Date();
var months = new Array(12);
months[0] = "January";
months[1] = "February";
months[2] = "March";
months[3] = "April";
months[4] = "May";
months[5] = "June";
months[6] = "July";
months[7] = "August";
months[8] = "September";
months[9] = "October";
months[10] = "November";
months[11] = "December";
_root.titleText = months[theDateObj.getMonth()] + " - TOP 50 SCORES";
BuildChart = function () {
i = 1;
while (i < 11) {
mc = "scorerow" + i;
duplicateMovieClip ("scorerow", mc, i);
this[mc]._y = scorerow._y + ((i - 1) * 17);
i++;
}
};
RemoveChart = function () {
chartClose = 1;
i = 1;
while (i < 11) {
mc = "scorerow" + i;
removeMovieClip(mc);
i++;
}
gotoAndPlay (1);
};
offset = 0;
lv = new LoadVars();
lv.tablename = tablename;
lv.sendAndLoad((_global.siteurl + "/asp/highscores.asp?cachebuster=") + random(999999), lv, "POST");
lv.onLoad = function (success) {
loadingscorestxt._visible = false;
tn = new Array();
ts = new Array();
for (i in lv) {
(((i != "tablename") and (i != "onLoad")) ? ((str = lTrim(i))) : 0);
}
spl = str.split(",");
i = 0;
while (i < 51) {
ns = spl[i].split(":");
tn[i] = ns[0];
ts[i] = ns[1];
i++;
}
};
this.onEnterFrame = function () {
i = 0;
while (i < 11) {
ind = i + offset;
mc = "scorerow" + (i + 1);
((tn[ind] != undefined) ? ((this[mc].name = (String(ind + 1) + ". ") + tn[ind])) : ((this[mc].name = String(ind + 1) + ".")));
((ts[ind] != undefined) ? ((this[mc].score = ts[ind])) : ((this[mc].score = "")));
i++;
}
if (offsetDo == "up") {
if (offset < 40) {
offset++;
}
}
if (offsetDo == "down") {
if (offset > 0) {
offset--;
}
}
};
BuildChart();
loadingscorestxt._visible = true;
but_next.onRelease = done;
stop();
Symbol 526 MovieClip [instructions] Frame 1
but_close.onRelease = done;
but_next.onRelease = function () {
nextFrame();
};
but_next.onRollOver = function () {
this.gotoAndStop(2);
};
but_next.onRollOut = function () {
this.gotoAndStop(1);
};
stop();
Symbol 526 MovieClip [instructions] Frame 2
but_next.onRelease = function () {
prevFrame();
};
but_next.onRollOver = function () {
this.gotoAndStop(2);
};
but_next.onRollOut = function () {
this.gotoAndStop(1);
};
stop();
Symbol 543 MovieClip [GameOverPanel2player] Frame 1
function emailValidator(emailInput) {
if ((((((((((emailInput.length < 6) || (emailInput.indexOf(",") >= 0)) || (emailInput.indexOf(";") >= 0)) || (emailInput.indexOf(":") >= 0)) || (emailInput.indexOf("/") >= 0)) || (emailInput.indexOf(" ") >= 0)) || (emailInput.indexOf("@") <= 0)) || (emailInput.indexOf("@") != emailInput.lastIndexOf("@"))) || (emailInput.lastIndexOf(".") < emailInput.indexOf("@"))) || ((emailInput.lastIndexOf(".") + 3) > emailInput.length)) {
r = false;
} else {
r = true;
}
return(r);
}
function lTrim(str) {
tstr = "";
i = 0;
while (i < str.length) {
((str.charCodeAt(i) > 10) ? ((tstr = tstr + str.charAt(i))) : 0);
i++;
}
return(tstr);
}
but_mainmenu.onRelease = done;
but_hiscores.onRelease = function () {
gotoAndStop ("highscores");
};
but_submit.onRelease = function () {
if (my_name.length > 0) {
nextFrame();
}
};
stop();
Symbol 543 MovieClip [GameOverPanel2player] Frame 2
((!score) ? ((score = random(50))) : 0);
((!my_email) ? ((my_email = "none")) : 0);
lv = new LoadVars();
lv.my_name = my_name;
lv.my_email = my_email;
lv.score = score;
lv.optin = false;
lv.sendAndLoad((_global.siteurl + "/asp/register.asp?cachebuster=") + random(999999), lv, "POST");
lv.onLoad = function (success) {
nextFrame();
};
stop();
Symbol 543 MovieClip [GameOverPanel2player] Frame 3
var theDateObj;
theDateObj = new Date();
var months = new Array(12);
months[0] = "January";
months[1] = "February";
months[2] = "March";
months[3] = "APRIL";
months[4] = "MAY";
months[5] = "JUNE";
months[6] = "JULY";
months[7] = "August";
months[8] = "September";
months[9] = "October";
months[10] = "November";
months[11] = "December";
_root.titleText = months[theDateObj.getMonth()] + " - TOP 50 SCORES";
BuildChart = function () {
i = 1;
while (i < 11) {
mc = "scorerow" + i;
duplicateMovieClip ("scorerow", mc, i);
this[mc]._y = scorerow._y + ((i - 1) * 17);
i++;
}
};
RemoveChart = function () {
chartClose = 1;
i = 1;
while (i < 11) {
mc = "scorerow" + i;
removeMovieClip(mc);
i++;
}
gotoAndPlay (1);
};
offset = 0;
lv = new LoadVars();
lv.tablename = tablename;
lv.sendAndLoad((_global.siteurl + "/asp/highscores.asp?cachebuster=") + random(999999), lv, "POST");
lv.onLoad = function (success) {
loadingscorestxt._visible = false;
tn = new Array();
ts = new Array();
for (i in lv) {
(((i != "tablename") and (i != "onLoad")) ? ((str = lTrim(i))) : 0);
}
spl = str.split(",");
i = 0;
while (i < 51) {
ns = spl[i].split(":");
tn[i] = ns[0];
ts[i] = ns[1];
i++;
}
};
this.onEnterFrame = function () {
i = 0;
while (i < 11) {
ind = i + offset;
mc = "scorerow" + (i + 1);
((tn[ind] != undefined) ? ((this[mc].name = (String(ind + 1) + ". ") + tn[ind])) : ((this[mc].name = String(ind + 1) + ".")));
((ts[ind] != undefined) ? ((this[mc].score = ts[ind])) : ((this[mc].score = "")));
i++;
}
if (offsetDo == "up") {
if (offset < 40) {
offset++;
}
}
if (offsetDo == "down") {
if (offset > 0) {
offset--;
}
}
};
BuildChart();
loadingscorestxt._visible = true;
but_next.onRelease = done;
stop();
Symbol 552 MovieClip Frame 1
stop();
Symbol 559 MovieClip Frame 1
stop();
Symbol 562 MovieClip Frame 1
stop();
Symbol 665 MovieClip Frame 1
stop();
Symbol 665 MovieClip Frame 2
splashpig.pig.gotoAndPlay(8);
splashpig.shad.gotoAndPlay(8);
Symbol 665 MovieClip Frame 12
Symbol 665 MovieClip Frame 76
Symbol 683 MovieClip Frame 1
stop();
Symbol 683 MovieClip Frame 129
stop();
Symbol 683 MovieClip Frame 136
stop();
Symbol 683 MovieClip Frame 145
stop();
Symbol 683 MovieClip Frame 152
stop();
Symbol 683 MovieClip Frame 159
stop();
Symbol 699 MovieClip Frame 1
stop();
Symbol 705 MovieClip Frame 1
but.onRelease = function () {
this._parent._visible = false;
};
but.onRollOver = function () {
this.gotoAndStop(2);
};
but.onRollOut = function () {
this.gotoAndStop(1);
};
but_buy.onRelease = function () {
this._parent._visible = false;
getURL ("http://www.toptrumps.com/acatalog/Family_Classics.html#a67", "_blank");
};
Symbol 710 MovieClip Frame 1
stop();
Symbol 710 MovieClip Frame 2
splashpig.pig.gotoAndPlay(8);
splashpig.shad.gotoAndPlay(8);
Symbol 710 MovieClip Frame 12
speechBubble.txt = voicesfx_line;
Symbol 710 MovieClip Frame 74