Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("2cedc7f3", this, 10301, true);
total = getBytesTotal();
gameurl = _url.toLowerCase();
validsite = 1;
Frame 2
actual = getBytesLoaded();
percloaded = int((actual / total) * 100);
if (percloaded < 100) {
showperc = percloaded add "%";
display.gotoAndStop(int(percloaded / 10) + 1);
} else if (validsite >= 0) {
gotoAndPlay (4);
}
Frame 3
gotoAndPlay ("loader");
Frame 6
stop();
Frame 15
var MochiAd = {getVersion:function () {
return("2.5");
}, showPreGameAd:function (options) {
var _local1 = this;
var DEFAULTS = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
} else {
var clip = options.clip;
var ad_msec = 11000;
var ad_timeout = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
} else {
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var wh = MochiAd._getRes(options);
var _local3 = wh[0];
var h = wh[1];
mc._x = _local3 * 0.5;
mc._y = h * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local3 * -0.5;
chk._y = h * -0.5;
var bar = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
bar._visible = false;
delete options.no_progress_bar;
} else {
bar._x = 10;
bar._y = h - 20;
}
var bar_color = options.color;
delete options.color;
var bar_background = options.background;
delete options.background;
var bar_outline = options.outline;
delete options.outline;
var backing = bar.createEmptyMovieClip("_outline", 1);
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(_local3 - 20, 0);
backing.lineTo(_local3 - 20, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var _local2 = bar.createEmptyMovieClip("_inside", 2);
_local2.beginFill(bar_color);
_local2.moveTo(0, 0);
_local2.lineTo(_local3 - 20, 0);
_local2.lineTo(_local3 - 20, 10);
_local2.lineTo(0, 10);
_local2.lineTo(0, 0);
_local2.endFill();
_local2._xscale = 0;
var outline = bar.createEmptyMovieClip("_outline", 3);
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(_local3 - 20, 0);
outline.lineTo(_local3 - 20, 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local1 = this;
var _local2 = 100 * (1 - ((getTimer() - _local1.fadeout_start) / _local1.fadeout_time));
if (_local2 > 0) {
_local1._parent._alpha = _local2;
} else {
var _local3 = _local1._parent._parent;
MochiAd.unload(_local3);
delete _local1.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local1 = this.mc._mochiad_wait;
_local1.server_control = true;
_local1.started = getTimer();
_local1.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local1 = this;
var _clip = _local1._parent._parent;
var ad_clip = _local1._parent._mochiad_ctr;
var elapsed = (getTimer() - _local1.started);
var _local3 = false;
var clip_total = _clip.getBytesTotal();
var clip_loaded = _clip.getBytesLoaded();
var _local2 = (100 * clip_loaded) / clip_total;
var ad_pcnt = ((100 * elapsed) / chk.ad_msec);
var _inside = _local1._mochiad_bar._inside;
var pcnt = Math.min(100, Math.min(_local2 || 0, ad_pcnt));
pcnt = Math.max(_local1.last_pcnt, pcnt);
_local1.last_pcnt = pcnt;
_inside._xscale = pcnt;
options.ad_progress(pcnt);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var total = ad_clip.getBytesTotal();
if ((total > 0) || (typeof(total) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((elapsed > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (elapsed > chk.ad_msec) {
_local3 = true;
}
if (((clip_total > 0) && (clip_loaded >= clip_total)) && (_local3)) {
if (_local1.server_control) {
delete _local1.onEnterFrame;
} else {
_local1.fadeout_start = getTimer();
_local1.onEnterFrame = chk.fadeFunction;
}
}
};
}
}
}, showClickAwayAd:function (options) {
var DEFAULTS = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = MochiAd._parseOptions(options, DEFAULTS);
var clip = options.clip;
var ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
} else {
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local2 = MochiAd._getRes(options);
var w = _local2[0];
var h = _local2[1];
mc._x = w * 0.5;
mc._y = h * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var sendHostProgress = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var ad_clip = this._parent._mochiad_ctr;
var _local3 = getTimer() - this.started;
var _local1 = false;
if (!chk.showing) {
var _local2 = ad_clip.getBytesTotal();
if ((_local2 > 0) || (typeof(_local2) == "undefined")) {
_local1 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local3 > chk.ad_timeout) {
options.ad_failed();
_local1 = true;
}
}
if (_local1) {
delete this.onEnterFrame;
}
};
}
}, showInterLevelAd:function (options) {
var _local1 = this;
var DEFAULTS = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = MochiAd._parseOptions(options, DEFAULTS);
var clip = options.clip;
var ad_msec = 11000;
var ad_timeout = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
} else {
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var wh = MochiAd._getRes(options);
var w = wh[0];
var h = wh[1];
mc._x = w * 0.5;
mc._y = h * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local1 = this;
var _local2 = 100 * (1 - ((getTimer() - _local1.fadeout_start) / _local1.fadeout_time));
if (_local2 > 0) {
_local1._parent._alpha = _local2;
} else {
var _local3 = _local1._parent._parent;
MochiAd.unload(_local3);
delete _local1.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local1 = this.mc._mochiad_wait;
_local1.server_control = true;
_local1.started = getTimer();
_local1.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local1 = this;
var ad_clip = _local1._parent._mochiad_ctr;
var elapsed = (getTimer() - _local1.started);
var _local2 = false;
if (!chk.showing) {
var _local3 = ad_clip.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (elapsed > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (elapsed > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (_local1.server_control) {
delete _local1.onEnterFrame;
} else {
_local1.fadeout_start = getTimer();
_local1.onEnterFrame = _local1.fadeFunction;
}
}
};
}
}, showPreloaderAd:function (options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(options);
}, showTimedAd:function (options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(options);
}, _allowDomains:function (server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}, load:function (options) {
var _local1 = options;
var DEFAULTS = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
_local1 = MochiAd._parseOptions(_local1, DEFAULTS);
_local1.swfv = _local1.clip.getSWFVersion() || 6;
_local1.mav = MochiAd.getVersion();
var clip = _local1.clip;
if (!MochiAd._isNetworkAvailable()) {
return(null);
}
if (clip._mochiad_loaded) {
return(null);
}
var depth = _local1.depth;
delete _local1.depth;
var mc = clip.createEmptyMovieClip("_mochiad", depth);
var wh = MochiAd._getRes(_local1);
_local1.res = (wh[0] + "x") + wh[1];
_local1.server = _local1.server + _local1.id;
delete _local1.id;
clip._mochiad_loaded = true;
var _local2 = mc.createEmptyMovieClip("_mochiad_ctr", 1);
for (var k in _local1) {
_local2[k] = _local1[k];
}
var server = _local2.server;
delete _local2.server;
var hostname = MochiAd._allowDomains(server);
mc.onEnterFrame = function () {
var _local1 = this;
if (_local1._mochiad_ctr._url != _local1._url) {
_local1.onEnterFrame = function () {
var _local1 = this;
if (!_local1._mochiad_ctr) {
delete _local1.onEnterFrame;
MochiAd.unload(_local1._parent);
}
};
}
};
var _local3 = new LocalConnection();
var name = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local3.mc = mc;
_local3.name = name;
_local3.hostname = hostname;
_local3.allowDomain = function (d) {
return(true);
};
_local3.allowInsecureDomain = _local3.allowDomain;
_local3.connect(name);
mc.lc = _local3;
_local2.lc = name;
_local2.st = getTimer();
_local2.loadMovie(server + ".swf", "POST");
return(mc);
}, unload:function (clip) {
var _local1 = clip;
if (typeof(_local1) == "undefined") {
_local1 = _root;
}
if (_local1.clip && (_local1.clip._mochiad)) {
_local1 = _local1.clip;
}
if (!_local1._mochiad) {
return(false);
}
if (_local1._mochiad._containerLCName != undefined) {
_local1._mochiad.lc.send(_local1._mochiad._containerLCName, "notify", {id:"unload"});
}
_local1._mochiad.removeMovieClip();
delete _local1._mochiad_loaded;
delete _local1._mochiad;
return(true);
}, _isNetworkAvailable:function () {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}, _getRes:function (options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var xy = options.res.split("x");
_local2 = parseFloat(xy[0]);
_local1 = parseFloat(xy[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}, _parseOptions:function (options, defaults) {
var _local3 = {};
for (var k in defaults) {
_local3[k] = defaults[k];
}
if (options) {
for (var k in options) {
_local3[k] = options[k];
}
}
if (_root.mochiad_options) {
var pairs = _root.mochiad_options.split("&");
var _local1 = 0;
while (_local1 < pairs.length) {
var _local2 = pairs[_local1].split("=");
_local3[unescape(_local2[0])] = unescape(_local2[1]);
_local1++;
}
}
if (_local3.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local3);
}, rpc:function (clip, callbackID, arg) {
var _local1 = clip;
var _local2 = arg;
switch (_local2.id) {
case "setValue" :
MochiAd.setValue(_local1, _local2.objectName, _local2.value);
return;
case "getValue" :
var val = MochiAd.getValue(_local1, _local2.objectName);
_local1._mochiad.lc.send(_local1._mochiad._containerLCName, "rpcResult", callbackID, val);
return;
case "runMethod" :
var _local3 = MochiAd.runMethod(_local1, _local2.method, _local2.args);
_local1._mochiad.lc.send(_local1._mochiad._containerLCName, "rpcResult", callbackID, _local3);
return;
default :
trace("[mochiads rpc] unknown rpc id: " + _local2.id);
}
}, setValue:function (base, objectName, value) {
var _local2 = base;
var nameArray:Array = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (nameArray.length - 1)) {
if ((_local2[nameArray[_local1]] == undefined) || (_local2[nameArray[_local1]] == null)) {
return;
}
_local2 = _local2[nameArray[_local1]];
_local1++;
}
_local2[nameArray[_local1]] = value;
}, getValue:function (base, objectName) {
var _local2 = base;
var nameArray:Array = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (nameArray.length - 1)) {
if ((_local2[nameArray[_local1]] == undefined) || (_local2[nameArray[_local1]] == null)) {
return(undefined);
}
_local2 = _local2[nameArray[_local1]];
_local1++;
}
return(_local2[nameArray[_local1]]);
}, runMethod:function (base, methodName, argsArray:Array) {
var _local2 = base;
var nameArray:Array = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (nameArray.length - 1)) {
if ((_local2[nameArray[_local1]] == undefined) || (_local2[nameArray[_local1]] == null)) {
return(undefined);
}
_local2 = _local2[nameArray[_local1]];
_local1++;
}
if (typeof(_local2[nameArray[_local1]]) == "function") {
return(_local2[nameArray[_local1]].apply(_local2, argsArray));
}
return(undefined);
}, _:null};
MochiAd.showPreGameAd({id:"fefe8e2d8f412aba", res:"640x530"});
Frame 26
securestartscore = 0;
securescorecheck = 0;
securetotal = 0;
securecount = 0;
ssfactor = random(10) + -1;
totalscore = securescore(0, 0, 3);
stop();
Frame 27
function clickedcard(clicknum) {
if ((deal == false) and (anim == false)) {
clicknum = Number(clicknum);
if (clicknum < 10) {
cardprefix = "c0";
} else {
cardprefix = "c";
}
tempmc = eval (cardprefix add clicknum);
cval = tempmc.cardval;
avail = tempmc.available;
ppos = tempmc.pyramidpos;
if (avail == true) {
if (cardtotal == 0) {
hilite._x = tempmc._x;
hilite._y = tempmc._y;
cardtotal = cval;
lastcard = tempmc;
cardcount = 1;
} else {
cardtotal = cardtotal + cval;
cardcount = 2;
if (cardtotal != 13) {
cardtotal = 0;
hilite._x = -500;
hilite._y = -500;
lastcard = "";
}
}
if (cardtotal == 13) {
hilite._x = -500;
hilite._y = -500;
tempmc.pyramidpos = 0;
lastcard.pyramidpos = 0;
tempmc.destx = -100;
tempmc.desty = -100;
tempmc.animsteps = animsteps;
tempmc.swapDepths(currentdepth);
currentdepth = currentdepth + 1;
lastcard.destx = -100;
lastcard.desty = -100;
lastcard.animsteps = animsteps;
lastcard.swapDepths(currentdepth);
currentdepth = currentdepth + 1;
anim = true;
cardtotal = 0;
lastcard = "";
totalscore = securescore(totalscore, cardcount, 1);
}
checkavailable();
}
if (ppos == 29) {
g = 1;
while (g <= 3) {
nextcard = deck[deckptr];
if (nextcard < 10) {
cardprefix = "c0";
} else {
cardprefix = "c";
}
nextmc = eval (cardprefix add nextcard);
destpos = 29 + g;
destmc = eval ("col" add destpos);
nextmc.destx = destmc._x;
nextmc.desty = destmc._y;
nextmc.animsteps = animsteps / 2;
nextmc.pyramidpos = destpos;
nextmc.swapDepths(currentdepth);
currentdepth = currentdepth + 1;
nextmc.gotoAndStop(1);
anim = true;
deckptr = deckptr - 1;
g++;
}
checkavailable();
}
}
}
function releasecard(clicknum) {
}
function dblclickcard(clicknum) {
}
function checkavailable() {
avcount = 0;
f = 1;
while (f <= totcards) {
ff = deck[f];
if (ff < 10) {
cardprefix = "c0";
} else {
cardprefix = "c";
}
mcname = eval (cardprefix add ff);
pp = mcname.pyramidpos;
if ((pp == 29) or (pp == 0)) {
mcname.available = false;
} else {
rn = rowsdefine[pp];
avail = 0;
if (rn < 7) {
cardpos1 = pp + rn;
cardpos2 = (pp + rn) + 1;
card1 = deck[cardpos1];
card2 = deck[cardpos2];
if (card1 < 10) {
cardprefix = "c0";
} else {
cardprefix = "c";
}
mccard1 = eval (cardprefix add card1);
if (card2 < 10) {
cardprefix = "c0";
} else {
cardprefix = "c";
}
mccard2 = eval (cardprefix add card2);
avail = mccard1.pyramidpos + mccard2.pyramidpos;
}
if ((avail == 0) or (pp > 29)) {
mcname.available = true;
avcount++;
}
}
f++;
}
trace("available=" + avcount);
if (avcount <= 0) {
totalscore = securescore(totalscore, 100, 1);
anim = false;
gotoAndPlay ("redeal");
}
}
function securescore(oldscore, ssval, ssmode) {
var _local1 = ssval;
var _local2 = ssmode;
var _local3 = oldscore;
ssmodified = false;
if ((securestartscore + (securetotal / ssfactor)) != _local3) {
ssmodified = true;
}
if (_local2 == 1) {
securetotal = securetotal + (_local1 * ssfactor);
}
if (_local2 == 2) {
securetotal = securetotal - (_local1 * ssfactor);
}
if (_local2 == 3) {
securetotal = securetotal + ((_local1 * ssfactor) - _local3);
}
securecount = securecount + 1;
if (_local3 != (securescorecheck / ssfactor)) {
ssmodified = true;
}
if (_local2 == 1) {
securescorecheck = securescorecheck + (_local1 * ssfactor);
}
if (_local2 == 2) {
securescorecheck = securescorecheck - (_local1 * ssfactor);
}
if (_local2 == 3) {
securescorecheck = _local1 * ssfactor;
}
if (ssmodified == true) {
}
return(securescorecheck / ssfactor);
}
rowsdefine = new Array(0, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7);
cardtotal = 0;
lastcard = "";
infotext = "";
framespeed = 25;
lastclick = 0;
dblclickspeed = 300;
showscore = "0000";
deck = new Array();
suitorder = new Array("clubs", "hearts", "spades", "diamonds", "clubs");
gameover = false;
deckpos = 1;
suitval = 1;
numdecks = 1;
cardwidth = 63;
cardheight = 84;
startx = -320;
starty = 540;
totcards = 52 * numdecks;
ftemp = 0;
f = 1;
while (f <= totcards) {
deck[f] = f;
ftemp = ftemp + 1;
if (ftemp > 52) {
ftemp = ftemp - 52;
}
cardnum = ftemp;
if (cardnum < 10) {
cardprefix2 = "c0";
} else {
cardprefix2 = "c";
}
if (f < 10) {
cardprefix = "c0";
} else {
cardprefix = "c";
}
attachMovie(cardprefix2 add ftemp, cardprefix add f, 50 + f);
mcname = eval (cardprefix add f);
mcname._x = startx;
mcname._y = starty + (f * 10);
mcname._width = cardwidth;
mcname._height = cardheight;
cardval = ftemp % 13;
if (cardval == 0) {
cardval = 13;
}
suitval = suitval % 4;
if ((suitval == 1) or (suitval == 3)) {
cardcol = "red";
} else {
cardcol = "black";
}
mcname.cardval = cardval;
mcname.cardcol = cardcol;
mcname.cardsuit = suitorder[suitval];
mcname.location = "deck";
mcname.available = false;
mcname.depth = f;
mcname.gotoAndStop(2);
if (cardval == 13) {
suitval = suitval + 1;
}
f++;
}
mixes = 20;
shuffletype = 1;
f = 1;
while (f <= mixes) {
g = 1;
while (g <= totcards) {
if (shuffletype == 1) {
swap = random(totcards) + 1;
}
temp = deck[swap];
deck[swap] = deck[g];
deck[g] = temp;
g++;
}
f++;
}
f = 1;
while (f <= totcards) {
ff = deck[f];
if (ff < 10) {
cardprefix = "c0";
} else {
cardprefix = "c";
}
mcname = eval (cardprefix add ff);
mcname.animsteps = 0;
mcname.swapDepths(f + 50);
mcname.depth = f + 50;
if (f <= 28) {
currentcol = f;
} else {
currentcol = 29;
}
mcname.pyramidpos = currentcol;
dest = eval ("col" add currentcol);
cv = mcname.cardval;
cs = mcname.cardsuit;
mcname.destx = dest._x;
mcname.desty = dest._y;
f++;
}
currentdepth = f + 50;
deckptr = totcards;
deal = true;
dealcard = 1;
dealdelay = 4;
delay = dealdelay;
attachMovie("dealer", "hands", 1001);
hands._x = 292;
hands._y = 436;
hands._visible = true;
attachMovie("dealer2", "hands2", 1);
hands2._x = 291;
hands2._y = 440;
attachMovie("buttonbar", "bbar", 2001);
bbar._x = 320;
bbar._y = 505;
attachMovie("showhint", "hilite", 2002);
hilite._x = -500;
hilite._y = -500;
checkavailable();
Instance of Symbol 226 MovieClip in Frame 27
onClipEvent (enterFrame) {
if ((/:securescorecheck / /:ssfactor) != /:totalscore) {
}
tempscore = "0000" add Math.abs(/:totalscore);
sl = tempscore.length;
Set("/:showscore", tempscore.substr(sl - 4, 4));
if (/:totalscore < 0) {
Set("/:showscore", "-" add /:showscore);
}
}
Frame 28
if ((deal == true) and (delay == 0)) {
animsteps = 10;
delay = dealdelay;
f = deck[dealcard];
if (f < 10) {
cardprefix = "c0";
} else {
cardprefix = "c";
}
mcname = eval (cardprefix add f);
mcname.animsteps = animsteps;
ppos = mcname.pyramidpos;
fn = 1;
if (ppos == 29) {
fn = 2;
mcname.animsteps = animsteps / 2;
}
mcname._x = 320;
mcname._y = 420;
mcname.gotoAndStop(fn);
anim = true;
dealcard = dealcard + 1;
if (dealcard > totcards) {
deal = false;
}
}
if (deal == true) {
delay = delay - 1;
}
if (anim == true) {
maxsteps = 0;
f = 1;
while (f <= totcards) {
if (f < 10) {
cardprefix = "c0";
} else {
cardprefix = "c";
}
mcname = eval (cardprefix add f);
stepcount = mcname.animsteps;
if (stepcount > maxsteps) {
maxsteps = stepcount;
}
if (stepcount > 0) {
dx = mcname.destx;
dy = mcname.desty;
sx = mcname._x;
sy = mcname._y;
newx = (dx - sx) / stepcount;
newy = (dy - sy) / stepcount;
mcname._x = mcname._x + newx;
mcname._y = mcname._y + newy;
stepcount = stepcount - 1;
mcname.animsteps = stepcount;
}
f++;
}
if (maxsteps == 0) {
anim = false;
hands._visible = false;
hands2._visible = false;
calcmoves();
}
}
Frame 29
gotoAndPlay ("gameloop");
Frame 30
attachMovie("gameover", "gover", 9999);
gover._x = 49;
gover._y = 70;
stop();
Frame 31
removeMovieClip("go");
removeMovieClip("gover");
removeMovieClip("hands");
removeMovieClip("hands2");
removeMovieClip("bbar");
removeMovieClip("hilite");
f = 1;
while (f <= totcards) {
cardnum = f;
if (cardnum < 10) {
cardprefix = "c0";
} else {
cardprefix = "c";
}
mcname = eval (cardprefix add f);
removeMovieClip(mcname);
f++;
}
gotoAndPlay (26);
Symbol 5 Button
on (press) {
cardnum = substring(this, 10, 3);
if (/:gameover == false) {
/:clickedcard(cardnum);
}
}
on (release, releaseOutside) {
cardnum = substring(this, 10, 3);
if ((/:lastclick > 0) and ((getTimer() - /:lastclick) < /:dblclickspeed)) {
if (/:gameover == false) {
/:dblclickcard(cardnum);
}
} else if (/:gameover == false) {
/:releasecard(cardnum);
}
}
Symbol 12 MovieClip Frame 1
Symbol 114 Button
on (press) {
_root.gotoAndPlay("restart");
}
Symbol 152 MovieClip Frame 1
Symbol 152 MovieClip Frame 198
_root.gotoAndStop("splash2");
Symbol 178 Button
on (release) {
getURL ("http://www.yougame.com/putonyourwebsite/", "_top");
}
Symbol 182 Button
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Symbol 199 Button
on (press) {
/:gotoAndPlay("restart");
}
Symbol 200 MovieClip [gameover] Frame 1
logoheight = 57;
stripheight = 3;
totstrips = logoheight / stripheight;
f = 2;
while (f <= (totstrips + 1)) {
duplicateMovieClip ("s1", "s" add f, f);
tempmc = eval ("s" add f);
tempmc._x = s1._x;
tempmc._y = s1._y + ((f - 1) * stripheight);
tempmc.logo._y = tempmc.logo._y - ((f - 1) * stripheight);
f++;
}
ang = 0;
ang2 = 0;
angdiff = Math.PI / (totstrips + 1);
angdiff2 = (Math.PI/4) / (totstrips + 1);
loop = 0;
Symbol 200 MovieClip [gameover] Frame 2
xm = (_xmouse - 275) / 3;
ym = _ymouse - 200;
smid = 275;
ymid = 200;
wavesize = 65;
wavesize2 = 15;
ang = loop * angdiff;
ang2 = loop * angdiff2;
f = 1;
while (f <= (totstrips + 1)) {
tempmc = eval ("s" add f);
yinc = Math.sin(ang2) * wavesize;
xinc = Math.sin(ang) * wavesize2;
ang = ang + angdiff;
ang2 = ang2 + angdiff2;
newy = ymid + yinc;
newx = smid + xinc;
tempmc._y = newy;
tempmc._x = newx;
f++;
}
loop = loop + 1;
Symbol 200 MovieClip [gameover] Frame 3
gotoAndPlay (2);
Symbol 206 Button
on (press) {
if ((/:deal != true) and (/:shuffle != true)) {
/:gotoAndPlay("gameover");
}
}
Symbol 216 Button
on (press) {
gotoAndPlay (27);
}