Frame 1
function resetData() {
mode.setValue(0);
theme.setValue(0);
level.setValue(0);
level2.setValue(0);
score.setValue(0);
level_score.setValue(0);
chain.setValue(0);
chain2.setValue(0);
card.setValue(0);
speed.setValue(0);
speed2.setValue(0);
}
function submitScore() {
var _local4 = mode.__get__value();
if (_local4 == 0) {
var _local3 = {n:[1, 8, 6, 10, 13, 8, 0, 2, 13, 10, 0, 14, 15, 15, 4, 4], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
} else {
var _local2 = level.__get__value();
if (_local2 == 1) {
var _local3 = {n:[5, 0, 3, 1, 10, 2, 13, 2, 15, 11, 14, 10, 6, 1, 15, 6], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 2) {
var _local3 = {n:[9, 2, 13, 3, 6, 13, 9, 13, 15, 3, 4, 6, 6, 2, 4, 14], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 3) {
var _local3 = {n:[6, 9, 11, 14, 5, 11, 15, 10, 13, 3, 6, 12, 14, 7, 10, 2], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 4) {
var _local3 = {n:[7, 0, 1, 10, 13, 0, 14, 6, 1, 4, 8, 2, 7, 2, 2, 9], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 5) {
var _local3 = {n:[15, 4, 14, 1, 13, 9, 3, 2, 0, 14, 10, 12, 3, 5, 2, 13], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 6) {
var _local3 = {n:[6, 10, 7, 12, 8, 12, 0, 6, 15, 15, 6, 15, 2, 0, 12, 11], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 7) {
var _local3 = {n:[12, 4, 13, 10, 6, 9, 15, 1, 3, 11, 14, 4, 15, 1, 1, 3], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 8) {
var _local3 = {n:[10, 12, 13, 4, 13, 7, 6, 9, 1, 5, 11, 3, 9, 9, 5, 15], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 9) {
var _local3 = {n:[14, 11, 1, 12, 6, 0, 8, 1, 15, 10, 5, 14, 5, 6, 6, 14], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 10) {
var _local3 = {n:[11, 10, 5, 6, 0, 11, 8, 7, 10, 14, 11, 1, 11, 6, 2, 14], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 11) {
var _local3 = {n:[12, 13, 15, 14, 12, 2, 7, 1, 2, 9, 13, 9, 15, 15, 0, 14], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 12) {
var _local3 = {n:[5, 4, 3, 9, 10, 2, 0, 0, 11, 10, 13, 0, 0, 14, 2, 6], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 13) {
var _local3 = {n:[5, 12, 9, 14, 2, 0, 10, 5, 2, 11, 4, 10, 12, 0, 12, 10], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 14) {
var _local3 = {n:[11, 14, 1, 0, 7, 14, 15, 15, 11, 4, 8, 13, 15, 13, 8, 3], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
if (_local2 == 15) {
var _local3 = {n:[1, 10, 4, 7, 12, 9, 0, 5, 10, 11, 3, 1, 4, 4, 3, 5], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
}
}
var _local5 = _local3.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:_local5, score:score.__get__value(), onClose:function () {
gameToMain();
}});
}
function makeMusic(m) {
delete _root.snds.onEnterFrame;
m0.stop();
m1.stop();
m2.stop();
m3.stop();
_root.createEmptyMovieClip("snds", 10000);
_root.createEmptyMovieClip("snd1", 10001);
s1 = new Sound(_root.snd1);
s1.attachSound("snd_shuffle");
s1.setVolume(35);
_root.createEmptyMovieClip("snd2", 10002);
s2 = new Sound(_root.snd2);
s2.attachSound("snd_move");
_root.createEmptyMovieClip("mus0", 10010);
m0 = new Sound(_root.mus0);
m0.attachSound("music0");
_root.createEmptyMovieClip("mus1", 10011);
m1 = new Sound(_root.mus1);
m1.attachSound("music1");
m1.setVolume(70);
_root.createEmptyMovieClip("mus2", 10012);
m2 = new Sound(_root.mus2);
m2.attachSound("music2");
m2.setVolume(80);
_root.createEmptyMovieClip("mus3", 10013);
m3 = new Sound(_root.mus3);
m3.attachSound("music3");
m3.setVolume(70);
if (m == 0) {
m0.start(0, 1);
}
if (m == 1) {
m1.start(0, 999);
}
if (m == 2) {
m2.start(0, 999);
}
if (m == 3) {
m3.start(0, 999);
}
var _local4 = new flash.filters.DropShadowFilter(2, 45, 0, 0.4, 3, 3, 1, 2);
_root.createEmptyMovieClip("mute", 10);
var _local2 = _root.mute;
_local2.createEmptyMovieClip("back", 1);
drawSquare(-1, -1, 17, 22, 16777215, _local2.back);
_local2.back._alpha = 0;
_local2.attachMovie("mute", "sym", 2);
_local2._x = 7;
_local2._y = 453;
_local2._alpha = 100;
_local2.filters = [_local4];
_local2.cacheAsBitmap = true;
_local2.onRelease = function () {
set_sound.setValue(0);
stopMusic();
};
}
function stopMusic() {
s1.stop();
s2.stop();
m0.stop();
m1.stop();
m2.stop();
m3.stop();
delete s1;
delete m0;
delete m1;
delete m2;
delete m3;
_root.snd1.removeMovieClip();
_root.snd2.removeMovieClip();
_root.mus0.removeMovieClip();
_root.mus1.removeMovieClip();
_root.mus2.removeMovieClip();
_root.mus3.removeMovieClip();
_root.mute._alpha = 50;
_root.mute.cacheAsBitmap = true;
_root.mute.onRelease = function () {
set_sound.setValue(1);
if (mode.__get__value() == 0) {
if (level.__get__value() == 0) {
makeMusic(0);
} else {
makeMusic(Math.ceil(level.__get__value() / 2));
}
} else {
makeMusic(theme.__get__value());
}
};
}
function killMusic() {
var s1v = 70;
var s2v = 80;
var s3v = 70;
_root.snds.onEnterFrame = function () {
s1v = s1v - 3;
s2v = s2v - 3;
s3v = s3v - 3;
m1.setVolume(s1v);
m2.setVolume(s2v);
m3.setVolume(s3v);
};
}
function doText(mc, title, fonts) {
var _local1 = mc;
_local1.text = title;
_local1.selectable = false;
_local1.wordWrap = true;
_local1.autoSize = "left";
_local1.embedFonts = true;
_local1.setTextFormat(fonts);
}
function drawSquare(x, y, width, height, fillColour, mc) {
var _local1 = mc;
_local1._x = x;
_local1._y = y;
_local1.beginFill(fillColour, 100);
_local1.lineTo(width, 0);
_local1.lineTo(width, height);
_local1.lineTo(0, height);
_local1.lineTo(0, 0);
_local1.endFill();
}
function drawSquared(x, y, width, height, mc) {
var _local1 = mc;
_local1._x = x;
_local1._y = y;
_local1.lineStyle(2, 10066329, 75);
_local1.lineTo(width, 0);
_local1.lineTo(width, height);
_local1.lineTo(0, height);
_local1.lineTo(0, 0);
}
function drawCard(p, up, l) {
_root["cards" + l]["c" + p].createEmptyMovieClip("back", 1);
var _local2 = _root["cards" + l]["c" + p].back;
var _local4 = 40;
var _local5 = 60;
var _local3 = 5;
_local2.lineStyle(2, 10066329, 75);
if (up == 1) {
colors = [16777215, 15658734];
matrix = {matrixType:"box", x:0, y:0, w:_local4, h:_local5, r:0};
_local2.beginGradientFill("linear", colors, [100, 100], [0, 255], matrix);
} else {
_local2.beginFill(14540253, 100);
}
_local2.moveTo(_local3, 0);
_local2.lineTo(_local4 - _local3, 0);
_local2.curveTo(_local4, 0, _local4, _local3);
_local2.lineTo(_local4, _local5 - _local3);
_local2.curveTo(_local4, _local5, _local4 - _local3, _local5);
_local2.lineTo(_local3, _local5);
_local2.curveTo(0, _local5, 0, _local5 - _local3);
_local2.lineTo(0, _local3);
_local2.curveTo(0, 0, _local3, 0);
_local2.endFill();
}
function drawSquareR(x, y, width, height, mc) {
var _local1 = mc;
var _local2 = 5;
_local1.lineStyle(2, 10066329, 75);
colors = [16777215, 15658734];
matrix = {matrixType:"box", x:0, y:0, w:width, h:height, r:0};
_local1.beginGradientFill("linear", colors, [100, 100], [0, 255], matrix);
_local1.moveTo(_local2, 0);
_local1.lineTo(width - _local2, 0);
_local1.curveTo(width, 0, width, _local2);
_local1.lineTo(width, height - _local2);
_local1.curveTo(width, height, width - _local2, height);
_local1.lineTo(_local2, height);
_local1.curveTo(0, height, 0, height - _local2);
_local1.lineTo(0, _local2);
_local1.curveTo(0, 0, _local2, 0);
_local1.endFill();
_local1._x = x;
_local1._y = y;
}
function drawSquareRvar(x, y, width, height, line, fill, mc) {
var _local1 = mc;
var _local2 = 5;
if (line != 0) {
_local1.lineStyle(2, 10066329, 75);
}
if (fill != 0) {
colors = [16777215, 15658734];
matrix = {matrixType:"box", x:0, y:0, w:width, h:height, r:0};
_local1.beginGradientFill("linear", colors, [100, 100], [0, 255], matrix);
}
_local1.moveTo(_local2, 0);
_local1.lineTo(width - _local2, 0);
_local1.curveTo(width, 0, width, _local2);
_local1.lineTo(width, height - _local2);
_local1.curveTo(width, height, width - _local2, height);
_local1.lineTo(_local2, height);
_local1.curveTo(0, height, 0, height - _local2);
_local1.lineTo(0, _local2);
_local1.curveTo(0, 0, _local2, 0);
if (fill != 0) {
_local1.endFill();
}
_local1._x = x;
_local1._y = y;
}
function drawFG() {
_root.createEmptyMovieClip("fg", 8);
var _local2 = _root.fg;
_local2.createEmptyMovieClip("l", 1);
drawSquare(0, 0, -600, 480, 16777215, _local2.l);
_local2.createEmptyMovieClip("r", 2);
drawSquare(640, 0, 600, 480, 16777215, _local2.r);
_local2.createEmptyMovieClip("t", 3);
drawSquare(-600, 0, 1840, -600, 16777215, _local2.t);
_local2.createEmptyMovieClip("b", 4);
drawSquare(-600, 480, 1840, 600, 16777215, _local2.b);
_local2.createEmptyMovieClip("l2", 5);
drawSquare(0, 0, 2, 480, 0, _local2.l2);
_local2.l2._alpha = 25;
_local2.createEmptyMovieClip("r2", 6);
drawSquare(640, 0, -2, 480, 0, _local2.r2);
_local2.r2._alpha = 25;
_local2.createEmptyMovieClip("t2", 7);
drawSquare(2, 0, 636, 2, 0, _local2.t2);
_local2.t2._alpha = 25;
_local2.createEmptyMovieClip("b2", 8);
drawSquare(2, 480, 636, -2, 0, _local2.b2);
_local2.b2._alpha = 25;
_local2.cacheAsBitmap = true;
}
function shuffleArray(a) {
var _local4 = a.length;
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local4) {
_local3.push(a.splice(Math.floor(Math.random() * a.length), 1));
_local1++;
}
return(_local3);
}
function getPos(p) {
var _local4 = level.__get__value();
var _local2 = 0;
var _local3 = 0;
p = parseInt(p);
if (_local4 == 1) {
if (p > 55) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 56) * 5) + 97;
return(Array(_local2, 390));
}
if (p > 27) {
p = p - 28;
_local3 = _local3 + 120;
}
if (p > 17) {
_local2 = ((p - 18) * 45) + 97;
_local3 = _local3 + 150;
return(Array(_local2, _local3));
}
if (p > 8) {
_local2 = ((p - 9) * 45) + 117;
_local3 = _local3 + 120;
return(Array(_local2, _local3));
}
if (p > 2) {
if (p > 6) {
p++;
}
if (p > 4) {
p++;
}
_local2 = (((p - 3) * 45) + 97) + 45;
_local3 = _local3 + 90;
return(Array(_local2, _local3));
}
if (p > 1) {
p = p + 2;
}
if (p > 0) {
p = p + 2;
}
_local2 = ((p * 45) + 117) + 45;
_local3 = _local3 + 60;
return(Array(_local2, _local3));
}
if (_local4 == 2) {
if (p > 79) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 80) * 5) + 97;
return(Array(_local2, 390));
}
if (p > 73) {
_local2 = ((p - 74) * 45) + 177;
_local3 = 160;
return(Array(_local2, _local3));
}
if (p > 59) {
_local3 = Math.floor((p - 60) / 7);
_local2 = (((p - 60) - (_local3 * 7)) * 45) + 157;
_local3 = ((_local3 * 65) + 70) + 60;
return(Array(_local2, _local3));
}
if (p > 35) {
_local3 = Math.floor((p - 36) / 8);
_local2 = (((p - 36) - (_local3 * 8)) * 45) + 137;
_local3 = ((_local3 * 65) + 70) + 30;
return(Array(_local2, _local3));
}
_local3 = Math.floor(p / 9);
_local2 = ((p - (_local3 * 9)) * 45) + 117;
_local3 = (_local3 * 65) + 70;
return(Array(_local2, _local3));
}
if (_local4 == 3) {
if (p > 67) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 68) * 5) + 97;
return(Array(_local2, 390));
}
if (p == 67) {
return(Array(457, 175));
}
if (p == 66) {
return(Array(142, 175));
}
if (p > 56) {
_local2 = (((p - 57) * 45) + 97) + 23;
return(Array(_local2, 175));
}
if (p > 46) {
_local2 = ((p - 47) * 45) + 97;
return(Array(_local2, 175));
}
if (p > 39) {
_local2 = ((((p - 40) * 45) + 97) + 45) + 23;
return(Array(_local2, 175));
}
if (p > 33) {
_local2 = (((p - 34) * 45) + 97) + 90;
return(Array(_local2, 175));
}
if (p > 25) {
p = p - 26;
if (p > 3) {
p = p - 4;
_local2 = _local2 + 405;
}
_local3 = Math.floor(p / 2);
_local2 = _local2 + ((((p - (_local3 * 2)) * 45) + 97) - 22);
_local3 = ((_local3 * 65) + 110) + 33;
return(Array(_local2, _local3));
}
if (p > 7) {
p = p - 8;
if (p > 8) {
p = p - 9;
_local2 = _local2 + 405;
}
_local3 = Math.floor(p / 3);
_local2 = _local2 + ((((p - (_local3 * 3)) * 45) + 97) - 45);
_local3 = (_local3 * 65) + 110;
return(Array(_local2, _local3));
}
if (p > 3) {
p = p - 4;
_local2 = _local2 + 405;
}
_local3 = Math.floor(p / 2);
_local2 = _local2 + ((((p - (_local3 * 2)) * 45) + 97) - 22);
_local3 = ((_local3 * 65) + 110) + 33;
return(Array(_local2, _local3));
}
if (_local4 == 4) {
if (p > 67) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 68) * 5) + 97;
return(Array(_local2, 390));
}
if (p == 67) {
return(Array(435, 170));
}
if (p == 66) {
return(Array(165, 170));
}
if (p == 65) {
return(Array(300, 35));
}
if (p == 64) {
return(Array(300, 295));
}
if (p > 61) {
_local3 = ((p - 62) * 65) + 135;
return(Array(435, _local3));
}
if (p > 59) {
_local3 = ((p - 60) * 65) + 135;
return(Array(165, _local3));
}
if (p > 57) {
_local2 = ((p - 58) * 45) + 277;
return(Array(_local2, 35));
}
if (p > 55) {
_local2 = ((p - 56) * 45) + 277;
return(Array(_local2, 295));
}
if (p > 52) {
_local3 = ((p - 53) * 65) + 100;
return(Array(435, _local3));
}
if (p > 49) {
_local3 = ((p - 50) * 65) + 100;
return(Array(165, _local3));
}
if (p > 46) {
_local2 = ((p - 47) * 45) + 255;
return(Array(_local2, 35));
}
if (p > 43) {
_local2 = ((p - 44) * 45) + 255;
return(Array(_local2, 295));
}
if (p > 39) {
_local3 = ((p - 40) * 65) + 70;
return(Array(435, _local3));
}
if (p > 35) {
_local3 = ((p - 36) * 65) + 70;
return(Array(165, _local3));
}
if (p > 29) {
_local2 = ((p - 30) * 45) + 187;
return(Array(_local2, 35));
}
if (p > 23) {
_local2 = ((p - 24) * 45) + 187;
return(Array(_local2, 295));
}
if (p > 18) {
_local3 = ((p - 19) * 65) + 35;
return(Array(435, _local3));
}
if (p > 13) {
_local3 = ((p - 14) * 65) + 35;
return(Array(165, _local3));
}
if (p > 8) {
_local2 = ((p - 9) * 45) + 210;
return(Array(_local2, 35));
}
if (p > 3) {
_local2 = ((p - 4) * 45) + 210;
return(Array(_local2, 295));
}
if (p == 3) {
return(Array(413, 265));
}
if (p == 2) {
return(Array(186, 265));
}
if (p == 1) {
return(Array(412, 65));
}
if (p == 0) {
return(Array(186, 65));
}
}
if (_local4 == 5) {
if (p > 51) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 52) * 5) + 97;
return(Array(_local2, 390));
}
if (p > 43) {
_local3 = ((p - 44) * 10) + 125;
return(Array(358, _local3));
}
if (p > 35) {
_local3 = ((p - 36) * 10) + 125;
return(Array(243, _local3));
}
if (p > 25) {
_local2 = ((p - 26) * 10) + 97;
return(Array(_local2, 160));
}
if (p > 15) {
_local2 = (((p - 16) * -10) + 600) - 97;
return(Array(_local2, 160));
}
if (p > 7) {
_local3 = ((p - 8) * 10) + 30;
return(Array(300, _local3));
}
_local3 = ((p * -10) + 320) - 30;
return(Array(300, _local3));
}
if (_local4 == 6) {
if (p > 63) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 64) * 5) + 97;
return(Array(_local2, 390));
}
if (p > 62) {
return(Array(300, 165));
}
if (p > 58) {
_local3 = Math.floor((p - 59) / 2);
_local2 = ((((p - 59) - (_local3 * 2)) * 45) + 300) - 23;
_local3 = (_local3 * 65) + 133;
return(Array(_local2, _local3));
}
if (p > 57) {
return(Array(300, 165));
}
if (p > 52) {
_local2 = ((p - 53) * -10) + 385;
return(Array(_local2, 165));
}
if (p > 47) {
_local2 = ((p - 48) * 10) + 215;
return(Array(_local2, 165));
}
if (p > 42) {
_local3 = ((p - 43) * -10) + 270;
return(Array(300, _local3));
}
if (p > 37) {
_local2 = ((p - 38) * -10) + 385;
_local3 = ((p - 38) * -10) + 270;
return(Array(_local2, _local3));
}
if (p > 32) {
_local2 = ((p - 33) * 10) + 215;
_local3 = ((p - 33) * -10) + 270;
return(Array(_local2, _local3));
}
if (p > 27) {
_local3 = ((p - 28) * 10) + 60;
return(Array(300, _local3));
}
if (p > 22) {
_local2 = ((p - 23) * -10) + 385;
_local3 = ((p - 23) * 10) + 60;
return(Array(_local2, _local3));
}
if (p > 17) {
_local2 = ((p - 18) * 10) + 215;
_local3 = ((p - 18) * 10) + 60;
return(Array(_local2, _local3));
}
if (p > 8) {
p = p - 9;
_local3 = Math.floor(p / 3);
_local2 = ((p - (_local3 * 3)) * 10) + 185;
_local3 = (_local3 * 105) + 60;
return(Array(_local2, _local3));
}
_local3 = Math.floor(p / 3);
_local2 = ((p - (_local3 * 3)) * -10) + 415;
_local3 = (_local3 * 105) + 60;
return(Array(_local2, _local3));
}
if (_local4 == 7) {
if (p > 65) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 66) * 5) + 97;
return(Array(_local2, 390));
}
if (p > 35) {
p = p - 36;
_local3 = Math.floor(p / 5);
_local2 = (((p * -15) + (_local3 * -15)) + 37) + 510;
_local3 = ((p - (_local3 * 5)) * 20) + 185;
return(Array(_local2, _local3));
}
_local3 = Math.floor(p / 6);
_local2 = (p * 15) + 37;
_local3 = ((p - (_local3 * 6)) * 20) + 65;
return(Array(_local2, _local3));
}
if (_local4 == 8) {
if (p > 79) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 80) * 5) + 97;
return(Array(_local2, 390));
}
if (p == 79) {
return(Array(300, 160));
}
if (p > 76) {
_local2 = ((((p - 77) * 45) + 30) + 225) + 23;
return(Array(_local2, 160));
}
if (p == 76) {
return(Array(300, 225));
}
if (p == 75) {
return(Array(300, 95));
}
if (p > 71) {
_local2 = (((p - 72) * 45) + 30) + 225;
return(Array(_local2, 160));
}
if (p > 69) {
_local2 = ((((p - 70) * 45) + 30) + 225) + 23;
return(Array(_local2, 225));
}
if (p > 67) {
_local2 = ((((p - 68) * 45) + 30) + 225) + 23;
return(Array(_local2, 95));
}
if (p > 63) {
_local2 = ((((p - 64) * 45) + 30) + 180) + 23;
return(Array(_local2, 160));
}
if (p == 63) {
return(Array(300, 290));
}
if (p == 62) {
return(Array(300, 30));
}
if (p > 58) {
_local2 = (((p - 59) * 45) + 30) + 225;
return(Array(_local2, 225));
}
if (p > 55) {
_local2 = (((p - 56) * 45) + 30) + 225;
return(Array(_local2, 95));
}
if (p > 50) {
_local2 = (((p - 51) * 45) + 30) + 180;
return(Array(_local2, 160));
}
if (p > 48) {
_local2 = ((((p - 49) * 45) + 30) + 225) + 23;
return(Array(_local2, 290));
}
if (p > 46) {
_local2 = ((((p - 47) * 45) + 30) + 225) + 23;
return(Array(_local2, 30));
}
if (p > 42) {
_local2 = ((((p - 43) * 45) + 30) + 180) + 23;
return(Array(_local2, 225));
}
if (p > 38) {
_local2 = ((((p - 39) * 45) + 30) + 180) + 23;
return(Array(_local2, 95));
}
if (p > 28) {
_local2 = ((((p - 29) * 45) + 30) + 45) + 23;
return(Array(_local2, 160));
}
if (p > 25) {
_local2 = (((p - 26) * 45) + 30) + 225;
return(Array(_local2, 290));
}
if (p > 22) {
_local2 = (((p - 23) * 45) + 30) + 225;
return(Array(_local2, 30));
}
if (p > 17) {
_local2 = (((p - 18) * 45) + 30) + 180;
return(Array(_local2, 225));
}
if (p > 12) {
_local2 = (((p - 13) * 45) + 30) + 180;
return(Array(_local2, 95));
}
_local2 = (p * 45) + 30;
return(Array(_local2, 160));
}
if (_local4 == 9) {
if (p > 64) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 65) * 5) + 97;
return(Array(_local2, 390));
}
if (p == 64) {
return(Array(500, 160));
}
if (p > 59) {
p = p - 60;
_local3 = Math.floor(p / 2);
_local2 = (((p - (_local3 * 2)) * 45) + 455) + 23;
_local3 = ((_local3 * 65) + 95) + 33;
return(Array(_local2, _local3));
}
if (p == 59) {
return(Array(100, 160));
}
if (p > 54) {
p = p - 55;
_local3 = Math.floor(p / 2);
_local2 = (((p - (_local3 * 2)) * 45) + 55) + 23;
_local3 = ((_local3 * 65) + 95) + 33;
return(Array(_local2, _local3));
}
if (p == 54) {
return(Array(300, 160));
}
if (p > 49) {
p = p - 50;
_local3 = Math.floor(p / 2);
_local2 = (((p - (_local3 * 2)) * 45) + 255) + 23;
_local3 = ((_local3 * 65) + 95) + 33;
return(Array(_local2, _local3));
}
if (p > 40) {
p = p - 41;
_local3 = Math.floor(p / 3);
_local2 = ((p - (_local3 * 3)) * 45) + 255;
_local3 = (_local3 * 65) + 95;
return(Array(_local2, _local3));
}
if (p > 24) {
p = p - 25;
_local3 = Math.floor(p / 4);
_local2 = (((p - (_local3 * 4)) * 45) + 210) + 23;
_local3 = ((_local3 * 65) + 30) + 33;
return(Array(_local2, _local3));
}
_local3 = Math.floor(p / 5);
_local2 = ((p - (_local3 * 5)) * 45) + 210;
_local3 = (_local3 * 65) + 30;
return(Array(_local2, _local3));
}
if (_local4 == 10) {
if (p > 41) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 42) * 5) + 97;
return(Array(_local2, 390));
}
if (p > 20) {
p = p - 21;
_local2 = 265;
}
if (p > 14) {
_local2 = _local2 + ((((p - 15) * 15) + 160) - 75);
_local3 = (((p - 15) * -20) + 65) + 100;
return(Array(_local2, _local3));
}
if (p > 9) {
_local2 = _local2 + (((p - 10) * -15) + 160);
_local3 = (((p - 10) * -20) + 65) + 200;
return(Array(_local2, _local3));
}
if (p > 4) {
_local2 = _local2 + ((((p - 5) * -15) + 160) + 75);
_local3 = (((p - 5) * 20) + 65) + 100;
return(Array(_local2, _local3));
}
_local2 = _local2 + ((p * 15) + 160);
_local3 = (p * 20) + 65;
return(Array(_local2, _local3));
}
if (_local4 == 11) {
if (p > 66) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 67) * 5) + 97;
return(Array(_local2, 390));
}
if (p == 66) {
return(Array(364, 160));
}
if (p == 65) {
return(Array(229, 160));
}
if (p > 59) {
_local2 = ((p - 60) * 45) + 207;
return(Array(_local2, 160));
}
if (p > 47) {
_local3 = Math.floor((p - 48) / 6);
_local2 = ((((p - 48) - (_local3 * 6)) * 45) + 94) + 90;
_local3 = ((_local3 * 65) + 95) + 32;
return(Array(_local2, _local3));
}
if (p > 40) {
_local2 = (((p - 41) * 45) + 117) + 45;
return(Array(_local2, 95));
}
if (p > 33) {
_local2 = (((p - 34) * 45) + 117) + 45;
return(Array(_local2, 225));
}
if (p > 25) {
_local2 = (((p - 26) * 45) + 94) + 45;
return(Array(_local2, 62));
}
if (p > 17) {
_local2 = (((p - 18) * 45) + 94) + 45;
return(Array(_local2, 267));
}
if (p > 8) {
_local2 = ((p - 9) * 45) + 117;
return(Array(_local2, 290));
}
_local2 = (p * 45) + 117;
return(Array(_local2, 30));
}
if (_local4 == 12) {
if (p > 91) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 92) * 5) + 97;
return(Array(_local2, 390));
}
if (p == 91) {
return(Array(457, 295));
}
if (p == 90) {
return(Array(457, 35));
}
if (p == 89) {
return(Array(142, 295));
}
if (p == 88) {
return(Array(142, 35));
}
if (p > 83) {
_local3 = ((p - 84) * 65) + 65;
return(Array(502, _local3));
}
if (p > 79) {
_local3 = ((p - 80) * 65) + 65;
return(Array(97, _local3));
}
if (p > 70) {
_local2 = ((p - 71) * 45) + 117;
return(Array(_local2, 295));
}
if (p > 61) {
_local2 = ((p - 62) * 45) + 117;
return(Array(_local2, 35));
}
if (p > 58) {
_local3 = ((p - 59) * 65) + 100;
return(Array(502, _local3));
}
if (p > 55) {
_local3 = ((p - 56) * 65) + 100;
return(Array(97, _local3));
}
if (p > 45) {
_local2 = ((p - 46) * 45) + 97;
return(Array(_local2, 295));
}
if (p > 35) {
_local2 = ((p - 36) * 45) + 97;
return(Array(_local2, 35));
}
_local3 = Math.floor(p / 9);
_local2 = ((p - (_local3 * 9)) * 45) + 117;
_local3 = (_local3 * 65) + 65;
return(Array(_local2, _local3));
}
if (_local4 == 13) {
if (p > 73) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 74) * 5) + 97;
return(Array(_local2, 390));
}
if (p > 36) {
p = p - 37;
_local2 = 150;
} else {
_local2 = -150;
}
if (p == 36) {
return(Array(_local2 + 300, 160));
}
if (p > 31) {
_local2 = _local2 + ((((((p - 32) * 20) + 117) + 45) + 33) + 20);
_local3 = (((((p - 32) * -20) + 45) + 240) - 10) - 20;
return(Array(_local2, _local3));
}
if (p > 27) {
_local2 = _local2 + ((((((p - 28) * -20) + 117) + 255) + 33) - 20);
_local3 = (((((p - 28) * -20) + 45) + 240) - 10) - 20;
return(Array(_local2, _local3));
}
if (p > 23) {
_local2 = _local2 + ((((((p - 24) * -20) + 117) + 255) + 33) - 20);
_local3 = (((p - 24) * 20) + 45) + 20;
return(Array(_local2, _local3));
}
if (p > 19) {
_local2 = _local2 + ((((((p - 20) * 20) + 117) + 45) + 33) + 20);
_local3 = (((p - 20) * 20) + 45) + 20;
return(Array(_local2, _local3));
}
if (p > 14) {
_local3 = ((((p - 15) * -20) + 45) + 240) - 10;
return(Array(_local2 + 300, _local3));
}
if (p > 9) {
_local3 = ((p - 10) * 20) + 45;
return(Array(_local2 + 300, _local3));
}
if (p > 4) {
_local2 = _local2 + (((((p - 5) * -20) + 117) + 255) + 33);
return(Array(_local2, 160));
}
_local2 = _local2 + ((((p * 20) + 117) + 45) + 33);
return(Array(_local2, 160));
}
if (_local4 == 14) {
if (p > 77) {
if (p == 103) {
return(Array(502, 390));
}
_local2 = ((p - 78) * 5) + 97;
return(Array(_local2, 390));
}
if (p == 77) {
return(Array(300, 200));
}
if (p > 71) {
_local2 = ((p - 72) * -30) + 450;
_local3 = ((p - 72) * 10) + 115;
return(Array(_local2, _local3));
}
if (p > 66) {
_local2 = ((p - 67) * 30) + 150;
_local3 = ((p - 67) * 10) + 115;
return(Array(_local2, _local3));
}
if (p > 62) {
_local2 = ((p - 63) * -30) + 450;
_local3 = ((p - 63) * -10) + 215;
return(Array(_local2, _local3));
}
if (p > 58) {
_local2 = ((p - 59) * 30) + 150;
_local3 = ((p - 59) * -10) + 215;
return(Array(_local2, _local3));
}
if (p > 54) {
_local3 = ((p - 55) * 65) + 65;
return(Array(480, _local3));
}
if (p > 50) {
_local3 = ((p - 51) * 65) + 65;
return(Array(120, _local3));
}
if (p > 43) {
_local2 = (((p - 44) * 45) + 120) + 45;
return(Array(_local2, 230));
}
if (p > 36) {
_local2 = (((p - 37) * 45) + 120) + 45;
return(Array(_local2, 165));
}
if (p > 29) {
_local2 = (((p - 30) * 45) + 120) + 45;
return(Array(_local2, 100));
}
if (p > 24) {
_local3 = ((p - 25) * 65) + 35;
return(Array(480, _local3));
}
if (p > 19) {
_local3 = ((p - 20) * 65) + 35;
return(Array(120, _local3));
}
if (p > 9) {
_local2 = ((p - 10) * 45) + 97;
return(Array(_local2, 265));
}
_local2 = (p * 45) + 97;
return(Array(_local2, 65));
}
if (_local4 == 15) {
if (p > 27) {
if (p == 103) {
return(Array(502, 390));
}
if (p > 79) {
_local2 = ((p - 80) * 5) + 97;
return(Array(_local2, 390));
}
return(Array(1000, 1000));
}
if (p > 17) {
_local2 = ((p - 18) * 45) + 97;
_local3 = _local3 + 210;
return(Array(_local2, _local3));
}
if (p > 8) {
_local2 = ((p - 9) * 45) + 117;
_local3 = _local3 + 180;
return(Array(_local2, _local3));
}
if (p > 2) {
if (p > 6) {
p++;
}
if (p > 4) {
p++;
}
_local2 = (((p - 3) * 45) + 97) + 45;
_local3 = _local3 + 150;
return(Array(_local2, _local3));
}
if (p > 1) {
p = p + 2;
}
if (p > 0) {
p = p + 2;
}
_local2 = ((p * 45) + 117) + 45;
_local3 = _local3 + 120;
return(Array(_local2, _local3));
}
return(Array(0, 0));
}
function makeCard(s, c, p, up, l) {
_root["cards" + l]["c" + p].removeMovieClip();
_root["cards" + l].createEmptyMovieClip("c" + p, p + 1);
var _local2 = _root["cards" + l]["c" + p];
drawCard(p, up, l);
if (up == 1) {
_local2.createTextField("txt", 2, 0, 4, 40, 20);
if (s & true) {
doText(_local2.txt, row[c], tFr);
} else {
doText(_local2.txt, row[c], tFb);
}
if (s > 3) {
s = s - 4;
}
_local2.attachMovie("sym" + s, "sym", 3);
_local2.sym._x = 20;
_local2.sym._y = 42;
_local2.sym._xscale = 120;
_local2.sym._yscale = 120;
}
_local2.cacheAsBitmap = true;
var _local6 = getPos(p, l);
_local2._x = _local6[0];
_local2._y = _local6[1];
_local2.s = s;
_local2.c = c;
_local2.p = p;
_local2.up = up;
}
function moveCard(f) {
s2.start(0, 1);
disableCards();
var _local8 = level.__get__value();
if (f < (table[_local8] + 1)) {
chain2.addValue(100);
speed2.addValue(25);
if (mode.__get__value() == 1) {
level_score.addValue(100 * level2.__get__value());
} else {
level_score.addValue(100 * _local8);
}
doText(_root.men.score_txt, "Score: " + level_score.__get__value(), tFwR);
} else {
if (chain2.__get__value() > chain.__get__value()) {
chain.setValue(chain2.__get__value());
}
chain2.setValue(0);
speed2.setValue(0);
}
var _local5 = 103;
var _local3 = _root.cards1["c" + f];
var _local7 = _local3.s;
var _local6 = _local3.c;
_local3.removeMovieClip();
makeCard(_local7, _local6, _local5, 1, 1);
makeCard(_local7, _local6, f, 1, 2);
_local3 = _root.cards1["c" + _local5];
var _local4 = _root.cards2["c" + f];
var x = ((_local3._x - _local4._x) / 10);
var y = ((_local3._y - _local4._y) / 10);
_local4.onEnterFrame = function () {
this._x = this._x + x;
this._y = this._y + y;
this._alpha = this._alpha - 10;
if (this._alpha < 10) {
this.removeMovieClip();
}
};
turnCards();
}
function turnCards() {
var _local15 = new flash.filters.GlowFilter(0, 0.4, 5, 5, 1, 3, false, false);
var filterArray1 = new Array();
filterArray1.push(_local15);
var _local14 = new flash.filters.GlowFilter(0, 0, 0, 0, 0, 0, false, false);
var filterArray2 = new Array();
filterArray2.push(_local14);
var _local8 = _root.cards1.c103.c;
var _local7;
var _local9;
var _local10;
var _local13 = 0;
var _local12 = 0;
var _local11 = 0;
var _local6 = table[level.__get__value()];
var _local3;
var _local4 = 0;
while (_local4 < 103) {
if (_root.cards1["c" + _local4]) {
_local3 = _root.cards1["c" + _local4];
_local7 = 0;
_local9 = 0;
if (_local4 > _local6) {
_local12++;
_local7++;
} else {
_local13++;
var _local5 = _local4 + 1;
while (_local5 < (_local6 + 1)) {
if (_local3.hitTest(_root.cards1["c" + _local5])) {
_local7++;
}
_local5++;
}
}
if (_local7 > 0) {
if (_local4 > _local6) {
if ((!_root.cards1["c" + (_local4 + 1)]) || (_local4 == 102)) {
_local9++;
}
}
if (_local3.up == 1) {
makeCard(_local3.s, _local3.c, _local3.p, 0, 1);
}
} else {
_local9++;
if (_local3.up == 0) {
makeCard(_local3.s, _local3.c, _local3.p, 1, 1);
}
}
if (_local9 > 0) {
_local10 = 0;
if (_local4 > _local6) {
_local10++;
} else if (((((_local3.c + 1) == _local8) || ((_local3.c - 1) == _local8)) || ((_local3.c == 0) && (_local8 == 12))) || ((_local3.c == 12) && (_local8 == 0))) {
_local11++;
_local10++;
}
if (_local10 > 0) {
_local3.onRollOver = function () {
this.filters = filterArray1;
};
_local3.onRollOut = function () {
this.filters = filterArray2;
};
_local3.onRelease = function () {
moveCard(this.p);
};
}
}
}
_local4++;
}
if (_local13 == 0) {
dropCards();
levelMenu(1);
} else if (_local12 == 0) {
if (_local11 == 0) {
dropCards();
levelMenu(0);
}
}
}
function disableCards() {
var _local2 = 0;
while (_local2 < 103) {
delete _root.cards1["c" + _local2].onRollOver;
delete _root.cards1["c" + _local2].onRollOut;
delete _root.cards1["c" + _local2].onRelease;
_local2++;
}
}
function dropCards() {
disableCards();
var y = 0;
_root.cards1.onEnterFrame = function () {
y++;
this._y = this._y + y;
_root.cards2._y = _root.cards2._y + y;
_root.men.speed_card._y = _root.men.speed_card._y + y;
if (this._y > 480) {
this.removeMovieClip();
_root.cards2.removeMovieClip();
_root.men.speed_card.removeMovieClip();
}
};
}
function dropCardsIn() {
var _local3 = 0;
while (_local3 < 104) {
if (_root.cards1["c" + _local3]._x == 1000) {
_root.cards1["c" + _local3].removeMovieClip();
} else {
_root.cards1["c" + _local3]._x = _root.cards1["c" + _local3]._x - 666;
_root.cards1["c" + _local3]._y = _root.cards1["c" + _local3]._y - 666;
_root.cards1["c" + _local3]._rotation = _root.cards1["c" + _local3]._rotation - 37;
}
_local3++;
}
var c = 0;
var c2 = 0;
_root.cards1.onEnterFrame = function () {
if (_root.cards1["c" + c]) {
dropCardIn(c);
}
if (c > 104) {
c2++;
if (c2 > 37) {
delete this.onEnterFrame;
if (!_root.pmen) {
turnCards();
}
}
}
if (c == 24) {
s1.start(0, 4);
}
c++;
};
}
function dropCardIn(i) {
var s = 37;
_root.cards1["c" + i].onEnterFrame = function () {
if (s > 0) {
s--;
this._x = this._x + s;
this._y = this._y + s;
this._rotation++;
} else {
delete this.onEnterFrame;
}
};
}
function makeObjects(t) {
_root.createEmptyMovieClip("falling", 4);
var _local2 = _root.falling;
var n = 0;
if (t == 1) {
_local2.onEnterFrame = function () {
n++;
if (n & true) {
makeSnow(n);
}
};
} else if (t == 3) {
_local2.onEnterFrame = function () {
n++;
makeRain(n);
};
}
}
function makeSnow(n) {
_root.falling.attachMovie("snow" + Math.ceil(Math.random() * 3), "s_" + n, n);
var _local3 = _root.falling["s_" + n];
_local3._alpha = Math.round(Math.random() * 25) + 25;
_local3._rotation = Math.round(Math.random() * 360);
_local3._x = Math.round(Math.random() * 700) - 60;
_local3._y = -10;
_local3.cacheAsBitmap = true;
var s = ((Math.random() * 2) + 3);
var s2 = 0;
_local3.onEnterFrame = function () {
if ((s2 > -4) && (s2 < 4)) {
s2 = s2 + (Math.random() - 0.5);
}
if (s2 < -3) {
s2++;
}
if (s2 > 3) {
s2--;
}
this._x = this._x + (0.1 * (s + s2));
this._y = this._y + (0.6 * s);
if ((this._x > 640) || (this._y > 480)) {
this.removeMovieClip();
}
};
}
function makeRain(n) {
_root.falling.createEmptyMovieClip("d_" + n, n);
var _local3 = _root.falling["d_" + n];
_local3.lineStyle((Math.random() * 1.8) + 0.2, 16777215, Math.round(Math.random() * 50) + 25);
_local3.lineTo(0, Math.round(Math.random() * 6) + 2);
_local3._rotation = 345;
_local3._x = Math.round(Math.random() * 700) - 60;
_local3._y = -10;
_local3.cacheAsBitmap = true;
var s = ((Math.random() * 5) + 5);
_local3.onEnterFrame = function () {
this._x = this._x + (0.1 * s);
this._y = this._y + (0.6 * s);
if ((this._x > 640) || (this._y > 480)) {
this.removeMovieClip();
}
};
}
function menuBasics(title, p) {
var _local4 = new flash.filters.DropShadowFilter(2, 45, 0, 0.4, 3, 3, 1, 2);
if (p) {
_root.createEmptyMovieClip("pmen", 11);
var _local3 = _root.pmen;
} else {
_root.createEmptyMovieClip("men", 3);
var _local3 = _root.men;
}
_local3.createEmptyMovieClip("back", 1);
drawSquareR(120, 80, 400, 320, _local3.back);
_local3.createTextField("logo", 2, 0, 5, 640, 20);
doText(_local3.logo, "6 Peaks Solitaire", tFlC2);
_local3.logo.filters = [_local4];
if (title != "") {
_local3.createTextField("title_txt", 3, 0, 80, 640, 20);
doText(_local3.title_txt, title, tFlC);
_local3.title_txt.filters = [_local4];
}
_local3._alpha = 0;
_local3.onEnterFrame = function () {
this._alpha = this._alpha + 4;
if (this._alpha > 96) {
this._alpha = 100;
delete this.onEnterFrame;
}
};
}
function menuPromo(mc) {
var _local2 = mc;
_local2.createEmptyMovieClip("more_but", 7);
_local2 = _local2.more_but;
_local2.createEmptyMovieClip("click", 1);
drawSquare(121, 270, 398, 80, 0, _local2.click);
_local2.click._alpha = 0;
_local2.createEmptyMovieClip("cover", 2);
drawSquare(121, 270, 398, 80, 0, _local2.cover);
_local2.createEmptyMovieClip("cards", 3);
var _local1 = 0;
while (_local1 < 4) {
_local2.cards.attachMovie("sym" + _local1, "s" + _local1, _local2.cards.getNextHighestDepth());
_local2.cards["s" + _local1]._x = 280 + (_local1 * 30);
_local2.cards["s" + _local1]._y = 300;
_local2.cards["s" + _local1]._xscale = 300;
_local2.cards["s" + _local1]._yscale = 300;
_local2.cards["s" + _local1]._rotation = (_local1 - 1.5) * 30;
if ((_local1 == 0) || (_local1 == 3)) {
_local2.cards["s" + _local1]._y = _local2.cards["s" + _local1]._y + 15;
}
_local1++;
}
_local2.cards.setMask(_local2.cover);
_local2.cards.cacheAsBitmap = true;
_local2.createEmptyMovieClip("but", 4);
_local2.but.attachMovie("kos_sponsor", "sponsor", 1);
_local2.but._x = 122.5;
_local2.but._y = 317.5;
_local2.onRelease = function () {
getURL ("http://www.kingofsolitaire.com/?ref=six-peaks-solitaire", "_blank");
};
}
function makeButton(y, title, mc, type) {
var _local3 = new flash.filters.DropShadowFilter(2, 45, 0, 0.4, 3, 3, 1, 2);
var _local2 = mc;
_local2.createEmptyMovieClip("back", 1);
drawSquare(0, 0, 398, 40, 14540253, _local2.back);
if (type == 1) {
_local2.createTextField("txt", 2, 0, -5, 398, 30);
} else {
_local2.createTextField("txt", 2, 54, -5, 344, 30);
}
doText(_local2.txt, title, tFmC);
_local2.txt.filters = [_local3];
_local2._x = 121;
_local2._y = y;
_local2.onRollOver = function () {
this.back._alpha = 60;
};
_local2.onRollOut = function () {
this.back._alpha = 100;
};
}
function startMenu() {
menuBasics("Menu");
var _local3 = _root.men;
_local3.createEmptyMovieClip("play_but", 4);
makeButton(150, "Play", _local3.play_but, 1);
_local3.play_but.onRelease = function () {
delete _root.men.cred_but.onRelease;
delete _root.men.instructions_but.onRelease;
delete this.onRelease;
doTransition(0, "main", "menu_play");
};
_local3.createEmptyMovieClip("instructions_but", 5);
makeButton(190, "Instructions", _local3.instructions_but, 1);
_local3.instructions_but.onRelease = function () {
delete _root.men.cred_but.onRelease;
delete this.onRelease;
delete _root.men.play_but.onRelease;
doTransition(0, "main", "menu_instructions");
};
_local3.createEmptyMovieClip("cred_but", 6);
makeButton(230, "Credits", _local3.cred_but, 1);
_local3.cred_but.onRelease = function () {
delete this.onRelease;
delete _root.men.instructions_but.onRelease;
delete _root.men.play_but.onRelease;
doTransition(0, "main", "menu_credits");
};
menuPromo(_local3);
}
function playMenu() {
var _local4 = new flash.filters.DropShadowFilter(2, 45, 0, 0.4, 3, 3, 1, 2);
menuBasics("Play");
var _local3 = _root.men;
_local3.createEmptyMovieClip("play_but", 4);
makeButton(150, "Play levels", _local3.play_but, 1);
_local3.play_but.onRelease = function () {
delete _root.men.back_but.onRelease;
delete this.onRelease;
delete _root.men.play2_but.onRelease;
mode.setValue(0);
nextLevel();
};
_local3.createEmptyMovieClip("play2_but", 5);
makeButton(190, "Custom game", _local3.play2_but, 1);
_local3.play2_but.onRelease = function () {
delete _root.men.back_but.onRelease;
delete _root.men.play_but.onRelease;
delete this.onRelease;
mode.setValue(1);
doTransition(0, "main", "menu_play2");
};
_local3.createEmptyMovieClip("back_but", 6);
makeButton(350, "Back", _local3.back_but, 1);
_local3.back_but.onRelease = function () {
delete this.onRelease;
delete _root.men.play_but.onRelease;
delete _root.men.play2_but.onRelease;
doTransition(0, "main", "main");
};
}
function playMenu2() {
var _local7 = new flash.filters.DropShadowFilter(2, 45, 0, 0.4, 3, 3, 1, 2);
menuBasics("Select a theme");
var _local5 = _root.men;
_local5.createEmptyMovieClip("theme1_but", 4);
makeButton(150, "North America", _local5.theme1_but, 2);
_local5.theme1_but.onRelease = function () {
delete _root.men.back_but.onRelease;
delete this.onRelease;
delete _root.men.theme2_but.onRelease;
delete _root.men.theme3_but.onRelease;
theme.setValue(1);
doTransition(0, "main", "menu_play3");
};
var _local6 = 3;
var _local3;
var _local4 = 1;
while (_local4 < 4) {
_local6 = _local6 + 2;
_local5.createEmptyMovieClip(("theme" + _local4) + "_logo", _local6);
_local3 = _local5[("theme" + _local4) + "_logo"];
_local3.createEmptyMovieClip("square", 1);
drawSquare(0, 0, 48, 36, 0, _local3.square);
_local3.attachMovie("bg" + _local4, "back", 2);
_local3.back._xscale = 7.52;
_local3.back._yscale = 7.52;
_local3.back.cacheAsBitmap = true;
_local3.back.setMask(_local3.square);
_local3._x = 123;
_local3._y = 112 + (40 * _local4);
_local4++;
}
_local5.createEmptyMovieClip("theme2_but", 6);
makeButton(190, "South America", _local5.theme2_but, 2);
_local5.theme2_but.onRelease = function () {
delete _root.men.back_but.onRelease;
delete _root.men.theme1_but.onRelease;
delete this.onRelease;
delete _root.men.theme3_but.onRelease;
theme.setValue(2);
doTransition(0, "main", "menu_play3");
};
_local5.createEmptyMovieClip("theme3_but", 8);
makeButton(230, "Japan", _local5.theme3_but, 2);
_local5.theme3_but.onRelease = function () {
delete _root.men.back_but.onRelease;
delete _root.men.theme1_but.onRelease;
delete _root.men.theme2_but.onRelease;
delete this.onRelease;
theme.setValue(3);
doTransition(0, "main", "menu_play3");
};
_local5.createEmptyMovieClip("back_but", 10);
makeButton(350, "Back", _local5.back_but, 1);
_local5.back_but.onRelease = function () {
delete this.onRelease;
delete _root.men.theme1_but.onRelease;
delete _root.men.theme2_but.onRelease;
delete _root.men.theme3_but.onRelease;
doTransition(0, "main", "menu_play");
};
}
function playMenu3() {
var _local8 = new flash.filters.DropShadowFilter(2, 45, 0, 0.4, 3, 3, 1, 2);
menuBasics("Select a layout");
var _local7 = _root.men;
_local7.createEmptyMovieClip("cards", 4);
drawSquare(121, 140, 398, 150, 14540253, _local7.cards);
var layouts = new Array("", "Six Peaks", "Block", "Bone", "Well", "Cross", "Fountain", "Wave", "Levee", "Pyramid", "Escher", "Arc", "Tub", "Stars", "Treasure Chest", "Tri Peaks (52 cards)");
var _local3;
var _local9 = theme.__get__value();
var _local5;
var i = 1;
while (i < 16) {
_local7.createEmptyMovieClip("layout_" + i, _local7.getNextHighestDepth());
_local3 = _local7["layout_" + i];
_local3.createEmptyMovieClip("square", 1);
drawSquare(0, 0, 64, 42, 16777215, _local3.square);
_local3.createEmptyMovieClip("cards", 2);
level.setValue(i);
var _local4 = 0;
while (_local4 < (table[i] + 1)) {
_local5 = getPos(_local4);
if (_local5[0] != -1000) {
_local3.cards.createEmptyMovieClip("c_" + _local4, _local3.cards.getNextHighestDepth());
drawSquare(_local5[0] / 10, _local5[1] / 10, 4, 6, 0, _local3.cards["c_" + _local4]);
}
_local4++;
}
_local3.cards.filters = [_local8];
_local3.cacheAsBitmap = true;
_local3._x = 152 + (((i - 1) - (Math.floor((i - 1) / 5) * 5)) * 68);
_local3._y = 142 + (Math.floor((i - 1) / 5) * 46);
_local3.i = i;
_local3.onRollOver = function () {
doText(_root.men.layout_txt, layouts[this.i], tFmC);
};
_local3.onRollOut = function () {
doText(_root.men.layout_txt, "", tFmC);
};
_local3.onRelease = function () {
delete _root.men.back_but.onRelease;
var _local3 = 1;
while (_local3 < 16) {
delete _root.men["layout_" + _local3].onRelease;
_local3++;
}
level.setValue(this.i);
nextLevel();
};
i++;
}
_local7.createTextField("layout_txt", 998, 121, 296, 398, 30);
doText(_local7.layout_txt, "", tFmC);
_local7.layout_txt.filters = [_local8];
_local7.createEmptyMovieClip("back_but", 999);
makeButton(350, "Back", _local7.back_but, 1);
_local7.back_but.onRelease = function () {
delete this.onRelease;
var _local3 = 1;
while (_local3 < 16) {
delete _root.men["layout_" + _local3].onRelease;
_local3++;
}
doTransition(0, "main", "menu_play2");
};
}
function helpMenu() {
var _local4 = new flash.filters.DropShadowFilter(2, 45, 0, 0.4, 3, 3, 1, 2);
menuBasics("Instructions");
var _local3 = _root.men;
_local3.createTextField("txt", 4, 125, 160, 390, 200);
doText(_local3.txt, "The game is based on standard Tri Peaks Solitaire rules. Click ascending or descending cards to put on the waste pile in the right bottom corner of the screen. Pick a card from the stock if there are no more moves.", tFb);
_local3.txt.filters = [_local4];
_local3.createEmptyMovieClip("more_but", 5);
makeButton(310, "More instructions", _local3.more_but, 1);
_local3.more_but.onRelease = function () {
getURL ("http://www.kingofsolitaire.com/tri-peaks-card-games/how-to-play/?ref=six-peaks-solitaire", "_blank");
};
_local3.createEmptyMovieClip("back_but", 6);
makeButton(350, "Back", _local3.back_but, 1);
_local3.back_but.onRelease = function () {
delete this.onRelease;
delete _root.men.next_but.onRelease;
doTransition(0, "main", "main");
};
}
function creditsMenu() {
menuBasics("Credits");
var _local3 = _root.men;
_local3.createEmptyMovieClip("but1", 4);
makeButton(190, "Game by Rick van Helden", _local3.but1, 1);
_local3.but1.onRelease = function () {
getURL ("http://www.rickvanhelden.com", "_blank");
};
_local3.createEmptyMovieClip("but2", 5);
makeButton(230, "Music by Kevin MacLeod", _local3.but2, 1);
_local3.but2.onRelease = function () {
getURL ("http://incompetech.com", "_blank");
};
_local3.createTextField("kevin", 6, 120, 270, 400, 100);
doText(_local3.kevin, "Transition One\nIntractable\nSancho Panza gets a Latte\nEastminster (ending)", tFbS);
_local3.createEmptyMovieClip("back_but", 7);
makeButton(350, "Back", _local3.back_but, 1);
_local3.back_but.onRelease = function () {
delete this.onRelease;
doTransition(0, "main", "main");
};
}
function gameMenu() {
var _local5 = new flash.filters.DropShadowFilter(2, 45, 0, 0.4, 3, 3, 1, 2);
_root.createEmptyMovieClip("men", 3);
var _local4 = _root.men;
_local4.createTextField("level_txt", 1, 3, 0, 240, 30);
if (mode.__get__value() == 1) {
doText(_local4.level_txt, "Level: " + level2.__get__value(), tFwL);
} else {
doText(_local4.level_txt, "Level: " + level.__get__value(), tFwL);
}
_local4.level_txt.filters = [_local5];
_local4.createTextField("score_txt", 2, 396, 0, 240, 30);
doText(_local4.score_txt, "Score: " + level_score.__get__value(), tFwR);
_local4.score_txt.filters = [_local5];
_local4.createEmptyMovieClip("speed_card", 3);
var _local3 = _local4.speed_card;
_local3.createEmptyMovieClip("square", 1);
_local3.createEmptyMovieClip("back", 2);
drawSquareRvar(0, 0, 40, 60, 0, 1, _local3.back);
_local3.back.setMask(_local3.square);
_local3.createTextField("txt", 3, 0, 20, 40, 20);
doText(_local3.txt, "speed", tFbS);
_local3.createEmptyMovieClip("line", 4);
drawSquareRvar(0, 0, 40, 60, 1, 0, _local3.line);
_local3._x = 459;
_local3._y = 390;
var s;
_local3.square.onEnterFrame = function () {
s = speed2.value;
this.clear();
if (s > 0) {
if ((s / 2) > 60) {
speed.setValue((120 - s) - 1);
drawSquare(0, 0, 40, 60, 0, this);
} else {
drawSquare(0, 60, 40, (s / 2) * -1, 0, this);
}
speed.addValue(s - 1);
speed2.addValue(-1);
}
};
_local4.createEmptyMovieClip("back_but", 4);
_local3 = _local4.back_but;
_local3.createEmptyMovieClip("back", 1);
drawSquare(25, 3, 75, 27, 16777215, _local3.back);
_local3.back._alpha = 0;
_local3.createTextField("txt", 2, 0, 0, 95, 30);
doText(_local3.txt, "menu", tFwR);
_local3.txt.filters = [_local5];
_local3.cacheAsBitmap = true;
_local3._x = 540;
_local3._y = 450;
_local3.onRelease = function () {
delete _root.men.speed_card.square.onEnterFrame;
this.removeMovieClip();
disableCards();
pauseMenu();
};
}
function pauseMenu() {
_root.assets.createEmptyMovieClip("pmen", _root.assets.getNextHighestDepth());
drawSquare(0, 0, 640, 480, 16777215, _root.assets.pmen);
_root.assets.pmen._alpha = 75;
menuBasics("Pause", 2);
var _local2 = _root.pmen;
_local2.createEmptyMovieClip("resume_but", 4);
makeButton(150, "Resume", _local2.resume_but, 1);
_local2.resume_but.onRelease = function () {
_root.assets.pmen.removeMovieClip();
_root.pmen.removeMovieClip();
gameMenu();
turnCards();
};
_local2.createEmptyMovieClip("restart_but", 5);
makeButton(190, "Restart", _local2.restart_but, 1);
_local2.restart_but.onRelease = function () {
_root.assets.pmen.removeMovieClip();
_root.pmen.removeMovieClip();
score.setValue(0);
level_score.setValue(0);
if (mode.__get__value() == 0) {
level.addValue(-1);
} else {
level2.addValue(-1);
}
nextLevel();
};
_local2.createEmptyMovieClip("menu_but", 6);
makeButton(230, "Menu", _local2.menu_but, 1);
_local2.menu_but.onRelease = function () {
_root.assets.pmen.removeMovieClip();
_root.pmen.removeMovieClip();
dropCards();
doTransition(0, "game", "main");
};
menuPromo(_local2);
}
function levelMenu(complete) {
delete _root.men.speed_card.onEnterFrame;
var _local8 = new flash.filters.DropShadowFilter(2, 45, 0, 0.4, 3, 3, 1, 2);
if (chain2.__get__value() > chain.__get__value()) {
chain.setValue(chain2.__get__value());
}
var _local6 = mode.__get__value();
var _local7 = level.__get__value();
var ls = level_score.__get__value();
var ch = chain.__get__value();
var sp = Math.round(speed.__get__value() / 10);
if (_local6 == 1) {
var co = (complete * (level2.__get__value() * 1000));
} else {
var co = (complete * (_local7 * 1000));
}
score.addValue(((ls + ch) + sp) + co);
if (complete == 1) {
if (_local6 == 1) {
menuBasics(("Level " + level2.__get__value()) + " Complete");
} else {
menuBasics(("Level " + _local7) + "/6 Complete");
}
} else {
menuBasics("Game Over");
}
var _local4 = _root.men;
_local4.createEmptyMovieClip("scores", 4);
var _local3 = _local4.scores;
_local3.createTextField("ls_txt", 3, 125, 140, 195, 20);
doText(_local3.ls_txt, "Level score:", tFmL);
_local3.createTextField("ls_val", 4, 315, 140, 195, 20);
doText(_local3.ls_val, ls, tFmR);
_local3.createTextField("sb_txt", 5, 125, 180, 195, 20);
doText(_local3.sb_txt, "Speed bonus:", tFmL);
_local3.createTextField("sb_val", 6, 315, 180, 195, 20);
doText(_local3.sb_val, sp, tFmR);
_local3.createTextField("cb_txt", 7, 125, 220, 195, 20);
doText(_local3.cb_txt, "Chain bonus:", tFmL);
_local3.createTextField("cb_val", 8, 315, 220, 195, 20);
doText(_local3.cb_val, ch, tFmR);
if (complete == 1) {
_local3.createTextField("complete_txt", 9, 125, 260, 195, 20);
doText(_local3.complete_txt, "Complete bonus:", tFmL);
_local3.createTextField("complete_val", 10, 315, 260, 195, 20);
doText(_local3.complete_val, co, tFmR);
}
_local3.createTextField("ts_txt", 11, 125, 300, 195, 20);
doText(_local3.ts_txt, "Total score:", tFmL);
_local3.createTextField("ts_val", 12, 315, 300, 195, 20);
doText(_local3.ts_val, score.__get__value(), tFmR);
_local3.filters = [_local8];
var count = 0;
var ls2 = ls;
_local3.onEnterFrame = function () {
count++;
if (count > 49) {
ls2 = ls;
if (sp > 0) {
if (sp > 100) {
sp = sp - 100;
ls = ls + 100;
} else if (sp > 10) {
sp = sp - 10;
ls = ls + 10;
} else {
sp--;
ls++;
}
doText(this.sb_val, sp, tFmR);
}
if (ch > 0) {
if (ch > 100) {
ch = ch - 100;
ls = ls + 100;
} else if (ch > 10) {
ch = ch - 10;
ls = ls + 10;
} else {
ch--;
ls++;
}
doText(this.cb_val, ch, tFmR);
}
if (co > 0) {
if (co > 100) {
co = co - 100;
ls = ls + 100;
} else if (co > 10) {
co = co - 10;
ls = ls + 10;
} else {
co--;
ls++;
}
doText(this.complete_val, co, tFmR);
}
if (ls2 != ls) {
doText(this.ls_val, ls, tFmR);
} else {
delete this.onEnterFrame;
}
}
};
_local4.createEmptyMovieClip("back_but", 5);
_local3 = _local4.back_but;
_local3.createEmptyMovieClip("back", 1);
drawSquare(25, 3, 75, 27, 16777215, _local3.back);
_local3.back._alpha = 0;
_local3.createTextField("txt", 2, 0, 0, 95, 30);
doText(_local3.txt, "menu", tFwR);
_local3.txt.filters = [_local8];
_local3.cacheAsBitmap = true;
_local3._x = 540;
_local3._y = 450;
_local3.onRelease = function () {
delete _root.men.speed_card.square.onEnterFrame;
_root.men.removeMovieClip();
dropCards();
doTransition(0, "game", "main");
};
if (((_local7 < 6) && (complete == 1)) || ((_local6 == 1) && (complete == 1))) {
_local4.createEmptyMovieClip("play_but", 999);
makeButton(350, "Continue", _local4.play_but, 1);
_local4.play_but.onRelease = function () {
_root.men.removeMovieClip();
nextLevel();
};
} else {
_local4.createEmptyMovieClip("submit_but", 999);
makeButton(350, "Submit score", _local4.submit_but, 1);
_local4.submit_but.onRelease = function () {
_root.men.removeMovieClip();
submitScore();
};
}
}
function doTransition(bg, from, to) {
var squares = new Array();
var _local3 = 0;
while (_local3 < 301) {
squares.push(_local3);
_local3++;
}
squares = shuffleArray(squares);
_root.createEmptyMovieClip("transition", 7);
var _local4 = _root.transition;
_local4.createEmptyMovieClip("square", 1);
drawSquare(-1, -1, 1, 1, 0, _local4.square);
_local4.createEmptyMovieClip("back", 2);
_local4.back.attachMovie("bg" + bg, "bg", 1);
_local4.back.attachMovie("cover", "cover", 2);
_local4.back.cacheAsBitmap = true;
_local4.back.setMask(_local4.square);
var s = 0;
var s2;
var s3 = 0;
var x;
var y;
var l;
_local4.onEnterFrame = function () {
s++;
s2 = 0;
while (s2 < s) {
s3++;
if (s3 < 301) {
this.square.createEmptyMovieClip("s" + squares[s3], this.square.getNextHighestDepth());
y = Math.floor(parseInt(squares[s3]) / 20);
x = parseInt(squares[s3]) - (y * 20);
drawSquare(x * 32, y * 32, 32, 32, 0, this.square["s" + squares[s3]]);
}
s2++;
}
this.back.setMask(this.square);
if (s3 > 300) {
if (from == "game") {
_root.falling.removeMovieClip();
_root.cards1.removeMovieClip();
_root.cards2.removeMovieClip();
resetData();
}
if (from == "main") {
}
if (to == "game") {
l = level.value;
makeObjects(Math.ceil(l / 2));
if (set_sound.__get__value() == 1) {
makeMusic(Math.ceil(l / 2));
}
_root.bg.removeMovieClip();
_root.attachMovie("bg" + Math.ceil(l / 2), "bg", 1);
_root.bg.cacheAsBitmap = true;
startLevel();
}
if (to == "game2") {
t = theme.value;
makeObjects(t);
if (level2.__get__value() < 2) {
if (set_sound.__get__value() == 1) {
makeMusic(t);
}
}
_root.bg.removeMovieClip();
_root.attachMovie("bg" + t, "bg", 1);
_root.bg.cacheAsBitmap = true;
startLevel();
}
if (to == "main") {
_root.bg.removeMovieClip();
_root.attachMovie("bg0", "bg", 1);
_root.bg.cacheAsBitmap = true;
if (from == "game") {
makeStage();
} else {
startMenu();
}
}
if (to == "menu_credits") {
creditsMenu();
}
if (to == "menu_instructions") {
helpMenu();
}
if (to == "menu_play") {
playMenu();
}
if (to == "menu_play2") {
playMenu2();
}
if (to == "menu_play3") {
playMenu3();
}
this.removeMovieClip();
}
};
}
function startUp() {
_root.attachMovie("bg0", "bg", 1);
_root.bg.cacheAsBitmap = true;
_root.attachMovie("cover", "cover", 2);
_root.cover.cacheAsBitmap = true;
_root.attachMovie("kos_sponsor", "sponsor", 3);
_root.sponsor._x = 10;
_root.sponsor._y = 175;
_root.sponsor._xscale = 157;
_root.sponsor._yscale = 157;
_root.sponsor.cacheAsBitmap = true;
_root.sponsor.onRelease = function () {
getURL ("http://www.kingofsolitaire.com/?ref=six-peaks-solitaire", "_blank");
};
var t = 0;
_root.bg.onEnterFrame = function () {
t++;
if (t > 100) {
delete this.onEnterFrame;
makeStage();
}
};
drawFG();
}
function makeStage() {
if (set_sound.__get__value() == 1) {
makeMusic(0);
}
_root.createEmptyMovieClip("assets", 9);
startMenu();
}
function gameToMain() {
killMusic();
doTransition(0, "game", "main");
}
function nextLevel() {
if (mode.__get__value() == 0) {
level.addValue(1);
var _local3 = level.__get__value();
if (_local3 & true) {
killMusic();
doTransition(Math.ceil(_local3 / 2), "main", "game");
} else {
var s = 0;
var x = 0;
_root.bg.onEnterFrame = function () {
if (x < 49) {
if (s < 10) {
s++;
}
}
if (x > 591) {
if (s > 0) {
s--;
}
}
x = x + s;
this._x = x * -1;
if (x > 639) {
delete this.onEnterFrame;
this.cacheAsBitmap = true;
startLevel();
}
};
}
} else {
level2.addValue(1);
doTransition(theme.__get__value(), "main", "game2");
}
}
function startLevel() {
level_score.setValue(0);
chain.setValue(0);
chain2.setValue(0);
speed.setValue(0);
speed2.setValue(0);
pos = shuffleArray(pos);
_root.createEmptyMovieClip("cards1", 5);
_root.createEmptyMovieClip("cards2", 6);
var _local4 = 0;
var _local3 = 0;
var _local2 = 0;
while (_local2 < 104) {
makeCard(_local4, _local3, parseInt(pos[_local2]), 1, 1);
_local3++;
if (_local3 > 12) {
_local3 = 0;
_local4++;
}
_local2++;
}
turnCards();
disableCards();
dropCardsIn();
gameMenu();
}
var _mochiads_game_id = "09df2d81a0669253";
mochi.as2.MochiServices.connect("09df2d81a0669253");
var mode;
mode = new mochi.as2.MochiDigits(0);
var theme;
theme = new mochi.as2.MochiDigits(0);
var level2;
level2 = new mochi.as2.MochiDigits(0);
var level;
level = new mochi.as2.MochiDigits(0);
var score;
score = new mochi.as2.MochiDigits(0);
var level_score;
level_score = new mochi.as2.MochiDigits(0);
var chain;
chain = new mochi.as2.MochiDigits(0);
var chain2;
chain2 = new mochi.as2.MochiDigits(0);
var card;
card = new mochi.as2.MochiDigits(0);
var speed;
speed = new mochi.as2.MochiDigits(0);
var speed2;
speed2 = new mochi.as2.MochiDigits(0);
var row = new Array("A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K");
var table = new Array(0, 55, 79, 67, 67, 51, 63, 65, 79, 64, 41, 66, 91, 73, 77, 27);
var pos = new Array();
var i = 0;
while (i < 104) {
pos.push(i);
i++;
}
var set_sound;
set_sound = new mochi.as2.MochiDigits(1);
tFr = new TextFormat();
tFr.align = "center";
tFr.font = "Font1";
tFr.color = 16711680 /* 0xFF0000 */;
tFr.size = 20;
tFb = new TextFormat();
tFb.align = "center";
tFb.font = "Font1";
tFb.color = 0;
tFb.size = 20;
tFbS = new TextFormat();
tFbS.align = "center";
tFbS.font = "Font1";
tFbS.color = 10066329 /* 0x999999 */;
tFbS.size = 12;
tFmC = new TextFormat();
tFmC.align = "center";
tFmC.font = "Font2";
tFmC.color = 0;
tFmC.size = 36;
tFmL = new TextFormat();
tFmL.align = "left";
tFmL.font = "Font2";
tFmL.color = 0;
tFmL.size = 36;
tFmR = new TextFormat();
tFmR.align = "right";
tFmR.font = "Font2";
tFmR.color = 0;
tFmR.size = 36;
tFlC = new TextFormat();
tFlC.align = "center";
tFlC.font = "Font2";
tFlC.color = 0;
tFlC.size = 48;
tFlC2 = new TextFormat();
tFlC2.align = "center";
tFlC2.font = "Font2";
tFlC2.color = 0;
tFlC2.size = 60;
tFwL = new TextFormat();
tFwL.align = "left";
tFwL.font = "Font1";
tFwL.color = 16777215 /* 0xFFFFFF */;
tFwL.size = 24;
tFwR = new TextFormat();
tFwR.align = "right";
tFwR.font = "Font1";
tFwR.color = 16777215 /* 0xFFFFFF */;
tFwR.size = 24;
tFwLs = new TextFormat();
tFwLs.align = "left";
tFwLs.font = "Font1";
tFwLs.color = 16777215 /* 0xFFFFFF */;
tFwLs.size = 18;
startUp();
Symbol 75 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiServices.warnID(boardID, true);
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
options.clip = mochi.as2.MochiServices.clip;
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
trace("WARNING! This application is attempting to connect to MochiServices inside a showLeaderboard call!");
trace("make sure MochiServices.connect is called as early in the application runtime as possible.");
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.as2.MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 76 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 77 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.9.1 as2");
}
static function allowDomains(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);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError.apply(null, [errorCode]);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "services" :
mochi.as2.MochiServices.triggerEvent(pkg.event, pkg.args);
break;
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "social" :
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://link.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static var CONNECTED = "onConnected";
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 78 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 79 MovieClip [__Packages.mochi.as2.MochiCoins] Frame 0
class mochi.as2.MochiCoins
{
function MochiCoins () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showStore(options) {
mochi.as2.MochiServices.send("coins_showStore", {options:options}, null, null);
}
static function showItem(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showItem call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showItem", {options:options}, null, null);
}
static function showVideo(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showVideo call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showVideo", {options:options}, null, null);
}
static function getStoreItems() {
mochi.as2.MochiServices.send("coins_getStoreItems");
}
static function requestFunding(properties) {
mochi.as2.MochiServices.send("social_requestFunding", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var STORE_SHOW = "StoreShow";
static var STORE_HIDE = "StoreHide";
static var ITEM_OWNED = "ItemOwned";
static var ITEM_NEW = "ItemNew";
static var STORE_ITEMS = "StoreItems";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 80 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("social_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("social_hideLoginWidget");
}
static function requestLogin(properties) {
mochi.as2.MochiServices.send("social_requestLogin", properties);
}
static function getFriendsList(properties) {
mochi.as2.MochiServices.send("social_getFriendsList", properties);
}
static function postToStream(properties) {
mochi.as2.MochiServices.send("social_postToStream", properties);
}
static function inviteFriends(properties) {
mochi.as2.MochiServices.send("social_inviteFriends", properties);
}
static function requestFan(properties) {
mochi.as2.MochiServices.send("social_requestFan", properties);
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("social_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var FRIEND_LIST = "FriendsList";
static var PROFILE_DATA = "ProfileData";
static var GAMEPLAY_DATA = "GameplayData";
static var ACTION_CANCELED = "onCancel";
static var ACTION_COMPLETE = "onComplete";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 81 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}