Combined Code
movieClip 3 GhKill {
frame 1 {
stop();
}
frame 2 {
tellTarget ('/') {
playing = false;
Pacman._visible = false;
}
play();
}
frame 12 {
tellTarget ('/') {
playing = true;
Pacman._visible = true;
gotoAndPlay('Loop');
}
}
frame 41 {
kval = '';
tellTarget ('_parent') {
if (fval) {
gotoAndStop(1);
}
}
}
}
movieClip 5 {
}
movieClip 7 {
}
movieClip 8 {
}
movieClip 9 {
frame 1 {
stop();
}
}
movieClip 10 Ghost {
frame 1 {
stop();
}
}
movieClip 12 Pill {
}
movieClip 14 {
}
movieClip 15 Power {
}
movieClip 16 Empty {
}
frame 1 {
stop();
this.onEnterFrame = function () {
sofar = this.getBytesLoaded();
total = this.getBytesTotal();
Bar._width = int((sofar / total) * 100);
if (sofar == total) {
delete this.onEnterFrame;
nextFrame();
}
};
}
frame 2 {
String.prototype.addCommas = function () {
var len = this.length;
var str = '';
var i = 0;
while (i <= len) {
str = this.charAt(len - i) + str;
if (i % 3 == 0 && i > 0 && i < len) {
str = ',' + str;
}
++i;
}
return str;
};
game_so = SharedObject.getLocal('neavePacman');
score = 0;
}
button 24 {
on (release) {
Key.removeListener(this);
gotoAndPlay(4);
}
}
frame 4 {
function initVars() {
pacDir = 3;
pacPos = 2;
pacX = 8;
pacY = 13;
nextX = pacX - 1;
nextY = pacY;
nextPacDir = 3;
ghKill = 100;
ghBlue = 0;
numEyes = 0;
Pacman.gotoAndStop(1);
pacStep = 6;
pacPosMax = 3;
pauseCount = 0;
with (Pacman) {
_x = 24 * pacX + 35;
_y = 24 * pacY + 22;
_rotation = 0;
}
tellTarget ('Ghost[1]') {
ghPos = 1;
ghDir = 3;
ghX = 8;
ghY = 8;
ghNX = ghX - 1;
_y = _root.OFFY + 24 * ghY;
}
tellTarget ('Ghost[2]') {
ghDir = 0;
ghX = 8;
}
tellTarget ('Ghost[3]') {
ghDir = 2;
ghX = 9;
}
tellTarget ('Ghost[4]') {
ghDir = 2;
ghX = 9;
}
g = 1;
while (g < 5) {
tellTarget ('Ghost[g]') {
if (this.g > 1) {
ghPos = 0;
ghY = 7;
ghNX = ghX;
_y = _root.OFFY + (24 * ghY + 6);
}
_x = _root.OFFX + 24 * ghX + 6;
gotoAndStop(1);
Eyes.gotoAndStop(1);
gNum = 0;
ghNY = ghY;
ghStep = 6;
ghPosMax = 3;
ghFast = true;
Shape._visible = true;
Shape.Hit._visible = true;
}
++g;
}
}
function setPacMove(d) {
if (d == 0) {
nextX = pacX;
nextY = pacY - 1;
} else {
if (d == 1) {
nextX = pacX + 1;
nextY = pacY;
Pacman._xscale = 100;
} else {
if (d == 2) {
nextX = pacX;
nextY = pacY + 1;
} else {
if (d == 3) {
nextX = pacX - 1;
nextY = pacY;
Pacman._xscale = -100;
}
}
}
}
}
function setGhMove(d, g) {
with (Ghost[g]) {
if (d == 0) {
ghNX = ghX;
ghNY = ghY - 1;
} else {
if (d == 1) {
ghNX = ghX + 1;
ghNY = ghY;
_xscale = 100;
} else {
if (d == 2) {
ghNX = ghX;
ghNY = ghY + 1;
} else {
if (d == 3) {
ghNX = ghX - 1;
ghNY = ghY;
_xscale = -100;
}
}
}
}
}
}
function startBGSnd() {
tellTarget ('BGSnd') {
if (_root.ghBlue > 2) {
if (_root.numEyes) {
EyesGh.start(0, 100);
BlueGh.stop();
} else {
EyesGh.stop();
BlueGh.start(0, 100);
}
} else {
BlueGh.stop();
EyesGh.stop();
_root['Back' + _root.bgNum].start(0, 1000);
}
}
}
OFFX = 24;
OFFY = 24;
score = 0;
lastScore = 0;
lives = 5;
level = 0;
fruitNum = 1;
notMute = true;
newLev = true;
newGame = true;
newLife = false;
quttting = false;
quit = false;
Snd.ChSnd = true;
Pacman.Hit._visible = false;
ghPause = 40;
ghBVal = 162;
ghMove = new Array(4);
ghChoice = new Array(4);
ghBest = new Array(4);
var g = 1;
while (g < 5) {
Ghost.attachMovie('Ghost', g, g);
Ghost.attachMovie('GhKill', 'K' + g, g + 4);
Ghost['K' + g].kval = '';
++g;
}
var i = 1;
while (i < 5) {
_root['Life' + i].gotoAndStop(1);
if (i >= lives) {
_root['Life' + i]._visible = false;
}
++i;
}
m = '##################O.............O##.##.##.#.##.##.##...............##.##.#.###.#.##.##...............##.#.#.#####.#.#.####.#.# #.#.###L.....# #.....R###.#.#####.#.####O#.#.......#.#O##...#.## ##.#...##.#.#..###..#.#.##.#...........#.##.##.#.###.#.##.##...............##################';
var i = -1;
while (i <= 17) {
Maze.attachMovie('Empty', i, i + 1);
++i;
}
pos = 0;
var j = 0;
while (j < 17) {
var i = 0;
while (i < 17) {
Maze[i][j] = m.charAt(pos++);
pill = false;
if (Maze[i][j] == '.') {
pill = true;
Maze[i].attachMovie('Pill', 'P' + j, pos);
}
if (Maze[i][j] == 'O') {
pill = true;
Maze[i].attachMovie('Power', 'P' + j, pos);
}
if (pill) {
with (Maze[i]['P' + j]) {
_x = OFFX + 24 * i;
_y = OFFY + 24 * j;
}
}
++i;
}
++j;
}
}
instance Maze of movieClip 16 Empty {
onClipEvent (keyDown) {
with (_root) {
if (Key.getCode() == 38) {
nextPacDir = 0;
} else {
if (Key.getCode() == 39) {
nextPacDir = 1;
} else {
if (Key.getCode() == 40) {
nextPacDir = 2;
} else {
if (Key.getCode() == 37) {
nextPacDir = 3;
} else {
if (playing && (Key.getCode() == 80 || Key.getCode() == 112)) {
if (Ready._visible) {
Ready._visible = false;
Ready.gotoAndStop(1);
if (notMute) {
startBGSnd();
}
if (!stopped) {
Pacman.play();
}
play();
} else {
stop();
Ready.gotoAndStop('Paused');
Ready._visible = true;
stopAllSounds();
Pacman.stop();
}
} else {
if (playing && (Key.getCode() == 81 || Key.getCode() == 113 || Key.getCode() == 27)) {
quitting = true;
stop();
Ready.gotoAndStop('Quit');
Ready._visible = true;
stopAllSounds();
Pacman.stop();
} else {
if (quitting && (Key.getCode() == 78 || Key.getCode() == 110)) {
quitting = false;
Ready._visible = false;
Ready.gotoAndStop(1);
if (notMute) {
startBGSnd();
}
if (!stopped) {
Pacman.play();
}
play();
} else {
if (quitting && (Key.getCode() == 89 || Key.getCode() == 121)) {
quit = true;
play();
} else {
if (playing && !Ready._visible && (Key.getCode() == 77 || Key.getCode() == 109)) {
notMute = !notMute;
if (notMute) {
startBGSnd();
} else {
stopAllSounds();
}
} else {
if (Key.getCode() == 76 || Key.getCode() == 108) {
toggleHighQuality();
}
}
}
}
}
}
}
}
}
}
}
}
}
movieClip 48 {
frame 1 {
fCount = 200;
stop();
}
frame 2 {
fval = 100;
}
frame 3 {
fval = 300;
}
frame 4 {
fval = 500;
}
frame 5 {
fval = 500;
}
frame 6 {
fval = 700;
}
frame 7 {
fval = 700;
}
frame 8 {
fval = 1000;
}
frame 9 {
fval = 1000;
}
frame 10 {
fval = 2000;
}
frame 11 {
fval = 2000;
}
frame 12 {
fval = 3000;
}
frame 13 {
fval = 3000;
}
frame 14 {
fval = 5000;
}
frame 15 {
stop();
tellTarget ('/') {
if (notMute) {
Snd.gotoAndPlay('EatFruit');
}
}
_root.score += fval;
F.kval = fval;
F.gotoAndPlay(2);
}
}
movieClip 51 {
}
movieClip 62 {
frame 7 {
stop();
}
}
movieClip 63 {
frame 41 {
stop();
}
}
movieClip 64 {
frame 5 {
gotoAndPlay(1);
}
frame 6 {
_root.BGSnd.stop();
stopAllSounds();
}
frame 25 {
tellTarget ('/') {
BGSnd.gotoAndPlay('Killed');
for (var g in Ghost) {
Ghost[g]._visible = false;
}
}
}
frame 27 {
_rotation = 0;
}
frame 59 {
stop();
tellTarget ('/') {
newLife = true;
gotoAndPlay('Restart');
}
}
}
movieClip 71 {
frame 1 {
stop();
Back1 = new Sound();
Back1.attachSound('BG1');
Back2 = new Sound();
Back2.attachSound('BG2');
Back3 = new Sound();
Back3.attachSound('BG3');
BlueGh = new Sound();
BlueGh.attachSound('BGGhost');
EyesGh = new Sound();
EyesGh.attachSound('BGEyes');
ExLife = new Sound();
ExLife.attachSound('ExLife');
NewLev = new Sound();
NewLev.attachSound('NewLev');
}
frame 2 {
if (!_root.notMute) {
gotoAndPlay(21);
}
}
frame 31 {
tellTarget ('/') {
if (!newGame) {
Ready.gotoAndStop('Level');
Ready._visible = true;
var j = 0;
while (j < 31) {
var i = 0;
while (i < 28) {
Maze[i]['P' + j]._visible = true;
++i;
}
++j;
}
}
newGame = false;
}
}
frame 65 {
tellTarget ('/') {
g = 1;
while (g < 5) {
Ghost[g]._visible = true;
++g;
}
Pacman._visible = true;
Ready.gotoAndStop(1);
}
}
frame 87 {
tellTarget ('/') {
Ready._visible = false;
playing = true;
nextPacDir = 3;
play();
if (notMute) {
BGSnd['Back' + bgNum].start(0, 1000);
}
}
stop();
}
frame 88 {
if (!_root.notMute) {
stop();
}
}
frame 90 {
stop();
}
}
movieClip 74 {
frame 1 {
stop();
}
frame 3 {
stop();
}
frame 5 {
stop();
}
frame 18 {
stop();
_root.BGSnd.EyesGh.start(0, 100);
}
frame 20 {
stop();
}
}
frame 5 {
stop();
stopAllSounds();
playing = false;
stopped = true;
Fruit.gotoAndStop(1);
if (newLev) {
newLev = false;
bgNum = 1;
pillEat = 0;
++level;
if (ghPause > 4) {
ghPause -= 4;
}
if (ghBVal > 2) {
ghBVal -= 10;
}
if (fruitNum < 14) {
++fruitNum;
FrLev.gotoAndStop(fruitNum);
}
initVars();
if (!newGame) {
var g = 1;
while (g < 5) {
Ghost[g]._visible = false;
++g;
}
Pacman._visible = false;
BGSnd.gotoAndPlay('NewLev');
}
}
if (newLife) {
newLife = false;
Ready._visible = true;
--lives;
if (lives > 0) {
_root['Life' + lives]._visible = false;
initVars();
BGSnd.gotoAndPlay('NewLife');
} else {
Pacman._visible = false;
gotoAndStop(11);
}
}
if (newGame) {
BGSnd.gotoAndPlay('NewGame');
}
}
frame 6 {
ang = Math.abs(pacDir - nextPacDir) / 2;
if (ang == 1) {
pacDir = nextPacDir;
} else {
if (pacPos == 0) {
tempDir = pacDir;
pacDir = nextPacDir;
}
}
setPacMove(pacDir);
if (pacPos == 0) {
P = Maze[pacX]['P' + pacY];
if (P._visible) {
pacStep = 6;
pacPosMax = 3;
if (notMute) {
tellTarget ('Snd') {
if (ChSnd) {
gotoAndPlay('Chomp1');
} else {
gotoAndPlay('Chomp2');
}
ChSnd = !ChSnd;
}
}
P._visible = false;
++pillEat;
if (notMute) {
if (pillEat == 30) {
BGSnd.Back1.stop();
bgNum = 2;
BGSnd.Back2.start(0, 1000);
} else {
if (pillEat == 100) {
BGSnd.Back2.stop();
bgNum = 3;
BGSnd.Back3.start(0, 1000);
}
}
}
if (pillEat == 142) {
newLev = true;
gotoAndStop(5);
}
score += 10;
if (Maze[pacX][pacY] == 'O') {
score += 40;
if (notMute) {
BGSnd['Back' + bgNum].stop();
BGSnd.BlueGh.start(0, 100);
}
ghBlue = ghBVal;
ghKill = 100;
var g = 1;
while (g < 5) {
tellTarget ('Ghost[g]') {
if (Shape._visible) {
c.setRGB(13311);
gotoAndStop(2);
Shape.gotoAndStop(2);
ghFast = false;
e = new Color(PPEyes);
e.setRGB(16777215);
}
}
++g;
}
}
} else {
if (++pauseCount % 2) {
pacStep = 8;
pacPosMax = 2;
} else {
pacStep = 6;
pacPosMax = 3;
}
}
if (Maze[pacX + 1][pacY] == 'L') {
pacX = 17;
nextX = 16;
Pacman._x = OFFX + 24 * pacX;
} else {
if (Maze[pacX - 1][pacY] == 'R') {
pacX = -1;
nextX = 0;
Pacman._x = OFFX - 24;
}
}
if (Maze[nextX][nextY] == '#' && ang != 1) {
pacDir = tempDir;
setPacMove(pacDir);
}
}
if (!(pacPos == 0 && Maze[nextX][nextY] == '#')) {
with (Pacman) {
if (nextX < pacX) {
_x -= pacStep;
--pacPos;
} else {
if (nextX > pacX) {
_x += pacStep;
++pacPos;
} else {
if (nextY < pacY) {
_y -= pacStep;
--pacPos;
} else {
if (nextY > pacY) {
_y += pacStep;
++pacPos;
}
}
}
}
}
if (pacPos < 0 || pacPos > pacPosMax) {
if (pacPos > pacPosMax) {
pacPos = 0;
} else {
if (pacPos < 0) {
pacPos = pacPosMax;
}
}
pacX = nextX;
pacY = nextY;
}
if (stopped) {
stopped = false;
Pacman.play();
}
} else {
if (!stopped) {
stopped = true;
Pacman.gotoAndStop(1);
}
}
tellTarget ('Fruit') {
if (_currentframe == 1) {
if (!random(600)) {
gotoAndStop(_root.fruitNum);
}
} else {
if (fCount) {
if (hitTest(_root.Pacman.Hit)) {
gotoAndStop('Show');
} else {
--fCount;
}
} else {
gotoAndStop(1);
}
}
}
if (ghBlue) {
--ghBlue;
}
unBlue = false;
var g = 1;
while (g < 5) {
with (Ghost[g]) {
if (ghBlue && _currentframe == 2) {
if (ghBlue == 50 || ghBlue == 40 || ghBlue == 30 || ghBlue == 20 || ghBlue == 10) {
unBlue = true;
Shape.gotoAndStop(1);
ghFast = true;
} else {
if (ghBlue == 45 || ghBlue == 35 || ghBlue == 25 || ghBlue == 15 || ghBlue == 5) {
Shape.gotoAndStop(1);
unBlue = true;
ghFast = true;
} else {
if (ghBlue == 1) {
gotoAndStop(1);
unBlue = true;
Shape.gotoAndStop(1);
ghFast = true;
}
}
}
}
gTest = false;
if (ghPos == 0) {
if (Maze[ghX + 1][ghY] == 'L' && ghDir == 3) {
ghX = 18;
ghNX = 19;
_x = OFFX + 24 * ghX;
} else {
if (Maze[ghX - 1][ghY] == 'R' && ghDir == 1) {
ghX = -2;
ghNX = -1;
_x = OFFX - 48;
} else {
if (ghX > 0 && ghX < 16) {
var i = 0;
while (i < 4) {
ghMove[i] = 1;
++i;
}
oppDir = ghDir < 2 ? ghDir + 2 : ghDir - 2;
ghMove[oppDir] = 0;
if (Maze[ghX][ghY - 1] == '#') {
ghMove[0] = 0;
}
if (Maze[ghX + 1][ghY] == '#') {
ghMove[1] = 0;
}
if (Maze[ghX][ghY + 1] == '#') {
ghMove[2] = 0;
}
if (Maze[ghX - 1][ghY] == '#') {
ghMove[3] = 0;
}
pos = 0;
var i = 0;
while (i < 4) {
ghChoice[i] = -1;
if (ghMove[i]) {
ghChoice[pos++] = i;
}
++i;
}
bestXDir = -1;
bestYDir = -1;
if (Shape._visible && _currentframe == 1) {
testX = pacX;
testY = pacY;
} else {
testX = 8;
testY = 5;
}
if (testX < ghX) {
bestXDir = 3;
} else {
if (testX > ghX) {
bestXDir = 1;
}
}
if (testY < ghY) {
bestYDir = 0;
} else {
if (testY > ghY) {
bestYDir = 2;
}
}
best = 0;
var i = 0;
while (i < pos) {
if (ghChoice[i] == bestXDir || ghChoice[i] == bestYDir) {
ghBest[best++] = ghChoice[i];
}
++i;
}
if (best == 0 || Shape._visible && !random(3)) {
ghDir = ghChoice[random(pos)];
} else {
ghDir = ghBest[random(best)];
}
if (ghFast) {
ghStep = 6;
ghPosMax = 3;
} else {
ghStep = 6;
ghPosMax = 3;
}
++gNum;
if (ghX == 8) {
if (ghY > 5 && ghY < 9) {
if (Shape._visible) {
gTest = true;
ghDir = 0;
if (gNum < 4) {
_y -= 2;
}
} else {
if (ghY == 7) {
Shape.gotoAndStop(1);
unBlue = true;
--numEyes;
Shape._visible = true;
Shape.Hit._visible = true;
}
}
} else {
if (ghY == 5) {
if (gNum == 1 && g == 1) {
_x -= 2;
}
if (gNum == 4) {
ghPos = 2;
if (ghFast) {
_x += 2;
} else {
_x -= 2;
}
}
if (!Shape._visible) {
gTest = true;
ghDir = 2;
}
}
}
}
if (ghY > 5 && ghY < 9) {
if (ghX == 8 && gNum == ghPause + 2) {
gTest = true;
ghDir = 1;
gNum = -1;
}
if (ghX == 8 && gNum == 2 * ghPause + 2) {
gTest = true;
ghDir = 3;
gNum = -1;
}
}
}
}
}
}
setGhMove(ghDir, g);
if (!(ghPos == 0 && Maze[ghNX][ghNY] == '#') || gTest) {
if (ghNX < ghX) {
_x -= ghStep;
--ghPos;
} else {
if (ghNX > ghX) {
_x += ghStep;
++ghPos;
} else {
if (ghNY < ghY) {
_y -= ghStep;
--ghPos;
} else {
if (ghNY > ghY) {
_y += ghStep;
++ghPos;
}
}
}
}
Eyes.gotoAndStop(ghDir + 1);
if (ghPos < 0 || ghPos > ghPosMax) {
if (ghPos > ghPosMax) {
ghPos = 0;
} else {
if (ghPos < 0) {
ghPos = ghPosMax;
}
}
ghX = ghNX;
ghY = ghNY;
}
}
if (Shape.Hit._visible && Pacman.Hit.hitTest(Shape.Hit) && !newLev) {
if (_currentframe == 1) {
_root.stop();
playing = false;
Pacman.gotoAndPlay('Die');
} else {
BGSnd.BlueGh.stop();
ghKill *= 2;
score += ghKill;
ghFast = true;
if (ghPos > ghPosMax) {
ghPos = 0;
} else {
if (ghPos < 0) {
ghPos = ghPosMax;
}
}
if (notMute) {
Snd.gotoAndPlay('EatGhost');
}
gotoAndStop(1);
++numEyes;
Shape._visible = false;
Shape.Hit._visible = false;
with (Ghost['K' + g]) {
_visible = true;
_x = Ghost[g]._x;
_y = Ghost[g]._y;
kval = ghKill;
play();
}
}
}
}
++g;
}
if (ghBlue && notMute) {
with (BGSnd) {
if (ghBlue == 1) {
BlueGh.stop();
EyesGh.stop();
(eval('Back' + bgNum)).start(0, 1000);
} else {
if (unBlue && !numEyes) {
EyesGh.stop();
BlueGh.start(0, 100);
}
}
}
}
if (lastScore != score) {
s = Math.floor(score / 10000);
sTest = (s + 1) / 2;
if (lives < 5 && sTest == int(sTest) && Math.floor(lastScore / 10000) < s) {
(eval('Life' + lives))._visible = true;
++lives;
if (notMute) {
BGSnd.ExLife.start(0, 6);
}
}
}
lastScore = score;
if (!playing) {
stop();
}
if (quit) {
gotoAndStop(2);
}
}
frame 7 {
gotoAndPlay(6);
}
frame 9 {
stop();
name_txt.restrict = 'A-Z 0-9.\\-';
name_txt.text = game_so.data.playerName;
Selection.setFocus(name_txt);
Selection.setSelection(name_txt.length, name_txt.length);
}
button 76 {
on (release) {
gotoAndStop(2);
}
}
button 78 {
on (release, keyPress '<Enter>') {
if (name_txt.length > 0) {
game_so.data.playerName = name_txt.text;
}
nextFrame();
}
}
movieClip 81 {
}
movieClip 82 {
frame 1 {
stop();
col = new Array(14483456, 16751001, 6750207, 16750848);
i = 0;
while (i < 4) {
G.attachMovie('Ghost', i, i);
tellTarget ('G[i]') {
_x = -200;
Eyes.gotoAndStop(2);
}
this['c' + i] = new Color(G[i].Shape);
this['c' + i].setRGB(col[i]);
++i;
}
ck = new Color('GK');
GK.kval = 100;
count = 0;
}
frame 2 {
++count;
if (count < 86) {
Pac._x += 4;
i = 0;
while (i < 4) {
if (count > 6 * i + 10) {
G[i]._x += 4;
}
++i;
}
} else {
if (count == 86) {
Pill._visible = false;
Pac._rotation = 0;
i = 0;
while (i < 4) {
G[i].gotoAndStop(2);
this['c' + i].setRGB(50344959);
++i;
}
} else {
if (count < 172) {
Pac._x -= 4;
i = 0;
while (i < 4) {
with (G[i]) {
_x -= 2;
if (_visible && Shape.Hit.hitTest(Pac.Hit)) {
_visible = false;
GK._x = _x;
GK.kval *= 2;
}
}
++i;
}
if (count == 155) {
GK.kval = '';
}
} else {
if (count == 172) {
i = 0;
while (i < 4) {
this['c' + i].setRGB(col[i]);
tellTarget ('G[i]') {
gotoAndStop(1);
Eyes.gotoAndStop(2);
_visible = true;
_x = -200;
}
++i;
}
tellTarget ('GK') {
_x = -16;
_xscale = _xscale * 2;
_yscale = _yscale * 2;
}
} else {
if (count < 580) {
i = 0;
while (i < 4) {
if (count == 244 + 90 * i) {
ck.setRGB(col[i]);
if (i == 0) {
GK.kval = '"BLINKY"';
}
if (i == 1) {
GK.kval = '"PINKY"';
}
if (i == 2) {
GK.kval = '"INKEY"';
}
if (i == 3) {
GK.kval = '"CLYDE"';
}
} else {
if (count > 180 + 90 * i && count < 244 + 90 * i || count > 270 + 90 * i && count < 307 + 90 * i) {
G[i]._x += 4;
GK.kval = '';
}
}
++i;
}
} else {
tellTarget ('GK') {
_x = -200;
_xscale = 100;
_yscale = 100;
kval = 100;
}
i = 0;
while (i < 4) {
G[i]._x = -200;
++i;
}
tellTarget ('Pac') {
_x = -196;
_rotation = 180;
}
ck.setRGB(16777215);
Pill._visible = true;
count = 0;
}
}
}
}
}
}
frame 3 {
gotoAndPlay(2);
}
}
movieClip 84 {
frame 17 {
stop();
CPac.gotoAndStop(1);
_root.Demo.play();
}
}
frame 10 {
stop();
showScores = function () {
var i = 10;
while (i > 0) {
var n = scoreboard_lv['name' + (page + i)];
var s = scoreboard_lv['score' + (page + i)];
var l_mc = this['line' + i + '_mc'];
l_mc.rank_txt.text = page + i + '.';
l_mc.name_txt.text = n.length ? n.toUpperCase() : '...';
l_mc.score_txt.text = s.length ? s.addCommas() : '...';
l_mc.score_txt.textColor = (game_so.data.playerName.length && n.toUpperCase() == game_so.data.playerName.toUpperCase()) ? 16777011 : 16777215;
l_mc.name_txt.textColor = l_mc.score_txt.textColor;
l_mc.rank_txt.textColor = l_mc.score_txt.textColor;
l_mc._visible = true;
loading_mc._visible = false;
--i;
}
};
page = 0;
maxScore = 100;
scoreboard_lv = new LoadVars();
if (score > 0 && game_so.data.playerName.length > 0) {
scoreboard_lv.score = score;
scoreboard_lv.name = game_so.data.playerName.toLowerCase();
}
scoreboard_lv.game = 'pacman';
scoreboard_lv.sendAndLoad('http://www.neave.com/games/games_score_text.php', scoreboard_lv, 'POST');
scoreboard_lv.onLoad = function (success) {
if (success) {
if (Boolean(scoreboard_lv.success)) {
next_btn._visible = true;
if (scoreboard_lv.maxScore.length > 0) {
maxScore = Number(scoreboard_lv.maxScore);
}
showScores();
} else {
loading_mc.errorMsg = scoreboard_lv.errorMsg.toUpperCase();
loading_mc.gotoAndStop(2);
}
} else {
loading_mc.errorMsg = 'COULD NOT ACCESS SCORES.';
loading_mc.gotoAndStop(2);
}
};
score = 0;
last_btn._visible = false;
next_btn._visible = last_btn._visible;
}
movieClip 90 {
}
movieClip 93 {
frame 1 {
stop();
errorMsg = '';
}
}
button 99 {
on (release) {
Key.removeListener(this);
gotoAndPlay(4);
}
}
button 120 {
on (release) {
Key.removeListener(this);
gotoAndPlay(4);
}
}