Frame 1
function loadobj() {
setProperty("MCBORDER", _visible , false);
duplicateMovieClip ("MCBORDER", "MCBORDER2", getNextHighestDepth());
duplicateMovieClip ("MCBORDER", "MCBORDER3", getNextHighestDepth());
y = 0;
while (y < lev_board_height) {
x = 0;
while (x < lev_board_width) {
mcfrom = "mclet_template";
mcname = (("mclet_" + y) + "_") + x;
duplicateMovieClip (mcfrom, mcname, getNextHighestDepth());
setProperty(mcname, _x , 20);
setProperty(mcname, _y , 20);
setProperty(mcname, _visible , false);
boardmc[y][x] = mcname;
x++;
}
y++;
}
c = 1;
while (c <= (gridsize - 1)) {
mcfrom = "mcword_template";
mcname = "mcword" + c;
duplicateMovieClip (mcfrom, mcname, getNextHighestDepth());
setProperty(mcname, _visible , false);
c++;
}
setProperty("MCPROMPT", _visible , false);
duplicateMovieClip ("MCPROMPT_TEMP", "MCPROMPT", getNextHighestDepth());
_root.MCPROMPT._visible = false;
linecount = 0;
objloaded = true;
}
function display_words() {
arr_wordcount = gridsize - 1;
if (arr_wordcount_load <= (gridsize - 1)) {
arr_wordcount = arr_wordcount_load;
}
d = 0;
while (d <= 2) {
c = 0;
while (c < arr_wordcount_load) {
myrnd = random(arr_wordcount_load);
tmp = arr_wl_load[c];
arr_wl_load[c] = arr_wl_load[myrnd];
arr_wl_load[myrnd] = tmp;
c++;
}
d++;
}
if (arr_wordcount_load > 0) {
c = 0;
while (c < arr_wordcount) {
arr_wl_disp[c] = arr_wl_load[c];
c++;
}
}
asort(arr_wl_disp, arr_wordcount);
c = 1;
while (c <= arr_wordcount) {
ret = "";
if (arr_wl_disp[c - 1].length > 0) {
d = 0;
while (d < arr_wl_disp[c - 1].length) {
ch = arr_wl_disp[c - 1].substr(d, 1);
if ((ch >= "A") && (ch <= "Z")) {
ret = ret + ch;
}
d++;
}
}
arr_wl[c - 1] = ret;
c++;
}
c = 1;
while (c <= arr_wordcount) {
arr_wl_found[c - 1] = "N";
c++;
}
c = 1;
while (c <= arr_wordcount) {
mcfrom = "mcword_template";
mcname = "mcword" + c;
setProperty(mcname, _x , gridsize_bdlef);
setProperty(mcname, _y , gridsize_bdtop + (20 * c));
_root[mcname].txtword._width = 230;
_root[mcname].txtword.text = arr_wl_disp[c - 1];
setProperty(mcname, _visible , true);
c++;
}
if ((arr_wordcount + 1) <= (gridsize - 1)) {
c = arr_wordcount + 1;
while (c <= (gridsize - 1)) {
mcname = "mcword" + c;
_root[mcname].txtword.text = "";
c++;
}
}
}
function initline() {
c = 1;
while (c <= arr_wordcount) {
mcfrom = "mcword_template";
mcname = "mcword" + c;
setProperty(mcname, _visible , true);
c++;
}
c = 1;
while (c <= arr_wordcount) {
arr_wl_found[c - 1] = "N";
c++;
}
mdflag = false;
_root.linetemp._visible = false;
_root.circletemp._visible = false;
_root.striketemp._visible = false;
_root.strikeword_temp._visible = false;
gamewon = false;
_root.mccongrats.txtcongrats.text = "Loading Game...";
shuffle();
_root.snd_dissolve.start();
_root.mccongrats._visible = false;
_root.mccongrats.txtcongrats.text = "Congratulations, You Solved the Word Search!";
linecount = 1;
loadline(linecount);
}
function releaseline() {
if (linecount > 0) {
c = 1;
while (c <= linecount) {
removeMovieClip(_root[("line" + c) + "a"]);
removeMovieClip(_root[("line" + c) + "b"]);
removeMovieClip(_root[("circle" + c) + "a"]);
removeMovieClip(_root[("circle" + c) + "b"]);
removeMovieClip(_root["strikeword" + c]);
c++;
}
}
linecount = 0;
}
function loadline(p_cnt) {
duplicateMovieClip ("linetemp", ("line" + p_cnt) + "a", getNextHighestDepth());
duplicateMovieClip ("linetemp", ("line" + p_cnt) + "b", getNextHighestDepth());
duplicateMovieClip ("circle_temp", ("circle" + p_cnt) + "a", getNextHighestDepth());
duplicateMovieClip ("circle_temp", ("circle" + p_cnt) + "b", getNextHighestDepth());
duplicateMovieClip ("strikeword_temp", "strikeword" + p_cnt, getNextHighestDepth());
_root[("line" + p_cnt) + "a"]._visible = false;
_root[("line" + p_cnt) + "b"]._visible = false;
_root[("circle" + p_cnt) + "a"]._visible = false;
_root[("circle" + p_cnt) + "b"]._visible = false;
_root["strikeword" + p_cnt]._visible = false;
_root[("circle" + p_cnt) + "a"].clear();
_root[("circle" + p_cnt) + "b"].clear();
}
function releaseobj() {
if (objloaded == true) {
removeMovieClip("MCBORDER2");
removeMovieClip("MCBORDER3");
c = 1;
while (c <= linecount) {
removeMovieClip(_root[("line" + c) + "a"]);
removeMovieClip(_root[("line" + c) + "b"]);
removeMovieClip(_root[("circle" + c) + "a"]);
removeMovieClip(_root[("circle" + c) + "b"]);
removeMovieClip(_root["strikeword" + c]);
c++;
}
y = 0;
while (y < lev_board_height) {
x = 0;
while (x < lev_board_width) {
removeMovieClip(boardmc[y][x]);
x++;
}
y++;
}
}
c = 1;
while (c <= arr_wordcount) {
mcfrom = "mcword_template";
mcname = "mcword" + c;
removeMovieClip(mcname);
c++;
}
}
function drawcircle(mc, p_dir, p_cir) {
mc.clear();
mc.lineStyle(3, 16776960, 100);
x = 1;
y = 0;
r = 12.2;
r = 10;
if (p_cir == 1) {
p_dir2 = p_dir;
}
if (p_cir == 2) {
if (p_dir == 0) {
p_dir2 = -1;
}
if (p_dir == 1) {
p_dir2 = 5;
}
if (p_dir == 5) {
p_dir2 = 1;
}
if (p_dir == 4) {
p_dir2 = 8;
}
if (p_dir == 8) {
p_dir2 = 4;
}
if (p_dir == 2) {
p_dir2 = 6;
}
if (p_dir == 6) {
p_dir2 = 2;
}
if (p_dir == 3) {
p_dir2 = 7;
}
if (p_dir == 7) {
p_dir2 = 3;
}
}
if ((((p_dir2 == 2) || (p_dir2 == 4)) || (p_dir2 == 6)) || (p_dir2 == 8)) {
r = 9;
}
if (p_dir2 == 0) {
mc.moveTo(r + x, y);
mc.curveTo(r + x, (0.414213562373095 * r) + y, (0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((0.414213562373095 * r) + x, r + y, x, r + y);
mc.curveTo((-0.414213562373095 * r) + x, r + y, (-0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((-r) + x, (0.414213562373095 * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, (-0.414213562373095 * r) + y, (-0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo((-0.414213562373095 * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((0.414213562373095 * r) + x, (-r) + y, (0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo(r + x, (-0.414213562373095 * r) + y, r + x, y);
}
if (p_dir2 == 2) {
mc.moveTo((0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((0.414213562373095 * r) + x, r + y, x, r + y);
mc.curveTo((-0.414213562373095 * r) + x, r + y, (-0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((-r) + x, (0.414213562373095 * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, (-0.414213562373095 * r) + y, (-0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
}
if (p_dir2 == 6) {
mc.moveTo((-0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo((-0.414213562373095 * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((0.414213562373095 * r) + x, (-r) + y, (0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo(r + x, (-0.414213562373095 * r) + y, r + x, y);
mc.curveTo(r + x, (0.414213562373095 * r) + y, (0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
}
if (p_dir2 == 4) {
mc.moveTo((0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo(r + x, (-0.414213562373095 * r) + y, r + x, y);
mc.curveTo(r + x, (0.414213562373095 * r) + y, (0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((0.414213562373095 * r) + x, r + y, x, r + y);
mc.curveTo((-0.414213562373095 * r) + x, r + y, (-0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
}
if (p_dir2 == 8) {
mc.moveTo((-0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((-r) + x, (0.414213562373095 * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, (-0.414213562373095 * r) + y, (-0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo((-0.414213562373095 * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((0.414213562373095 * r) + x, (-r) + y, (0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
}
if (p_dir2 == 1) {
mc.moveTo(x, r + y);
mc.curveTo((-0.414213562373095 * r) + x, r + y, (-0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((-r) + x, (0.414213562373095 * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, (-0.414213562373095 * r) + y, (-0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo((-0.414213562373095 * r) + x, (-r) + y, x, (-r) + y);
}
if (p_dir2 == 5) {
mc.moveTo(x, (-r) + y);
mc.curveTo((0.414213562373095 * r) + x, (-r) + y, (0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo(r + x, (-0.414213562373095 * r) + y, r + x, y);
mc.curveTo(r + x, (0.414213562373095 * r) + y, (0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((0.414213562373095 * r) + x, r + y, x, r + y);
}
if (p_dir2 == 3) {
x = x - 1;
mc.moveTo(r + x, y);
mc.curveTo(r + x, (0.414213562373095 * r) + y, (0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((0.414213562373095 * r) + x, r + y, x, r + y);
mc.curveTo((-0.414213562373095 * r) + x, r + y, (-0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((-r) + x, (0.414213562373095 * r) + y, (-r) + x, y);
}
if (p_dir2 == 7) {
x = x - 1;
mc.moveTo((-r) + x, y);
mc.curveTo((-r) + x, (-0.414213562373095 * r) + y, (-0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo((-0.414213562373095 * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((0.414213562373095 * r) + x, (-r) + y, (0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo(r + x, (-0.414213562373095 * r) + y, r + x, y);
}
}
function drawobj(p_flag) {
if (gridsize == 10) {
bdwid = 212;
bdhei = 218;
}
if (gridsize == 14) {
bdwid = 382;
bdhei = 390;
}
if (gridsize == 18) {
bdwid = 382;
bdhei = 390;
}
setProperty("MCBORDER2", _x , board_left);
setProperty("MCBORDER2", _y , board_top);
setProperty("MCBORDER2", _width , gridsize_bdwid);
setProperty("MCBORDER2", _height , gridsize_bdhei);
setProperty("MCBORDER2", _visible , true);
setProperty("MCBORDER3", _x , gridsize_bdwid + 13);
setProperty("MCBORDER3", _y , board_top);
setProperty("MCBORDER3", _width , 195);
setProperty("MCBORDER3", _height , gridsize_bdhei);
setProperty("MCBORDER3", _visible , true);
y = 0;
while (y < lev_board_height) {
x = 0;
while (x < lev_board_width) {
letx = board_left + (21 * x);
lety = board_top + (21 * y);
setProperty(boardmc[y][x], _x , letx);
setProperty(boardmc[y][x], _y , lety);
setProperty(boardmc[y][x], _visible , p_flag);
x++;
}
y++;
}
}
function getangle(Ax, Ay, Bx, By, Cx, Cy) {
dot_product = dotproduct(Ax, Ay, Bx, By, Cx, Cy);
cross_product = crossproductlength(Ax, Ay, Bx, By, Cx, Cy);
ret = atan2(cross_product, dot_product);
return(ret);
}
function getdegree(Ax, Ay, Bx, By, Cx, Cy) {
dot_product = dotproduct(Ax, Ay, Bx, By, Cx, Cy);
cross_product = crossproductlength(Ax, Ay, Bx, By, Cx, Cy);
ret = atan2(cross_product, dot_product);
return(int((ret / Math.PI) * 180));
}
function mousedown() {
if (_root.MCPROMPT._visible) {
return(undefined);
}
if (gamewon) {
return(undefined);
}
if (mdflag) {
mdoffscreen = true;
mouseup();
return(undefined);
}
xm = _xmouse;
ym = _ymouse;
letx = int((xm - board_left) / 21);
lety = int((ym - board_top) / 21);
md_posx = -1;
md_posy = -1;
mdflag2 = true;
if ((((letx < 0) || (lety < 0)) || (letx > (gridsize - 1))) || (lety > (gridsize - 1))) {
mdflag2 = false;
}
if (mdflag2) {
mdflag = true;
xm = _xmouse;
ym = _ymouse;
letx = int((xm - board_left) / 21);
lety = int((ym - board_top) / 21);
md_posx = letx;
md_posy = lety;
origin_x = ((letx * 21) + board_left) + 12;
origin_y = ((lety * 21) + board_top) + 11;
namecirclea = ("circle" + linecount) + "a";
namelinea = ("line" + linecount) + "a";
namelineb = ("line" + linecount) + "b";
drawcircle(_root[namecirclea], 0, 1);
_root[namecirclea]._visible = true;
_root[namecirclea]._x = origin_x;
_root[namecirclea]._y = origin_y;
_root[namelinea]._visible = true;
_root[namelinea]._x = origin_x;
_root[namelinea]._y = origin_y;
_root[namelinea]._xscale = 0;
_root[namelinea]._yscale = 0;
_root[namelineb]._visible = true;
_root[namelineb]._x = origin_x;
_root[namelineb]._y = origin_y;
_root[namelineb]._xscale = 0;
_root[namelineb]._yscale = 0;
}
}
function mousemove() {
if (_root.MCPROMPT._visible) {
return(undefined);
}
if (gamewon) {
return(undefined);
}
xm = _xmouse;
ym = _ymouse;
letx = int((xm - board_left) / 21);
lety = int((ym - board_top) / 21);
mdflag2 = true;
if (letx < 0) {
letx = 0;
}
if (letx >= lev_board_width) {
letx = lev_board_width - 1;
}
if (lety < 0) {
lety = 0;
}
if (lety >= lev_board_height) {
lety = lev_board_height - 1;
}
if (mdflag && (mdflag2)) {
xm = ((letx * 21) + board_left) + 12;
ym = ((lety * 21) + board_top) + 11;
xdir = (xm - origin_x) / Math.abs(xm - origin_x);
ydir = (ym - origin_y) / Math.abs(ym - origin_y);
scale_x = xm - origin_x;
scale_y = ym - origin_y;
if (Math.abs(scale_x) < Math.abs(scale_y)) {
zm = Math.abs(scale_x);
}
if (Math.abs(scale_x) >= Math.abs(scale_y)) {
zm = Math.abs(scale_y);
}
linerad = 8;
mydir = 0;
if ((scale_x != 0) || (scale_y != 0)) {
myangle = getdegree(xm, ym, origin_x, origin_y, origin_x + 50, origin_y);
ang = myangle;
if ((ang > 0) && (ang <= 22.5)) {
myangle = 0;
scale_y = 0;
mydir = 1;
}
if ((ang > 22.5) && (ang <= 45)) {
myangle = 45;
scale_x = zm * xdir;
scale_y = zm * ydir;
mydir = 2;
}
if ((ang > 45) && (ang <= 67.5)) {
myangle = 45;
scale_x = zm * xdir;
scale_y = zm * ydir;
mydir = 2;
}
if ((ang > 67.5) && (ang <= 90)) {
myangle = 90;
scale_x = 0;
mydir = 3;
}
if ((ang > 90) && (ang <= 115.5)) {
myangle = 90;
scale_x = 0;
mydir = 3;
}
if ((ang > 115.5) && (ang <= 135)) {
myangle = 135;
scale_x = zm * xdir;
scale_y = zm * ydir;
mydir = 4;
}
if ((ang > 135) && (ang <= 157.5)) {
myangle = 135;
scale_x = zm * xdir;
scale_y = zm * ydir;
mydir = 4;
}
if ((ang > 157.5) && (ang <= 180)) {
myangle = 180;
scale_y = 0;
mydir = 5;
}
if ((ang > -180) && (ang <= -157.5)) {
myangle = 180;
scale_y = 0;
mydir = 5;
}
if ((ang > -157.5) && (ang <= -135)) {
myangle = -135;
scale_x = zm * xdir;
scale_y = zm * ydir;
mydir = 6;
}
if ((ang > -135) && (ang <= -115.5)) {
myangle = -135;
scale_x = zm * xdir;
scale_y = zm * ydir;
mydir = 6;
}
if ((ang > -115.5) && (ang <= -90)) {
myangle = -90;
scale_x = 0;
mydir = 7;
}
if ((ang > -90) && (ang <= -67.5)) {
myangle = -90;
scale_x = 0;
mydir = 7;
}
if ((ang > -67.5) && (ang <= -45)) {
myangle = -45;
scale_x = zm * xdir;
scale_y = zm * ydir;
mydir = 8;
}
if ((ang > -45) && (ang <= -22.5)) {
myangle = -45;
scale_x = zm * xdir;
scale_y = zm * ydir;
mydir = 8;
}
if ((ang > -22.5) && (ang <= 0)) {
myangle = 0;
scale_y = 0;
mydir = 1;
}
if ((((mydir == 2) || (mydir == 4)) || (mydir == 6)) || (mydir == 8)) {
linerad = 7;
}
offx = Math.sin((myangle * Math.PI) / 180) * linerad;
offy = Math.cos((myangle * Math.PI) / 180) * linerad;
}
namecirclea = ("circle" + linecount) + "a";
namecircleb = ("circle" + linecount) + "b";
namelinea = ("line" + linecount) + "a";
namelineb = ("line" + linecount) + "b";
drawcircle(_root[namecirclea], mydir, 1);
drawcircle(_root[namecircleb], mydir, 2);
_root[namecircleb]._visible = true;
_root[namecircleb]._x = origin_x + scale_x;
_root[namecircleb]._y = origin_y + scale_y;
offx1 = 0;
offx2 = 0;
if (mydir == 2) {
offx1 = 1;
}
if (mydir == 6) {
offx2 = 1;
}
if (mydir == 4) {
offx1 = 1;
}
if (mydir == 8) {
offx2 = 1;
}
_root[namelinea]._x = (origin_x - offx) + offx2;
_root[namelinea]._y = origin_y - offy;
_root[namelinea]._xscale = scale_x + 0.01;
_root[namelinea]._yscale = scale_y + 0.01;
_root[namelineb]._x = (origin_x + offx) + offx1;
_root[namelineb]._y = origin_y + offy;
_root[namelineb]._xscale = scale_x + 0.01;
_root[namelineb]._yscale = scale_y + 0.01;
updateAfterEvent();
}
}
function mouseup() {
if (_root.MCPROMPT._visible) {
return(undefined);
}
if (gamewon) {
return(undefined);
}
xm = _xmouse;
ym = _ymouse;
letx = int((xm - board_left) / 21);
lety = int((ym - board_top) / 21);
mdflag2 = true;
if ((((letx < 0) || (lety < 0)) || (letx > (gridsize - 1))) || (lety > (gridsize - 1))) {
mdflag2 = false;
}
hideline = false;
if (mdflag) {
mu_posx = letx;
mu_posy = lety;
cw = checkword(md_posx, md_posy, mu_posx, mu_posy, mydir);
if (cw != -1) {
mcname = "mcword" + (cw + 1);
tw = _root[mcname].txtword.textWidth;
_root["strikeword" + linecount]._x = gridsize_strikex - (tw / 2);
_root["strikeword" + linecount]._y = gridsize_strikey + (cw * 20);
_root["strikeword" + linecount]._width = tw + 4;
_root["strikeword" + linecount]._visible = true;
linecount = linecount + 1;
loadline(linecount);
snd_gotword.start();
} else {
hideline = true;
}
} else {
hideline = true;
}
if (hideline) {
_root[("line" + linecount) + "a"]._visible = false;
_root[("line" + linecount) + "b"]._visible = false;
_root[("circle" + linecount) + "a"]._visible = false;
_root[("circle" + linecount) + "b"]._visible = false;
if (((md_posx != -1) && (md_posy != -1)) && (mdoffscreen == false)) {
snd_hitwall.start();
}
mdoffscreen = false;
}
if ((testflag == true) || (checkwin())) {
gamewon = true;
_root.mcquit.txtquit.text = "Play Again";
_root.mccongrats._visible = true;
_root[vicsound].start();
}
mdflag = false;
}
function dotproduct(Ax, Ay, Bx, By, Cx, Cy) {
BAx = Ax - Bx;
BAy = Ay - By;
BCx = Cx - Bx;
BCy = Cy - By;
return((BAx * BCx) + (BAy * BCy));
}
function crossproductlength(Ax, Ay, Bx, By, Cx, Cy) {
BAx = Ax - Bx;
BAy = Ay - By;
BCx = Cx - Bx;
BCy = Cy - By;
return((BAx * BCy) - (BAy * BCx));
}
function atan2(opp, adj) {
if (Math.abs(adj) < 0.0001) {
angle = (Math.PI/2);
} else {
angle = Math.abs(Math.atan(opp / adj));
}
if (adj < 0) {
angle = Math.PI - angle;
}
if (opp < 0) {
angle = angle * -1;
}
return(angle);
}
function checkword(md_posx, md_posy, mu_posx, mu_posy, mydir) {
wd1 = "";
wd2 = "";
if (mu_posx < 0) {
mu_posx = 0;
}
if (mu_posx >= lev_board_width) {
mu_posx = lev_board_width - 1;
}
if (mu_posy < 0) {
mu_posy = 0;
}
if (mu_posy >= lev_board_height) {
mu_posy = lev_board_height - 1;
}
switch (mydir) {
case 0 :
return(-1);
case 1 :
c = md_posx;
while (c <= mu_posx) {
wd1 = wd1 + board[md_posy][c];
wd2 = board[md_posy][c] + wd2;
c++;
}
break;
case 3 :
c = mu_posy;
while (c <= md_posy) {
wd1 = wd1 + board[c][md_posx];
wd2 = board[c][md_posx] + wd2;
c++;
}
break;
case 5 :
c = mu_posx;
while (c <= md_posx) {
wd1 = wd1 + board[md_posy][c];
wd2 = board[md_posy][c] + wd2;
c++;
}
break;
case 7 :
c = md_posy;
while (c <= mu_posy) {
wd1 = wd1 + board[c][md_posx];
wd2 = board[c][md_posx] + wd2;
c++;
}
break;
case 2 :
d = 0;
end1 = mu_posx - md_posx;
end2 = md_posy - mu_posy;
if (end1 > end2) {
end = end2;
} else {
end = end1;
}
c = md_posx;
while (c <= (md_posx + end)) {
wd1 = wd1 + board[md_posy - d][c];
wd2 = board[md_posy - d][c] + wd2;
d = d + 1;
c++;
}
break;
case 6 :
d = 0;
end1 = md_posx - mu_posx;
end2 = mu_posy - md_posy;
if (end1 > end2) {
end = end2;
} else {
end = end1;
}
c = md_posx;
while (c >= (md_posx - end)) {
wd1 = wd1 + board[md_posy + d][c];
wd2 = board[md_posy + d][c] + wd2;
d = d + 1;
c--;
}
break;
case 4 :
d = 0;
end1 = md_posx - mu_posx;
end2 = md_posy - mu_posy;
if (end1 > end2) {
end = end2;
} else {
end = end1;
}
c = md_posx;
while (c >= (md_posx - end)) {
wd1 = wd1 + board[md_posy - d][c];
wd2 = board[md_posy - d][c] + wd2;
d = d + 1;
c--;
}
break;
case 8 :
d = 0;
end1 = mu_posx - md_posx;
end2 = mu_posy - md_posy;
if (end1 > end2) {
end = end2;
} else {
end = end1;
}
c = md_posx;
for(;;){
if (c > (md_posx + end)) {
break;
}
wd1 = wd1 + board[md_posy + d][c];
wd2 = board[md_posy + d][c] + wd2;
d = d + 1;
c++;
};
}
ret = -1;
c = 0;
while (c < arr_wordcount) {
if (arr_wl_found[c] != "Y") {
if (arr_wl[c] == wd1) {
arr_wl_found[c] = "Y";
}
if (arr_wl[c] == wd2) {
arr_wl_found[c] = "Y";
}
if (arr_wl_found[c] == "Y") {
ret = c;
}
}
c++;
}
return(ret);
}
function checkwin() {
c = 0;
while (c < arr_wordcount) {
if (arr_wl_found[c] != "Y") {
return(false);
}
c++;
}
return(true);
}
function resizescreen() {
if (gridsize == 10) {
gridsize_bdwid = 212;
gridsize_bdhei = 218;
gridsize_titlex = -70;
gridsize_bdlef = 205;
gridsize_bdlef2 = 245;
gridsize_bdtop = 56;
gridsize_strikex = 320;
gridsize_strikey = 87;
txtloadpuzzle._x = -20;
txtloadpuzzle._y = 140;
txtcapinstructions._x = -22;
txtcapinstructions._y = 45;
txtcapinstructions._height = 24;
mcinst._x = 6;
mcinst._y = 40;
mcinst._width = 200;
mcinst._height = 100;
mcbegingame._x = 60;
mcbegingame._y = 160;
mcbegingame._width = 200;
mcbegingame._height = 24;
mccustomize._x = 25;
mccustomize._y = 220;
mccustomize._width = 200;
mccustomize._height = 30;
mcatksolutions._x = 80;
mcatksolutions._y = 260;
mcatklink._x = 275;
mcatklink._y = 260;
mccongrats._x = -50;
mccongrats._y = 253;
mcquit._x = 377;
mcquit._y = 253;
MCPROMPT_TEMP._y = 40;
}
if (gridsize == 14) {
gridsize_bdwid = 300;
gridsize_bdhei = 300;
gridsize_titlex = -43;
gridsize_bdlef = 295;
gridsize_bdlef2 = 335;
gridsize_bdtop = 57;
gridsize_strikex = 409;
gridsize_strikey = 87;
mcquit._x = 460;
mcquit._y = 335;
txtloadpuzzle._x = 20;
txtloadpuzzle._y = 170;
txtcapinstructions._x = 15;
txtcapinstructions._y = 53;
txtcapinstructions._height = 24;
mcinst._x = 6;
mcinst._y = 46;
mcinst._width = 270;
mcinst._height = 140;
mcbegingame._x = 100;
mcbegingame._y = 207;
mcbegingame._width = 200;
mcbegingame._height = 30;
mccustomize._x = 35;
mccustomize._y = 290;
mccustomize._width = 270;
mccustomize._height = 40;
mcatksolutions._x = 110;
mcatksolutions._y = 340;
mcatklink._x = 300;
mcatklink._y = 340;
mccongrats._x = -50;
mccongrats._y = 333;
MCPROMPT_TEMP._x = -260;
MCPROMPT_TEMP._y = 80;
}
if (gridsize == 18) {
gridsize_bdwid = 382;
gridsize_bdhei = 390;
gridsize_titlex = 0;
gridsize_bdlef = 378;
gridsize_bdlef2 = 240;
gridsize_bdtop = 61;
gridsize_strikex = 493;
gridsize_strikey = 92;
}
if (gridsize != 18) {
txttitle._x = gridsize_titlex;
txtcategory._x = gridsize_bdlef2;
mcarrowl._x = gridsize_bdlef2 - 16;
mcarrowl_ro._x = gridsize_bdlef2 - 16;
mcwl_line._x = gridsize_bdlef2 + 24;
mcarrowr._x = gridsize_bdlef2 + 144;
mcarrowr_ro._x = gridsize_bdlef2 + 144;
}
}
function shuffle() {
mainc = 1;
while (mainc <= arr_wordcount) {
arr_wl_shuffle[mainc - 1] = arr_wl[mainc - 1];
mainc++;
}
passc = 1;
while (passc <= 2) {
mainc = 1;
while (mainc <= arr_wordcount) {
myrnd = random(arr_wordcount) + 1;
tmp = arr_wl_shuffle[mainc - 1];
arr_wl_shuffle[mainc - 1] = arr_wl_shuffle[myrnd - 1];
arr_wl_shuffle[myrnd - 1] = tmp;
mainc++;
}
passc++;
}
redoshuffle = true;
while (redoshuffle) {
y = 0;
while (y < lev_board_height) {
x = 0;
while (x < lev_board_width) {
board[y][x] = "-";
x++;
}
y++;
}
alldirfailed = false;
maxcount = arr_wordcount;
mainc = 1;
while (mainc <= maxcount) {
myword = arr_wl_shuffle[mainc - 1];
lgth = myword.length;
rnddir = random(4) + 1;
rndrev = random(2) + 1;
rndattach = random(2) + 1;
mainflag = true;
failcount = 0;
ret = false;
if (rndattach == 1) {
while (mainflag) {
ret = run_direction(myword, lgth, rnddir, rndrev, true);
if (ret == false) {
failcount++;
}
if (ret == true) {
trace((((("Ok ATTACH: " + mainc) + " ") + myword) + " Direction: ") + rnddir);
mainflag = false;
}
rnddir = rnddir + 1;
if (rnddir == 5) {
rnddir = 1;
}
if (failcount >= 4) {
mainflag = false;
}
}
}
if (ret == false) {
mainflag = true;
while (mainflag) {
ret = run_direction(myword, lgth, rnddir, rndrev, false);
if (ret == false) {
failcount++;
}
if (ret == true) {
trace((((("Ok PLACED: " + mainc) + " Placed: ") + myword) + " Direction: ") + rnddir);
mainflag = false;
}
rnddir = rnddir + 1;
if (rnddir == 5) {
rnddir = 1;
}
if ((failcount >= 4) && (rndattach == 2)) {
mainflag = false;
}
if (failcount >= 8) {
mainflag = false;
}
}
}
if ((failcount >= 4) && (rndattach == 2)) {
trace("All Directions Failed: " + myword);
alldirfailed = true;
break;
}
if (failcount >= 8) {
trace("All Directions Failed: " + myword);
alldirfailed = true;
break;
}
mainc++;
}
if (alldirfailed == false) {
redoshuffle = false;
}
}
trace("End Shuffle");
y = 0;
while (y < lev_board_height) {
x = 0;
while (x < lev_board_width) {
if (board[y][x] == "-") {
newlet = random(26) + 65;
newchar = chr(newlet);
board[y][x] = newchar;
}
x++;
}
y++;
}
y = 0;
while (y < lev_board_height) {
x = 0;
while (x < lev_board_width) {
mcname = (("mclet_" + y) + "_") + x;
_root[mcname].txtlet.text = board[y][x];
x++;
}
y++;
}
}
function run_direction(myword, lgth, rnddir, rndrev, myattach) {
switch (rnddir) {
case 1 :
xmax = (lev_board_width - lgth) + 1;
ymax = lev_board_height;
xpos = random(xmax);
ypos = random(ymax);
break;
case 2 :
xmax = lev_board_width;
ymax = (lev_board_height - lgth) + 1;
xpos = random(xmax);
ypos = random(ymax);
break;
case 3 :
xmax = (lev_board_width - lgth) + 1;
ymax = (lev_board_height - lgth) + 1;
xpos = random(xmax);
ypos = random(ymax);
break;
case 4 :
xmax = (lev_board_width - lgth) + 1;
ymax = (lev_board_height - lgth) + 1;
xpos = random(xmax);
ypos = random(ymax);
}
ret = scan_range(myword, rnddir, rndrev, xpos, ypos, xmax, ymax, myattach);
if (ret == false) {
ret = scan_range(myword, rnddir, 2 - rndrev, xpos, ypos, xmax, ymax, myattach);
}
if (ret == false) {
return(false);
}
return(true);
}
function scan_range(myword, rnddir, rndrev, p_xpos, p_ypos, p_xmax, p_ymax, p_attach) {
myx = p_xpos;
myy = p_ypos;
flag = true;
while (flag) {
if (check_the_board(rnddir, rndrev, myx, myy, myword, false, p_attach) == true) {
check_the_board(rnddir, rndrev, myx, myy, myword, true, p_attach);
return(true);
}
myx++;
if (myx == p_xmax) {
myx = 0;
myy++;
if (myy >= p_ymax) {
myy = 0;
}
}
if ((myx == p_xpos) && (myy == p_ypos)) {
flag = false;
return(false);
}
}
}
function check_the_board(p_dir, p_rev, p_x, p_y, p_word, p_assign, p_attach) {
ret = true;
foundlet = false;
if (p_attach == false) {
foundlet = true;
}
switch (p_dir) {
case 1 :
c = 0;
while (c < p_word.length) {
if (p_rev == 1) {
ch = p_word.substr(c, 1);
} else {
ch = p_word.substr((p_word.length - c) - 1, 1);
}
if (p_assign == true) {
board[p_y][p_x + c] = ch;
} else if ((board[p_y][p_x + c] != "-") && (board[p_y][p_x + c] != ch)) {
return(false);
}
if (p_assign == false) {
if (board[p_y][p_x + c] == ch) {
foundlet = true;
}
}
c++;
}
break;
case 2 :
c = 0;
while (c < p_word.length) {
if (p_rev == 1) {
ch = p_word.substr(c, 1);
} else {
ch = p_word.substr((p_word.length - c) - 1, 1);
}
if (p_assign == true) {
board[p_y + c][p_x] = ch;
} else if ((board[p_y + c][p_x] != "-") && (board[p_y + c][p_x] != ch)) {
return(false);
}
if (p_assign == false) {
if (board[p_y + c][p_x] == ch) {
foundlet = true;
}
}
c++;
}
break;
case 3 :
c = 0;
while (c < p_word.length) {
if (p_rev == 1) {
ch = p_word.substr(c, 1);
} else {
ch = p_word.substr((p_word.length - c) - 1, 1);
}
if (p_assign == true) {
board[p_y + c][p_x + c] = ch;
} else if ((board[p_y + c][p_x + c] != "-") && (board[p_y + c][p_x + c] != ch)) {
return(false);
}
if (p_assign == false) {
if (board[p_y + c][p_x + c] == ch) {
foundlet = true;
}
}
c++;
}
break;
case 4 :
c = 0;
for(;;){
if (c >= p_word.length) {
break;
}
if (p_rev == 1) {
ch = p_word.substr(c, 1);
} else {
ch = p_word.substr((p_word.length - c) - 1, 1);
}
if (p_assign == true) {
board[p_y + c][p_x + ((p_word.length - 1) - c)] = ch;
} else if ((board[p_y + c][p_x + ((p_word.length - 1) - c)] != "-") && (board[p_y + c][p_x + ((p_word.length - 1) - c)] != ch)) {
return(false);
}
if (p_assign == false) {
if (board[p_y + c][p_x + ((p_word.length - 1) - c)] == ch) {
foundlet = true;
}
}
c++;
};
}
if (foundlet == false) {
return(false);
}
return(ret);
}
function parse_string(mystring, myval) {
index = mystring.indexOf(myval + "=");
if (index == -1) {
return("");
}
newst = mystring.substr(index, mystring.length);
index = newst.indexOf("|");
if (index == -1) {
return("");
}
newst = newst.substr(0, index);
index = newst.indexOf("=");
if (index == -1) {
return("");
}
rightst = newst.substr(index + 1, newst.length);
return(rightst);
}
function dupletter(mctemp, mcname, let) {
duplicateMovieClip (mctemp, mcname, getNextHighestDepth());
_root[mcname].txtlet.text = let;
_root[mcname]._x = -100;
_root[mcname]._y = -100;
_root[mcname]._visible = true;
}
function url_decode(string) {
c = 0;
while (c <= 255) {
hexl = get_hex_char(int(c / 16));
hexr = get_hex_char(c % 16);
myhex = ("%" + hexl) + hexr;
string = str_replace(string, myhex, chr(c));
c++;
}
return(string);
}
function get_hex_char(num) {
switch (num) {
case 0 :
ret = "0";
break;
case 1 :
ret = "1";
break;
case 2 :
ret = "2";
break;
case 3 :
ret = "3";
break;
case 4 :
ret = "4";
break;
case 5 :
ret = "5";
break;
case 6 :
ret = "6";
break;
case 7 :
ret = "7";
break;
case 8 :
ret = "8";
break;
case 9 :
ret = "9";
break;
case 10 :
ret = "A";
break;
case 11 :
ret = "B";
break;
case 12 :
ret = "C";
break;
case 13 :
ret = "D";
break;
case 14 :
ret = "E";
break;
case 15 :
ret = "F";
}
return(ret);
}
function str_replace(block, find, replace) {
return(block.split(find).join(replace));
}
function alltrim(sString) {
while (sString.substring(0, 1) == " ") {
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length - 1, sString.length) == " ") {
sString = sString.substring(0, sString.length - 1);
}
return(sString);
}
function set_color_rgb(mc, r, g, b) {
if (((((((((!isNaN(r)) && (!isNaN(g))) && (!isNaN(b))) && (r < 256)) && (r >= 0)) && (g < 256)) && (g >= 0)) && (b < 256)) && (b >= 0)) {
r = parseInt(r).toString(16);
((r.length == 1) ? (r = "0" + r) : (r));
g = parseInt(g).toString(16);
((g.length == 1) ? (g = "0" + g) : (g));
b = parseInt(b).toString(16);
((b.length == 1) ? (b = "0" + b) : (b));
col = new Color(mc);
col.setRGB(parseInt((("0x" + r) + g) + b));
}
}
function set_color_hex(mc, hex) {
col = new Color(mc);
col.setRGB(hex);
}
function asort(arr, cnt) {
d = 0;
while (d < cnt) {
c = d;
while (c < cnt) {
if (arr[c] < arr[d]) {
tmp = arr[c];
arr[c] = arr[d];
arr[d] = tmp;
}
c++;
}
d++;
}
}
function get_category(p_cat, p_action) {
arr_categories = ["GENERAL", "ANIMALS", "AUTOS", "CARTOONS", "EUROPE", "FITNESS", "JUNK FOOD", "MOVIES", "MUSICIANS", "PRESIDENTS", "ROCK BANDS", "SITCOMS", "STAR WARS", "SPORTS", "TEAMS - MLB", "TEAMS - NBA", "TEAMS - NFL", "TEAMS - NHL", "U.S. STATES", "VIDEOGAMES"];
if (p_action == "XXX") {
ret = p_cat;
} else {
ret = arr_categories[0];
}
c = 0;
while (c < 20) {
if (arr_categories[c] == p_cat) {
if ((p_action == "NEXT") && (c < 19)) {
ret = arr_categories[c + 1];
break;
}
if ((p_action == "NEXT") && (c == 19)) {
ret = arr_categories[0];
break;
}
if ((p_action == "PREV") && (c == 0)) {
ret = arr_categories[19];
break;
}
if ((p_action == "PREV") && (c > 0)) {
ret = arr_categories[c - 1];
break;
}
}
c++;
}
get_wordlist(ret);
if ((p_action == "NEXT") || (p_action == "PREV")) {
snd_blip.start();
}
return(ret);
}
function get_wordlist(p_cat) {
switch (p_cat) {
case "GENERAL" :
arr_wl_load = ["COMPUTERS", "TELEVISION", "TREES", "GRASS", "OCEAN", "TELEPHONE", "MOVIES", "SITCOMS", "ANIMALS", "PEOPLE", "CARTOONS", "FITNESS", "SUCCESS", "AUTOMOBILES", "SPORTS", "ENTERTAINMENT", "CAMPING", "TRAVELING"];
arr_wordcount_load = 18;
break;
case "ANIMALS" :
arr_wl_load = ["DOGS", "KITTEN", "COWARDLY LION", "ELEPHANT", "KING KONG", "TIGER", "SNAKE", "BUNNY RABBIT", "HAMSTER", "MOUSE", "GODZILLA", "MOTHRA", "BIG BIRD", "CAVE MAN", "DOLPHIN", "BUMBLE BEE", "TURKEY", "CHICKEN", "KERMIT THE FROG", "MISS PIGGY", "FOZZIE BEAR", "GOLD FISH", "BUTTERFLY", "MONKEY"];
arr_wordcount_load = 24;
break;
case "AUTOS" :
arr_wl_load = ["CHEVROLET", "PORSCHE", "CORVETTE", "LAMBORGHINI", "PICKUP TRUCK", "BMW", "STRATUS", "HUMMER", "FIREBIRD", "MUSTANG", "CAMARO", "DELOREAN", "LEXUS", "VIPER", "JEEP", "CADILLAC", "VOLKSWAGON", "MAZDA PROTAGE", "LAND ROVER", "EXPLORER", "FERRARI"];
arr_wordcount_load = 21;
break;
case "CARTOONS" :
arr_wl_load = ["BUGS BUNNY", "DAFFY DUCK", "FOGHORN LEGHORN", "MICKEY MOUSE", "WOODY WOODPECKER", "SPONGEBOB", "ELMER FUDD", "FRED FLINSTONE", "GEORGE JETSON", "BARNEY RUBBLE", "ROAD RUNNER", "TOM CAT", "JERRY MOUSE", "WILE E COYOTE", "TWEETY BIRD", "PORKEY PIG", "TAZMANIAN DEVIL", "MARVIN THE MARTIAN"];
arr_wordcount_load = 18;
break;
case "EUROPE" :
arr_wl_load = ["GREAT BRITIAN", "FRANCE", "BELGIUM", "POLAND", "GERMANY", "AUSTRIA", "SWEDEN", "SWISS ALPS", "ITALY", "TURKEY", "AMSTERDAM", "SPAIN", "DENMARK", "NORWAY", "PORTUGAL", "IRELAND", "HUNGARY", "CZECH REPUBLIC", "FINLAND", "NETHERLANDS", "RUSSIA", "SWITZERLAND", "UKRAINE"];
arr_wordcount_load = 23;
break;
case "FITNESS" :
arr_wl_load = ["CARDIOVASCULAR", "BENCH PRESS", "PROTEIN BAR", "EXERCISE", "TRAINING", "STEP CLASS", "AEROBICS", "STRETCHING", "TREADMILL", "SITUPS", "PUSHUPS", "FREE WEIGHTS", "MACHINES", "EGG WHITES", "VITAMINS", "CALCIUM", "BO FLEX", "RUNNING", "HEALTHY DIET"];
arr_wordcount_load = 19;
break;
case "ROCK BANDS" :
arr_wl_load = ["DEF LEPPARD", "GUNS AND ROSES", "METALLICA", "LED ZEPPLIN", "BON JOVI", "WHITESNAKE", "POISON", "AEROSMITH", "TWISTED SISTER", "BEASTIE BOYS", "MOTORHEAD", "WHITE LION", "KISS", "BLACK SABBOTH", "RATT", "QUIET RIOT", "VAN HALEN", "SKID ROW", "WINGER", "MEGADETH", "JUDAS PRIEST", "IRON MAIDEN", "BOSTON", "ACDC"];
arr_wordcount_load = 24;
break;
case "HUMAN BODY" :
arr_wl_load = ["EYEBROW", "NOSTRAL", "MOUTH", "EAR LOBE", "CRANIUM", "ARMS", "LEGS", "TOES", "CHEST", "BACK", "HAIR", "FEET", "HEARTBEAT", "BLOOD VESSLES", "STOMACH", "ELBOWS", "FINGERS", "SHOULDERS", "MUSCLES", "BONES"];
arr_wordcount_load = 20;
break;
case "JUNK FOOD" :
arr_wl_load = ["TWIZZLERS", "MILKYWAY", "SODAPOP", "ENERGY DRINK", "GUMMY BEAR", "CAFFEINE", "SUGAR", "BIG MAC", "CHOCOLATE", "ICE CREAM", "CANDY BAR", "CUP CAKES", "FRENCH FRIES", "NUTRASWEET", "LAYERED CAKE", "BACON", "POTATO CHIPS", "DORITOS", "PEANUT BUTTER CUP", "TWINKIES", "FRIED CHICKEN"];
arr_wordcount_load = 21;
break;
case "MOVIES" :
arr_wl_load = ["ROCKY", "RAMBO", "BACK TO THE FUTURE", "SUPERMAN", "X-MEN", "GODFATHER", "TITANIC", "INDEPENDENCE DAY", "STAR WARS", "DIE HARD", "MISSION IMPOSSIBLE", "MEN IN BLACK", "SPEED", "CELLULAR", "LIAR LIAR", "BATMAN", "WITNESS", "FOREST GUMP", "THE MARINE", "BLUE STREAK", "TERMINATOR", "MARS ATTACKS", "AMERICAN PIE"];
arr_wordcount_load = 23;
break;
case "MUSICIANS" :
arr_wl_load = ["MADONNA", "MICHAEL JACKSON", "ELVIS PRESLEY", "BILLY JOEL", "PAULA ABDUL", "JENNIFER LOPEZ", "FRANK SINATRA", "RAY CHARLES", "JEWEL", "BEETHOVEN", "MOZART", "JOHN WILLIAMS", "FRANCES SCOTT KEY", "WHITNEY HOUSTON", "JOHN LENNON", "BING CROSBY", "LOUIS ARMSTRONG", "SEBASTIAN BACH"];
arr_wordcount_load = 18;
break;
case "PRESIDENTS" :
arr_wl_load = ["GEORGE WASHINGTON", "JOHN ADAMS", "THOMAS JEFFERSON", "MONROE", "CHESTER ARTHUR", "ANDREW JOHNSON", "ABRAHAM LINCOLN", "BUCHANAN", "JIMMY CARTER", "GROVER CLEVELAND", "BILL CLINTON", "CALVIN COOLIDGE", "JAMES POLK", "GERALD FORD", "RONALD REAGAN", "ROOSEVELT", "WARREN HARDING", "HARRY TRUMAN", "ANDREW JACKSON", "WOODROW WILSON", "GEORGE BUSH", "ZACH TAYLOR", "RICHARD NIXON", "JOHN KENNEDY", "EISENHOWER", "ULYSSES GRANT", "JAMES GARFIELD", "HARRISON", "HERBERT HOOVER"];
arr_wordcount_load = 29;
break;
case "SITCOMS" :
arr_wl_load = ["SEINFELD", "JEFFERSONS", "SANFORD AND SON", "ALL IN THE FAMILY", "FAMILY TIES", "THREES COMPANY", "FACTS OF LIFE", "SAVED BY THE BELL", "FAMILY MATTERS", "ALICE", "BRADY BUNCH", "GILLIGANS ISLAND", "SILVER SPOONS", "COSBY SHOW", "CHEERS", "CHARLES IN CHARGE", "FRASIER", "FRIENDS", "FULL HOUSE", "DIFFERENT STROKES", "AADAMS FAMILY"];
arr_wordcount_load = 21;
break;
case "SPORTS" :
arr_wl_load = ["BOWLING", "SOCCER", "BASEBALL", "HOCKEY", "BOXING", "WRESTLING", "FOOTBALL", "RUGBY", "BASKETBALL", "TENNIS", "FIGURE SKATING", "WEIGHTLIFTING", "NASCAR", "GOLF", "LACROSSE", "HANDBALL", "TRACK AND FIELD", "FENCING", "BADMINTON", "GYMNASTICS"];
arr_wordcount_load = 20;
break;
case "SUCCESS" :
arr_wl_load = ["HUSTLE", "LOYALTY", "RESPECT", "PRAYERS", "VITAMINS", "TRAINING", "MOTIVATION", "POSITIVE ATTITUDE", "BELIEF", "FAITH", "ACTION", "EDUCATION", "DISCIPLINE", "PERSISTANT", "CONSISTENCY"];
arr_wordcount_load = 15;
break;
case "STAR WARS" :
arr_wl_load = ["MASTER YODA", "LUKE SKYWALKER", "WOOKIE", "HANS SOLO", "PRINCESS LEAH", "CHEWBACCA", "DARTH VADER", "PALPAINE", "DARTH SIDIOUS", "COUNT DOOKU", "ANAKIN SKYWALKER", "JABBA THE HUTT", "STORM TROOPER", "MILLENIUM FALCON", "OBI WAN KENOBI", "CHANCELLOR VALORUM", "DARTH MAUL", "QUI GON JINN", "QUEEN AMIDALA", "DEATH STAR", "NABOO", "GALATIC SENATE", "JEDI KNIGHT"];
arr_wordcount_load = 23;
break;
case "TEAMS - MLB" :
arr_wl_load = ["METS", "YANKEES", "PHILLIES", "PIRATES", "ORIOLES", "RED SOX", "WHITE SOX", "BRAVES", "CUBS", "INDIANS", "DIAMONDBACKS", "REDS", "TIGERS", "ROYALS", "MARLINS", "ANGELS", "ASTROS", "TWINS", "ATHLETICS", "MARINERS", "DEVIL RAYS", "BLUE JAYS", "GIANTS", "CARDINALS", "BREWERS", "DODGERS"];
arr_wordcount_load = 26;
break;
case "TEAMS - NBA" :
arr_wl_load = ["HAWKS", "CELTICS", "BOB CATS", "BULLS", "CAVALIERS", "MAVERICS", "NUGGETS", "PISTONS", "WARRIORS", "ROCKETS", "PISTONS", "CLIPPERS", "LAKERS", "GRIZZLIES", "HEAT", "BUCKS", "TIMBERWOLVES", "NETS", "HORNETS", "KNICKS", "MAGIC", "SUNS", "TRAIL BLAZERS", "KINGS", "SPURS", "SUPERSONICS", "RAPTORS", "JAZZ", "WIZARDS"];
arr_wordcount_load = 29;
break;
case "TEAMS - NFL" :
arr_wl_load = ["RAVENS", "BILLS", "BENGALS", "BROWNS", "BRONCOS", "TEXANS", "COLTS", "JAGUARS", "CHIEFS", "DOLPHINS", "PATRIOTS", "JETS", "RAIDERS", "STEELERS", "CHARGERS", "TITANS", "REDSKINS", "BUCKANEERS", "RAMS", "SEAHAWKS", "EAGLES", "GIANTS", "SAINTS", "VIKINGS", "PACKERS", "LIONS", "COWBOYS", "BEARS", "PANTHERS", "FALCONS", "CARDINALS"];
arr_wordcount_load = 31;
break;
case "TEAMS - NHL" :
arr_wl_load = ["DEVILS", "ISLANDERS", "RANGERS", "FLYERS", "PENGUINS", "BRUINS", "SABRES", "CANADIENS", "SENATORS", "MAPLE LEAFS", "THRASHERS", "HURRICANES", "PANTHERS", "LIGHTNING", "CAPITALS", "BLACK HAWKS", "BLUE JACKETS", "RED WINGS", "PREDATORS", "BLUES", "FLAMES", "AVALANCHE", "OILERS", "WILD", "CANUCKS", "DUCKS", "STARS", "KINGS", "COYOTES", "SHARKS"];
arr_wordcount_load = 30;
break;
case "U.S. STATES" :
arr_wl_load = ["ALABAMA", "ALASKA", "ARIZONA", "ARKANSAS", "CALIFORNIA", "COLORODO", "CONNECTICUT", "DELAWARE", "FLORIDA", "GEORGIA", "HAWAII", "IDAHO", "ILLINOIS", "INDIANA", "IOWA", "KENTUCKY", "KANSAS", "LOUISIANA", "MAINE", "MARYLAND", "MASSACHUSETTS", "MICHIGAN", "MINNESOTA", "MISSISSIPPI", "MISSOURI", "MONTANA", "NEBRASKA", "NEW HAMPSHIRE", "NEW JERSEY", "NEW YORK", "NORTH CAROLINA", "NORTH DAKOTA", "OHIO", "OKLAHOMA", "OREGON", "PENNSYLVANIA", "RHODE ISLAND", "SOUTH CAROLINA", "SOUTH DAKOTA", "TENNESSEE", "TEXAS", "UTAH", "VERMONT", "VIRGINIA", "WASHINGTON", "WEST VIRGINIA", "WISCONSIN", "WYOMING"];
arr_wordcount_load = 48;
break;
case "VIDEOGAMES" :
arr_wl_load = ["SUPER MARIO BROS", "METROID", "PAC-MAN", "DEFENDER", "MORTAL KOMBAT", "STREET FIGHTER", "DONKEY KONG", "WORLD OF WARCRAFT", "PONG", "FROGGER", "ASTEROIDS", "ARKANOID", "TRACK AND FIELD", "BUBBLE BOBBLE", "ZAXXON", "SHINOBI", "JUNGLE HUNT", "THE MAIN EVENT", "MOON PATROL", "DOUBLE DRAGON"];
arr_wordcount_load = 20;
}
ctrim = 0;
while (ctrim < arr_wordcount_load) {
if (arr_wl_load[ctrim].length > gridsize) {
arr_wl_load[ctrim] = arr_wl_load[ctrim].substr(0, gridsize);
}
ctrim++;
}
}
Stage.showMenu = false;
var hss = true;
var testflag = false;
var gridsize = 18;
var gridsize_bdwid = 0;
var gridsize_bdhei = 0;
var gridsize_bdlef = 0;
var gridsize_bdlef2 = 0;
var gridsize_bdtop = 0;
var gridsize_strikex = 0;
var gridsize_strikey = 0;
var gridsize_titlex = 0;
var db_userid = 0;
var db_username = "";
var db_title = "";
var db_hideatk = "N";
var db_hidead = "Y";
var db_loadstring = "";
var mcategory = "";
var skipintro = false;
var dragpiece = "";
var shuffleflag = false;
var begingame = false;
var vicsound = "snd_success";
var origin_x = 0;
var origin_y = 0;
var md_posx = 0;
var md_posy = 0;
var mu_posx = 0;
var mu_posy = 0;
var mydir = -1;
var linecount = 1;
var mdflag = false;
var mdoffscreen = false;
var objloaded = false;
var keypressed = 0;
var gamewon = false;
var arr_wordcount = 0;
var arr_wordcount_load = 0;
arr_categories = new Array();
arr_wl = new Array();
arr_wl_shuffle = new Array();
arr_wl_disp = new Array();
arr_wl_found = new Array();
arr_wl_load = new Array();
Frame 2
var keypiece = 0;
var keydir = "";
var keyflag = true;
var movecount = 0;
var gamestate = "GO";
var aniclock = 0;
var board_top = 40;
var board_left = 5;
var board_grid_width = 450;
var board_grid_height = 400;
var screenchanged = false;
var msquarew = 0;
var msquareh = 0;
var lev_board_width = 5;
var lev_board_height = 4;
var lev_piece_count = 10;
Frame 3
snd_winner2 = new Sound();
snd_winner2.attachSound("winner2");
snd_dissolve = new Sound();
snd_dissolve.attachSound("dissolve");
snd_blip = new Sound();
snd_blip.attachSound("blip");
snd_gotword = new Sound();
snd_gotword.attachSound("snd_gotword");
snd_hitwall = new Sound();
snd_hitwall.attachSound("hitwall");
snd_groan = new Sound();
snd_groan.attachSound("groan");
snd_success = new Sound();
snd_success.attachSound("success");
snd_computerbeep = new Sound();
snd_computerbeep.attachSound("computerbeep");
snd_prompt_open = new Sound();
snd_prompt_open.attachSound("snd_prompt_open");
snd_prompt_close = new Sound();
snd_prompt_close.attachSound("snd_prompt_close");
Frame 4
lev_board_height = 25;
lev_board_width = 25;
board = new Array();
boardmc = new Array();
y = 0;
while (y < 40) {
board[y] = new Array();
boardmc[y] = new Array();
x = 0;
while (x < 40) {
board[y][x] = "A";
boardmc[y][x] = "";
x++;
}
y++;
}
Frame 5
myid = "-1";
myusername = "XXX";
if ((_root.username != undefined) && (_root.id != undefined)) {
myid = _root.id;
myusername = _root.username;
}
if (!((myid == "-1") && (myusername == "XXX"))) {
myurl = "http://www.atksolutions.com/games/loadwordsearch.php";
myurl = (((myurl + "?id=") + myid) + "&username=") + myusername;
var myvar = new LoadVars();
myvar.onLoad = function (success) {
if (success) {
db_loadstring = this.toString();
db_loadstring = url_decode(db_loadstring);
_root.gotoAndPlay(6);
} else {
db_loadstring = "ERROR";
}
_root.txtloadstring.text = "Error Loading Puzzle";
_root.gotoAndPlay(6);
};
myvar.load(myurl);
_root.txtloadstring.text = "Loading Information....Please Wait";
stop();
} else {
db_loadstring = "ERROR";
}
Frame 6
okflag = true;
if (db_loadstring == "ERROR") {
okflag = false;
}
db_hideatk = "";
myshowad = "Y";
if (okflag) {
db_title = parse_string(db_loadstring, "TITLE");
db_hideatk = parse_string(db_loadstring, "HIDEATK");
db_hidead = parse_string(db_loadstring, "HIDEAD");
mywordlist = parse_string(db_loadstring, "WORDLIST");
mywordlist = mywordlist.toUpperCase();
mywordlist = mywordlist + ",";
arr_wordcount_load = 0;
index = mywordlist.indexOf(",");
while (index != -1) {
myleft = alltrim(mywordlist.substr(0, index));
myleft = myleft.substr(0, gridsize);
mywordlist = mywordlist.substr(index + 1, mywordlist.length);
if (myleft != "") {
arr_wordcount_load = arr_wordcount_load + 1;
arr_wl_load[arr_wordcount_load - 1] = myleft;
}
index = mywordlist.indexOf(",");
}
} else {
db_title = "Word Search";
arr_wordcount_load = gridsize - 1;
if (gridsize == 10) {
arr_wl_load = ["PROTEIN", "MINERAL", "VEGETABLE", "CALORIES", "VITAMINS", "CHOLESTEROL", "FRUIT", "CHOCOLATE", "CARDIO", "CAFFEINE", "DAIRY", "WATER"];
}
if (gridsize == 18) {
arr_wl_load = ["PROTEIN", "CARBOHYDRATE", "MINERAL", "VEGETABLE", "CALORIES", "DAILY INTAKE", "VITAMINS", "WEIGHT LOSS", "CHOLESTEROL", "SATURATED FAT", "FRUIT", "CHOCOLATE", "HEALTHY DIET", "CARDIOVASCULAR", "CAFFEINE", "DAIRY", "SPRING WATER"];
}
}
Frame 7
lev_board_width = gridsize;
lev_board_height = gridsize;
lev_let_count = 10;
msquarew = board_grid_width / lev_board_width;
msquareh = board_grid_height / lev_board_height;
lev_piece_count = 25;
lev_board_col = ["AAAAA", "BBBBB", "CCCCC", "DDDDD", "EEEEE"];
lev_board_num = ["12345", "12345", "12345", "12345", "12345"];
lev_board_goal_col = ["AAAAA", "BBBBB", "CCCCC", "DDDDD", "EEEEE"];
lev_board_goal_num = ["12345", "12345", "12345", "12345", "12345"];
Frame 10
releaseobj();
Frame 11
resizescreen();
loadobj();
mcategory = "GENERAL";
Frame 15
mcarrowl_ro._y = mcarrowl._y;
mcarrowr_ro._y = mcarrowr._y;
if (db_loadstring == "ERROR") {
get_category(mcategory, "XXX");
mccustomize._visible = true;
mcatksolutions._visible = true;
mcatklink._visible = true;
mcarrowl._visible = true;
mcarrowr._visible = true;
mcarrowl_ro._visible = false;
mcarrowr_ro._visible = false;
txtcategory.text = mcategory;
mcinst.txtinst.text = "Use the mouse to click, drag and find the words in the puzzle to clear the word from the word list on the right. Puzzle is completed once all words have been found! Click arrows to change category.";
} else {
mcategory = "WORD LIST";
if (db_hidead == "N") {
mccustomize._visible = true;
} else {
mccustomize._visible = false;
}
mcatksolutions._visible = true;
mcatklink._visible = true;
mcarrowl._visible = false;
mcarrowr._visible = false;
mcarrowl_ro._visible = false;
mcarrowr_ro._visible = false;
txtcategory.text = "WORD LIST";
}
if (db_hideatk == "Y") {
mcatksolutions._visible = false;
mcatklink._visible = false;
} else {
mcatksolutions._visible = true;
mcatklink._visible = true;
}
txtcategory.text = mcategory;
txttitle.text = db_title;
resizescreen();
drawobj(false);
display_words();
stop();
Instance of Symbol 33 MovieClip "mcatksolutions" in Frame 15
on (release) {
getURL ("http://www.atksolutions.com", "_blank");
}
Instance of Symbol 35 MovieClip "mcatklink" in Frame 15
on (release) {
getURL ("http://www.atksolutions.com", "_blank");
}
Instance of Symbol 38 MovieClip "mcbegingame" in Frame 15
on (release) {
_root.gotoAndPlay(19);
}
Instance of Symbol 41 MovieClip "mccustomize" in Frame 15
on (release) {
getURL ("http://www.atksolutions.com/games/addwordsearch.php", "_blank");
}
Instance of Symbol 45 MovieClip "mcarrowl" in Frame 15
on (rollOver) {
_root.mcarrowl._visible = false;
_root.mcarrowl_ro._visible = true;
}
Instance of Symbol 48 MovieClip "mcarrowr" in Frame 15
on (rollOver) {
_root.mcarrowr._visible = false;
_root.mcarrowr_ro._visible = true;
}
Instance of Symbol 53 MovieClip "mcarrowl_ro" in Frame 15
on (rollOut) {
_root.mcarrowl._visible = true;
_root.mcarrowl_ro._visible = false;
}
on (press) {
_root.mcategory = _root.get_category(_root.mcategory, "PREV");
_root.txtcategory.text = _root.mcategory;
_root.display_words();
}
Instance of Symbol 56 MovieClip "mcarrowr_ro" in Frame 15
on (rollOut) {
_root.mcarrowr._visible = true;
_root.mcarrowr_ro._visible = false;
}
on (press) {
_root.mcategory = _root.get_category(_root.mcategory, "NEXT");
_root.txtcategory.text = _root.mcategory;
_root.display_words();
}
Frame 19
txtcategory.text = "WORD LIST";
txttitle.text = db_title;
resizescreen();
drawobj(false);
Frame 20
txtcategory.text = "WORD LIST";
txttitle.text = db_title;
resizescreen();
drawobj(true);
stop();
Instance of Symbol 61 MovieClip in Frame 20
onClipEvent (keyDown) {
}
onClipEvent (load) {
_root.initline();
}
onClipEvent (mouseDown) {
_root.mousedown();
updateAfterEvent();
}
onClipEvent (mouseMove) {
_root.mousemove();
}
onClipEvent (mouseUp) {
_root.mouseup();
}
Instance of Symbol 66 MovieClip "mcquit" in Frame 20
on (press) {
if (_root.gamewon == false) {
if (_root.MCPROMPT._visible == false) {
_root.MCPROMPT.swapDepths(_root["strikeword" + _root.linecount]);
_root.MCPROMPT._visible = true;
_root.MCPROMPT.gotoAndPlay(2);
}
} else {
_root.MCPROMPT._visible = false;
_root.releaseline();
_root.gotoAndPlay(15);
}
}
Frame 30
if (lev_level == "Easy") {
mytxt = "Congratulations! You Solved the Puzzle!";
mytxt2 = "Level: Beginner!";
mycomment2 = "Why not try the advanced puzzle...";
myrnd = random(5);
if (myrnd == 0) {
mycomment = "Fortune favors the brave! - Aida";
}
if (myrnd == 1) {
mycomment = "The best way out is always through! - Robert Frost";
}
if (myrnd == 2) {
mycomment = "Nothing will ever be attempted if all possible objections must first be overcome!";
}
if (myrnd == 3) {
mycomment = "Nothing great was ever achieved without enthusiasm! - Ralph Waldo Emerson";
}
if (myrnd == 4) {
mycomment = "If you do not hope, you will not find what is beyond your hopes!";
}
}
if (lev_level == "Hard") {
mytxt = "Congratulations! You Solved the Puzzle!";
mytxt2 = "Level: Advanced!";
mycomment2 = "You are a Mind Boggle Master!";
myrnd = random(5);
if (myrnd == 0) {
mycomment = "They can because they think they can! - Virgil";
}
if (myrnd == 1) {
mycomment = "Along with success comes a reputation for wisdom! - Euripides";
}
if (myrnd == 2) {
mycomment = "Try not to become a man of success but a man of value! - Albert Einstein";
}
if (myrnd == 3) {
mycomment = "The art of being wise is knowing what to overlook! - William James";
}
if (myrnd == 4) {
mycomment = "Courage is the price that life exacts for granting peace! - Amelia Earhart ";
}
}
txtcongrats.text = mytxt;
txtcongrats2.text = mytxt2;
txtcomment.text = mycomment;
txtcomment2.text = mycomment2;
snd = random(2);
if (snd == 0) {
snd_winner2.start();
} else {
snd_success.start();
}
drawgrid(true);
stop();
Frame 31
gotoAndPlay (30);
Instance of Symbol 25 MovieClip in Symbol 28 MovieClip Frame 1
on (release) {
_root.MCPROMPT.swapDepths(_root["strikeword" + _root.linecount]);
_root.MCPROMPT._visible = false;
_root.releaseline();
_root.snd_computerbeep.start();
_root.gotoAndPlay(15);
}
Instance of Symbol 27 MovieClip in Symbol 28 MovieClip Frame 1
on (release) {
_root.MCPROMPT.gotoAndPlay(31);
}
Symbol 29 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 2
_root.snd_prompt_open.start();
Instance of Symbol 25 MovieClip in Symbol 29 MovieClip Frame 2
on (release) {
_root.MCPROMPT.swapDepths(_root["strikeword" + _root.linecount]);
_root.MCPROMPT._visible = false;
_root.releaseline();
_root.snd_computerbeep.start();
_root.gotoAndPlay(15);
}
Instance of Symbol 27 MovieClip in Symbol 29 MovieClip Frame 2
on (release) {
_root.MCPROMPT.gotoAndPlay(31);
}
Symbol 29 MovieClip Frame 30
stop();
Symbol 29 MovieClip Frame 31
_root.snd_prompt_close.start();
Symbol 29 MovieClip Frame 59
_root.MCPROMPT._visible = false;
_root.MCPROMPT.swapDepths(_root["strikeword" + _root.linecount]);
stop();