Frame 1
stop();
Stage.scaleMode = "noScale";
Stage.showMenu = false;
this.onEnterFrame = function () {
var _local2 = this.getBytesLoaded() / this.getBytesTotal();
var _local3 = Math.round(_local2 * 100).toString();
percent_txt.text = _local3;
if (!isNaN(_local2)) {
if ((_local2 >= 1) && (getTimer() >= 0)) {
delete onEnterFrame;
gotoAndStop ("Init");
}
} else if ((_local2 >= 1) && (getTimer() >= 10000)) {
delete onEnterFrame;
percent_txt.text = "Loading...";
gotoAndStop ("Init");
}
};
Frame 3
function mo() {
}
function md() {
}
function saveGame(gameName, content) {
var _local1 = ("SavedGames/" + gameName) + ".xml";
saveTo = _local1;
saveContent = content;
fscommand ("flashstudio.savetofile", "saveTo,saveContent");
}
function saveScores(gameName, content) {
var _local1 = ("Scores/" + gameName) + ".xml";
saveTo = _local1;
saveContent = content;
fscommand ("flashstudio.savetofile", "saveTo,saveContent");
}
function deleteGame(gameName) {
file = ("SavedGames/" + gameName) + ".xml";
fscommand ("flashstudio.deletefile", "file");
}
function saveOptions(name, ops) {
var _local1 = ("Options/" + name) + ".xml";
saveTo = _local1;
saveContent = ops.toXML();
fscommand ("flashstudio.savetofile", "saveTo,saveContent");
}
function doneLoadingFile() {
if ((optionsToLoad.length == 0) && (gameInfoDoc.loaded)) {
gotoMenu();
full = true;
}
}
function loadNextOptionsDoc() {
optionsDoc = new XML();
optionsDoc.ignoreWhite = true;
optionsDoc.onLoad = function () {
OM.addOptions(optionsDoc);
if (optionsToLoad.length > 0) {
loadNextOptionsDoc();
} else {
doneLoadingFile();
}
};
optionsDoc.load(("http://downloads.kewlbox.com/games_online/regalsolitaire/Options/" + optionsToLoad.pop()) + ".xml");
}
function loadGame(gameName) {
doc = new XML();
doc.ignoreWhite = true;
doc.onLoad = game_mc.gameLoaded;
doc.load(("http://downloads.kewlbox.com/games_online/regalsolitaire/SavedGames/" + gameName) + ".xml");
}
function setHandCursor() {
for (var _local2 in this) {
if (this[_local2].useHandCursor) {
this[_local2].useHandCursor = false;
}
}
}
function startMusic(index) {
index = index - 1;
if (index == 0) {
index = random(tracks.length - 1) + 1;
}
var _local2 = tracks[index];
music.stop();
var _local3 = OM.getOptionsByName("General").bin.MusicVolume;
music.setVolume(_local3);
music.attachSound(_local2);
music.start(0, 10000000);
}
function gotoMenu() {
startLoop();
gotoAndStop ("Menu");
}
function startLoop() {
var _local2 = OM.getOptionsByName("General");
var _local1 = _local2.getBin();
var _local3 = _local1.MusicTrack;
if (!_local1.Mute) {
startMusic(_local3);
}
}
function saveGameInfo() {
var _local2 = "Data.electro";
saveTo = _local2;
var _local1 = new Wddx();
saveContent = _local1.serialize(gameInfo);
fscommand ("flashstudio.savetofile", "saveTo,saveContent");
}
function getSessionInfo() {
return(gameInfo);
}
stop();
var SM = Sounds.SoundManager.getInstance();
var OM = new OptionsManager();
var optionsToLoad = ["General", "Klondike", "Golf", "Scorpion"];
var tracks = ["random", "loop1.mp3", "loop2.mp3", "loop3.mp3"];
var ops = OM.getOptionsByName("General");
var bin = ops.getBin();
SM.setPlaySounds(!bin.Mute);
var optionsDoc;
loadNextOptionsDoc();
this.onMouseMove = function () {
updateAfterEvent();
};
var doc;
var path;
music_mc = this.createEmptyMovieClip("music_mc", 1234);
var music = new Sound(music_mc);
var gameInfoDoc = new XML();
gameInfoDoc.ignoreWhite = true;
gameInfoDoc.onLoad = function () {
var _local1 = new Wddx();
gameInfo = _local1.deserialize(gameInfoDoc);
doneLoadingFile();
};
gameInfoDoc.load("http://downloads.kewlbox.com/games_online/regalsolitaire/Data.electro");
Frame 13
function launchPurchaseURL() {
var _local1 = ("http://www.electrotank.com/redirectCounter.electro?n=Solitaire&r=" + screen) + "&u=http://www.electrotank.com/games/solitaireRedirect.electro";
getURL (_local1);
}
function downloadDemo() {
getURL ("http://www.kewlbox.com/games/downloadgame.cfm?gameId=128&pc=1", "_blank");
}
function gameChosen(which) {
gotoAndStop(which);
}
function downloadToPlayClicked() {
screen = "Center Button Online";
launchPurchaseURL();
}
function loadAd() {
var _local1 = OM.getOptionsByName("General");
var _local2 = _local1.getBin();
if (_local2.GameNews) {
adHolder_mc.holder_mc.loadMovie(adURL);
}
}
function showSS(who) {
ss_mc.gotoAndStop(who);
var _local1 = gameInfo.games[who];
ss_mc.won_txt.text = _local1.won;
ss_mc.lost_txt.text = _local1.lost;
ss_mc.difficulty_txt.text = _local1.difficulty;
ss_mc.played_txt.text = _local1.played;
}
function showGameFrame() {
var _local2 = 0;
while (_local2 < gameNames.length) {
var _local3 = this[gameNames[_local2]];
_local3.gotoAndStop(gameNames[_local2]);
_local2++;
}
}
function establishMouseHandling() {
var _local4 = 0;
while (_local4 < gameNames.length) {
var _local2 = this[gameNames[_local4]];
_local2.onRollOver = function () {
this.hl_mc.gotoAndStop(2);
showSS(this._name);
mo();
};
_local2.onRollOut = function () {
this.hl_mc.gotoAndStop(1);
};
_local2.onDragOut = function () {
this.hl_mc.gotoAndStop(1);
};
_local2.onRelease = function () {
var _local2 = this._name;
if (((_local2 == "Klondike") || (_local2 == "Golf")) || (_local2 == "Scorpion")) {
this.hl_mc.gotoAndStop(1);
gameChosen(this._name);
md();
} else {
downloadDemo();
}
};
_local4++;
}
}
function clicked(which) {
if (which == "options") {
options_mc.popup("General");
} else if (which == "rules") {
gotoAndStop ("Rules");
} else if (which == "scoreboard") {
gotoAndStop ("Scores");
} else if (which == "exit") {
exit();
}
}
var adURL = "http://www.electrotank.com/games/swfFiles/Solitaire/ad.swf";
var SM;
var gameNames = ["Klondike", "Osmosis", "FreeCell", "Scorpion", "Poker", "ThreeBlindMice", "Golf", "Pyramid", "Spider", "Vegas"];
loadAd();
showGameFrame();
establishMouseHandling();
Frame 18
function clicked(who) {
rules_mc.popup(who);
}
stop();
var i = 0;
while (i < gameNames.length) {
this[gameNames[i]].onRelease = function () {
clicked(this._name);
};
i++;
}
Frame 23
gotoAndStop(where);
Frame 24
gotoAndStop(where);
Symbol 22 MovieClip Frame 50
_parent._parent.removeMe(_parent);
stop();
Symbol 23 MovieClip [fireworks_ani] Frame 1
stop();
Symbol 30 MovieClip Frame 1
stop();
gotoAndStop(random(_totalframes) + 1);
Symbol 31 MovieClip [particle] Frame 1
#initclip 1
Object.registerClass("particle", com.electrotank.FireworkMC);
#endinitclip
stop();
Symbol 31 MovieClip [particle] Frame 20
Symbol 31 MovieClip [particle] Frame 24
this.onDeath();
stop();
Symbol 37 MovieClip Frame 1
function selectCard(num) {
myCard = num;
gotoAndStop(myCard);
}
function next() {
myCard++;
if (myCard > _totalframes) {
myCard = 1;
}
selectCard(myCard);
}
function back() {
myCard--;
if (myCard < 1) {
myCard = _totalframes;
}
selectCard(myCard);
}
stop();
var myCard = 1;
Symbol 102 MovieClip [card_mc] Frame 1
stop();
gotoAndStop(frame);
Symbol 110 MovieClip Frame 1
stop();
Symbol 110 MovieClip Frame 2
btn.useHandCursor = false;
Symbol 429 MovieClip [__Packages.com.electrotank.FireworkMC] Frame 0
class com.electrotank.FireworkMC extends MovieClip
{
var particle, owner, _time, onEnterFrame, _x, _y, gotoAndPlay, getDepth, swapDepths, removeMovieClip;
function FireworkMC () {
super();
}
function init() {
particle = new com.robertpenner.PhysicsParticle(this, 0, 0);
var _local2 = owner.explodeSpeed + (owner.explodeSpeedVariance * (Math.random() - 0.5));
particle.vel.reset(_local2, 0);
particle.vel.rotate(Math.random() * 360);
particle.vel.y = particle.vel.y + owner.initialVerticalSpeed;
particle.addForce("gravity", owner.gravityForce);
_time = 0;
onEnterFrame = live;
}
function live() {
if ((++_time) == lifeSpan) {
die();
}
if (_time > 1) {
var _local2 = particle.vel;
var _local7 = _x - _local2.x;
var _local5 = _y - _local2.y;
var _local6 = _x;
var _local4 = _y;
var _local3 = owner.target_mc;
_local3.lineStyle(1, owner.color, (1.1 - (_time / lifeSpan)) * 100);
_local3.moveTo(_x - _local2.x, _y - _local2.y);
_local3.lineTo(_x, _y);
}
}
function die() {
gotoAndPlay("death");
}
function onDeath() {
cleanUp();
if (getDepth() < 0) {
swapDepths(22222);
}
removeMovieClip();
}
function cleanUp() {
particle.stop();
delete particle;
}
var lifeSpan = 25;
}
Symbol 430 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");
};
}
}
}
Symbol 431 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++;
}
}
}
Symbol 432 MovieClip [__Packages.com.robertpenner.PhysicsParticle] Frame 0
class com.robertpenner.PhysicsParticle
{
var target, pos, vel, accel, friction, forces, onEnterFrame, _xProp, _yProp;
function PhysicsParticle (target, x, y, xProp, yProp) {
this.target = target;
pos = new com.robertpenner.Vector(x, y);
vel = new com.robertpenner.Vector(0, 0);
accel = new com.robertpenner.Vector(0, 0);
friction = new com.robertpenner.Vector(0, 0);
setXYProps(xProp, yProp);
forces = {};
onEnterFrame = move;
start();
}
function addForce(id_str, force_obj) {
forces[id_str] = force_obj;
force_obj.setParent(this);
}
function removeForce(id_str) {
delete forces[id_str];
}
function setPosition(x, y) {
pos.reset(x, y);
}
function getPosition() {
return(pos);
}
function setFriction(fx, fy) {
if (fy == undefined) {
fy = fx;
}
friction.reset(fx, fy);
}
function getFriction() {
return(friction);
}
function setXYProps(xp, yp) {
_xProp = ((xp == undefined) ? "_x" : (xp));
_yProp = ((yp == undefined) ? "_y" : (yp));
}
function move() {
var _local4 = 0;
var _local3 = 0;
var _local2 = forces;
for (var _local6 in _local2) {
if (!_local2[_local6].live()) {
delete _local2[_local6];
} else {
_local4 = _local4 + _local2[_local6].value.x;
_local3 = _local3 + _local2[_local6].value.y;
}
}
accel.reset(_local4, _local3);
var _local5 = vel;
_local5.plus(accel);
_local5.x = _local5.x * (1 - friction.x);
_local5.y = _local5.y * (1 - friction.y);
pos.plus(_local5);
render();
}
function render() {
target[_xProp] = pos.x;
target[_yProp] = pos.y;
}
function start() {
MovieClip.addListener(this);
}
function stop() {
MovieClip.removeListener(this);
}
function toString() {
return("[PhysicsParticle]");
}
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
}
Symbol 433 MovieClip [__Packages.com.robertpenner.Vector] Frame 0
class com.robertpenner.Vector
{
var x, y;
function Vector (xValue, yValue) {
x = xValue;
y = yValue;
}
function toString() {
var _local3 = Math.round(x * 1000) / 1000;
var _local2 = Math.round(y * 1000) / 1000;
return(((("[" + _local3) + ", ") + _local2) + "]");
}
function reset(xValue, yValue) {
x = xValue;
y = yValue;
}
function getClone() {
return(new com.robertpenner.Vector(x, y));
}
function plus(v) {
x = x + v.x;
y = y + v.y;
}
function plusNew(v) {
return(new com.robertpenner.Vector(x + v.x, y + v.y));
}
function minus(v) {
x = x - v.x;
y = y - v.y;
}
function minusNew(v) {
return(new com.robertpenner.Vector(x - v.x, y - v.y));
}
function negate() {
x = -x;
y = -y;
}
function negateNew() {
return(new com.robertpenner.Vector(-x, -y));
}
function scale(s) {
x = x * s;
y = y * s;
}
function scaleNew(s) {
return(new com.robertpenner.Vector(x * s, y * s));
}
function getLength() {
return(Math.sqrt(x * x, y * y));
}
function get length() {
return(Math.sqrt(x * x, y * y));
}
function setLength(len) {
var _local2 = getLength();
if (_local2) {
scale(len / _local2);
} else {
x = len;
}
}
function set length(len) {
var _local2 = getLength();
if (_local2) {
scale(len / _local2);
} else {
x = len;
}
//return(length);
}
function getAngle() {
return(Math.atan2(y, x) * 57.2957795130823);
}
function get angle() {
return(Math.atan2(y, x) * 57.2957795130823);
}
function setAngle(ang) {
var _local2 = getLength();
x = _local2 * Math.cos(ang * (Math.PI/180));
y = _local2 * Math.sin(ang * (Math.PI/180));
}
function set angle(ang) {
var _local2 = getLength();
x = _local2 * Math.cos(ang * (Math.PI/180));
y = _local2 * Math.sin(ang * (Math.PI/180));
//return(angle);
}
function rotate(ang) {
var _local3 = Math.cos(ang * (Math.PI/180));
var _local2 = Math.sin(ang * (Math.PI/180));
var _local5 = (x * _local3) - (y * _local2);
var _local4 = (x * _local2) + (y * _local3);
x = _local5;
y = _local4;
}
function rotateNew(ang) {
var _local2 = new com.robertpenner.Vector(x, y);
_local2.rotate(ang);
return(_local2);
}
function rotateAround(p, ang) {
var _local4 = Math.cos(ang * (Math.PI/180));
var _local3 = Math.sin(ang * (Math.PI/180));
var _local6 = ((x - p.x) * _local4) - ((y - p.y) * _local3);
var _local5 = ((x - p.x) * _local3) + ((y - p.y) * _local4);
x = _local6 + p.x;
y = _local5 + p.y;
}
function rotateAroundNew(p, ang) {
var _local2 = new com.robertpenner.Vector(x, y);
_local2.rotateAround(p, ang);
return(_local2);
}
function dot(v) {
return((x * v.x) + (y * v.y));
}
function getNormal() {
return(new com.robertpenner.Vector(-y, x));
}
function isNormalTo(v) {
return(dot(v) == 0);
}
function angleBetween(v) {
var _local3 = dot(v);
var _local2 = _local3 / (getLength() * v.getLength());
return(Math.acos(_local2) * 57.2957795130823);
}
}
Symbol 434 MovieClip [__Packages.com.electrotank.Fireworks] Frame 0
class com.electrotank.Fireworks
{
var target_mc, particleID, numParticles, gravityForce, frictionVector, __get__gravity, __get__friction, _particles, _time;
function Fireworks (host_mc, x, y, particleID, numParticles) {
var _local2 = (++numInstances) + startingDepth;
target_mc = host_mc.createEmptyMovieClip("fireworks_" + _local2, _local2);
target_mc._x = x;
target_mc._y = y;
this.particleID = particleID;
this.numParticles = numParticles;
gravityForce = new com.robertpenner.Force(0, _gravity);
frictionVector = new com.robertpenner.Vector(_friction, _friction);
}
function set gravity(g) {
_gravity = g;
gravityForce.setValue(0, g);
//return(__get__gravity());
}
function set friction(f) {
_friction = f;
frictionVector.reset(f, f);
//return(__get__friction());
}
function start() {
var _local2 = 0;
while (_local2 < numParticles) {
var _local4 = target_mc.attachMovie(particleID, "p" + _local2, _local2);
var _local3 = com.electrotank.FireworkMC(_local4);
_local3.owner = this;
_local3.init();
_local3.lifeSpan = lifeSpan + Math.floor((Math.random() - 0.5) * lifeSpanVariance);
_local3.particle.friction = frictionVector;
_particles[_local2] = _local3;
_local2++;
}
_time = 0;
MovieClip.addListener(this);
}
function onEnterFrame() {
if ((++_time) == (lifeSpan + lifeSpanVariance)) {
die();
}
}
function die() {
onEnterFrame = fade;
}
function fade() {
target_mc._alpha = target_mc._alpha - (100 / fadeFrames);
if (target_mc._alpha <= 0) {
cleanUp();
}
}
function cleanUp() {
MovieClip.removeListener(this);
var _local2 = _particles.length;
while (_local2--) {
_particles[_local2].cleanUp();
}
trace("MovieClip._listeners.length: " + MovieClip._listeners.length);
delete _particles;
target_mc.removeMovieClip();
}
static var numInstances = 0;
static var startingDepth = 2000;
var _gravity = 0.4;
var _friction = 0.06;
var explodeSpeed = 16;
var explodeSpeedVariance = 4;
var initialVerticalSpeed = -7;
var color = 10079487;
var lifeSpan = 24;
var lifeSpanVariance = 8;
var fadeFrames = 10;
}
Symbol 435 MovieClip [__Packages.com.robertpenner.Force] Frame 0
class com.robertpenner.Force
{
var _value, _life, _parent, _parentPos;
function Force (x, y, life) {
_value = new com.robertpenner.Vector(x, y);
setLife(life);
}
function setValue(x, y) {
_value.reset(x, y);
}
function getValue() {
return(_value);
}
function get value() {
return(_value);
}
function setLife(life) {
_life = ((life == undefined) ? (Infinity) : (life));
}
function getLife() {
return(_life);
}
function setParent(p) {
_parent = p;
_parentPos = p.getPosition();
}
function getParent() {
return(_parent);
}
function live() {
if ((_life--) <= 0) {
return(false);
}
update();
return(true);
}
function update() {
}
}
Symbol 436 MovieClip [__Packages.Options] Frame 0
class Options
{
var bin, name;
function Options () {
bin = new Object();
}
function save() {
}
function fromXML(info) {
setName(info.firstChild.attributes.name);
var _local3 = info.firstChild.childNodes;
var _local2 = 0;
while (_local2 < _local3.length) {
var _local5 = _local3[_local2].nodeName;
var _local4 = interpret(_local3[_local2].firstChild.nodeValue);
bin[_local5] = _local4;
_local2++;
}
}
function toXML() {
var _local2 = ("<Options name = '" + getName()) + "'>";
for (var _local3 in getBin()) {
_local2 = _local2 + (((((("<" + _local3) + ">") + getBin()[_local3].toString()) + "</") + _local3) + ">");
}
_local2 = _local2 + "</Options>";
return(_local2);
}
function getBin() {
return(bin);
}
function interpret(val) {
if (isNaN(val)) {
if (val.toLowerCase() == "true") {
val = true;
} else if (val.toLowerCase() == "false") {
val = false;
}
} else {
val = Number(val);
}
return(val);
}
function setName(val) {
name = val;
}
function getName() {
return(name);
}
}
Symbol 437 MovieClip [__Packages.Wddx] Frame 0
class Wddx
{
var tzOffset, timezoneString, wddxPacket, packet, useTimeZoneInfo;
function Wddx () {
var _local2 = 0;
while (_local2 < 256) {
if ((((_local2 < 32) && (_local2 != 9)) && (_local2 != 10)) && (_local2 != 13)) {
var _local3 = _local2.toString(16);
if (_local3.length == 1) {
_local3 = "0" + _local3;
}
et[_local2] = ("<char code='" + _local3) + "'/>";
at[_local2] = "";
} else if (_local2 < 128) {
et[_local2] = chr(_local2);
at[_local2] = chr(_local2);
} else {
et[_local2] = ("&#x" + _local2.toString(16)) + ";";
etRev[("&#x" + _local2.toString(16)) + ";"] = chr(_local2);
at[_local2] = ("&#x" + _local2.toString(16)) + ";";
atRev[("&#x" + _local2.toString(16)) + ";"] = chr(_local2);
}
_local2++;
}
et[60] = "<";
et[62] = ">";
et[38] = "&";
etRev["<"] = "<";
etRev[">"] = ">";
etRev["&"] = "&";
at[60] = "<";
at[62] = ">";
at[38] = "&";
at[39] = "'";
at[34] = """;
atRev["<"] = "<";
atRev[">"] = ">";
atRev["&"] = "&";
atRev["'"] = "'";
atRev["""] = "\"";
tzOffset = new Date().getTimezoneOffset();
if (tzOffset >= 0) {
timezoneString = "-";
} else {
timezoneString = "+";
}
timezoneString = timezoneString + ((Math.floor(Math.abs(tzOffset) / 60) + ":") + (Math.abs(tzOffset) % 60));
}
function serialize(rootObj) {
delete wddxPacket;
var _local2 = new XML();
packet = new XML();
packet.appendChild(_local2.createElement("wddxPacket"));
wddxPacket = packet.firstChild;
wddxPacket.attributes.version = "1.0";
wddxPacket.appendChild(_local2.createElement("header"));
wddxPacket.appendChild(_local2.createElement("data"));
if (serializeValue(rootObj, wddxPacket.childNodes[1])) {
return(packet);
}
return(null);
}
function serializeValue(obj, node) {
var _local4 = true;
var _local6 = obj.valueOf();
var _local9 = null;
var _local7 = new XML();
if (obj == null) {
node.appendChild(_local7.createElement("null"));
} else if (typeof(_local6) == "string") {
serializeString(_local6, node);
} else if (typeof(_local6) == "number") {
if (typeof(obj.getTimezoneOffset) == "function") {
if (useTimeZoneInfo) {
_local9 = timezoneString;
}
node.appendChild(_local7.createElement("dateTime"));
node.lastChild.appendChild(_local7.createTextNode(((((((((((obj.getFullYear() + "-") + (obj.getMonth() + 1)) + "-") + obj.getDate()) + "T") + obj.getHours()) + ":") + obj.getMinutes()) + ":") + obj.getSeconds()) + _local9));
} else {
node.appendChild(new XML().createElement("number"));
node.lastChild.appendChild(new XML().createTextNode(_local6));
}
} else if (typeof(_local6) == "boolean") {
node.appendChild(_local7.createElement("boolean"));
node.lastChild.attributes.value = _local6;
} else if (typeof(obj) == "object") {
if (typeof(obj.wddxSerialize) == "function") {
_local4 = obj.wddxSerialize(this, node);
} else if ((typeof(obj.join) == "function") && (typeof(obj.reverse) == "function")) {
node.appendChild(_local7.createElement("array"));
node.lastChild.attributes.length = obj.length;
var _local3 = 0;
while (_local4 && (_local3 < obj.length)) {
_local4 = serializeValue(obj[_local3], node.lastChild);
_local3++;
}
} else {
node.appendChild(_local7.createElement("struct"));
if (typeof(obj.wddxSerializationType) == "string") {
node.lastChild.attributes.type = obj.wddxSerializationType;
}
for (var _local8 in obj) {
if (_local8 != "wddxSerializationType") {
_local4 = serializeVariable(_local8, obj[_local8], node.lastChild);
if (!_local4) {
break;
}
}
}
}
} else {
_local4 = false;
}
return(_local4);
}
function serializeVariable(name, obj, node) {
var _local2 = true;
var _local3 = new XML();
if (typeof(obj) != "function") {
node.appendChild(_local3.createElement("var"));
node.lastChild.attributes.name = (preserveVarCase ? (serializeAttr(name)) : (serializeAttr(name.toLowerCase())));
_local2 = serializeValue(obj, node.lastChild);
}
return(_local2);
}
function serializeString(s, node) {
var _local5 = "";
var _local7 = new XML();
var _local6 = s.length;
node.appendChild(_local7.createElement("string"));
var _local2 = 0;
while (_local2 < _local6) {
var _local4 = substring(s, _local2 + 1, 1);
_local5 = _local5 + et[ord(substring(s, _local2 + 1, 1))];
_local2++;
}
node.lastChild.appendChild(_local7.createTextNode(_local5));
}
function serializeAttr(s) {
var _local3 = "";
var _local4 = s.length;
var _local2 = 0;
while (_local2 < _local4) {
_local3 = _local3 + at[ord(substring(s, _local2 + 1, 1))];
_local2++;
}
return(_local3);
}
function deserialize(wddxPacket) {
if (typeof(wddxPacket) != "object") {
wddxPacket = new XML(wddxPacket);
}
var _local5 = new XML();
var _local4 = new Array();
var _local2;
var _local6 = new Object();
while (wddxPacket.nodeName == null) {
wddxPacket = wddxPacket.firstChild;
}
_local5 = wddxPacket;
if (_local5.nodeName.toLowerCase() == "wddxpacket") {
_local4 = _local5.childNodes;
_local2 = 0;
while ((_local4[_local2].nodeName.toLowerCase() != "data") && (_local2 < _local4.length)) {
_local2++;
}
if (_local2 < _local4.length) {
_local6 = deserializeNode(_local4[_local2].firstChild);
return(_local6);
}
return(null);
}
return(null);
}
function deserializeNode(node) {
var _local9 = node.nodeName.toLowerCase();
if (_local9 == "number") {
var _local7 = node.firstChild.nodeValue;
return(Number(_local7));
}
if (_local9 == "boolean") {
var _local7 = String(node.attributes.value).toLowerCase() == "true";
return(_local7);
}
if (_local9 == "string") {
if (node.childNodes.length > 1) {
var _local7 = "";
var _local4 = 0;
_local4 = 0;
while (_local4 < node.childNodes.length) {
if (node.childNodes[_local4].nodeType == 3) {
_local7 = _local7 + deserializeString(node.childNodes[_local4].nodeValue);
} else if (node.childNodes[_local4].nodeName == "char") {
_local7 = _local7 + chr(parseInt(node.childNodes[_local4].attributes.code, 16));
}
_local4++;
}
} else {
var _local7 = deserializeString(node.firstChild.nodeValue);
}
return(_local7);
}
if (_local9 == "array") {
var _local7 = new Array();
var _local15 = 0;
var _local4 = 0;
while (_local4 < node.attributes.length) {
_local7[_local4] = deserializeNode(node.childNodes[_local4].cloneNode(true));
_local4++;
}
return(_local7);
}
if (_local9 == "datetime") {
var _local10 = node.firstChild.nodeValue;
var _local13 = _local10.indexOf("T");
var _local8 = _local10.indexOf("+");
var _local11 = new Array();
var _local12 = new Array();
var _local14 = new Array();
var _local7 = new Date();
if (_local8 == -1) {
_local8 = _local10.lastIndexOf("-");
if (_local8 < _local13) {
_local8 = -1;
}
}
_local11 = _local10.slice(0, _local13).split("-");
_local12 = _local10.slice(_local13 + 1, _local8).split(":");
_local14 = _local10.slice(_local8).split(":");
_local7.setFullYear(parseInt(_local11[0]), parseInt(_local11[1]) - 1, parseInt(_local11[2]));
_local7.setHours(parseInt(_local12[0]), parseInt(_local12[1]));
if (_local8 != -1) {
tzOffset = (parseInt(_local14[0]) * 60) + parseInt(_local14[1]);
_local7.setMinutes(_local7.getMinutes() - (_local7.getTimezoneOffset() + tzOffset));
}
return(_local7);
}
if (_local9 == "struct") {
var _local7 = new Object();
var _local4 = 0;
while (_local4 < node.childNodes.length) {
if (node.childNodes[_local4].nodeName.toLowerCase() == "var") {
_local7[deserializeAttr(node.childNodes[_local4].attributes.name)] = deserializeNode(node.childNodes[_local4].firstChild);
}
_local4++;
}
return(_local7);
}
if (_local9 == "recordset") {
var _local7 = new WddxRecordset(node.attributes.fieldNames.split(",").reverse(), parseInt(node.attributes.rowCount));
var _local4 = node.childNodes.length - 1;
while (_local4 >= 0) {
if (node.childNodes[_local4].nodeName.toLowerCase() == "field") {
var _local5 = deserializeAttr(node.childNodes[_local4].attributes.name);
_local7[_local5].wddxSerializationType = "field";
var _local3 = node.childNodes[_local4].childNodes.length - 1;
while (_local3 >= 0) {
_local7[_local5][_local3] = new Object();
var _local6 = deserializeNode(node.childNodes[_local4].childNodes[_local3]);
_local7.setField(_local3, _local5, _local6);
_local3--;
}
}
_local4--;
}
return(_local7);
}
}
function deserializeAttr(attr) {
var _local7 = attr.length;
var _local3 = 0;
var _local2;
var _local6 = "";
while (_local3 < _local7) {
_local2 = substring(attr, _local3 + 1, 1);
if (_local2 == "&") {
var _local4 = _local2;
do {
_local2 = substring(attr, _local3 + 1, 1);
_local4 = _local4 + _local2;
_local3++;
} while (_local2 != ";");
_local6 = _local6 + atRev[_local4];
} else {
_local6 = _local6 + _local2;
}
_local3++;
}
return(_local6);
}
function deserializeString(str) {
var _local7 = str.length;
var _local3 = 0;
var _local2;
var _local6 = "";
while (_local3 < _local7) {
_local2 = substring(str, _local3 + 1, 1);
if (_local2 == "&") {
var _local4 = _local2;
do {
_local3++;
_local2 = substring(str, _local3 + 1, 1);
_local4 = _local4 + _local2;
} while (_local2 != ";");
_local6 = _local6 + etRev[_local4];
} else {
_local6 = _local6 + _local2;
}
_local3++;
}
return(_local6);
}
var et = new Object();
var etRev = new Object();
var at = new Object();
var atRev = new Object();
var preserveVarCase = true;
var useTimezoneInfo = true;
}
Symbol 438 MovieClip [__Packages.WddxRecordset] Frame 0
class WddxRecordset
{
function WddxRecordset (arguments) {
if (arguments.length > 0) {
var _local8;
_local8 = arguments[0].valueOf();
if (typeof(_local8) == "boolean") {
preserveFieldCase = arguments[0];
} else {
var _local7 = arguments[0];
var _local6 = 0;
if (arguments.length > 1) {
_local8 = arguments[1].valueOf();
if (typeof(_local8) == "boolean") {
preserveFieldCase = arguments[1];
} else {
_local6 = arguments[1];
if (arguments.length > 2) {
preserveFieldCase = arguments[2];
}
}
}
var _local4 = 0;
while (_local4 < _local7.length) {
var _local5 = new Array(_local6);
var _local3 = 0;
while (_local3 < _local6) {
_local5[_local3] = null;
_local3++;
}
this[(preserveFieldCase ? (_local7[_local4]) : (_local7[_local4].toLowerCase()))] = _local5;
_local4++;
}
}
}
}
function duplicate() {
var _local2 = new WddxRecordset();
for (var _local4 in this) {
if (_local4.toUpperCase() == "PRESERVEFIELDCASE") {
_local2[_local4] = this[_local4];
} else if (this[_local4].isColumn()) {
_local2.addColumn(_local4);
for (var _local3 in this[_local4]) {
_local2.setField(_local3, _local4, getField(_local3, _local4));
}
}
}
return(_local2);
}
function isColumn(name) {
return((typeof(this[name]) == "object") && (name.indexOf("_private_") == -1));
}
function getRowCount() {
var _local2 = 0;
for (var _local3 in this) {
if (isColumn(_local3)) {
_local2 = this[_local3].length;
break;
}
}
return(_local2);
}
function addColumn(name) {
var _local4 = getRowCount();
var _local3 = new Array(_local4);
var _local2 = 0;
while (_local2 < _local4) {
_local3[_local2] = null;
_local2++;
}
this[(preserveFieldCase ? (name) : (name.toLowerCase()))] = _local3;
}
function addRows(n) {
for (var _local5 in this) {
if (isColumn(_local5)) {
var _local3 = this[_local5].length;
var _local2 = _local3;
while (_local2 < (_local3 + n)) {
this[_local5][_local2] = "";
_local2++;
}
}
}
}
function getField(row, col) {
return(this[(preserveFieldCase ? (col) : (col.toLowerCase()))][row]);
}
function setField(row, col, value) {
this[(preserveFieldCase ? (col) : (col.toLowerCase()))][row] = value;
}
function wddxSerialize(serializer, node) {
var _local7 = "";
var _local8 = new Array();
var _local4 = 0;
for (var _local11 in this) {
if (isColumn(_local11)) {
_local8[_local4++] = _local11;
if (_local7.length > 0) {
_local7 = _local7 + ",";
}
_local7 = _local7 + _local11;
}
}
var _local9 = getRowCount();
node.appendChild(new XML().createElement("recordset"));
node.lastChild.attributes.rowCount = _local9;
node.lastChild.attributes.fieldNames = _local7;
var _local3 = true;
_local4 = 0;
while (_local3 && (_local4 < _local8.length)) {
var _local5 = _local8[_local4];
node.lastChild.appendChild(new XML().createElement("field"));
node.lastChild.lastChild.attributes.name = _local5;
var _local2 = 0;
while (_local3 && (_local2 < _local9)) {
_local3 = serializer.serializeValue(this[_local5][_local2], node.lastChild.lastChild);
_local2++;
}
_local4++;
}
return(_local3);
}
var preserveFieldCase = true;
}
Symbol 439 MovieClip [__Packages.OptionsManager] Frame 0
class OptionsManager
{
var optionsArr, optionsByName;
function OptionsManager () {
optionsArr = new Array();
optionsByName = new Object();
}
function addOptions(info) {
var _local2 = new Options();
_local2.fromXML(info);
getOptions().push(_local2);
optionsByName[_local2.getName()] = _local2;
}
function getOptionsByName(str) {
return(optionsByName[str]);
}
function getOptions() {
return(optionsArr);
}
function parse(info) {
var _local1 = new Options();
_local1.fromXML(info);
return(_local1);
}
}
Symbol 440 MovieClip [__Packages.Sounds.SoundManager] Frame 0
class Sounds.SoundManager
{
static var sounds, soundsByID, _instance, volumeFactor, highestID;
var playSounds, musicVolumeFactor, music;
function SoundManager () {
setHighestID(0);
sounds = new Array();
soundsByID = new Array();
setVolumeFactor(1);
setMusicVolumeFactor(1);
setPlaySounds(true);
}
static function getInstance() {
if (_instance == null) {
_instance = new Sounds.SoundManager();
}
return(_instance);
}
function setPlaySounds(val) {
playSounds = val;
}
function getPlaySounds() {
return(playSounds);
}
function setMusicVolumeFactor(num) {
musicVolumeFactor = num;
getMusic().setVolume(getMusic().getOriginalVolume() * getMusicVolumeFactor());
}
function getMusicVolumeFactor() {
return(musicVolumeFactor);
}
function setVolumeFactor(num) {
volumeFactor = num;
}
function getVolumeFactor() {
return(volumeFactor);
}
function createSound(linkage, props) {
if (getPlaySounds()) {
var _local3 = new Sounds.ETSound(linkage, props.volume, getVolumeFactor(), props.pan, props.loop, props.offset, props.callBack);
_local3.setID(generateID());
addSound(_local3);
}
}
function startMusic(linkage, props) {
if (props == undefined) {
props = new Object();
}
props.loop = 100000 /* 0x0186A0 */;
var _local3 = new Sounds.ETSound(linkage, props.volume, getMusicVolumeFactor(), props.pan, props.loop, props.offset);
_local3.setID(generateID());
setMusic(_local3);
}
function stopMusic() {
getMusic().stop();
}
function setMusic(tmp_sound) {
music = tmp_sound;
}
function getMusic() {
return(music);
}
function mute() {
changeGlobalVolume(0);
}
function changeGlobalVolume(num) {
setVolumeFactor(num);
var _local2 = 0;
while (_local2 < getSounds().length) {
var _local3 = getSounds()[_local2];
_local3.setVolume(_local3.getOriginalVolume() * getVolumeFactor());
_local2++;
}
}
function removeSound(tmp_sound, callBack) {
callBack();
var _local4 = tmp_sound.getID();
delete soundsByID[_local4];
var _local2 = 0;
while (_local2 < getSounds().length) {
if (getSounds()[_local2] == tmp_sound) {
getSounds().splice(_local2, 1);
break;
}
_local2++;
}
}
function addSound(tmp_sound) {
getSounds().push(tmp_sound);
soundsByID[tmp_sound.getID()] = tmp_sound;
}
function generateID() {
setHighestID(getHighestID() + 1);
return(getHighestID());
}
function setHighestID(num) {
highestID = num;
}
function getHighestID() {
return(highestID);
}
function getSounds() {
return(sounds);
}
function getSoundByID(num) {
return(soundsByID[num]);
}
}
Symbol 441 MovieClip [__Packages.Sounds.ETSound] Frame 0
class Sounds.ETSound extends Sound
{
var SM, attachSound, callBack, setVolume, setPan, start, originalVolume, id, linkage;
function ETSound (tmp_link, tmp_vol, volume_factor, tmp_pan, tmp_loop, tmp_offset, tmp_callBack) {
super();
SM = Sounds.SoundManager.getInstance();
setLinkage(tmp_link);
attachSound(getLinkage());
callBack = tmp_callBack;
if (tmp_vol == undefined) {
setOriginalVolume(100);
setVolume(100 * volume_factor);
} else {
setOriginalVolume(tmp_vol);
setVolume(tmp_vol * volume_factor);
}
if (tmp_pan == undefined) {
setPan(0);
} else {
setPan(tmp_pan);
}
if (tmp_loop == undefined) {
tmp_loop = 0;
}
if (tmp_offset == undefined) {
tmp_offset = 0;
}
setPan(0);
start(tmp_offset, tmp_loop);
}
function setOriginalVolume(vol) {
originalVolume = vol;
}
function getOriginalVolume() {
return(originalVolume);
}
function onSoundComplete() {
SM.removeSound(this, callBack);
}
function setID(num) {
id = num;
}
function getID() {
return(id);
}
function setLinkage(tmp_link) {
linkage = tmp_link;
}
function getLinkage() {
return(linkage);
}
}
Symbol 442 MovieClip [__Packages.cards.UI] Frame 0
class cards.UI
{
static var path;
function UI () {
}
static function setPath(tmp) {
path = tmp;
}
static function getPath() {
return(path);
}
static function setEnabled(val) {
enabled = val;
}
static function getEnabled() {
return(enabled);
}
static function enable() {
setEnabled(true);
Mouse.addListener(mouseListener);
enableDoubleClick(true);
}
static function enableDoubleClick(val) {
doubleClickEnabled = val;
}
static function disable() {
setEnabled(false);
Mouse.removeListener(mouseListener);
}
static function clean() {
disable();
mouseListener = new Object();
}
static function mouseMove() {
getPath().mouseMove();
}
static function mouseDown() {
if (!mouseIsDown) {
var _local1 = false;
if (((getTimer() - lastClick) < doubleClickTime) && (doubleClickEnabled)) {
_local1 = true;
lastClick = 0;
}
mouseIsDown = true;
getPath().mouseDown(_local1);
lastClick = getTimer();
} else {
mouseUp();
}
}
static function mouseUp() {
mouseIsDown = false;
getPath().mouseUp();
}
static function addMouseMoveListener() {
mouseListener.onMouseMove = mouseMove;
}
static function addMouseDownListener() {
mouseListener.onMouseDown = mouseDown;
}
static function addMouseUpListener() {
mouseListener.onMouseUp = mouseUp;
}
static var mouseListener = new Object();
static var mouseIsDown = false;
static var lastClick = 0;
static var doubleClickTime = 500;
static var doubleClickEnabled = true;
static var enabled = false;
}
Symbol 443 MovieClip [__Packages.cards.Card] Frame 0
class cards.Card
{
static var cardIDs;
var endX, endY, k, id, isUp, clip, path, suit, isBlack, isRed, faceValue, isFace;
function Card (x, y) {
setIsUp(false);
setID(getNextCardID());
}
static function setBack(num) {
back = num;
}
static function getBack() {
return(back);
}
function refreshBack() {
getClip().back_mc.gotoAndStop(getBack());
}
function setEndX(val) {
endX = val;
}
function getEndX() {
return(endX);
}
function setEndY(val) {
endY = val;
}
function getEndY() {
return(endY);
}
static function resetCardIDs() {
cardIDs = 0;
}
static function getNextCardID() {
return(++cardIDs);
}
function animateToPoint(x, y, tmp_k) {
setK(tmp_k);
setEndX(x);
setEndY(y);
getClip().me = this;
getClip().xmov = 0;
getClip().ymov = 0;
getClip().k = getK();
getClip().endX = x;
getClip().endY = y;
getClip().onEnterFrame = function () {
var _local2 = (this.endX - this._x) * this.k;
var _local3 = (this.endY - this._y) * this.k;
this._x = this._x + _local2;
this._y = this._y + _local3;
if (((_local2 * _local2) + (_local3 * _local3)) < 1) {
this._x = this.endX;
this._y = this.endY;
delete this.me.getClip().onEnterFrame;
}
};
}
function setK(num) {
k = num;
}
function getK() {
return(k);
}
function setID(num) {
id = num;
}
function getID() {
return(id);
}
function toXML() {
var _local2 = ((((("<Card suit = '" + getSuit()) + "' faceValue = '") + getFaceValue()) + "' id = '") + getID()) + "'/>";
return(_local2);
}
function fromXML(info) {
var _local4 = Number(info.attributes.suit);
var _local5 = Number(info.attributes.faceValue);
var _local3 = Number(info.attributes.id);
setSuit(_local4);
setFaceValue(_local5);
setID(_local3);
}
function checkMouse() {
return(getClip().hitTest(getPath()._xmouse, getPath()._ymouse));
}
static function getNextDepth() {
return(++highestDepth);
}
static function setNextDepth(num) {
highestDepth = num;
}
static function getWidth() {
return(width);
}
static function setWidth(num) {
width = num;
}
static function getHeight() {
return(height);
}
static function setHeight(num) {
height = num;
}
function CreatePhysicalAsset() {
var _local2 = getNextDepth();
var _local3 = "card_mc" + _local2;
setClip(getPath().attachMovie(linkage, _local3, _local2));
refreshBack();
}
function setIsUp(val) {
isUp = val;
}
function getIsUp() {
return(isUp);
}
function create(x, y) {
CreatePhysicalAsset();
Move(x, y);
scaleClip();
showFrame();
flip(getIsUp());
}
function getFrame() {
return(suitNames[getSuit()] + getFaceValue().toString());
}
function showFrame() {
getClip().frame = getFrame();
}
function remove() {
getClip().removeMovieClip();
}
function scaleClip() {
getClip()._xscale = (getClip()._yscale = getScale());
}
static function getOriginalWidth() {
return(originalWidth);
}
static function getOriginalHeight() {
return(originalHeight);
}
static function setScale(num) {
scale = num;
setWidth((getScale() * getOriginalWidth()) / 100);
setHeight((getScale() * getOriginalHeight()) / 100);
}
static function getScale() {
return(scale);
}
function Move(x, y, snap, tmp_k, delay) {
if ((snap || (snap == undefined)) || (globalSnap)) {
delete getClip().onEnterFrame;
placeX(x);
placeY(y);
} else {
animateToPoint(x, y, tmp_k, delay);
}
}
function placeX(num) {
setEndX(num);
clip._x = num;
}
function placeY(num) {
setEndY(num);
clip._y = num;
}
function setPath(tmp) {
path = tmp;
}
function getPath() {
return(path);
}
function getSuitName() {
return(suitNames[getSuit()]);
}
function getFaceValueName() {
return(faceValueNames[getFaceValue()]);
}
function setClip(mc) {
clip = mc;
}
function getClip() {
return(clip);
}
function setSuit(num) {
suit = num;
if ((suit == 0) || (suit == 3)) {
setIsBlack(true);
setIsRed(false);
} else {
setIsBlack(false);
setIsRed(true);
}
}
function flip(val) {
if (val == undefined) {
if (getIsUp()) {
setIsUp(false);
} else {
setIsUp(true);
}
} else {
setIsUp(val);
}
if (getIsUp()) {
getClip().back_mc._visible = false;
} else {
getClip().back_mc._visible = true;
}
}
function setIsBlack(val) {
isBlack = val;
}
function setIsRed(val) {
isRed = val;
}
function getIsBlack() {
return(isBlack);
}
function getIsRed() {
return(isRed);
}
function getSuit() {
return(suit);
}
function setFaceValue(num) {
faceValue = num;
if (faceValue >= 10) {
setIsFace(true);
} else {
setIsFace(true);
}
}
function setIsFace(val) {
isFace = val;
}
function getIsFace() {
return(isFace);
}
function getFaceValue() {
return(faceValue);
}
static var highestDepth = 1000;
static var scale = 100;
static var suitNames = ["CLUBS", "DIAMONDS", "HEARTS", "SPADES"];
static var faceValueNames = ["ACE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "JACK", "QUEEN", "KING"];
static var linkage = "card_mc";
static var originalWidth = 164;
static var originalHeight = 228;
static var width = originalWidth;
static var height = originalHeight;
static var globalSnap = false;
static var back = 1;
}
Symbol 444 MovieClip [__Packages.cards.Solitaire.SolBase] Frame 0
class cards.Solitaire.SolBase
{
var maxTime, maxBonus;
function SolBase () {
}
function setMaxTime(val) {
maxTime = val;
}
function getMaxTime() {
return(maxTime);
}
function setMaxBonus(val) {
maxBonus = val;
}
function getMaxBonus() {
return(maxBonus);
}
}
Symbol 445 MovieClip [__Packages.cards.Solitaire.Klondike.Klondike] Frame 0
class cards.Solitaire.Klondike.Klondike extends cards.Solitaire.SolBase
{
var setMaxTime, setMaxBonus, SM, hitAreaDepth, DM, piles, foundations, loadedFromXML, allPiles, seed, myOptions, score, UE, soundOn, uiRedirect, path, deckXML, myStock;
function Klondike (tmpPath, tmp_seed) {
super();
setMaxTime(1800000);
setMaxBonus(350);
cards.Card.setScale(40);
cards.Card.setNextDepth(1000);
setHistory(new cards.HistoryEngine.History());
setPath(tmpPath);
cards.UI.setPath(this);
cards.UI.clean();
cards.UI.enable();
SM = Sounds.SoundManager.getInstance();
hitAreaDepth = 100;
DM = new cards.DeckManager();
piles = new Array();
foundations = new Array();
DM.addDeck(1, 4, tmp_seed);
DM.doneAddingDecks();
setSoundOn(true);
loadedFromXML = false;
allPiles = new Array();
setScore(0);
}
function setSeed(num) {
seed = num;
}
function getSeed() {
return(seed);
}
function setOptions(val) {
var _local2 = new XML(val.toXML());
myOptions = getPath()._parent.OM.parse(_local2);
}
function getOptions() {
return(myOptions);
}
function dragging() {
if ((!getHistory().undoing) && (!getHistory().getLocked())) {
playSound("pickup", {offset:0.02});
}
}
function addToScore(num) {
setScore(getScore() + num);
getPath().displayScore(getScore());
}
function checkForWin() {
var _local3 = true;
var _local4 = calculateScore();
getPath()._parent.menu_mc.updateScore(_local4);
var _local2 = 0;
while (_local2 < getFoundations().length) {
if (getFoundations()[_local2].getTopCards().length != 13) {
_local3 = false;
break;
}
_local2++;
}
if (_local3) {
getPath().gameOver(true, _local4);
}
}
function calculateScore() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < getFoundations().length) {
_local3 = _local3 + getFoundations()[_local2].getTopCards().length;
_local2++;
}
_local3 = _local3 * 10;
if (_local3 >= 520) {
_local3 = _local3 + 100;
var _local4 = 500;
var _local5 = getHistory().getActions().length;
var _local6 = (_local4 - _local5) / _local4;
if (_local5 > _local4) {
_local6 = 0;
}
_local3 = _local3 + Math.round(100 * _local6);
}
return(_local3);
}
function setScore(num) {
score = num;
}
function getScore() {
return(score);
}
function getDeckXML() {
return(DM.toXML());
}
function setGlobalSnap(val) {
cards.Card.globalSnap = val;
}
function getGlobalSnap() {
return(cards.Card.globalSnap);
}
function getAllPiles() {
return(allPiles);
}
function toXML() {
var _local2 = "<Game type='Klondike'>";
_local2 = _local2 + (("<Time millis='" + getPath()._parent.menu_mc.timer_mc.getMS()) + "'/>");
_local2 = _local2 + getOptions().toXML();
_local2 = _local2 + DM.toXML();
_local2 = _local2 + getHistory().toXML();
_local2 = _local2 + "</Game>";
return(_local2);
}
function fromXML(info) {
loadedFromXML = true;
var _local3 = info.firstChild.childNodes;
var _local5;
var _local6;
var _local7;
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].nodeName == "Cards") {
_local5 = _local3[_local2];
} else if (_local3[_local2].nodeName == "History") {
_local6 = _local3[_local2];
} else if (_local3[_local2].nodeName == "Options") {
_local7 = new XML(_local3[_local2].toString());
} else if (_local3[_local2].nodeName == "Time") {
var _local4 = Number(_local3[_local2].attributes.millis);
getPath()._parent.menu_mc.timer_mc.start(_local4);
}
_local2++;
}
setOptions(getPath()._parent.OM.parse(_local7));
DM.fromXML(_local5, this);
setUpTable();
getHistory().fromXML(_local6, this);
getPath()._parent.menu_mc.setGameNumber();
}
function setHistory(tmp) {
UE = tmp;
}
function getHistory() {
return(UE);
}
function addHistoryAction(ob) {
getHistory().addAction(ob);
}
function setSoundOn(val) {
soundOn = val;
}
function getSoundOn() {
return(soundOn);
}
function playSound(which, props) {
if (soundOn) {
SM.createSound(which, props);
}
}
function enableGame() {
cards.UI.addMouseDownListener();
cards.UI.addMouseUpListener();
cards.UI.addMouseMoveListener();
}
function determineWhatWasClicked(doubleClick) {
if (getStock().checkMouse()) {
uiRedirect = getStock();
uiRedirect.mouseDown(doubleClick);
} else {
var _local3 = false;
var _local2 = 0;
while (_local2 < getPiles().length) {
if (getPile(_local2).checkMouse()) {
uiRedirect = getPile(_local2);
uiRedirect.mouseDown(doubleClick);
_local3 = true;
break;
}
_local2++;
}
if (!_local3) {
_local2 = 0;
while (_local2 < getFoundations().length) {
if (getFoundations()[_local2].checkMouse()) {
uiRedirect = getFoundations()[_local2];
uiRedirect.mouseDown();
break;
}
_local2++;
}
}
}
}
function compareCards(tmp_card, isStock, index, cards, doubleClick) {
var _local8 = false;
var _local2 = 0;
while (_local2 < getPiles().length) {
if (_local2 != index) {
if (getPile(_local2).compareCards(tmp_card)) {
_local8 = true;
cards = uiRedirect.removeCardsToDrag();
getPile(_local2).addTopCards(cards);
var _local3 = new Object();
_local3.minorActions = new Array();
var _local5 = new Object();
_local5.path = uiRedirect;
_local5.method = "removeCards";
_local5.reversePath = uiRedirect;
_local5.reverseMethod = "addTopCards";
_local5.cards = cards;
_local3.minorActions.push(_local5);
var _local4 = new Object();
_local4.method = "addTopCards";
_local4.path = getPile(_local2);
_local4.reversePath = getPile(_local2);
_local4.reverseMethod = "removeCards";
_local4.cards = cards;
_local3.minorActions.push(_local4);
if (isStock && (getStock().getGrouping().length == 0)) {
getStock().resurrectLastCollapsedCard();
var _local6 = new Object();
_local6.path = uiRedirect;
_local6.method = "resurrectLastCollapsedCard";
_local6.reversePath = uiRedirect;
_local6.reverseMethod = "recollapse";
_local3.minorActions.unshift(_local6);
} else if ((uiRedirect.getTopCards().length == 0) && (uiRedirect.getBottomCards().length > 0)) {
_local3.minorActions.push(uiRedirect.convertTopCard(false));
}
addHistoryAction(_local3);
break;
}
}
_local2++;
}
_local2 = 0;
while (_local2 < getFoundations().length) {
if (getFoundations()[_local2].getIndex() != index) {
if (getFoundations()[_local2].compareCards(tmp_card, doubleClick)) {
_local8 = true;
cards = uiRedirect.removeCardsToDrag();
getFoundations()[_local2].addTopCards(cards);
var _local3 = new Object();
_local3.minorActions = new Array();
var _local5 = new Object();
_local5.path = uiRedirect;
_local5.method = "removeCards";
_local5.reversePath = uiRedirect;
_local5.reverseMethod = "addTopCards";
_local5.cards = cards;
_local3.minorActions.push(_local5);
var _local4 = new Object();
_local4.path = getFoundations()[_local2];
_local4.method = "addTopCards";
_local4.reversePath = getFoundations()[_local2];
_local4.reverseMethod = "removeCards";
_local4.cards = cards;
_local3.minorActions.push(_local4);
if (isStock && (getStock().getGrouping().length == 0)) {
getStock().resurrectLastCollapsedCard();
var _local6 = new Object();
_local6.path = uiRedirect;
_local6.method = "resurrectLastCollapsedCard";
_local6.reversePath = uiRedirect;
_local6.reverseMethod = "recollapse";
_local3.minorActions.unshift(_local6);
} else if ((uiRedirect.getTopCards().length == 0) && (uiRedirect.getBottomCards().length > 0)) {
_local3.minorActions.push(uiRedirect.convertTopCard(false));
}
addHistoryAction(_local3);
break;
}
}
_local2++;
}
if (doubleClick) {
uiRedirect = undefined;
}
if (_local8) {
checkForWin();
playSound("click");
}
}
function mouseDown(doubleClick) {
determineWhatWasClicked(doubleClick);
}
function mouseUp() {
uiRedirect.mouseUp();
uiRedirect = null;
}
function mouseMove() {
if (cards.UI.mouseIsDown) {
uiRedirect.mouseMove();
}
}
function setPath(tmpPath) {
path = tmpPath;
}
function getPath() {
return(path);
}
function setDeckXML(str) {
deckXML = str;
}
function initialize() {
var _local2 = getGlobalSnap();
setGlobalSnap(true);
if (!loadedFromXML) {
setOptions(getPath()._parent.OM.getOptionsByName(getPath().gameName));
if (deckXML != undefined) {
var _local3 = new XML(deckXML);
DM.fromXML(_local3.firstChild.firstChild);
}
setUpTable();
}
createPhysicalAssets();
getHistory().setLocked(true);
flipUpTopCards();
getHistory().setLocked(false);
if (!loadedFromXML) {
getHistory().reset();
} else {
getHistory().resume();
}
setGlobalSnap(_local2);
getPath()._parent.menu_mc.updateScore(calculateScore());
}
function flipUpTopCards() {
var _local2 = 0;
while (_local2 < getPiles().length) {
getPile(_local2).convertTopCard();
_local2++;
}
}
function createPhysicalAssets() {
var _local9 = 20;
var _local6 = cards.Card.getWidth();
var _local7 = (600 - (7 * _local6)) / 6;
var _local5 = 190;
var _local11 = true;
var _local8 = 4;
if (!_local11) {
_local8 = 0;
}
var _local3 = 0;
while (_local3 < getPiles().length) {
getPile(_local3).initialize(_local9, _local6, _local7, _local5, _local8, this);
_local3++;
}
var _local4 = getPile(0).getHitArea()._x;
_local5 = 90;
getStock().setHitArea(addHitArea(_local4, _local5));
getStock().setGroupY(_local5);
getStock().setDeckX(_local4);
getStock().setDeckY(_local5);
getStock().initialize();
var _local10 = getPile(3).getHitArea()._x;
_local3 = 0;
while (_local3 < getFoundations().length) {
var _local2 = getFoundations()[_local3];
_local4 = _local10 + (_local3 * (_local6 + _local7));
_local2.setHitArea(addHitArea(_local4, _local5));
_local2.setBaseX(_local4);
_local2.setBaseY(_local5);
_local2.setTopCascade(0);
_local3++;
}
}
function addHitArea(x, y) {
var _local3 = ++hitAreaDepth;
var _local2 = getPath().attachMovie("hitArea_mc", "hitArea" + _local3.toString(), _local3);
_local2._x = x;
_local2._y = y;
_local2._width = cards.Card.getWidth();
_local2._height = cards.Card.getHeight();
return(_local2);
}
function saveInAllPiles(tmp_pile) {
allPiles[tmp_pile.getIndex()] = tmp_pile;
}
function setUpTable() {
var _local6 = 0;
while (_local6 < 7) {
var _local3 = new cards.Solitaire.Klondike.Pile();
_local3.setType("tableau");
_local3.setIndex(_local6);
_local3.setDepthBase((_local6 + 1) * 1000);
_local3.setGame(this);
_local3.setPath(getPath());
getPiles().push(_local3);
saveInAllPiles(_local3);
_local6++;
}
var _local8 = DM.getDeck();
var _local4 = 0;
_local6 = 0;
while (_local6 < 28) {
var _local5 = _local8.dealCard();
_local5.setPath(getPath());
var _local2 = _local4;
while (_local2 < getPiles().length) {
var _local3 = getPile(_local2);
if ((_local3.getIndex() + 1) > _local3.getBottomCards().length) {
_local3.addBottomCard(_local5);
break;
}
_local2++;
}
_local4++;
if (_local4 >= getPiles().length) {
_local4 = 0;
}
_local6++;
}
_local6 = 0;
while (_local6 < 4) {
var _local3 = new cards.Solitaire.Klondike.Pile();
_local3.setType("foundation");
var _local7 = _local6 + 12;
_local3.setDepthBase(_local7 * 1000);
_local3.setIndex(_local7);
_local3.setGame(this);
_local3.setPath(getPath());
getFoundations().push(_local3);
saveInAllPiles(_local3);
_local6++;
}
myStock = new cards.Solitaire.Klondike.Stock();
getStock().setPath(getPath());
getStock().setDeck(_local8);
getStock().setDepthBase(20000);
getStock().setGame(this);
}
function getStock() {
return(myStock);
}
function getFoundations() {
return(foundations);
}
function getDestination(num) {
return(getFoundations()[num]);
}
function getPiles() {
return(piles);
}
function getPile(num) {
return(getPiles()[num]);
}
}
Symbol 446 MovieClip [__Packages.cards.DeckManager] Frame 0
class cards.DeckManager
{
var decks, seed, cardsByID, deckXML;
function DeckManager () {
cards.Card.resetCardIDs();
decks = new Array();
}
function setSeed(num) {
seed = num;
}
function getSeed() {
return(seed);
}
function addDeck(num, numSuits, tmp_seed) {
if (tmp_seed != undefined) {
setSeed(tmp_seed);
}
if (getSeed() == undefined) {
setSeed(random(10000000));
}
var _local2 = new cards.Deck(getSeed(), num, numSuits);
getDecks().push(_local2);
}
function toXML() {
var _local3 = "<Cards>";
var _local2 = 0;
while (_local2 < getDecks().length) {
_local3 = _local3 + (("<Deck seed = '" + getSeed()) + "' />");
_local2++;
}
_local3 = _local3 + "</Cards>";
return(_local3);
}
function fromXML(info, where, numDecks, suits) {
cards.Card.resetCardIDs();
var _local5 = info.childNodes;
decks = new Array();
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2];
var _local4 = Number(_local3.attributes.seed);
setSeed(_local4);
addDeck(numDecks, suits);
_local2++;
}
refreshCardsByID();
}
function getCardByID(id) {
return(cardsByID[id]);
}
function refreshCardsByID() {
cardsByID = new Array();
var _local6 = 0;
while (_local6 < getDecks().length) {
var _local4 = getDeck(_local6).getPile();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
var _local5 = _local3.getID();
cardsByID[_local5] = _local3;
_local2++;
}
_local6++;
}
}
function doneAddingDecks() {
refreshCardsByID();
setDeckXML(toXML());
}
function setDeckXML(str) {
deckXML = str;
}
function getDeckXML() {
return(deckXML);
}
function toXML2() {
var _local4 = "";
if (getDeckXML() == undefined) {
_local4 = "<Cards>";
var _local2 = 0;
while (_local2 < getDeck().getPile().length) {
var _local3 = getDeck().getPile()[_local2];
_local4 = _local4 + _local3.toXML();
_local2++;
}
_local4 = _local4 + "</Cards>";
} else {
_local4 = getDeckXML();
}
return(_local4);
}
function getDecks() {
return(decks);
}
function getDeck(num) {
if (num == undefined) {
num = 0;
}
return(getDecks()[num]);
}
}
Symbol 447 MovieClip [__Packages.cards.Deck] Frame 0
class cards.Deck
{
var cardsInUse, seed, allCards, pile, cardsToShuffle;
function Deck (tmp_seed, numDecks, numSuits) {
if (numDecks == undefined) {
numDecks = 1;
}
if ((numSuits == undefined) || (numSuits > 4)) {
numSuits = 4;
}
setSeed(tmp_seed);
cardsInUse = new Array();
buildCardInstances(numDecks, numSuits);
shuffle();
}
function refreshBacks() {
var _local2 = 0;
while (_local2 < getAllCards().length) {
getAllCards()[_local2].refreshBack();
_local2++;
}
}
function setSeed(num) {
seed = num;
}
function getSeed() {
return(seed);
}
function buildCardInstances(numDecks, numSuits) {
var _local8 = 52 / numSuits;
allCards = new Array();
var _local7 = 0;
while (_local7 < numDecks) {
var _local2 = 0;
while (_local2 < 52) {
var _local5 = Math.floor(_local2 / _local8);
var _local6 = Math.floor(_local2 / 13);
var _local4 = _local2 - (_local6 * 13);
var _local3 = new cards.Card();
_local3.setSuit(_local5);
_local3.setFaceValue(_local4);
allCards.push(_local3);
_local2++;
}
_local7++;
}
}
function dealCard() {
var _local2 = getPile().pop();
getCardsInUse().push(_local2);
return(_local2);
}
function placeCardOnPile(tmp_card) {
var _local2 = 0;
while (_local2 < getCardsInUse().length) {
if (getCardsInUse()[_local2] == tmp_card) {
getCardsInUse().splice(_local2, 1);
break;
}
_local2++;
}
getPile().push(tmp_card);
}
function getAllCards() {
return(allCards);
}
function getPile() {
return(pile);
}
function getCardsInUse() {
return(cardsInUse);
}
function getCardsToShuffle() {
return(cardsToShuffle);
}
function generateCardsToShuffle() {
cardsToShuffle = new Array();
var _local2 = 0;
while (_local2 < getAllCards().length) {
getCardsToShuffle().push(getAllCards()[_local2]);
_local2++;
}
}
function shuffle() {
generateCardsToShuffle();
pile = new Array();
var _local3 = new RandomNumberGenerator(getSeed());
while (getCardsToShuffle().length > 0) {
var _local2 = _local3.NextInRange(0, getCardsToShuffle().length - 1);
getPile().push(getCardsToShuffle()[_local2]);
getCardsToShuffle().splice(_local2, 1);
}
}
}
Symbol 448 MovieClip [__Packages.RandomNumberGenerator] Frame 0
class RandomNumberGenerator
{
var seed, A, M, Q, R, oneOverM;
function RandomNumberGenerator (seedIn) {
var _local2 = "" + seedIn.toString();
var _local4 = _local2.length;
var _local3 = Math.floor(_local4 / 2);
var _local5 = parseInt(_local2.substr(0, _local3));
var _local6 = parseInt(_local2.substr(_local3, _local4));
seed = (2345678901 + (_local5 * 16777215)) + (_local6 * 65535);
A = 48271;
M = 2147483647 /* 0x7FFFFFFF */;
Q = M / A;
R = M % A;
oneOverM = 1 / M;
}
function Next() {
var _local4 = seed / Q;
var _local3 = seed % Q;
var _local2 = (A * _local3) - (R * _local4);
if (_local2 > 0) {
seed = _local2;
} else {
seed = _local2 + M;
}
return(seed * oneOverM);
}
function NextInRange(lrn, urn) {
var _local2 = Next();
return(Math.floor((((urn - lrn) + 1) * _local2) + lrn));
}
}
Symbol 449 MovieClip [__Packages.cards.Solitaire.StockBase] Frame 0
class cards.Solitaire.StockBase
{
var xShift, yShift;
function StockBase () {
}
function setXShift(val) {
xShift = val;
xShift = (-cards.Card.getWidth()) / 2;
}
function getXShift() {
return(xShift);
}
function setYShift(val) {
yShift = val;
yShift = (-cards.Card.getHeight()) * 0.2;
}
function getYShift() {
return(yShift);
}
}
Symbol 450 MovieClip [__Packages.cards.Solitaire.Klondike.Stock] Frame 0
class cards.Solitaire.Klondike.Stock extends cards.Solitaire.StockBase
{
var justReplacedDeck, grouping, cardsToReplace, timesThroughPile, timesAllowedThroughPile, isStock, game, dragDepth, setXShift, setYShift, dragging, getXShift, getYShift, depthBase, numInGroup, deckX, deckY, groupX, groupY, path, myDeck, hitArea;
function Stock () {
super();
justReplacedDeck = false;
setIsStock(true);
grouping = new Array();
cardsToReplace = new Array();
setGroupX(100);
setDragging(false);
setDragDepth(60000);
setTimesThroughPile(1);
}
function setTimesThroughPile(num) {
timesThroughPile = num;
}
function setTimesThroughPile_aux(nothing, num) {
num = Number(num);
if (num == undefined) {
num = 1;
}
setTimesThroughPile(num);
}
function getTimesThroughPile() {
return(timesThroughPile);
}
function setTimesAllowedThroughPile(val) {
timesAllowedThroughPile = val;
}
function getTimesAllowedThroughPile() {
return(timesAllowedThroughPile);
}
function setIsStock(val) {
isStock = val;
}
function getIsStock() {
return(isStock);
}
function setGame(tmp) {
game = tmp;
}
function getGame() {
return(game);
}
function setDragDepth(num) {
dragDepth = num;
}
function getDragDepth() {
return(dragDepth);
}
function initializeDepths() {
var _local4 = getDeck().getPile();
var _local5 = getDepthBase();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].getClip();
_local3.swapDepths(_local5 + _local2);
_local2++;
}
}
function checkMouse() {
var _local2 = getHitArea().hitTest(getPath()._xmouse, getPath()._ymouse);
var _local3 = getGrouping()[getGrouping().length - 1].getClip().hitTest(getPath()._xmouse, getPath()._ymouse);
return(_local2 || (_local3));
}
function mouseDown(doubleClick) {
var _local2 = getHitArea().hitTest(getPath()._xmouse, getPath()._ymouse);
var _local3 = getGrouping()[getGrouping().length - 1].getClip().hitTest(getPath()._xmouse, getPath()._ymouse);
if (_local2) {
nextGrouping();
} else if (_local3) {
startDragging();
if (doubleClick) {
mouseUp(doubleClick);
}
}
}
function startDragging() {
getGame().dragging();
var _local2 = getGrouping()[getGrouping().length - 1].getClip();
setXShift(_local2._x - getPath()._xmouse);
setYShift(_local2._y - getPath()._ymouse);
setDragging(true);
_local2.swapDepths(getDragDepth());
mouseMove();
}
function removeCardsToDrag() {
var _local2 = getGrouping().pop();
return([_local2]);
}
function removeCards() {
removeCardsToDrag();
}
function setDragging(val) {
dragging = val;
}
function getDragging() {
return(dragging);
}
function mouseMove() {
if (getDragging()) {
var _local4 = getPath()._ymouse;
var _local3 = getPath()._xmouse;
var _local6 = _local3 + getXShift();
var _local5 = _local4 + getYShift();
var _local2 = getGrouping()[getGrouping().length - 1].getClip();
_local2._x = _local6;
_local2._y = _local5;
}
}
function mouseUp(doubleClick) {
if (getDragging()) {
var _local2 = doubleClick;
getGame().compareCards(getGrouping()[getGrouping().length - 1], true, null, getGrouping(), _local2);
placeGrouping();
setDragging(false);
}
}
function setDepthBase(num) {
depthBase = num;
}
function getDepthBase() {
return(depthBase);
}
function getNumInGroup() {
return(numInGroup);
}
function setNumInGroup(num) {
numInGroup = num;
}
function setDeckX(val) {
deckX = val;
}
function getDeckX() {
return(deckX);
}
function setDeckY(val) {
deckY = val;
}
function getDeckY() {
return(deckY);
}
function setGroupX(val) {
groupX = val;
}
function getGroupX() {
return(groupX);
}
function setGroupY(val) {
groupY = val;
}
function getGroupY() {
return(groupY);
}
function setPath(tmp) {
path = tmp;
}
function getPath() {
return(path);
}
function getGrouping() {
return(grouping);
}
function getCardsToReplace() {
return(cardsToReplace);
}
function replaceDeck() {
var _local3 = getTimesThroughPile();
var _local4 = getTimesAllowedThroughPile();
if (checkRedeals()) {
while (getCardsToReplace().length > 0) {
var _local2 = getCardsToReplace().pop();
_local2.flip(false);
_local2.getClip()._visible = false;
getDeck().placeCardOnPile(_local2);
_local2.Move(getDeckX(), getDeckY());
}
getDeck().getPile()[getDeck().getPile().length - 1].getClip()._visible = true;
initializeDepths();
setTimesThroughPile(_local3 + 1);
justReplacedDeck = true;
} else {
resurrectLastCollapsedCard();
}
}
function initialize() {
setNumInGroup(getGame().getOptions().bin.Draw);
var _local5 = getGame().getOptions().bin.Redeals;
if (isNaN(_local5)) {
_local5 = 100000 /* 0x0186A0 */;
}
setTimesAllowedThroughPile(_local5);
var _local4 = getDeck().getPile();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local3.create(getDeckX(), getDeckY());
_local3.getClip()._visible = false;
_local2++;
}
getDeck().getPile()[getDeck().getPile().length - 1].getClip()._visible = true;
initializeDepths();
}
function resurrectLastCollapsedCard() {
var _local2 = getCardsToReplace().pop();
if (_local2 != undefined) {
_local2.getClip()._visible = true;
getGrouping().unshift(_local2);
_local2.Move(getGroupX(), getGroupY());
placeGrouping();
}
}
function recollapse() {
var _local2 = getGrouping().shift();
getCardsToReplace().push(_local2);
_local2.Move(getGroupX(), getGroupY());
placeGrouping();
}
function collapseCurrentGrouping() {
while (getGrouping().length > 0) {
var _local2 = getGrouping().shift();
_local2.getClip()._visible = false;
getCardsToReplace().push(_local2);
_local2.Move(getGroupX(), getGroupY(), true);
}
getCardsToReplace()[getCardsToReplace().length - 1].getClip()._visible = true;
}
function showPreviousGrouping(nothing, param) {
if (getGrouping().length > 0) {
getDeck().getPile()[getDeck().getPile().length - 1].getClip()._visible = false;
while (getGrouping().length > 0) {
var _local2 = getGrouping().pop();
_local2.getClip()._visible = false;
_local2.flip(false);
getDeck().placeCardOnPile(_local2);
_local2.Move(getDeckX(), getDeckY(), true);
}
getDeck().getPile()[getDeck().getPile().length - 1].getClip()._visible = true;
var _local3 = 0;
var _local4 = Number(param);
while ((getCardsToReplace().length > 0) && (_local3 < _local4)) {
_local3++;
var _local2 = getCardsToReplace().pop();
if (_local2 != undefined) {
_local2.getClip()._visible = true;
getGrouping().unshift(_local2);
_local2.Move(getGroupX(), getGroupY(), true);
}
}
} else {
while (getDeck().getPile().length > 0) {
nextGrouping(true);
}
}
placeGrouping();
}
function addTopCards(arr) {
var _local3 = arr[0];
if (getGrouping().length >= getNumInGroup()) {
var _local2 = getGrouping().pop();
getDeck().placeCardOnPile(_local2);
getDeck().getPile()[getDeck().getPile().length - 1].getClip()._visible = true;
_local2.Move(getDeckX(), getDeckY());
}
getGrouping().push(_local3);
placeGrouping();
}
function checkRedeals() {
var _local3 = getTimesThroughPile();
var _local2 = getTimesAllowedThroughPile();
return(_local3 < _local2);
}
function nextGrouping(byPassSaving) {
var _local3 = getGrouping().length;
var _local2 = true;
if (checkRedeals() || (getDeck().getPile().length > 0)) {
collapseCurrentGrouping();
}
if (getDeck().getPile().length > 0) {
showNextGrouping();
} else if (checkRedeals()) {
replaceDeck();
} else {
_local2 = false;
}
if ((byPassSaving != true) && (_local2)) {
saveForUndo("nextGrouping", "showPreviousGrouping", undefined, _local3);
}
if (justReplacedDeck) {
justReplacedDeck = false;
}
}
function showNextGrouping() {
var _local3 = 0;
while (_local3 < getNumInGroup()) {
var _local2 = getDeck().dealCard();
if (_local2 != undefined) {
_local2.getClip()._visible = true;
getGrouping().push(_local2);
}
_local3++;
}
getDeck().getPile()[getDeck().getPile().length - 1].getClip()._visible = true;
placeGrouping();
}
function saveForUndo(method, reverseMethod, forwardParam, reverseParam) {
var _local4 = new Object();
_local4.minorActions = new Array();
var _local2 = new Object();
_local2.path = this;
_local2.method = method;
_local2.forwardParam = forwardParam;
_local2.reversePath = this;
_local2.reverseMethod = reverseMethod;
_local2.reverseParam = reverseParam;
_local4.minorActions.push(_local2);
if (justReplacedDeck) {
var _local3 = new Object();
_local3.method = "setTimesThroughPile_aux";
_local3.forwardParam = getTimesThroughPile();
_local3.reverseMethod = "setTimesThroughPile_aux";
_local3.reversePath = this;
_local3.reverseParam = getTimesThroughPile() - 1;
_local4.minorActions.push(_local3);
}
getGame().addHistoryAction(_local4);
}
function placeGrouping() {
var _local4 = getDepthBase() + 500;
var _local2 = 0;
while (_local2 < getGrouping().length) {
var _local3 = getGrouping()[_local2];
_local3.Move(getGroupX() + (_local2 * 20), getGroupY(), false, 0.7);
_local3.flip(true);
_local3.getClip().swapDepths((_local4 + getCardsToReplace().length) + _local2);
_local2++;
}
_local2 = 0;
while (_local2 < getCardsToReplace().length) {
var _local3 = getCardsToReplace()[_local2];
_local3.Move(getGroupX(), getGroupY(), true);
_local2++;
}
}
function setDeck(tmp) {
myDeck = tmp;
var _local2 = 0;
while (_local2 < getDeck().getPile().length) {
var _local3 = getDeck().getPile()[_local2];
_local3.setPath(getPath());
_local2++;
}
}
function getDeck() {
return(myDeck);
}
function getPile() {
return(getDeck().getPile());
}
function setHitArea(tmp) {
hitArea = tmp;
}
function getHitArea() {
return(hitArea);
}
}
Symbol 451 MovieClip [__Packages.cards.HistoryEngine.History] Frame 0
class cards.HistoryEngine.History
{
var undoing, locked, actions;
function History () {
reset();
setLocked(false);
undoing = false;
}
function setLocked(val) {
locked = val;
}
function getLocked() {
return(locked);
}
function generateXML(ob) {
var _local2 = "";
_local2 = _local2 + "<Action>";
var _local5 = ob.minorActions;
var _local4 = 0;
while (_local4 < _local5.length) {
ob = _local5[_local4];
_local2 = _local2 + "<MinorAction>";
_local2 = _local2 + generatePathXML(ob.path);
_local2 = _local2 + generateCardXML(ob.cards);
_local2 = _local2 + (("<ForwardMethod>" + ob.method) + "</ForwardMethod>");
_local2 = _local2 + (("<ForwardParam>" + ob.forwardParam) + "</ForwardParam>");
_local2 = _local2 + (("<ReverseMethod>" + ob.reverseMethod) + "</ReverseMethod>");
_local2 = _local2 + (("<ReverseParam>" + ob.reverseParam) + "</ReverseParam>");
_local2 = _local2 + "</MinorAction>";
_local4++;
}
_local2 = _local2 + "</Action>";
return(_local2);
}
function addAction(ob) {
if (!getLocked()) {
ob.xmlData = generateXML(ob);
getActions().push(ob);
}
}
function toXML() {
var _local3 = "<History>";
var _local2 = 0;
while (_local2 < getActions().length) {
_local3 = _local3 + getActions()[_local2].xmlData;
_local2++;
}
_local3 = _local3 + "</History>";
return(_local3);
}
function reset() {
actions = new Array();
}
function getActions() {
return(actions);
}
function getAction() {
return(getActions().pop());
}
function resume() {
setLocked(true);
var _local5 = 0;
while (_local5 < getActions().length) {
var _local6 = actions[_local5];
var _local4 = _local6.minorActions;
var _local3 = 0;
while (_local3 < _local4.length) {
var _local2 = _local4[_local3];
_local2.path[_local2.method](_local2.cards);
_local3++;
}
_local5++;
}
setLocked(false);
}
function stepForward() {
var _local5 = actions[ind];
ind++;
var _local4 = _local5.minorActions;
var _local3 = 0;
while (_local3 < _local4.length) {
var _local2 = _local4[_local3];
_local2.path[_local2.method](_local2.cards);
_local3++;
}
}
function undo() {
undoing = true;
var _local5 = getAction();
var _local4 = _local5.minorActions;
var _local3 = _local4.length - 1;
while (_local3 >= 0) {
var _local2 = _local4[_local3];
_local2.reversePath[_local2.reverseMethod](_local2.cards, _local2.reverseParam);
_local3--;
}
undoing = false;
}
function determinePath(info, gamePath) {
var _local1;
var _local3 = info.attributes.isStock;
var _local2 = info.attributes.index;
if (_local3 == "true") {
_local1 = gamePath.getStock();
} else {
_local1 = gamePath.getAllPiles()[Number(_local2)];
}
return(_local1);
}
function parseCards(info, gamePath) {
var _local3 = info.firstChild.nodeValue.split(",");
var _local5 = gamePath.DM;
var _local4 = new Array();
var _local1 = 0;
while (_local1 < _local3.length) {
var _local2 = Number(_local3[_local1]);
_local4.push(_local5.getCardByID(_local2));
_local1++;
}
if (_local4.length == 0) {
_local4 = undefined;
}
return(_local4);
}
function fromXML(info, gamePath) {
reset();
var _local14 = info.childNodes;
var _local13 = 0;
while (_local13 < _local14.length) {
var _local12 = new Object();
_local12.minorActions = new Array();
var _local9 = _local14[_local13].childNodes;
var _local7 = 0;
while (_local7 < _local9.length) {
var _local10 = _local9[_local7];
var _local4 = new Object();
var _local3 = _local10.childNodes;
var _local2 = 0;
while (_local2 < _local3.length) {
var _local5 = _local3[_local2].nodeName;
if (_local5 == "Path") {
var _local6 = determinePath(_local3[_local2], gamePath);
_local4.path = _local6;
_local4.reversePath = _local6;
} else if (_local5 == "Cards") {
var _local8 = parseCards(_local3[_local2], gamePath);
_local4.cards = _local8;
} else if (_local5 == "ForwardMethod") {
_local4.method = _local3[_local2].firstChild.nodeValue;
} else if (_local5 == "ForwardParam") {
_local4.forwardParam = _local3[_local2].firstChild.nodeValue;
} else if (_local5 == "ReverseMethod") {
_local4.reverseMethod = _local3[_local2].firstChild.nodeValue;
} else if (_local5 == "ReverseParam") {
_local4.reverseParam = _local3[_local2].firstChild.nodeValue;
}
_local2++;
}
_local12.minorActions.push(_local4);
_local7++;
}
addAction(_local12);
_local13++;
}
}
function generatePathXML(path) {
var _local1 = "";
if (path.getIsStock()) {
_local1 = "<Path isStock = 'true' />";
} else {
_local1 = ("<Path index = '" + path.getIndex()) + "' />";
}
return(_local1);
}
function generateCardXML(cards) {
var _local3 = "";
if ((cards.length == 0) || (cards == undefined)) {
_local3 = "<Cards />";
} else {
_local3 = "<Cards>";
var _local1 = 0;
while (_local1 < cards.length) {
var _local4 = cards[_local1].getID().toString();
_local3 = _local3 + _local4;
if (_local1 != (cards.length - 1)) {
_local3 = _local3 + ",";
}
_local1++;
}
_local3 = _local3 + "</Cards>";
}
return(_local3);
}
var ind = 0;
}
Symbol 452 MovieClip [__Packages.cards.Solitaire.PileBase] Frame 0
class cards.Solitaire.PileBase
{
var groupXShift, groupYShift;
function PileBase () {
}
function setGroupXShift(val) {
groupXShift = val;
groupXShift = (-cards.Card.getWidth()) / 2;
}
function getGroupXShift() {
return(groupXShift);
}
function setGroupYShift(val) {
groupYShift = val;
groupYShift = (-cards.Card.getHeight()) * 0.2;
}
function getGroupYShift() {
return(groupYShift);
}
}
Symbol 453 MovieClip [__Packages.cards.Solitaire.Klondike.Pile] Frame 0
class cards.Solitaire.Klondike.Pile extends cards.Solitaire.PileBase
{
var bottomCards, topCards, cardsToDrag, path, game, dragging, bottomCascade, topCascade, baseX, baseY, depthBase, type, hitArea, setGroupXShift, setGroupYShift, getGroupXShift, getGroupYShift, index;
function Pile () {
super();
bottomCards = new Array();
topCards = new Array();
cardsToDrag = new Array();
setTopCascade(15);
setDragging(false);
}
function setPath(tmp) {
path = tmp;
}
function getPath() {
return(path);
}
function setGame(tmp) {
game = tmp;
}
function getGame() {
return(game);
}
function compareCards(tmp_card1, doubleClick) {
var _local3 = false;
if (getType() == "tableau") {
if (getTopCards().length > 0) {
var _local4 = getTopCards()[getTopCards().length - 1];
if (tmp_card1.getClip().hitTest(_local4.getClip())) {
var _local5 = tmp_card1.getIsBlack() != _local4.getIsBlack();
var _local7 = (_local4.getFaceValue() - tmp_card1.getFaceValue()) == 1;
if (_local5 && (_local7)) {
_local3 = true;
} else {
_local3 = false;
}
}
} else if (getBottomCards().length > 0) {
_local3 = false;
} else if ((getBottomCards().length == 0) && (getTopCards().length == 0)) {
var _local6 = tmp_card1.getFaceValue() == 12;
var _local8 = tmp_card1.getClip().hitTest(getHitArea());
if (_local6 && (_local8)) {
_local3 = true;
}
}
} else if (getType() == "foundation") {
if (tmp_card1.getClip().hitTest(getHitArea()) || (doubleClick)) {
if (getTopCards().length == 0) {
if (tmp_card1.getFaceValue() == 0) {
_local3 = true;
}
} else {
var _local4 = getTopCards()[getTopCards().length - 1];
var _local9 = tmp_card1.getSuit() == _local4.getSuit();
var _local7 = (_local4.getFaceValue() - tmp_card1.getFaceValue()) == -1;
if (_local9 && (_local7)) {
_local3 = true;
}
}
}
}
return(_local3);
}
function setDragging(val) {
dragging = val;
}
function getDragging() {
return(dragging);
}
function setBottomCascade(val) {
bottomCascade = val;
}
function getBottomCascade() {
return(bottomCascade);
}
function setTopCascade(num) {
topCascade = num;
}
function getTopCascade() {
return(topCascade);
}
function setBaseX(val) {
baseX = val;
}
function getBaseX() {
return(baseX);
}
function setBaseY(val) {
baseY = val;
}
function getBaseY() {
return(baseY);
}
function setDepthBase(num) {
depthBase = num;
}
function getDepthBase() {
return(depthBase);
}
function initializeDepths() {
var _local4 = getBottomCards();
var _local5 = getDepthBase();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].getClip();
_local3.swapDepths(_local5 + _local2);
_local2++;
}
}
function setType(str) {
type = str;
}
function getType() {
return(type);
}
function setHitArea(clip) {
hitArea = clip;
}
function getHitArea() {
return(hitArea);
}
function convertTopCard(saveIt) {
var _local4 = removeBottomCard();
_local4.flip(true);
addTopCards([_local4]);
var _local2 = new Object();
_local2.path = this;
_local2.method = "convertTopCard";
_local2.reversePath = this;
_local2.reverseMethod = "revertTopCard";
if ((saveIt == true) || (saveIt == undefined)) {
var _local3 = new Object();
_local3.minorActions = new Array();
_local3.minorActions.push(_local2);
getGame().addHistoryAction(_local3);
}
return(_local2);
}
function revertTopCard() {
var _local2 = getTopCards().shift();
_local2.flip(false);
getBottomCards().push(_local2);
initializeDepths();
applyTopPositions();
applyTopDepths();
}
function initialize(leftMargin, width, spacing, y, cascadeShift, sol) {
setBottomCascade(cascadeShift);
var _local5 = leftMargin + (getIndex() * (width + spacing));
setBaseX(_local5);
setBaseY(y);
var _local2 = 0;
while (_local2 < getBottomCards().length) {
var _local3 = getBottomCards()[_local2];
var _local4 = getBottomCascade() * _local2;
_local3.create(_local5, y + _local4);
if (_local2 == 0) {
setHitArea(sol.addHitArea(_local5, y));
}
_local2++;
}
initializeDepths();
}
function addTopCards(cards) {
var _local2 = 0;
while (_local2 < cards.length) {
addTopCard(cards[_local2]);
_local2++;
}
applyTopPositions();
applyTopDepths();
if (getType() == "foundation") {
}
}
function applyTopPositions() {
var _local7 = getBaseX();
var _local3;
var _local6 = getTopCascade();
var _local4 = getTopCards();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local5 = _local4[_local2];
if ((_local2 == 0) && (getBottomCards().length == 0)) {
_local3 = getBaseY();
} else if ((_local2 == 0) && (getBottomCards().length > 0)) {
_local3 = getBottomCards()[getBottomCards().length - 1].getEndY() + getBottomCascade();
} else {
_local3 = _local4[_local2 - 1].getEndY() + _local6;
}
_local5.Move(_local7, _local3, false, 0.7);
_local2++;
}
}
function addTopCard(tmp_card) {
getTopCards().push(tmp_card);
}
function applyTopDepths(cards, db) {
applyDepths(getTopCards(), getDepthBase() + 500);
}
function applyDepths(cards, db) {
var _local1 = 0;
while (_local1 < cards.length) {
cards[_local1].getClip().swapDepths(db + _local1);
_local1++;
}
}
function getBottomCards() {
return(bottomCards);
}
function startGroupDrag(index) {
getGame().dragging();
setDragging(true);
cardsToDrag = getTopCards().slice(index);
var _local3 = cardsToDrag[0].getClip()._x - getPath()._xmouse;
var _local2 = cardsToDrag[0].getClip()._y - getPath()._ymouse;
setGroupXShift(_local3);
setGroupYShift(_local2);
applyDepths(cardsToDrag, highestDepth);
}
function removeCardsToDrag() {
var _local3;
var _local2 = 0;
while (_local2 < getTopCards().length) {
if (getTopCards()[_local2] == cardsToDrag[0]) {
_local3 = _local2;
break;
}
_local2++;
}
return(removeTopCards(_local3));
}
function removeTopCards(index) {
var _local2 = getTopCards().slice(index);
getTopCards().splice(index);
if (getType() == "foundation") {
getGame().addToScore(-10);
}
return(_local2);
}
function removeCards(cards) {
var _local3;
var _local2 = 0;
while (_local2 < getTopCards().length) {
if (getTopCards()[_local2] == cards[0]) {
_local3 = _local2;
break;
}
_local2++;
}
return(removeTopCards(_local3));
}
function mouseUp(doubleClick) {
var _local3 = doubleClick && (getCardsToDrag().length == 1);
var _local2 = getCardsToDrag()[0];
getGame().compareCards(_local2, false, getIndex(), getCardsToDrag(), _local3);
applyTopPositions();
applyTopDepths();
setDragging(false);
}
function getCardsToDrag() {
return(cardsToDrag);
}
function mouseMove() {
if (getDragging()) {
var _local5 = getPath()._ymouse;
var _local7 = getPath()._xmouse;
var _local6 = _local7 + getGroupXShift();
var _local3;
var _local2 = 0;
while (_local2 < cardsToDrag.length) {
var _local4 = getCardsToDrag()[_local2];
if (_local2 == 0) {
_local3 = _local5 + getGroupYShift();
} else {
_local3 = cardsToDrag[_local2 - 1].getClip()._y + getTopCascade();
}
_local4.Move(_local6, _local3);
_local2++;
}
}
}
function checkMouse() {
var _local2 = getHitArea().hitTest(getPath()._xmouse, getPath()._ymouse);
var _local3 = getTopCards()[getTopCards().length - 1].getClip().hitTest(getPath()._xmouse, getPath()._ymouse);
return(_local2 || (_local3));
}
function mouseDown(doubleClick) {
if (getType() == "tableau") {
if (getTopCards().length == 0) {
var _local5 = getHitArea().hitTest(getPath()._xmouse, getPath()._ymouse);
if (_local5 && (getBottomCards().length > 0)) {
convertTopCard();
}
} else {
var _local2 = getTopCards().length - 1;
while (_local2 >= 0) {
if (getTopCards()[_local2].checkMouse() && (!doubleClick)) {
startGroupDrag(_local2);
break;
}
if (getTopCards()[_local2].checkMouse() && (doubleClick)) {
startGroupDrag(_local2);
mouseUp(doubleClick);
}
_local2--;
}
}
} else if (getType() == "foundation") {
var _local4 = getTopCards().length - 1;
if (_local4 >= 0) {
startGroupDrag(_local4);
}
}
mouseMove();
}
function addBottomCard(tmp_card) {
getBottomCards().push(tmp_card);
}
function getBottomCard() {
return(getBottomCards()[getBottomCards().length - 1]);
}
function removeBottomCard() {
var _local2 = getBottomCards().pop();
return(_local2);
}
function getTopCards() {
return(topCards);
}
function getTopCard() {
return(getTopCards()[getTopCards().length - 1]);
}
function getIndex() {
return(index);
}
function setIndex(num) {
index = num;
}
var highestDepth = 50000;
}
Symbol 454 MovieClip [__Packages.cards.Solitaire.Golf.Golf] Frame 0
class cards.Solitaire.Golf.Golf extends cards.Solitaire.SolBase
{
var setMaxTime, setMaxBonus, SM, hitAreaDepth, DM, piles, foundations, loadedFromXML, allPiles, myOptions, started, score, UE, soundOn, uiRedirect, path, deckXML, myStock;
function Golf (tmpPath, tmp_seed) {
super();
setMaxTime(2100000);
setMaxBonus(0);
cards.Card.setScale(45);
cards.Card.setNextDepth(1000);
setHistory(new cards.HistoryEngine.History());
setPath(tmpPath);
cards.UI.setPath(this);
cards.UI.clean();
cards.UI.enable();
SM = Sounds.SoundManager.getInstance();
hitAreaDepth = 100;
DM = new cards.DeckManager();
piles = new Array();
foundations = new Array();
DM.addDeck(1, 4, tmp_seed);
DM.doneAddingDecks();
setSoundOn(true);
loadedFromXML = false;
allPiles = new Array();
setScore(-52);
setStarted(false);
}
function setOptions(val) {
var _local2 = new XML(val.toXML());
myOptions = getPath()._parent.OM.parse(_local2);
}
function getOptions() {
return(myOptions);
}
function setStarted(val) {
started = val;
}
function getStarted() {
return(started);
}
function addToScore(num) {
setScore(getScore() + num);
getPath().displayScore(getScore());
}
function calculateScore() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < 7) {
_local3 = _local3 + getPile(_local2).getTopCards().length;
_local2++;
}
return(_local3);
}
function checkForWin() {
var _local4 = calculateScore();
getPath()._parent.menu_mc.updateScore(_local4);
var _local5 = false;
var _local3 = true;
var _local6 = false;
_local4 = calculateScore();
var _local2 = 0;
while (_local2 < 7) {
if (getPile(_local2).getTopCards().length > 0) {
_local3 = false;
}
_local2++;
}
if (_local3) {
getPath().gameOver(true, _local4);
}
}
function setScore(num) {
score = num;
}
function getScore() {
return(score);
}
function getDeckXML() {
return(DM.toXML());
}
function setGlobalSnap(val) {
cards.Card.globalSnap = val;
}
function getGlobalSnap() {
return(cards.Card.globalSnap);
}
function getAllPiles() {
return(allPiles);
}
function toXML() {
var _local2 = "<Game type='Golf'>";
_local2 = _local2 + (("<Time millis='" + getPath()._parent.menu_mc.timer_mc.getMS()) + "'/>");
_local2 = _local2 + getOptions().toXML();
_local2 = _local2 + DM.toXML();
_local2 = _local2 + getHistory().toXML();
_local2 = _local2 + "</Game>";
return(_local2);
}
function fromXML(info) {
loadedFromXML = true;
var _local3 = info.firstChild.childNodes;
var _local5;
var _local6;
var _local7;
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].nodeName == "Cards") {
_local5 = _local3[_local2];
} else if (_local3[_local2].nodeName == "History") {
_local6 = _local3[_local2];
} else if (_local3[_local2].nodeName == "Options") {
_local7 = new XML(_local3[_local2].toString());
} else if (_local3[_local2].nodeName == "Time") {
var _local4 = Number(_local3[_local2].attributes.millis);
getPath()._parent.menu_mc.timer_mc.start(_local4);
}
_local2++;
}
setOptions(getPath()._parent.OM.parse(_local7));
DM.fromXML(_local5, this);
setUpTable();
getHistory().fromXML(_local6, this);
getPath()._parent.menu_mc.setGameNumber();
}
function setHistory(tmp) {
UE = tmp;
}
function getHistory() {
return(UE);
}
function addHistoryAction(ob) {
getHistory().addAction(ob);
}
function setSoundOn(val) {
soundOn = val;
}
function getSoundOn() {
return(soundOn);
}
function playSound(which) {
if (soundOn) {
SM.createSound(which);
}
}
function enableGame() {
setStarted(true);
cards.UI.addMouseDownListener();
cards.UI.addMouseUpListener();
cards.UI.addMouseMoveListener();
}
function determineWhatWasClicked(doubleClick) {
if (getStock().checkMouse()) {
uiRedirect = getStock();
uiRedirect.mouseDown(doubleClick);
} else {
var _local3 = false;
var _local2 = 0;
while (_local2 < getPiles().length) {
if (getPile(_local2).checkMouse()) {
uiRedirect = getPile(_local2);
uiRedirect.mouseDown(doubleClick);
_local3 = true;
break;
}
_local2++;
}
}
}
function compareCards(tmp_card, isStock, index, cards, doubleClick) {
var _local7 = false;
var _local5 = 0;
if (getFoundations()[_local5].compareCards(tmp_card, doubleClick) || (isStock)) {
_local7 = true;
cards = uiRedirect.removeCardsToDrag();
getFoundations()[_local5].addTopCards(cards);
var _local4 = new Object();
_local4.minorActions = new Array();
var _local3 = new Object();
_local3.path = uiRedirect;
_local3.method = "removeCards";
_local3.reversePath = uiRedirect;
_local3.reverseMethod = "addTopCards";
_local3.cards = cards;
_local4.minorActions.push(_local3);
var _local2 = new Object();
_local2.path = getFoundations()[_local5];
_local2.method = "addTopCards";
_local2.reversePath = getFoundations()[_local5];
_local2.reverseMethod = "removeCards";
_local2.cards = cards;
_local4.minorActions.push(_local2);
addHistoryAction(_local4);
}
if (doubleClick) {
uiRedirect = undefined;
}
if (_local7 && (getStarted())) {
checkForWin();
playSound("click");
}
}
function mouseDown(doubleClick) {
determineWhatWasClicked(doubleClick);
}
function mouseUp() {
uiRedirect = null;
}
function mouseMove() {
if (cards.UI.mouseIsDown) {
uiRedirect.mouseMove();
}
}
function setPath(tmpPath) {
path = tmpPath;
}
function getPath() {
return(path);
}
function setDeckXML(str) {
deckXML = str;
}
function initialize() {
var _local2 = getGlobalSnap();
setGlobalSnap(true);
if (!loadedFromXML) {
setOptions(getPath()._parent.OM.getOptionsByName(getPath().gameName));
if (deckXML != undefined) {
var _local3 = new XML(deckXML);
DM.fromXML(_local3.firstChild.firstChild);
}
setUpTable();
}
getHistory().setLocked(true);
createPhysicalAssets();
getHistory().setLocked(false);
if (!loadedFromXML) {
getHistory().reset();
} else {
getHistory().resume();
}
setGlobalSnap(_local2);
setStarted(true);
getPath()._parent.menu_mc.updateScore(calculateScore());
}
function flipUpTopCards() {
var _local2 = 0;
while (_local2 < getPiles().length) {
getPile(_local2).convertTopCard();
_local2++;
}
}
function createPhysicalAssets() {
var _local9 = 20;
var _local6 = cards.Card.getWidth();
var _local7 = (600 - (7 * _local6)) / 6;
var _local5 = 90;
var _local11 = true;
var _local8 = 15;
if (!_local11) {
_local8 = 0;
}
var _local3 = 0;
while (_local3 < getPiles().length) {
getPile(_local3).initialize(_local9, _local6, _local7, _local5, _local8, this);
_local3++;
}
var _local4 = getPile(2).getHitArea()._x + 45;
_local5 = 280;
getStock().setHitArea(addHitArea(_local4, _local5));
getStock().setGroupY(_local5);
getStock().setDeckX(_local4);
getStock().setDeckY(_local5);
getStock().initialize();
var _local10 = getPile(3).getHitArea()._x + 45;
_local3 = 0;
while (_local3 < getFoundations().length) {
var _local2 = getFoundations()[_local3];
_local4 = _local10 + (_local3 * (_local6 + _local7));
_local2.setHitArea(addHitArea(_local4, _local5));
_local2.setBaseX(_local4);
_local2.setBaseY(_local5);
_local2.setTopCascade(0);
_local3++;
}
}
function addHitArea(x, y) {
var _local3 = ++hitAreaDepth;
var _local2 = getPath().attachMovie("hitArea_mc", "hitArea" + _local3.toString(), _local3);
_local2._x = x;
_local2._y = y;
_local2._width = cards.Card.getWidth();
_local2._height = cards.Card.getHeight();
return(_local2);
}
function saveInAllPiles(tmp_pile) {
allPiles[tmp_pile.getIndex()] = tmp_pile;
}
function setUpTable() {
var _local5 = 0;
while (_local5 < 7) {
var _local3 = new cards.Solitaire.Golf.Pile();
_local3.setType("tableau");
_local3.setIndex(_local5);
_local3.setDepthBase((_local5 + 1) * 1000);
_local3.setGame(this);
_local3.setPath(getPath());
getPiles().push(_local3);
saveInAllPiles(_local3);
_local5++;
}
var _local7 = DM.getDeck();
_local5 = 0;
while (_local5 < 5) {
var _local2 = 0;
while (_local2 < getPiles().length) {
var _local3 = getPile(_local2);
var _local4 = _local7.dealCard();
_local4.setPath(getPath());
_local3.addBottomCard(_local4);
_local2++;
}
_local5++;
}
_local5 = 0;
while (_local5 < 1) {
var _local3 = new cards.Solitaire.Golf.Pile();
_local3.setType("foundation");
var _local6 = _local5 + 12;
_local3.setDepthBase(_local6 * 1000);
_local3.setIndex(_local6);
_local3.setGame(this);
_local3.setPath(getPath());
getFoundations().push(_local3);
saveInAllPiles(_local3);
_local5++;
}
myStock = new cards.Solitaire.Golf.Stock();
getStock().setPath(getPath());
getStock().setDeck(_local7);
getStock().setDepthBase(20000);
getStock().setGame(this);
}
function getStock() {
return(myStock);
}
function getFoundations() {
return(foundations);
}
function getDestination(num) {
return(getFoundations()[num]);
}
function getPiles() {
return(piles);
}
function getPile(num) {
return(getPiles()[num]);
}
}
Symbol 455 MovieClip [__Packages.cards.Solitaire.Golf.Stock] Frame 0
class cards.Solitaire.Golf.Stock extends cards.Solitaire.StockBase
{
var grouping, cardsToReplace, timesThroughPile, timesAllowedThroughPile, isStock, game, dragDepth, dragging, getXShift, getYShift, depthBase, numInGroup, deckX, deckY, groupX, groupY, path, myDeck, hitArea;
function Stock () {
super();
setIsStock(true);
setNumInGroup(1);
grouping = new Array();
cardsToReplace = new Array();
setGroupX(100);
setDragging(false);
setDragDepth(60000);
setTimesThroughPile(1);
setTimesAllowedThroughPile(1);
}
function setVisuals() {
var _local4 = getDeck().getPile().length;
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = getDeck().getPile()[_local2].getClip();
_local3._visible = true;
_local2++;
}
getDeck().getPile()[_local4 - 1].getClip()._visible = true;
getDeck().getPile()[_local4 - 2].getClip()._visible = true;
}
function setTimesThroughPile(num) {
timesThroughPile = num;
}
function getTimesThroughPile() {
return(timesThroughPile);
}
function setTimesAllowedThroughPile(val) {
timesAllowedThroughPile = val;
}
function getTimesAllowedThroughPile() {
return(timesAllowedThroughPile);
}
function setIsStock(val) {
isStock = val;
}
function getIsStock() {
return(isStock);
}
function setGame(tmp) {
game = tmp;
}
function getGame() {
return(game);
}
function setDragDepth(num) {
dragDepth = num;
}
function getDragDepth() {
return(dragDepth);
}
function initializeDepths() {
var _local4 = getDeck().getPile();
var _local5 = getDepthBase();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].getClip();
_local3.swapDepths(_local5 + _local2);
_local2++;
}
}
function checkMouse() {
var _local2 = getHitArea().hitTest(getPath()._xmouse, getPath()._ymouse);
var _local3 = getGrouping()[getGrouping().length - 1].getClip().hitTest(getPath()._xmouse, getPath()._ymouse);
return(_local2 || (_local3));
}
function mouseDown(doubleClick) {
var _local2 = getHitArea().hitTest(getPath()._xmouse, getPath()._ymouse);
if (_local2) {
nextGrouping();
}
}
function startDragging() {
setDragging(true);
}
function removeCardsToDrag() {
if (getGrouping().length == 0) {
showNextGrouping();
}
var _local2 = getGrouping().pop();
return([_local2]);
}
function removeCards() {
removeCardsToDrag();
setVisuals();
}
function addTopCards(arr) {
var _local2 = arr[0];
getGrouping().push(_local2);
showPreviousGrouping();
setVisuals();
}
function setDragging(val) {
dragging = val;
}
function getDragging() {
return(dragging);
}
function mouseMove() {
if (getDragging()) {
var _local4 = getPath()._ymouse;
var _local3 = getPath()._xmouse;
var _local6 = _local3 + getXShift();
var _local5 = _local4 + getYShift();
var _local2 = getGrouping()[getGrouping().length - 1].getClip();
_local2._x = _local6;
_local2._y = _local5;
}
}
function mouseUp(doubleClick) {
if (getDragging()) {
var _local2 = doubleClick;
getGame().compareCards(getGrouping()[getGrouping().length - 1], true, null, getGrouping(), _local2);
placeGrouping();
setDragging(false);
}
}
function setDepthBase(num) {
depthBase = num;
}
function getDepthBase() {
return(depthBase);
}
function getNumInGroup() {
return(numInGroup);
}
function setNumInGroup(num) {
numInGroup = num;
}
function setDeckX(val) {
deckX = val;
}
function getDeckX() {
return(deckX);
}
function setDeckY(val) {
deckY = val;
}
function getDeckY() {
return(deckY);
}
function setGroupX(val) {
groupX = val;
}
function getGroupX() {
return(groupX);
}
function setGroupY(val) {
groupY = val;
}
function getGroupY() {
return(groupY);
}
function setPath(tmp) {
path = tmp;
}
function getPath() {
return(path);
}
function getGrouping() {
return(grouping);
}
function getCardsToReplace() {
return(cardsToReplace);
}
function replaceDeck() {
var _local3 = getTimesThroughPile();
var _local4 = getTimesAllowedThroughPile();
if (_local3 < _local4) {
while (getCardsToReplace().length > 0) {
var _local2 = getCardsToReplace().pop();
_local2.flip(false);
getDeck().placeCardOnPile(_local2);
_local2.Move(getDeckX(), getDeckY());
}
initializeDepths();
setTimesAllowedThroughPile(_local3 + 1);
} else {
resurrectLastCollapsedCard();
}
}
function initialize() {
var _local4 = getDeck().getPile();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local3.create(getDeckX(), getDeckY());
_local2++;
}
initializeDepths();
}
function resurrectLastCollapsedCard() {
var _local2 = getCardsToReplace().pop();
if (_local2 != undefined) {
getGrouping().unshift(_local2);
_local2.Move(getGroupX(), getGroupY());
placeGrouping();
}
}
function recollapse() {
var _local2 = getGrouping().shift();
getCardsToReplace().push(_local2);
_local2.Move(getGroupX(), getGroupY());
placeGrouping();
}
function collapseCurrentGrouping() {
while (getGrouping().length > 0) {
var _local2 = getGrouping().shift();
getCardsToReplace().push(_local2);
_local2.Move(getGroupX(), getGroupY());
}
}
function showPreviousGrouping() {
while (getGrouping().length > 0) {
var _local2 = getGrouping().pop();
_local2.flip(false);
getDeck().placeCardOnPile(_local2);
_local2.Move(getDeckX(), getDeckY());
}
var _local3 = 0;
while ((getCardsToReplace().length > 0) && (_local3 < getNumInGroup())) {
_local3++;
var _local2 = getCardsToReplace().pop();
if (_local2 != undefined) {
getGrouping().unshift(_local2);
_local2.Move(getGroupX(), getGroupY());
}
}
placeGrouping();
}
function showNextGrouping() {
var _local2 = getDeck().dealCard();
_local2.flip(true);
if (_local2 != undefined) {
getGrouping().push(_local2);
}
startDragging();
mouseUp();
}
function saveForUndo(method, reverseMethod) {
var _local3 = new Object();
_local3.minorActions = new Array();
var _local2 = new Object();
_local2.path = this;
_local2.method = method;
_local2.reversePath = this;
_local2.reverseMethod = reverseMethod;
_local3.minorActions.push(_local2);
getGame().addHistoryAction(_local3);
}
function placeGrouping() {
var _local4 = getDepthBase() + 500;
var _local2 = 0;
while (_local2 < getGrouping().length) {
var _local3 = getGrouping()[_local2];
_local3.Move(getGroupX() + (_local2 * 20), getGroupY(), false, 0.7);
_local3.flip(true);
_local3.getClip().swapDepths((_local4 + getCardsToReplace().length) + _local2);
_local2++;
}
}
function nextGrouping() {
collapseCurrentGrouping();
if (getDeck().getPile().length > 0) {
showNextGrouping();
}
}
function setDeck(tmp) {
myDeck = tmp;
var _local2 = 0;
while (_local2 < getDeck().getPile().length) {
var _local3 = getDeck().getPile()[_local2];
_local3.setPath(getPath());
_local2++;
}
}
function getDeck() {
return(myDeck);
}
function getPile() {
return(getDeck().getPile());
}
function setHitArea(tmp) {
hitArea = tmp;
}
function getHitArea() {
return(hitArea);
}
}
Symbol 456 MovieClip [__Packages.cards.Solitaire.Golf.Pile] Frame 0
class cards.Solitaire.Golf.Pile extends cards.Solitaire.PileBase
{
var bottomCards, topCards, cardsToDrag, path, aceOnKing, game, dragging, bottomCascade, topCascade, baseX, baseY, depthBase, type, hitArea, getGroupXShift, getGroupYShift, index;
function Pile () {
super();
bottomCards = new Array();
topCards = new Array();
cardsToDrag = new Array();
setTopCascade(15);
setDragging(false);
}
function setPath(tmp) {
path = tmp;
}
function getPath() {
return(path);
}
function setAceOnKing(val) {
aceOnKing = val;
}
function setVisuals() {
var _local4 = getTopCards().length;
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = getTopCards()[_local2].getClip();
_local3._visible = false;
_local2++;
}
getTopCards()[_local4 - 1].getClip()._visible = true;
getTopCards()[_local4 - 2].getClip()._visible = true;
}
function getAceOnKing() {
return(aceOnKing);
}
function setGame(tmp) {
game = tmp;
}
function getGame() {
return(game);
}
function compareCards(tmp_card1, doubleClick) {
var _local4 = false;
setAceOnKing(getGame().getPiles()[0].getAceOnKing());
if (getType() == "foundation") {
var _local2 = getTopCards()[getTopCards().length - 1];
var _local8 = tmp_card1.getSuit() == _local2.getSuit();
var _local5 = Math.abs(_local2.getFaceValue() - tmp_card1.getFaceValue()) == 1;
var _local6 = (Math.abs(_local2.getFaceValue() - tmp_card1.getFaceValue()) == 12) && (getAceOnKing());
var _local7 = (((_local2.getFaceValue() == 12) && (tmp_card1.getFaceValue() == 11)) ? false : true);
if ((_local5 || (_local6)) && (_local7)) {
_local4 = true;
}
}
return(_local4);
}
function setDragging(val) {
dragging = val;
}
function getDragging() {
return(dragging);
}
function setBottomCascade(val) {
bottomCascade = val;
}
function getBottomCascade() {
return(bottomCascade);
}
function setTopCascade(num) {
topCascade = num;
}
function getTopCascade() {
return(topCascade);
}
function setBaseX(val) {
baseX = val;
}
function getBaseX() {
return(baseX);
}
function setBaseY(val) {
baseY = val;
}
function getBaseY() {
return(baseY);
}
function setDepthBase(num) {
depthBase = num;
}
function getDepthBase() {
return(depthBase);
}
function initializeDepths() {
var _local4 = getBottomCards();
var _local5 = getDepthBase();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].getClip();
_local3.swapDepths(_local5 + _local2);
_local2++;
}
}
function setType(str) {
type = str;
}
function getType() {
return(type);
}
function setHitArea(clip) {
hitArea = clip;
}
function getHitArea() {
return(hitArea);
}
function convertTopCard() {
var _local4 = removeBottomCard();
_local4.flip(true);
addTopCards([_local4]);
var _local3 = new Object();
_local3.minorActions = new Array();
var _local2 = new Object();
_local2.path = this;
_local2.method = "convertTopCard";
_local2.reversePath = this;
_local2.reverseMethod = "revertTopCard";
_local3.minorActions.push(_local2);
getGame().addHistoryAction(_local3);
}
function revertTopCard() {
var _local2 = getTopCards().pop();
_local2.flip(true);
getBottomCards().push(_local2);
initializeDepths();
}
function initialize(leftMargin, width, spacing, y, cascadeShift, sol) {
setAceOnKing(getGame().getOptions().bin.AcesOnKings);
setBottomCascade(cascadeShift);
var _local5 = leftMargin + (getIndex() * (width + spacing));
setBaseX(_local5);
setBaseY(y);
var _local2 = 0;
while (_local2 < getBottomCards().length) {
var _local3 = getBottomCards()[_local2];
var _local4 = getBottomCascade() * _local2;
_local3.create(_local5, y + _local4);
_local3.flip(true);
if (_local2 == 0) {
setHitArea(sol.addHitArea(_local5, y));
}
_local2++;
}
initializeDepths();
while (getBottomCards().length > 0) {
convertTopCard();
}
}
function addTopCards(cards) {
var _local2 = 0;
while (_local2 < cards.length) {
addTopCard(cards[_local2]);
_local2++;
}
applyTopPositions();
applyTopDepths();
if (getType() == "foundation") {
if (getTopCards().length > 2) {
}
setVisuals();
}
}
function applyTopPositions() {
var _local7 = getBaseX();
var _local3;
var _local6 = getTopCascade();
var _local4 = getTopCards();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local5 = _local4[_local2];
if ((_local2 == 0) && (getBottomCards().length == 0)) {
_local3 = getBaseY();
} else if ((_local2 == 0) && (getBottomCards().length > 0)) {
_local3 = getBottomCards()[getBottomCards().length - 1].getEndY() + getBottomCascade();
} else {
_local3 = _local4[_local2 - 1].getEndY() + _local6;
}
_local5.Move(_local7, _local3, false, 0.7);
_local2++;
}
}
function addTopCard(tmp_card) {
tmp_card.flip(true);
getTopCards().push(tmp_card);
}
function applyTopDepths(cards, db) {
applyDepths(getTopCards(), getDepthBase() + 500);
}
function applyDepths(cards, db) {
var _local1 = 0;
while (_local1 < cards.length) {
cards[_local1].getClip().swapDepths(db + _local1);
_local1++;
}
}
function getBottomCards() {
return(bottomCards);
}
function removeCardsToDrag() {
var _local3;
var _local2 = 0;
while (_local2 < getTopCards().length) {
if (getTopCards()[_local2] == cardsToDrag[0]) {
_local3 = _local2;
break;
}
_local2++;
}
return(removeTopCards(_local3));
}
function removeTopCards(index) {
if (getType() == "foundation") {
getGame().addToScore(-5);
}
var _local2 = getTopCards().slice(index);
getTopCards().splice(index);
return(_local2);
}
function removeCards(cards) {
var _local3;
var _local2 = 0;
while (_local2 < getTopCards().length) {
if (getTopCards()[_local2] == cards[0]) {
_local3 = _local2;
break;
}
_local2++;
}
var _local5 = removeTopCards(_local3);
if (getType() == "foundation") {
setVisuals();
}
return(_local5);
}
function startGroupDrag(index) {
setDragging(true);
cardsToDrag = getTopCards().slice(index);
applyDepths(cardsToDrag, highestDepth);
}
function mouseUp(doubleClick) {
var _local3 = doubleClick && (getCardsToDrag().length == 1);
var _local2 = getCardsToDrag()[0];
getGame().compareCards(_local2, false, getIndex(), getCardsToDrag(), _local3);
applyTopPositions();
applyTopDepths();
setDragging(false);
}
function getCardsToDrag() {
return(cardsToDrag);
}
function mouseMove() {
if (getDragging()) {
var _local5 = getPath()._ymouse;
var _local7 = getPath()._xmouse;
var _local6 = _local7 + getGroupXShift();
var _local3;
var _local2 = 0;
while (_local2 < cardsToDrag.length) {
var _local4 = getCardsToDrag()[_local2];
if (_local2 == 0) {
_local3 = _local5 + getGroupYShift();
} else {
_local3 = cardsToDrag[_local2 - 1].getClip()._y + getTopCascade();
}
_local4.Move(_local6, _local3);
_local2++;
}
}
}
function checkMouse() {
var _local2 = getTopCards()[getTopCards().length - 1].getClip().hitTest(getPath()._xmouse, getPath()._ymouse);
return(_local2);
}
function mouseDown(doubleClick) {
if (getType() == "tableau") {
var _local2 = getTopCards().length - 1;
if (getTopCards()[_local2].checkMouse() && (_local2 >= 0)) {
startGroupDrag(_local2);
mouseUp(doubleClick);
}
}
mouseMove();
}
function addBottomCard(tmp_card) {
getBottomCards().push(tmp_card);
}
function getBottomCard() {
return(getBottomCards()[getBottomCards().length - 1]);
}
function removeBottomCard() {
var _local2 = getBottomCards().pop();
return(_local2);
}
function getTopCards() {
return(topCards);
}
function getTopCard() {
return(getTopCards()[getTopCards().length - 1]);
}
function getIndex() {
return(index);
}
function setIndex(num) {
index = num;
}
var highestDepth = 50000;
}
Symbol 457 MovieClip [__Packages.cards.Solitaire.Scorpion.Scorpion] Frame 0
class cards.Solitaire.Scorpion.Scorpion extends cards.Solitaire.SolBase
{
var setMaxTime, setMaxBonus, SM, hitAreaDepth, DM, piles, foundations, loadedFromXML, allPiles, myOptions, score, UE, soundOn, uiRedirect, path, deckXML, myStock;
function Scorpion (tmpPath, tmp_seed) {
super();
setMaxTime(1800000);
setMaxBonus(350);
cards.Card.setScale(40);
cards.Card.setNextDepth(1000);
setHistory(new cards.HistoryEngine.History());
setPath(tmpPath);
cards.UI.setPath(this);
cards.UI.clean();
cards.UI.enable();
SM = Sounds.SoundManager.getInstance();
hitAreaDepth = 100;
DM = new cards.DeckManager();
piles = new Array();
foundations = new Array();
DM.addDeck(1, 4, tmp_seed);
DM.doneAddingDecks();
setSoundOn(true);
loadedFromXML = false;
allPiles = new Array();
setScore(0);
}
function setOptions(val) {
var _local2 = new XML(val.toXML());
myOptions = getPath()._parent.OM.parse(_local2);
}
function getOptions() {
return(myOptions);
}
function dragging() {
if ((!getHistory().undoing) && (!getHistory().getLocked())) {
playSound("pickup");
}
}
function addToScore(num) {
setScore(getScore() + num);
getPath().displayScore(getScore());
}
function addItUp() {
var _local10 = 0;
var _local5 = 0;
while (_local5 < 10) {
var _local3 = false;
var _local6 = 100;
var _local8 = 100;
var _local4 = 0;
while (_local4 < getPiles()[_local5].getTopCards().length) {
var _local2 = getPiles()[_local5].getTopCards()[_local4];
if (_local3) {
var _local7 = (_local6 - _local2.getFaceValue()) == 1;
var _local9 = _local8 == _local2.getSuit();
if (_local7 && (_local9)) {
_local10++;
if (_local6 == 12) {
_local10++;
}
} else {
_local3 = false;
}
}
if (!_local3) {
if (_local2.getFaceValue() == 12) {
_local3 = true;
}
}
_local6 = _local2.getFaceValue();
_local8 = _local2.getSuit();
_local4++;
}
_local5++;
}
return(_local10);
}
function calculateScore(win) {
var _local2 = addItUp();
return(_local2);
}
function checkWin() {
var _local4 = false;
var _local3 = 0;
var _local2 = 0;
while (_local2 < getPiles().length) {
if (getPile(_local2).getTopCards().length == 13) {
_local3++;
}
_local2++;
}
if (_local3 == 4) {
_local4 = true;
}
return(_local4);
}
function checkForWin() {
var _local2 = checkWin();
var _local3 = calculateScore(_local2);
getPath()._parent.menu_mc.updateScore(_local3);
if (_local2) {
getPath().gameOver(true, _local3);
}
}
function setScore(num) {
score = num;
}
function getScore() {
return(score);
}
function getDeckXML() {
return(DM.toXML());
}
function setGlobalSnap(val) {
cards.Card.globalSnap = val;
}
function getGlobalSnap() {
return(cards.Card.globalSnap);
}
function getAllPiles() {
return(allPiles);
}
function toXML() {
var _local2 = "<Game type='Scorpion'>";
_local2 = _local2 + (("<Time millis='" + getPath()._parent.menu_mc.timer_mc.getMS()) + "'/>");
_local2 = _local2 + getOptions().toXML();
_local2 = _local2 + DM.toXML();
_local2 = _local2 + getHistory().toXML();
_local2 = _local2 + "</Game>";
return(_local2);
}
function fromXML(info) {
loadedFromXML = true;
var _local3 = info.firstChild.childNodes;
var _local5;
var _local6;
var _local7;
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].nodeName == "Cards") {
_local5 = _local3[_local2];
} else if (_local3[_local2].nodeName == "History") {
_local6 = _local3[_local2];
} else if (_local3[_local2].nodeName == "Options") {
_local7 = new XML(_local3[_local2].toString());
} else if (_local3[_local2].nodeName == "Time") {
var _local4 = Number(_local3[_local2].attributes.millis);
getPath()._parent.menu_mc.timer_mc.start(_local4);
}
_local2++;
}
setOptions(getPath()._parent.OM.parse(_local7));
DM.fromXML(_local5, this);
setUpTable();
getHistory().fromXML(_local6, this);
getPath()._parent.menu_mc.setGameNumber();
}
function setHistory(tmp) {
UE = tmp;
}
function getHistory() {
return(UE);
}
function addHistoryAction(ob) {
getHistory().addAction(ob);
}
function setSoundOn(val) {
soundOn = val;
}
function getSoundOn() {
return(soundOn);
}
function playSound(which) {
if (soundOn) {
SM.createSound(which);
}
}
function enableGame() {
cards.UI.addMouseDownListener();
cards.UI.addMouseUpListener();
cards.UI.addMouseMoveListener();
}
function determineWhatWasClicked(doubleClick) {
if (getStock().checkMouse()) {
uiRedirect = getStock();
uiRedirect.mouseDown(doubleClick);
} else {
var _local3 = false;
var _local2 = 0;
while (_local2 < getPiles().length) {
if (getPile(_local2).checkMouse()) {
uiRedirect = getPile(_local2);
uiRedirect.mouseDown(doubleClick);
_local3 = true;
break;
}
_local2++;
}
}
}
function compareCards2(tmp_card, ind) {
if (ind != undefined) {
getPile(ind).addTopCards([tmp_card]);
getStock().removeCards([tmp_card]);
}
checkForWin();
}
function compareCards(tmp_card, isStock, index, cards, doubleClick) {
var _local8 = false;
var _local2 = 0;
while (_local2 < getPiles().length) {
if (_local2 != index) {
if (getPile(_local2).compareCards(tmp_card)) {
_local8 = true;
cards = uiRedirect.removeCardsToDrag();
getPile(_local2).addTopCards(cards);
var _local3 = new Object();
_local3.minorActions = new Array();
var _local5 = new Object();
_local5.path = uiRedirect;
_local5.method = "removeCards";
_local5.reversePath = uiRedirect;
_local5.reverseMethod = "addTopCards";
_local5.cards = cards;
_local3.minorActions.push(_local5);
var _local4 = new Object();
_local4.method = "addTopCards";
_local4.path = getPile(_local2);
_local4.reversePath = getPile(_local2);
_local4.reverseMethod = "removeCards";
_local4.cards = cards;
_local3.minorActions.push(_local4);
if (isStock && (getStock().getGrouping().length == 0)) {
getStock().resurrectLastCollapsedCard();
var _local6 = new Object();
_local6.path = uiRedirect;
_local6.method = "resurrectLastCollapsedCard";
_local6.reversePath = uiRedirect;
_local6.reverseMethod = "recollapse";
_local3.minorActions.unshift(_local6);
} else if ((uiRedirect.getTopCards().length == 0) && (uiRedirect.getBottomCards().length > 0)) {
_local3.minorActions.push(uiRedirect.convertTopCard(false));
}
addHistoryAction(_local3);
break;
}
}
_local2++;
}
_local2 = 0;
while (_local2 < getFoundations().length) {
if (getFoundations()[_local2].getIndex() != index) {
if (getFoundations()[_local2].compareCards(tmp_card, doubleClick)) {
_local8 = true;
cards = uiRedirect.removeCardsToDrag();
getFoundations()[_local2].addTopCards(cards);
var _local3 = new Object();
_local3.minorActions = new Array();
var _local5 = new Object();
_local5.path = uiRedirect;
_local5.method = "removeCards";
_local5.reversePath = uiRedirect;
_local5.reverseMethod = "addTopCards";
_local5.cards = cards;
_local3.minorActions.push(_local5);
var _local4 = new Object();
_local4.path = getFoundations()[_local2];
_local4.method = "addTopCards";
_local4.reversePath = getFoundations()[_local2];
_local4.reverseMethod = "removeCards";
_local4.cards = cards;
_local3.minorActions.push(_local4);
if (isStock && (getStock().getGrouping().length == 0)) {
getStock().resurrectLastCollapsedCard();
var _local6 = new Object();
_local6.path = uiRedirect;
_local6.method = "resurrectLastCollapsedCard";
_local6.reversePath = uiRedirect;
_local6.reverseMethod = "recollapse";
_local3.minorActions.unshift(_local6);
} else if ((uiRedirect.getTopCards().length == 0) && (uiRedirect.getBottomCards().length > 0)) {
_local3.minorActions.push(uiRedirect.convertTopCard(false));
}
addHistoryAction(_local3);
break;
}
}
_local2++;
}
if (_local8) {
checkForWin();
playSound("click");
}
}
function mouseDown(doubleClick) {
determineWhatWasClicked(doubleClick);
}
function mouseUp() {
uiRedirect.mouseUp();
uiRedirect = null;
}
function mouseMove() {
if (cards.UI.mouseIsDown) {
uiRedirect.mouseMove();
}
}
function setPath(tmpPath) {
path = tmpPath;
}
function getPath() {
return(path);
}
function setDeckXML(str) {
deckXML = str;
}
function initialize() {
var _local2 = getGlobalSnap();
setGlobalSnap(true);
if (loadedFromXML) {
}
if (!loadedFromXML) {
setOptions(getPath()._parent.OM.getOptionsByName(getPath().gameName));
if (deckXML != undefined) {
var _local3 = new XML(deckXML);
DM.fromXML(_local3.firstChild.firstChild);
}
setUpTable();
}
getHistory().setLocked(true);
createPhysicalAssets();
getHistory().setLocked(false);
if (!loadedFromXML) {
getHistory().reset();
} else {
getHistory().resume();
}
setGlobalSnap(_local2);
getPath()._parent.menu_mc.updateScore(calculateScore());
}
function flipUpTopCards() {
var _local2 = 0;
while (_local2 < getPiles().length) {
getPile(_local2).convertTopCard();
_local2++;
}
}
function createPhysicalAssets() {
var _local6 = 20;
var _local4 = cards.Card.getWidth();
var _local5 = (600 - (7 * _local4)) / 6;
var _local7 = 90;
var _local9 = true;
var _local3 = 4;
if (!_local9) {
_local3 = 0;
}
var _local2 = 0;
while (_local2 < getPiles().length) {
getPile(_local2).initialize(_local6, _local4, _local5, _local7, _local3, this);
_local2++;
}
var _local8 = getPile(0).getHitArea()._x;
_local7 = 340;
getStock().setHitArea(addHitArea(_local8, _local7));
getStock().setGroupY(_local7);
getStock().setDeckX(_local8);
getStock().setDeckY(_local7);
getStock().initialize();
}
function addHitArea(x, y) {
var _local3 = ++hitAreaDepth;
var _local2 = getPath().attachMovie("hitArea_mc", "hitArea" + _local3.toString(), _local3);
_local2._x = x;
_local2._y = y;
_local2._width = cards.Card.getWidth();
_local2._height = cards.Card.getHeight();
return(_local2);
}
function saveInAllPiles(tmp_pile) {
allPiles[tmp_pile.getIndex()] = tmp_pile;
}
function setUpTable() {
var _local5 = 0;
while (_local5 < 7) {
var _local4 = new cards.Solitaire.Scorpion.Pile();
_local4.setType("tableau");
_local4.setIndex(_local5);
_local4.setDepthBase((_local5 + 1) * 1000);
_local4.setGame(this);
_local4.setPath(getPath());
getPiles().push(_local4);
saveInAllPiles(_local4);
_local5++;
}
var _local7 = DM.getDeck();
var _local6 = 0;
_local5 = 0;
while (_local5 < 7) {
var _local2 = 0;
while (_local2 < getPiles().length) {
var _local3 = _local7.dealCard();
_local3.setPath(getPath());
var _local4 = getPile(_local2);
_local4.addBottomCard(_local3);
_local2++;
}
_local6++;
if (_local6 >= getPiles().length) {
_local6 = 0;
}
_local5++;
}
myStock = new cards.Solitaire.Scorpion.Stock();
getStock().setPath(getPath());
getStock().setDeck(_local7);
getStock().setDepthBase(20000);
getStock().setGame(this);
}
function getStock() {
return(myStock);
}
function getFoundations() {
return(foundations);
}
function getDestination(num) {
return(getFoundations()[num]);
}
function getPiles() {
return(piles);
}
function getPile(num) {
return(getPiles()[num]);
}
}
Symbol 458 MovieClip [__Packages.cards.Solitaire.Scorpion.Stock] Frame 0
class cards.Solitaire.Scorpion.Stock extends cards.Solitaire.StockBase
{
var grouping, cardsToReplace, timesThroughPile, timesAllowedThroughPile, isStock, game, dragDepth, dragging, getXShift, getYShift, depthBase, numInGroup, deckX, deckY, groupX, groupY, path, myDeck, hitArea;
function Stock () {
super();
setIsStock(true);
setNumInGroup(3);
grouping = new Array();
cardsToReplace = new Array();
setGroupX(100);
setDragging(false);
setDragDepth(60000);
setTimesThroughPile(1);
setTimesAllowedThroughPile(1);
}
function setTimesThroughPile(num) {
timesThroughPile = num;
}
function getTimesThroughPile() {
return(timesThroughPile);
}
function setTimesAllowedThroughPile(val) {
timesAllowedThroughPile = val;
}
function getTimesAllowedThroughPile() {
return(timesAllowedThroughPile);
}
function setIsStock(val) {
isStock = val;
}
function getIsStock() {
return(isStock);
}
function setGame(tmp) {
game = tmp;
}
function getGame() {
return(game);
}
function setDragDepth(num) {
dragDepth = num;
}
function getDragDepth() {
return(dragDepth);
}
function initializeDepths() {
var _local4 = getDeck().getPile();
var _local5 = getDepthBase();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].getClip();
_local3.swapDepths(_local5 + _local2);
_local2++;
}
}
function checkMouse() {
var _local2 = getHitArea().hitTest(getPath()._xmouse, getPath()._ymouse);
var _local3 = getGrouping()[getGrouping().length - 1].getClip().hitTest(getPath()._xmouse, getPath()._ymouse);
return(_local2 || (_local3));
}
function mouseDown(doubleClick) {
var _local2 = getHitArea().hitTest(getPath()._xmouse, getPath()._ymouse);
if (_local2) {
dealAll();
}
}
function startDragging() {
getGame().dragging();
setDragging(true);
}
function removeCardsToDrag() {
if (getGrouping().length == 0) {
}
var _local2 = getGrouping().shift();
return([_local2]);
}
function removeCards() {
removeCardsToDrag();
}
function addTopCards(arr) {
var _local3 = arr[0];
getCardsToReplace().push(arr[0]);
}
function setDragging(val) {
dragging = val;
}
function getDragging() {
return(dragging);
}
function mouseMove() {
if (getDragging()) {
var _local4 = getPath()._ymouse;
var _local3 = getPath()._xmouse;
var _local6 = _local3 + getXShift();
var _local5 = _local4 + getYShift();
var _local2 = getGrouping()[getGrouping().length - 1].getClip();
_local2._x = _local6;
_local2._y = _local5;
}
}
function mouseUp(num) {
getGame().compareCards2(getGrouping()[0], num);
setDragging(false);
if (getDragging()) {
}
}
function setDepthBase(num) {
depthBase = num;
}
function getDepthBase() {
return(depthBase);
}
function getNumInGroup() {
return(numInGroup);
}
function setNumInGroup(num) {
numInGroup = num;
}
function setDeckX(val) {
deckX = val;
}
function getDeckX() {
return(deckX);
}
function setDeckY(val) {
deckY = val;
}
function getDeckY() {
return(deckY);
}
function setGroupX(val) {
groupX = val;
}
function getGroupX() {
return(groupX);
}
function setGroupY(val) {
groupY = val;
}
function getGroupY() {
return(groupY);
}
function setPath(tmp) {
path = tmp;
}
function getPath() {
return(path);
}
function getGrouping() {
return(grouping);
}
function getCardsToReplace() {
return(cardsToReplace);
}
function replaceDeck() {
while (getCardsToReplace().length > 0) {
var _local2 = getCardsToReplace().pop();
_local2.flip(false);
getDeck().placeCardOnPile(_local2);
_local2.Move(getDeckX(), getDeckY());
}
initializeDepths();
}
function initialize() {
var _local4 = getDeck().getPile();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local3.create(getDeckX(), getDeckY());
_local2++;
}
initializeDepths();
}
function resurrectLastCollapsedCard() {
var _local2 = getCardsToReplace().pop();
if (_local2 != undefined) {
getGrouping().unshift(_local2);
_local2.Move(getGroupX(), getGroupY());
placeGrouping();
}
}
function recollapse() {
var _local2 = getGrouping().shift();
getCardsToReplace().push(_local2);
_local2.Move(getGroupX(), getGroupY());
placeGrouping();
}
function collapseCurrentGrouping() {
while (getGrouping().length > 0) {
var _local2 = getGrouping().shift();
getCardsToReplace().push(_local2);
_local2.Move(getGroupX(), getGroupY());
}
}
function showPreviousGrouping() {
while (getGrouping().length > 0) {
var _local2 = getGrouping().pop();
_local2.flip(false);
getDeck().placeCardOnPile(_local2);
_local2.Move(getDeckX(), getDeckY());
}
var _local3 = 0;
while ((getCardsToReplace().length > 0) && (_local3 < getNumInGroup())) {
_local3++;
var _local2 = getCardsToReplace().pop();
if (_local2 != undefined) {
getGrouping().unshift(_local2);
_local2.Move(getGroupX(), getGroupY());
}
}
placeGrouping();
}
function showNextGrouping() {
var _local3 = 0;
while (_local3 < 3) {
var _local2 = getDeck().dealCard();
_local2.flip(true);
if (_local2 != undefined) {
getGrouping().push(_local2);
}
_local3++;
}
startDragging();
mouseUp(0);
startDragging();
mouseUp(1);
startDragging();
mouseUp(2);
saveForUndo("showNextGrouping", "returnGrouping");
}
function returnGrouping() {
var _local2 = getGame().getPile(0);
var _local4 = getGame().getPile(1);
var _local3 = getGame().getPile(2);
var _local7 = _local2.getTopCards()[_local2.getTopCards().length - 1];
var _local6 = _local4.getTopCards()[_local4.getTopCards().length - 1];
var _local5 = _local3.getTopCards()[_local3.getTopCards().length - 1];
_local2.removeCards([_local7]);
_local4.removeCards([_local6]);
_local3.removeCards([_local5]);
addTopCards([_local7]);
addTopCards([_local6]);
addTopCards([_local5]);
replaceDeck();
}
function saveForUndo(method, reverseMethod) {
var _local3 = new Object();
_local3.minorActions = new Array();
var _local2 = new Object();
_local2.path = this;
_local2.method = method;
_local2.reversePath = this;
_local2.reverseMethod = reverseMethod;
_local3.minorActions.push(_local2);
getGame().addHistoryAction(_local3);
}
function placeGrouping() {
var _local4 = getDepthBase() + 500;
var _local2 = 0;
while (_local2 < getGrouping().length) {
var _local3 = getGrouping()[_local2];
_local3.Move(getGroupX() + (_local2 * 20), getGroupY(), false, 0.7);
_local3.flip(true);
_local3.getClip().swapDepths((_local4 + getCardsToReplace().length) + _local2);
_local2++;
}
}
function dealAll() {
nextGrouping();
}
function nextGrouping() {
if (getDeck().getPile().length > 0) {
showNextGrouping();
}
}
function setDeck(tmp) {
myDeck = tmp;
var _local2 = 0;
while (_local2 < getDeck().getPile().length) {
var _local3 = getDeck().getPile()[_local2];
_local3.setPath(getPath());
_local2++;
}
}
function getDeck() {
return(myDeck);
}
function getPile() {
return(getDeck().getPile());
}
function setHitArea(tmp) {
hitArea = tmp;
}
function getHitArea() {
return(hitArea);
}
}
Symbol 459 MovieClip [__Packages.cards.Solitaire.Scorpion.Pile] Frame 0
class cards.Solitaire.Scorpion.Pile extends cards.Solitaire.PileBase
{
var bottomCards, topCards, cardsToDrag, path, game, dragging, bottomCascade, topCascade, baseX, baseY, depthBase, type, hitArea, setGroupXShift, setGroupYShift, getGroupXShift, getGroupYShift, index;
function Pile () {
super();
bottomCards = new Array();
topCards = new Array();
cardsToDrag = new Array();
setTopCascade(15);
setDragging(false);
}
function setPath(tmp) {
path = tmp;
}
function getPath() {
return(path);
}
function setGame(tmp) {
game = tmp;
}
function getGame() {
return(game);
}
function compareCards(tmp_card1, doubleClick) {
var _local2 = false;
if (getType() == "tableau") {
if (getTopCards().length > 0) {
var _local4 = getTopCards()[getTopCards().length - 1];
if (tmp_card1.getClip().hitTest(_local4.getClip())) {
var _local5 = tmp_card1.getSuit() == _local4.getSuit();
var _local7 = (_local4.getFaceValue() - tmp_card1.getFaceValue()) == 1;
if (_local5 && (_local7)) {
_local2 = true;
} else {
_local2 = false;
}
}
} else if (getBottomCards().length > 0) {
_local2 = false;
} else if ((getBottomCards().length == 0) && (getTopCards().length == 0)) {
var _local6 = tmp_card1.getFaceValue() == 12;
var _local8 = tmp_card1.getClip().hitTest(getHitArea());
if (_local6 && (_local8)) {
_local2 = true;
}
}
}
return(_local2);
}
function setDragging(val) {
dragging = val;
}
function getDragging() {
return(dragging);
}
function setBottomCascade(val) {
bottomCascade = val;
}
function getBottomCascade() {
return(bottomCascade);
}
function setTopCascade(num) {
topCascade = num;
}
function getTopCascade() {
return(topCascade);
}
function setBaseX(val) {
baseX = val;
}
function getBaseX() {
return(baseX);
}
function setBaseY(val) {
baseY = val;
}
function getBaseY() {
return(baseY);
}
function setDepthBase(num) {
depthBase = num;
}
function getDepthBase() {
return(depthBase);
}
function initializeDepths() {
var _local4 = getBottomCards();
var _local5 = getDepthBase();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].getClip();
_local3.swapDepths(_local5 + _local2);
_local2++;
}
}
function setType(str) {
type = str;
}
function getType() {
return(type);
}
function setHitArea(clip) {
hitArea = clip;
}
function getHitArea() {
return(hitArea);
}
function convertTopCard(saveIt) {
var _local4 = removeBottomCard();
_local4.flip(true);
addTopCards([_local4]);
var _local2 = new Object();
_local2.path = this;
_local2.method = "convertTopCard";
_local2.reversePath = this;
_local2.reverseMethod = "revertTopCard";
if ((saveIt == true) || (saveIt == undefined)) {
var _local3 = new Object();
_local3.minorActions = new Array();
_local3.minorActions.push(_local2);
getGame().addHistoryAction(_local3);
}
return(_local2);
}
function revertTopCard() {
var _local2 = getTopCards().shift();
_local2.flip(false);
getBottomCards().push(_local2);
initializeDepths();
applyTopPositions();
applyTopDepths();
}
function initialize(leftMargin, width, spacing, y, cascadeShift, sol) {
setBottomCascade(cascadeShift);
var _local5 = leftMargin + (getIndex() * (width + spacing));
setBaseX(_local5);
setBaseY(y);
var _local2 = 0;
while (_local2 < getBottomCards().length) {
var _local3 = getBottomCards()[_local2];
var _local4 = getBottomCascade() * _local2;
_local3.create(_local5, y + _local4);
if (_local2 == 0) {
setHitArea(sol.addHitArea(_local5, y));
}
_local2++;
}
initializeDepths();
convertTopCard();
convertTopCard();
convertTopCard();
convertTopCard();
if (getIndex() > 3) {
convertTopCard();
convertTopCard();
convertTopCard();
}
}
function addTopCards(cards) {
var _local2 = 0;
while (_local2 < cards.length) {
addTopCard(cards[_local2]);
_local2++;
}
applyTopPositions();
applyTopDepths();
if (getType() == "foundation") {
}
}
function applyTopPositions() {
var _local7 = getBaseX();
var _local3;
var _local6 = getTopCascade();
var _local4 = getTopCards();
var _local2 = 0;
while (_local2 < _local4.length) {
var _local5 = _local4[_local2];
if ((_local2 == 0) && (getBottomCards().length == 0)) {
_local3 = getBaseY();
} else if ((_local2 == 0) && (getBottomCards().length > 0)) {
_local3 = getBottomCards()[getBottomCards().length - 1].getEndY() + getBottomCascade();
} else {
_local3 = _local4[_local2 - 1].getEndY() + _local6;
}
_local5.Move(_local7, _local3, false, 0.7);
_local2++;
}
}
function addTopCard(tmp_card) {
getTopCards().push(tmp_card);
}
function applyTopDepths(cards, db) {
applyDepths(getTopCards(), getDepthBase() + 500);
}
function applyDepths(cards, db) {
var _local1 = 0;
while (_local1 < cards.length) {
cards[_local1].getClip().swapDepths(db + _local1);
_local1++;
}
}
function getBottomCards() {
return(bottomCards);
}
function startGroupDrag(index) {
getGame().dragging();
setDragging(true);
cardsToDrag = getTopCards().slice(index);
var _local3 = cardsToDrag[0].getClip()._x - getPath()._xmouse;
var _local2 = cardsToDrag[0].getClip()._y - getPath()._ymouse;
setGroupXShift(_local3);
setGroupYShift(_local2);
applyDepths(cardsToDrag, highestDepth);
}
function removeCardsToDrag() {
var _local3;
var _local2 = 0;
while (_local2 < getTopCards().length) {
if (getTopCards()[_local2] == cardsToDrag[0]) {
_local3 = _local2;
break;
}
_local2++;
}
return(removeTopCards(_local3));
}
function removeTopCards(index) {
var _local2 = getTopCards().slice(index);
getTopCards().splice(index);
if (getType() == "foundation") {
getGame().addToScore(-10);
}
return(_local2);
}
function removeCards(cards) {
var _local3;
var _local2 = 0;
while (_local2 < getTopCards().length) {
if (getTopCards()[_local2] == cards[0]) {
_local3 = _local2;
break;
}
_local2++;
}
return(removeTopCards(_local3));
}
function mouseUp(doubleClick) {
var _local3 = doubleClick && (getCardsToDrag().length == 1);
var _local2 = getCardsToDrag()[0];
getGame().compareCards(_local2, false, getIndex(), getCardsToDrag(), _local3);
applyTopPositions();
applyTopDepths();
setDragging(false);
}
function getCardsToDrag() {
return(cardsToDrag);
}
function mouseMove() {
if (getDragging()) {
var _local5 = getPath()._ymouse;
var _local7 = getPath()._xmouse;
var _local6 = _local7 + getGroupXShift();
var _local3;
var _local2 = 0;
while (_local2 < cardsToDrag.length) {
var _local4 = getCardsToDrag()[_local2];
if (_local2 == 0) {
_local3 = _local5 + getGroupYShift();
} else {
_local3 = cardsToDrag[_local2 - 1].getClip()._y + getTopCascade();
}
_local4.Move(_local6, _local3);
_local2++;
}
}
}
function checkMouse() {
var _local4 = getHitArea().hitTest(getPath()._xmouse, getPath()._ymouse);
var _local3 = false;
var _local2 = getTopCards().length - 1;
while (_local2 >= 0) {
if (getTopCards()[_local2].getClip().hitTest(getPath()._xmouse, getPath()._ymouse)) {
_local3 = true;
break;
}
_local2--;
}
return(_local4 || (_local3));
}
function mouseDown(doubleClick) {
if (getType() == "tableau") {
if (getTopCards().length == 0) {
var _local5 = getHitArea().hitTest(getPath()._xmouse, getPath()._ymouse);
if (_local5 && (getBottomCards().length > 0)) {
convertTopCard();
}
} else {
var _local2 = getTopCards().length - 1;
while (_local2 >= 0) {
if (getTopCards()[_local2].checkMouse() && (!doubleClick)) {
startGroupDrag(_local2);
break;
}
if (getTopCards()[_local2].checkMouse() && (doubleClick)) {
startGroupDrag(_local2);
mouseUp(doubleClick);
}
_local2--;
}
}
} else if (getType() == "foundation") {
var _local4 = getTopCards().length - 1;
if (_local4 >= 0) {
startGroupDrag(_local4);
}
}
mouseMove();
}
function addBottomCard(tmp_card) {
getBottomCards().push(tmp_card);
}
function getBottomCard() {
return(getBottomCards()[getBottomCards().length - 1]);
}
function removeBottomCard() {
var _local2 = getBottomCards().pop();
return(_local2);
}
function getTopCards() {
return(topCards);
}
function getTopCard() {
return(getTopCards()[getTopCards().length - 1]);
}
function getIndex() {
return(index);
}
function setIndex(num) {
index = num;
}
var highestDepth = 50000;
}
Symbol 117 MovieClip Frame 1
function Crypto(front, game, base, factor) {
this.front = front;
this.game = game;
this.base = base;
this.factor = factor;
}
function reverse(str) {
var _local3 = "";
var _local1 = 1;
while (_local1 <= str.length) {
_local3 = _local3 + str.substr(str.length - _local1, 1);
_local1++;
}
return(_local3);
}
function decryptAndValidate(toDecrypt) {
var _local3 = false;
var _local1 = crypt.decrypt(toDecrypt, reverse(crypt.front) + crypt.front);
_local1 = _local1.substr(crypt.game.length);
var _local2 = Number(_local1);
var _local4 = (_local2 - crypt.base) % crypt.factor;
if ((_local2 > 1000000) && (_local4 == 0)) {
_local3 = true;
}
return(_local3);
}
Crypto.prototype.myescape = function (value) {
if (value == "") {
return("%00");
}
return(escape(value));
};
Crypto.prototype.xor = function (aKey) {
var _local3 = "";
var _local4;
var _local5 = 0;
var _local2 = 0;
while (_local2 < this.source.length) {
_local4 = this.source[_local2].charCodeAt(0);
_local4 = _local4 ^ aKey.charCodeAt(_local5);
_local5 = (_local5 + 1) % aKey.length;
_local3 = _local3.concat(String.fromCharCode(_local4));
_local2++;
}
this.help = new Array();
_local2 = 0;
while (_local2 < _local3.length) {
this.help[_local2] = _local3.charAt(_local2);
_local2++;
}
};
Crypto.prototype.encrypt = function (str, pass) {
str = str.toString();
this.source = new Array();
var _local5 = 0;
var _local2 = 0;
while (_local2 < str.length) {
this.source[_local5] = str.charAt(_local2);
_local5++;
_local2++;
}
this.xor(pass);
var _local3 = "";
_local2 = 0;
while (_local2 < this.help.length) {
_local3 = _local3.concat(this.myescape(this.help[_local2]));
_local2++;
}
delete this.source;
delete this.help;
return(_local3);
};
Crypto.prototype.decrypt = function (str, pass) {
this.source = new Array();
var _local3 = 0;
var _local4 = 0;
while (_local4 < str.length) {
if (str.charAt(_local4) == "%") {
this.source[_local3] = (str.charAt(_local4) + str.charAt(_local4 + 1)) + str.charAt(_local4 + 2);
_local4 = _local4 + 2;
} else {
this.source[_local3] = str.charAt(_local4);
}
this.source[_local3] = unescape(this.source[_local3]);
_local3++;
_local4++;
}
this.xor(pass);
var _local5 = "";
_local4 = 0;
while (_local4 < this.help.length) {
_local5 = _local5.concat(this.help[_local4]);
_local4++;
}
delete this.source;
delete this.help;
return(_local5);
};
crypt = new Crypto("lazydog", "sv1", 1234567, 47);
Symbol 138 MovieClip Frame 1
function ok() {
gotoFrame1();
}
function endGame() {
_parent.menu_mc.gameCompletelyDone(false);
}
function gotoFrame1() {
restoreUI();
gotoAndStop (1);
}
function cancel() {
gotoFrame1();
}
function popup(where, tmp_val) {
cancelWhenDone = tmp_val;
saveUIVal();
if (where == "Submit Score") {
next = "new hand";
}
gotoAndStop(where);
bg_btn.useHandCursor = false;
}
function saveUIVal() {
uiVal = cards.UI.getEnabled();
cards.UI.disable();
_parent.menu_mc.timer_mc.pause();
}
function restoreUI() {
if (uiVal) {
cards.UI.enable();
_parent.menu_mc.timer_mc.resume();
} else {
cards.UI.disable();
}
}
stop();
var uiVal = true;
Symbol 138 MovieClip Frame 3
function done() {
_parent.gotoAndStop("refresh");
cancel();
}
yes_btn.onRelease = function () {
endGame();
done();
};
cancel_btn.onRelease = function () {
cancel();
};
Symbol 138 MovieClip Frame 11
yes_btn.onRelease = function () {
endGame();
next = "Select Hand";
gotoAndStop ("Submit Score");
};
cancel_btn.onRelease = function () {
cancel();
};
Symbol 138 MovieClip Frame 16
yes_btn.onRelease = function () {
endGame();
next = "replay hand";
gotoAndStop ("Submit Score");
};
cancel_btn.onRelease = function () {
cancel();
};
Symbol 138 MovieClip Frame 70
stop();
gotoFrame1();
Symbol 148 MovieClip Frame 1
stop();
Symbol 161 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 1
stop();
Symbol 212 Button
on (release) {
nextFrame();
}
Symbol 222 Button
on (release) {
prevFrame();
}
Symbol 302 MovieClip Frame 1
function popup(where) {
saveUIVal();
gotoAndStop(where);
icon_mc.gotoAndStop(where);
cancel_btn.onRelease = cancel;
bg_btn.useHandCursor = false;
}
function cancel() {
restoreUI();
gotoAndStop (1);
}
function saveUIVal() {
uiVal = cards.UI.getEnabled();
cards.UI.disable();
_parent.menu_mc.timer_mc.pause();
}
function restoreUI() {
if (uiVal) {
cards.UI.enable();
_parent.menu_mc.timer_mc.resume();
} else {
cards.UI.disable();
}
}
stop();
var uiVal = true;
Symbol 305 MovieClip Frame 1
function playRandomSound() {
var _local2 = random(2) + 1;
var _local1 = "fw" + _local2.toString();
SM.createSound(_local1);
}
function start(which) {
if (which == undefined) {
which = 2;
}
display = new Array();
var _local3;
var _local2;
if (which == 1) {
_local3 = 5;
_local2 = 70;
} else if (which == 2) {
_local3 = 8;
_local2 = 100;
} else if (which == 3) {
_local3 = 16;
_local2 = 200;
}
var _local1 = 0;
while (_local1 < _local3) {
display.push(random(_local2));
_local1++;
}
display.sort(16);
startFireworks();
}
function everyFrame() {
frames++;
if (frames == display[0]) {
createFirework();
display.shift();
frames--;
}
if (display.length == 0) {
endID = setInterval(endFunc, 1500);
delete this.onEnterFrame;
}
}
function endFunc() {
_parent.menu_mc.happyAnimationDone();
clearInterval(endID);
}
function startFireworks() {
frames = -1;
this.onEnterFrame = everyFrame;
}
function getRandomTransform() {
return(transforms[random(transforms.length)]);
}
function createFirework() {
depth++;
var _local3 = "fireworks" + depth;
var _local2 = this.attachMovie(linkage, _local3, depth);
_local2.gotoAndStop(chooseRandomFrame());
_local2._x = 100 + random(400);
_local2._y = 100 + random(200);
var _local4 = 60 + random(40);
_local2._xscale = (_local2._yscale = _local4);
myColorTransform = getRandomTransform();
var _local5 = new Color(_local2);
_local5.setTransform(myColorTransform);
playRandomSound();
}
function chooseRandomFrame() {
return(aniFrames[random(aniFrames.length)]);
}
stop();
var linkage = "fireworks_ani";
var depth = 100;
var aniFrames = ["Fireworks2"];
var SM = Sounds.SoundManager.getInstance();
var transforms = new Array();
transforms.push({ra:96, rb:370, ga:85, gb:60, ba:61, bb:-61, aa:100, ab:0});
transforms.push({ra:96, rb:37, ga:96, gb:-56, ba:61, bb:-93, aa:100, ab:0});
transforms.push({ra:96, rb:-5, ga:83, gb:-195, ba:43, bb:-51, aa:100, ab:0});
transforms.push({ra:96, rb:27, ga:83, gb:-140, ba:43, bb:153, aa:100, ab:0});
transforms.push({ra:45, rb:13, ga:67, gb:-79, ba:100, bb:4, aa:100, ab:0});
transforms.push({ra:40, rb:-47, ga:69, gb:-56, ba:100, bb:0, aa:100, ab:0});
transforms.push({ra:40, rb:-47, ga:69, gb:78, ba:100, bb:0, aa:100, ab:0});
transforms.push({ra:52, rb:-42, ga:69, gb:83, ba:100, bb:-255, aa:100, ab:0});
var display;
Symbol 332 MovieClip Frame 1
stop();
Symbol 343 Button
on (release) {
clicked("rules");
}
Symbol 346 Button
on (release) {
downloadDemo();
}
Symbol 360 Button
on (release) {
gotoAndStop ("Menu");
}
Symbol 365 MovieClip Frame 1
stop();
Symbol 380 MovieClip Frame 1
function show(which) {
if (!isNaN(which)) {
gotoAndStop(Number(which) + 1);
} else if (which == ",") {
} else if (which == "$") {
}
}
stop();
Symbol 381 MovieClip Frame 1
function animate(tmp_startNum, tmp_stopNum) {
startNum = tmp_startNum;
stopNum = tmp_stopNum;
currentNum = startNum;
incNum = Math.round((stopNum - startNum) / 10);
if (incNum < 1) {
incNum = 1;
}
this.onEnterFrame = animateIt;
}
function animateIt() {
if (ani == 0) {
currentNum = currentNum + incNum;
if (currentNum > stopNum) {
currentNum = stopNum;
}
setScore(currentNum);
SM.createSound("coin");
if (currentNum == stopNum) {
delete this.onEnterFrame;
}
}
ani++;
if (ani == 4) {
ani = 0;
}
}
function setScore(num) {
reset();
var _local1 = num.toString();
if (_local1.substr(0, 1) == "$") {
showCommas = false;
}
if (showCommas) {
var _local2 = _local1.length;
if (_local1.length > 6) {
var _local3 = _local1.substr(_local2 - 3);
var _local4 = _local1.substring(_local2 - 6, _local2 - 3);
var _local5 = _local1.substr(0, _local2 - 6);
_local1 = (((_local5 + ",") + _local4) + ",") + _local3;
} else if (_local1.length > 3) {
var _local4 = _local1.substr(_local2 - 3);
var _local5 = _local1.substr(0, _local2 - 3);
_local1 = (_local5 + ",") + _local4;
}
}
display(_local1);
}
function display(str) {
var _local2 = 0;
while (_local2 < str.length) {
var _local5 = this["digit" + _local2];
_local5._visible = true;
var _local3 = Number(str.substr(_local2, 1)) + 1;
if (str.substr(_local2, 1) == ",") {
_local3 = 11;
} else if (str.substr(_local2, 1) == "$") {
_local3 = 12;
} else if (str.substr(_local2, 1) == "-") {
_local3 = 13;
}
_local5.gotoAndStop(_local3);
_local2++;
}
if (center) {
_x = (home - ((str.length / 2) * width));
}
}
function reset() {
var _local2 = 0;
while (_local2 < 12) {
this["digit" + _local2]._visible = false;
_local2++;
}
}
var showCommas = true;
home = _x;
width = 16;
center = false;
var startNum;
var stopNum;
var currentNum;
incNum = 10;
var SM = Sounds.SoundManager.getInstance();
ani = 0;
setScore(0);
Symbol 390 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 2
play();
Symbol 390 MovieClip Frame 8
stop();
Symbol 390 MovieClip Frame 9
play();
Symbol 390 MovieClip Frame 13
stop();
Symbol 390 MovieClip Frame 14
play();
Symbol 390 MovieClip Frame 17
stop();
Symbol 391 MovieClip Frame 1
stop();
Symbol 391 MovieClip Frame 2
lfcard01.nextFrame();
rcard01.nextFrame();
Symbol 391 MovieClip Frame 4
lfcard01_25.nextFrame();
rcard01_25.nextFrame();
Symbol 391 MovieClip Frame 6
lfcard01_5.nextFrame();
rcard01_5.nextFrame();
Symbol 391 MovieClip Frame 8
lfcard01_75.nextFrame();
rcard01_75.nextFrame();
Symbol 391 MovieClip Frame 10
lfcard02.nextFrame();
rcard02.nextFrame();
Symbol 391 MovieClip Frame 12
lfcard02_25.nextFrame();
rcard02_25.nextFrame();
Symbol 391 MovieClip Frame 14
lfcard02_5.nextFrame();
rcard02_5.nextFrame();
Symbol 391 MovieClip Frame 16
lfcard02_75.nextFrame();
rcard02_75.nextFrame();
Symbol 391 MovieClip Frame 18
lfcard03.nextFrame();
rcard03.nextFrame();
Symbol 391 MovieClip Frame 20
lfcard03_25.nextFrame();
rcard03_25.nextFrame();
Symbol 391 MovieClip Frame 22
lfcard03_5.nextFrame();
rcard03_5.nextFrame();
Symbol 391 MovieClip Frame 24
lfcard03_75.nextFrame();
rcard03_75.nextFrame();
Symbol 391 MovieClip Frame 31
lfcard01.nextFrame();
lfcard01_25.nextFrame();
lfcard01_5.nextFrame();
lfcard01_75.nextFrame();
lfcard02.nextFrame();
lfcard02_25.nextFrame();
lfcard02_5.nextFrame();
lfcard02_75.nextFrame();
lfcard03.nextFrame();
lfcard03_25.nextFrame();
lfcard03_5.nextFrame();
lfcard03_75.nextFrame();
rcard01.nextFrame();
rcard01_25.nextFrame();
rcard01_5.nextFrame();
rcard01_75.nextFrame();
rcard02.nextFrame();
rcard02_25.nextFrame();
rcard02_5.nextFrame();
rcard02_75.nextFrame();
rcard03.nextFrame();
rcard03_25.nextFrame();
rcard03_5.nextFrame();
rcard03_75.nextFrame();
Symbol 391 MovieClip Frame 38
lfcard01.nextFrame();
rcard01.nextFrame();
Symbol 391 MovieClip Frame 40
lfcard01_25.nextFrame();
rcard01_25.nextFrame();
Symbol 391 MovieClip Frame 42
lfcard01_5.nextFrame();
rcard01_5.nextFrame();
Symbol 391 MovieClip Frame 44
lfcard01_75.nextFrame();
rcard01_75.nextFrame();
Symbol 391 MovieClip Frame 46
lfcard02.nextFrame();
rcard02.nextFrame();
Symbol 391 MovieClip Frame 48
lfcard02_25.nextFrame();
rcard02_25.nextFrame();
Symbol 391 MovieClip Frame 50
lfcard02_5.nextFrame();
rcard02_5.nextFrame();
Symbol 391 MovieClip Frame 52
lfcard02_75.nextFrame();
rcard02_75.nextFrame();
Symbol 391 MovieClip Frame 54
lfcard03.nextFrame();
rcard03.nextFrame();
Symbol 391 MovieClip Frame 56
lfcard03_25.nextFrame();
rcard03_25.nextFrame();
Symbol 391 MovieClip Frame 58
lfcard03_5.nextFrame();
rcard03_5.nextFrame();
Symbol 391 MovieClip Frame 60
lfcard03_75.nextFrame();
rcard03_75.nextFrame();
Symbol 400 Button
on (rollOver) {
dd_mc.expand(true);
}
Symbol 408 Button
on (release) {
clicked("newHand");
}
Symbol 412 Button
on (release) {
clicked("menu");
}
Symbol 414 MovieClip Frame 1
function expand(val) {
if (!open) {
saveUIVal();
open = true;
gotoAndPlay ("Open");
} else if (open && (!val)) {
restoreUI();
open = false;
gotoAndStop (1);
delete this.onEnterFrame;
}
}
function saveUIVal() {
uiVal = cards.UI.getEnabled();
cards.UI.disable();
}
function restoreUI() {
if (uiVal) {
cards.UI.enable();
} else {
cards.UI.disable();
}
}
function clicked(which) {
expand(false);
_parent.clicked(which);
}
stop();
animating = false;
open = false;
var uiVal = true;
Symbol 414 MovieClip Frame 2
this.onEnterFrame = function () {
var _local4 = this._xmouse;
var _local3 = this._ymouse;
var _local2 = hitArea_mc;
if ((((_local4 < _local2._x) || (_local4 > (_local2._x + _local2._width))) || (_local3 < _local2._y)) || (_local3 > (_local2._y + _local2._height))) {
expand(false);
}
};
exit_btn.onRelease = function () {
clicked("exit");
};
animating = false;
stop();
Symbol 415 MovieClip Frame 1
function unpauseSelected() {
timer_mc.resume();
}
function pauseSelected() {
pauseCover_mc.gotoAndStop(2);
}
function sendTableToColorFrame() {
var _local2 = genOps.bin.TableColor;
_parent.bg_mc.gotoAndStop(_local2);
}
function happyAnimationDone() {
_parent.endGame_mc.popup("Submit Score", true);
}
function calculateTimeBonus() {
realMS = timer_mc.getRealMS();
var _local3 = getSol().getMaxTime();
var _local2 = getSol().getMaxBonus();
var _local1 = 1 - (realMS / _local3);
if (_local1 > 1) {
_local1 = 1;
} else if (_local1 < 0) {
_local1 = 0;
}
timeBonus = Math.round(_local1 * _local2);
}
function calculateScore() {
gameScore = getSol().calculateScore();
if (gameScore.substr(0, 1) == "$") {
gameScore = gameScore.substr(1);
gameScore = Number(gameScore);
}
gameScore = gameScore + timeBonus;
}
function determineAmount() {
var _local2 = 1;
var _local3 = getSol().getMaxTime();
var _local4 = getSol().getMaxBonus();
var _local1 = 1 - (realMS / _local3);
if (_local1 > 1) {
_local1 = 1;
} else if (_local1 < 0) {
_local1 = 0;
}
if (_local1 <= 0.33) {
_local2 = 1;
} else if (_local1 <= 0.66) {
_local2 = 2;
} else {
_local2 = 3;
}
return(_local2);
}
function gameOver(won, score) {
timer_mc.pause();
if (won) {
calculateTimeBonus();
calculateScore();
_parent.fireworks_mc.start(determineAmount());
} else {
calculateScore();
happyAnimationDone();
}
cards.UI.disable();
gameCompletelyDone(true);
trace((("Game Over, won=" + won) + ", score=") + score);
}
function updateScore(num) {
scoreDisplay_mc.setScore(num);
}
function submitScore(username) {
var _local6 = Math.round(realMS / 1000);
var _local4 = gameScore;
if (isNaN(_local6)) {
_local6 = 600;
}
if (_local4.substr(0, 1) == "$") {
_local4 = _local4.substr(1);
}
var _local2 = getSol().getOptions().bin;
var _local3 = "";
for (var _local5 in _local2) {
_local3 = _local3 + (((_local5 + "=") + _local2[_local5]) + ";");
}
var _local7 = (((((((username + "||") + game_txt.text) + "||") + _local6) + "||") + _local4) + "||") + _local3;
_parent.scores_mc.submitFinalScore(username, _local4, _local7, _parent.game_mc.gameName);
}
function gameCompletelyDone(won) {
if (getSol().getHistory().getActions().length >= 10) {
var _local2 = _parent.gameInfo.games[_parent.game_mc.gameName];
if (won) {
_local2.won++;
} else {
_local2.lost++;
}
_local2.played++;
gameInProgress = false;
_parent.saveGameInfo();
}
_parent.deleteGame(_parent.game_mc.gameName);
}
function applyGeneralOptions() {
sendTableToColorFrame();
timer_mc._visible = genOps.bin.ShowTimer;
cards.Card.setBack(genOps.bin.CardBack);
getSol().DM.getDeck().refreshBacks();
}
function go(where) {
clearInterval(undoID);
_parent.gotoAndStop(where);
}
function getSol() {
return(_parent.game_mc.sol);
}
function setGameNumber() {
var _local2 = getSol().DM.getDeck().getSeed();
var _local1 = _local2.toString();
if ((_local1 != undefined) && (_local1 != "undefined")) {
game_txt.text = _local1;
}
}
function showButton(val) {
if (val) {
_parent.bigButton_mc.gotoAndStop(2);
} else {
_parent.bigButton_mc.gotoAndStop(1);
}
}
function shuffleSoundDone() {
clearInterval(shuffleID);
showButton(false);
dealClicked();
}
function loadFailed() {
shuffling_mc._visible = true;
if (SM.getPlaySounds()) {
SM.createSound("shuffle");
shuffleID = setInterval(shuffleSoundDone, 2000);
shuffling_mc.ani_mc.gotoAndPlay(2);
showButton(true);
} else {
dealClicked();
}
}
function frameLoaded() {
_parent.startLoop();
scoreDisplay_mc.showCommas = true;
if (_parent.game_mc.gameName == "Vegas") {
scoreDisplay_mc.showCommas = false;
}
gameInProgress = true;
startInterval();
icon_mc.gotoAndStop(_parent.game_mc.gameName);
setGameNumber();
_parent.game_mc.gameLoaded(false);
}
function save() {
}
function clicked(which) {
if (which == "save") {
save();
} else if (which == "replayHand") {
_parent.where = _parent.game_mc.gameName;
_parent.seed = getSol().DM.getDeck().getSeed();
gameCompletelyDone(false);
_parent.gotoAndStop("refresh");
} else if (which == "exit") {
save();
_parent.exit();
} else if (which == "menu") {
save();
go("Menu");
} else if (which == "newHand") {
if (gameInProgress && (getSol().getHistory().getActions().length >= 10)) {
calculateScore();
_parent.endGame_mc.popup("End Game");
} else {
gameCompletelyDone(false);
_parent.where = _parent.game_mc.gameName;
_parent.gotoAndStop("refresh2");
}
} else if (which == "selectHand") {
if (gameInProgress && (getSol().getHistory().getActions().length >= 10)) {
calculateScore();
_parent.endGame_mc.popup("End Game2");
} else {
gameCompletelyDone(false);
_parent.endGame_mc.popup("Select Hand");
}
} else if (which == "rules") {
_parent.rules_mc.popup(_parent.game_mc.gameName);
} else if (which == "scoreboard") {
_parent.scores_mc.popup(_parent.game_mc.gameName);
} else if (which == "options") {
_parent.options_mc.popup(_parent.game_mc.gameName);
}
}
function replayTheHand() {
_parent.seed = getSol().DM.getDeck().getSeed();
_parent.where = _parent.game_mc.gameName;
_parent.endGame_mc.popup("End Game3");
}
function dealClicked() {
timeBonus = 0;
shuffling_mc._visible = false;
_parent.seed = undefined;
_parent.game_mc.deal();
deal_btn.enabled = false;
timer_mc.start();
setGameNumber();
}
function runUndoEnabledLogic() {
var _local1;
var _local2;
if ((getSol().getHistory().getActions().length > 0) && (cards.UI.getEnabled())) {
_local1 = true;
_local2 = 100;
} else {
_local1 = false;
_local2 = 50;
}
undo_btn.enabled = _local1;
undo_btn._alpha = _local2;
}
function startInterval() {
runUndoEnabledLogic();
undoID = setInterval(runUndoEnabledLogic, 300);
}
var SM = Sounds.SoundManager.getInstance();
var genOps = _parent.OM.getOptionsByName("General");
shuffling_mc._visible = false;
gameInProgress = false;
timeBonus = 0;
_parent.startLoop();
applyGeneralOptions();
undo_btn.onRelease = function () {
getSol().getHistory().undo();
updateScore(getSol().calculateScore());
};
quit_btn.onRelease = function () {
};
deal_btn.onRelease = function () {
dealClicked();
};
var undoID;
Symbol 420 MovieClip Frame 1
function startGame() {
sol.initialize();
sol.enableGame();
}
function displayScore(num) {
score_txt.text = num;
}
function gameOver(won) {
if (won) {
gameover_txt.text = won;
}
}
function gameLoaded(success) {
if (success) {
sol.fromXML(this);
deal();
} else {
_parent.menu_mc.loadFailed();
}
}
function gameOver(won, score) {
_parent.menu_mc.gameOver(won, score);
}
function deal() {
startGame();
}
var gameName = "Klondike";
var sol = (new cards.Solitaire.Klondike.Klondike(this, _parent.seed));
sol.gameOver = gameOver;
_parent.menu_mc.frameLoaded();
Symbol 424 MovieClip Frame 1
function startGame() {
sol.initialize();
sol.enableGame();
}
function displayScore(num) {
score_txt.text = num;
}
function gameLoaded(success) {
if (success) {
sol.fromXML(this);
deal();
} else {
_parent.menu_mc.loadFailed();
}
}
function gameOver(won, score) {
_parent.menu_mc.gameOver(won, score);
}
function deal() {
startGame();
}
var gameName = "Golf";
var sol = (new cards.Solitaire.Golf.Golf(this, _parent.seed));
sol.gameOver = gameOver;
_parent.menu_mc.frameLoaded();
Symbol 428 MovieClip Frame 1
function startGame() {
sol.initialize();
sol.enableGame();
}
function displayScore(num) {
score_txt.text = num;
}
function gameOver(won, score) {
_parent.menu_mc.gameOver(won, score);
}
function gameLoaded(success) {
if (success) {
sol.fromXML(this);
deal();
} else {
_parent.menu_mc.loadFailed();
}
}
function deal() {
startGame();
}
var gameName = "Scorpion";
var sol = (new cards.Solitaire.Scorpion.Scorpion(this, _parent.seed));
sol.gameOver = gameOver;
_parent.menu_mc.frameLoaded();