Frame 1
function runURL(urlid) {
trace([myURLS[urlid].link, myURLS[urlid].target]);
getURL (myURLS[urlid].link, myURLS[urlid].target);
}
XML.prototype.ignoreWhite = true;
_root.loaderxml = new XML();
_root.loaderxml.ignoreWhite = true;
_root.megaText = "";
trace(loaderxml);
_root.myURLS = {};
_root.loaderxml.onLoad = function (suc) {
if (suc) {
_root.megaText = String(_root.loaderxml.firstChild.firstChild.firstChild.nodeValue);
var _local8 = 0;
var _local3 = 0;
var _local12 = 0;
if (_root.megaText) {
do {
if (_root.megaText.indexOf("<a", _local8) == -1) {
break;
}
var _local6 = _root.megaText.toLowerCase();
var _local5 = _local6.indexOf("<a", _local8);
var _local4 = _local6.indexOf(">", _local5);
_local4 = ((_local4 != -1) ? (_local4) : (_local6.length));
trace((_local5 + " - ") + _local4);
var _local9 = _root.megaText.substring(_local5, _local4) + "/>";
var _local2 = new XML(_local9);
_root.myURLS[_local3] = {};
for (var _local11 in _local2.firstChild.attributes) {
if (_local11.toUpperCase() == "HREF") {
_root.myURLS[_local3].link = _local2.firstChild.attributes[_local11];
_local2.firstChild.attributes[_local11] = "asfunction:runURL," + _local3;
} else if (_local11.toUpperCase() == "TARGET") {
_root.myURLS[_local3].target = _local2.firstChild.attributes[_local11];
}
}
var _local7 = _local2.toString();
var _local10 = (_root.megaText.substr(0, _local5) + _local7.substring(0, _local7.length - 2)) + _root.megaText.substr(_local4, 16777215);
_root.megaText = _local10;
_local3++;
_local8 = _local5 + 10;
_local12++;
} while (_local12 < 255);
_root.promo.html = true;
_root.promo.htmlText = ((typeof(_root.megaText) != "undefined") ? (_root.megaText) : "");
}
}
};
_root.loaderxml.onHTTPStatus = function (val) {
};
_root.loaderxml.load(promourl);
stop();
Stage.showMenu = false;
startLevel = 1;
this.onEnterFrame = function () {
sofar = this.getBytesLoaded();
total = this.getBytesTotal();
if (sofar == total) {
delete this.onEnterFrame;
nextFrame();
}
};
Frame 2
_root.promo.html = true;
_root.promo.htmlText = _root.megaText;
String.prototype.addCommas = function () {
var _local4 = this.length;
var _local3 = "";
var _local2 = 0;
while (_local2 <= _local4) {
_local3 = this.charAt(_local4 - _local2) + _local3;
if ((((_local2 % 3) == 0) && (_local2 > 0)) && (_local2 < _local4)) {
_local3 = "," + _local3;
}
_local2++;
}
return(_local3);
};
game_so = SharedObject.getLocal("neaveTetris");
score = 0;
level = startLevel;
play_btn.onRelease = function () {
play();
};
highScores_btn.onRelease = function () {
gotoAndStop (1);
};
neave_btn.onRelease = function () {
};
Key.removeListener(this);
Frame 3
stop();
checkButtons = function () {
if (startLevel < 2) {
down_btn._alpha = 50;
down_btn.enabled = false;
} else if (startLevel > 9) {
up_btn._alpha = 50;
up_btn.enabled = false;
} else {
up_btn._alpha = (down_btn._alpha = 100);
up_btn.enabled = (down_btn.enabled = true);
}
};
checkButtons();
down_btn.onPress = function () {
startLevel--;
checkButtons();
};
up_btn.onPress = function () {
startLevel++;
checkButtons();
};
ok_btn.onPress = function () {
play();
};
Frame 4
startFall = function () {
timeout = setInterval(down, speed);
};
stopFall = function () {
clearInterval(timeout);
};
drawBlock = function (num, blockPos) {
b_mc[blockPos].gotoAndStop(num + 1);
};
drawNextBlock = function (num, blockPos) {
next_mc[blockPos].gotoAndStop(num + 1);
};
drawThisShape = function () {
if (moved) {
var _local1 = 0;
while (_local1 < 4) {
drawBlock(0, block_array[_local1]);
_local1++;
}
} else {
moved = true;
}
var _local1 = 0;
while (_local1 < 4) {
blockPos = shape_array[((thisShape * 16) + (rotation * 4)) + _local1];
block_array[_local1] = ((((blockPos >> 2) * 6) + blockPos) + xPos) + yPos;
drawBlock(thisShape + 1, block_array[_local1]);
_local1++;
}
};
drawNextShape = function () {
nextShape = int(Math.random() * 7);
var _local1 = 0;
while (_local1 < 11) {
drawNextBlock(0, _local1);
_local1++;
}
_local1 = 0;
while (_local1 < 4) {
drawNextBlock(nextShape + 1, shape_array[(nextShape * 16) + _local1]);
_local1++;
}
};
collision = function (x, y, rot) {
var _local1 = 0;
while (_local1 < 4) {
blockPos = shape_array[((thisShape * 16) + (rot * 4)) + _local1];
if (flag_array[((((blockPos >> 2) * 6) + blockPos) + x) + y] != 0) {
return(true);
}
_local1++;
}
return(false);
};
left = function () {
var _local2 = 0;
while (_local2 < 4) {
var _local1 = block_array[_local2] - yPos;
while (_local1 >= 0) {
if (_local1 == 0) {
return(undefined);
}
_local1 = _local1 - 10;
}
_local2++;
}
if (!collision(xPos - 1, yPos, rotation)) {
xPos--;
drawThisShape();
}
};
right = function () {
var _local2 = 0;
while (_local2 < 4) {
var _local1 = block_array[_local2] - yPos;
while (_local1 >= 0) {
if (_local1 == 9) {
return(undefined);
}
_local1 = _local1 - 10;
}
_local2++;
}
if (!collision(xPos + 1, yPos, rotation)) {
xPos++;
drawThisShape();
}
};
rotate = function (clockwise) {
testRot = rotation;
if (clockwise) {
testRot++;
} else {
testRot--;
}
if (testRot == 4) {
testRot = 0;
} else if (testRot == -1) {
testRot = 3;
}
var _local2 = 0;
while (_local2 < 4) {
blockPos = shape_array[((thisShape * 16) + (testRot * 4)) + _local2];
var _local1 = (((blockPos >> 2) * 6) + blockPos) + xPos;
while (_local1 >= -1) {
if (((_local1 == -1) && (xPos < 0)) || ((_local1 == 0) && (xPos > 6))) {
return(undefined);
}
_local1 = _local1 - 10;
}
_local2++;
}
if ((((((blockPos >> 2) * 6) + blockPos) + xPos) + yPos) > 179) {
return(undefined);
}
if (!collision(xPos, yPos, testRot)) {
rotation = testRot;
drawThisShape();
sound_mc.gotoAndPlay("popHi");
}
};
down = function () {
if (gameOver || (simult)) {
return(undefined);
}
score++;
if (((block_array[3] - xPos) < 170) && (!collision(xPos, yPos + 10, rotation))) {
yPos = yPos + 10;
drawThisShape();
} else {
var _local1 = 0;
while (_local1 < 4) {
flag_array[block_array[_local1]] = thisShape + 1;
_local1++;
}
simult = 0;
var _local2 = 0;
while (_local2 < 180) {
var _local3 = 0;
while (_local3 < 10) {
if (flag_array[_local3 + _local2] == 0) {
break;
}
if (_local3 == 9) {
stopFall();
_local1 = 0;
while (_local1 < 10) {
b_mc[_local1 + _local2].bang_mc.y = _local2;
b_mc[_local1 + _local2].bang_mc.play();
_local1++;
}
simult++;
lines++;
}
_local3++;
}
_local2 = _local2 + 10;
}
if (simult) {
sound_mc.gotoAndPlay("win");
switch (simult) {
case 1 :
score = score + (level * 40);
break;
case 2 :
score = score + (level * 100);
break;
case 3 :
score = score + (level * 300);
break;
case 4 :
score = score + (level * 1200);
}
}
scoreTxt = String(score).addCommas();
if (collision(xPos, yPos, rotation) && (yPos == -10)) {
gameOver = true;
stopFall();
sound_mc.gotoAndPlay("end");
quitGame_mc.gotoAndStop(2);
quitGame_mc._visible = true;
} else {
level = int(lines / 10) + startLevel;
speed = ((level < 10) ? (600 - (level * 50)) : 100);
xPos = 3;
yPos = -10;
rotation = 0;
moved = false;
thisShape = nextShape;
if (!simult) {
drawNextShape();
drawThisShape();
sound_mc.gotoAndPlay("popLo");
}
}
}
updateAfterEvent();
};
this.onKeyDown = function () {
if (gameOver || (simult)) {
return(undefined);
}
var _local2 = Key.getCode();
switch (_local2) {
case 80 :
pause_btn.onPress();
break;
case 81 :
quit_btn.onPress();
}
if (!paused) {
switch (_local2) {
case 37 :
left();
break;
case 39 :
right();
break;
case 40 :
this.onEnterFrame = down;
break;
case 38 :
case 88 :
rotate(true);
break;
case 90 :
rotate(false);
}
}
updateAfterEvent();
};
this.onKeyUp = function () {
delete this.onEnterFrame;
};
Key.removeListener(this);
Key.addListener(this);
gameOver = true;
paused = (moved = false);
score = (scoreTxt = (lines = (thisShape = (nextShape = (rotation = 0)))));
level = startLevel;
speed = ((level < 10) ? (600 - (level * 50)) : 100);
xPos = 3;
yPos = -10;
shape_array = new Array(5, 6, 9, 10, 5, 6, 9, 10, 5, 6, 9, 10, 5, 6, 9, 10, 4, 5, 6, 9, 1, 4, 5, 9, 1, 4, 5, 6, 1, 5, 6, 9, 4, 5, 9, 10, 2, 5, 6, 9, 4, 5, 9, 10, 2, 5, 6, 9, 5, 6, 8, 9, 1, 5, 6, 10, 5, 6, 8, 9, 1, 5, 6, 10, 4, 5, 6, 8, 0, 1, 5, 9, 2, 4, 5, 6, 1, 5, 9, 10, 4, 5, 6, 10, 1, 5, 8, 9, 0, 4, 5, 6, 1, 2, 5, 9, 4, 5, 6, 7, 1, 5, 9, 13, 4, 5, 6, 7, 1, 5, 9, 13);
block_array = new Array(0, 0, 0, 0);
flag_array = new Array();
var i = 18;
while (i >= 0) {
var j = 0;
while (j < 10) {
var k = ((i * 10) + j);
b_mc.attachMovie("block", k, k, {_x:j * 20, _y:i * 20});
flag_array[k] = 0;
j++;
}
i--;
}
var i = 0;
while (i < 3) {
var j = 0;
while (j < 4) {
var k = ((i * 4) + j);
next_mc.attachMovie("block", k, k, {_x:j * 20, _y:i * 20});
j++;
}
i++;
}
Frame 24
stop();
pause_btn.onPress = function () {
if (gameOver || (quitGame_mc._visible)) {
return(undefined);
}
stopFall();
sound_mc.gotoAndPlay("popMed");
b_mc._visible = !((paused_mc._visible = (paused = !paused)));
if (!paused) {
startFall();
}
};
quit_btn.onPress = function () {
if (gameOver) {
return(undefined);
}
stopFall();
sound_mc.gotoAndPlay("popMed");
b_mc._visible = (paused_mc._visible = false);
quitGame_mc._visible = (paused = true);
};
drawNextShape();
thisShape = nextShape;
drawThisShape();
drawNextShape();
gameOver = false;
stopFall();
startFall();
Symbol 2 MovieClip Frame 1
stop();
Symbol 2 MovieClip Frame 7
x = Number(_parent._name) - y;
with (_root) {
var j = y;
while (j > 0) {
drawBlock((flag_array[x + j] = flag_array[(x + j) - 10]), x + j);
j = j - 10;
}
if (!x) {
simult--;
}
if (!simult) {
drawNextShape();
drawThisShape();
startFall();
}
}
Symbol 10 MovieClip [block] Frame 1
stop();
Symbol 24 MovieClip Frame 12
stop();
Symbol 35 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 3
stop();
Symbol 35 MovieClip Frame 5
stop();
Symbol 35 MovieClip Frame 7
stop();
Symbol 35 MovieClip Frame 9
stop();
Symbol 62 MovieClip Frame 1
stop();
_visible = false;
yes_btn.onPress = function () {
_root.stopFall();
_root.gotoAndStop(2);
};
no_btn.onPress = function () {
_visible = false;
_root.pause_btn.onPress();
};
yes_btn.onKeyDown = function () {
if (Key.getCode() == 89) {
this.onPress();
}
if (Key.getCode() == 78) {
no_btn.onPress();
}
};
Key.addListener(yes_btn);
Symbol 62 MovieClip Frame 2
stop();
yes_btn.onPress = function () {
_root.stopFall();
_root.gotoAndStop(2);
};
no_btn.onPress = function () {
_visible = false;
_root.pause_btn.onPress();
};
yes_btn.onKeyDown = function () {
if (Key.getCode() == 89) {
this.onPress();
}
if (Key.getCode() == 78) {
no_btn.onPress();
}
};
Key.addListener(yes_btn);
Symbol 65 MovieClip Frame 1
_visible = false;
hit_mc.onPress = _root.pause;