Frame 1
tbytes = _root.getBytesTotal();
lbytes = _root.getBytesLoaded();
perc = int((lbytes / tbytes) * 100);
_root.pBar.setPercentage(perc);
if (perc == 100) {
gotoAndStop (3);
}
Frame 2
gotoAndPlay (1);
Frame 3
function Init() {
i = 0;
while (i < 9) {
xpos = i % 3;
ypos = int(i / 3);
attachMovie("Square", "sq" + i, 500 + i);
mc = eval ("sq" + i);
mc._x = 80 + (xpos * 120);
mc._y = 80 + (ypos * 120);
mc.xpos = xpos;
mc.ypos = ypos;
squares[i] = mc;
i++;
}
}
function FlipSquares(xp, yp) {
if (hiding) {
Unhide();
} else {
i = (yp * 3) + xp;
if (xp > 0) {
_root.squares[i - 1].Flip();
}
if (xp < 2) {
_root.squares[i + 1].Flip();
}
if (yp > 0) {
_root.squares[i - 3].Flip();
}
if (yp < 2) {
_root.squares[i + 3].Flip();
}
_root.squares[i].Flip();
if (CheckColour(maxcol)) {
_Root.PenPen.SetPic(maxcol);
picnum = maxcol;
_Root.ProgBox.Next();
if (maxcol == 4) {
_root.infotext = "Congratulations. You've completed the puzzles. Just click the buttons below to see the pics.<br><br>Interested in more of my art? Then just visit my site at <a href='http://sketched.furserve.com/'>http://sketched.furserve.com/</a> for more.<br><br>I hope you enjoyed playing... Graphite";
}
if (maxcol < 4) {
maxcol++;
i = 0;
while (i < 9) {
_root.squares[i].IncNumCol();
i++;
}
}
}
}
}
function CheckColour(col) {
c = 0;
i = 0;
while (i < 9) {
if (_root.squares[i].CurrentColor() == col) {
c++;
}
i++;
}
return(c == 9);
}
function Hide() {
i = 0;
while (i < 9) {
squares[i]._alpha = 0;
i++;
}
hiding = true;
}
function Unhide() {
i = 0;
while (i < 9) {
squares[i]._alpha = 100;
i++;
}
hiding = false;
}
function Reset() {
i = 0;
while (i < 9) {
_root.squares[i].Reset();
i++;
}
_root.PenPen.Reset();
}
function ShowPic(pnum) {
if ((picnum == pnum) && (hiding)) {
Unhide();
} else {
picnum = pnum;
_Root.PenPen.SetPic(pnum);
Hide();
}
}
var squares = new Array(9);
maxcol = 2;
picnum = 1;
hiding = false;
Init();
Symbol 2 MovieClip [Square] Frame 1
#initclip 1
function Square() {
this.xpos = 0;
this.ypos = 0;
this.numcol = 2;
}
Square.prototype = new MovieClip();
Square.prototype.Flip = function () {
if (this._currentframe == this.numcol) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(this._currentframe + 1);
}
};
Square.prototype.CurrentColor = function () {
return(this._currentframe);
};
Square.prototype.IncNumCol = function () {
if (this.numcol < 4) {
this.numcol++;
}
};
Square.prototype.Reset = function () {
this.numcol = 2;
this.gotoAndStop(1);
};
Square.prototype.onRelease = function () {
_level0.flipSquares(this.xpos, this.ypos);
};
Object.registerClass("Square", Square);
#endinitclip
stop();
Symbol 8 MovieClip Frame 1
function setPercentage(perc) {
gotoAndStop(perc);
percentage = perc + "%";
}
Symbol 18 MovieClip Frame 1
function SetPic(pnum) {
gotoAndStop(pnum);
}
function NextPic() {
if (_currentframe < 4) {
gotoAndStop(_currentframe + 1);
}
}
function Reset() {
gotoAndStop (1);
}
stop();
Symbol 20 MovieClip Frame 1
function Next() {
gotoAndPlay(_currentframe + 1);
}
Symbol 20 MovieClip Frame 10
stop();
Instance of Symbol 19 MovieClip in Symbol 20 MovieClip Frame 10
on (release) {
_level0.ShowPic(1);
}
Symbol 20 MovieClip Frame 15
stop();
Instance of Symbol 19 MovieClip in Symbol 20 MovieClip Frame 15
on (release) {
_level0.ShowPic(2);
}
Symbol 20 MovieClip Frame 20
stop();
Instance of Symbol 19 MovieClip in Symbol 20 MovieClip Frame 20
on (release) {
_level0.ShowPic(3);
}
Symbol 20 MovieClip Frame 25
stop();
Instance of Symbol 19 MovieClip in Symbol 20 MovieClip Frame 25
on (release) {
_level0.ShowPic(4);
}
Symbol 20 MovieClip Frame 26
gotoAndStop (25);