Frame 1
Application.main(this);
Symbol 20480 MovieClip [__Packages.com.abowman.ABMovieClip] Frame 0
class com.abowman.ABMovieClip extends MovieClip
{
var curveTo, moveTo, lineTo;
function ABMovieClip () {
super();
}
function drawArc(x, y, radius, arc, startAngle, yRadius) {
if (arguments.length < 5) {
return(null);
}
if (yRadius == undefined) {
yRadius = radius;
}
if (Math.abs(arc) > 360) {
arc = 360;
}
var _local12 = Math.ceil(Math.abs(arc) / 45);
var _local8 = arc / _local12;
var _local9 = (-(_local8 / 180)) * Math.PI;
var _local10 = (-(startAngle / 180)) * Math.PI;
var _local13 = x - (Math.cos(_local10) * radius);
var _local14 = y - (Math.sin(_local10) * yRadius);
if (_local12 > 0) {
var _local19 = 0;
for ( ; _local19 < _local12 ; _local19++) {
_local10 = _local10 + _local9;
var _local11 = _local10 - (_local9 / 2);
var _local15 = _local13 + (Math.cos(_local10) * radius);
var _local16 = _local14 + (Math.sin(_local10) * yRadius);
var _local17 = _local13 + (Math.cos(_local11) * (radius / Math.cos(_local9 / 2)));
var _local18 = _local14 + (Math.sin(_local11) * (yRadius / Math.cos(_local9 / 2)));
curveTo(_local17, _local18, _local15, _local16);
}
}
return({x:_local15, y:_local16});
}
function drawOval(x, y, radius, yRadius) {
if (arguments.length < 3) {
return(undefined);
}
if (yRadius == undefined) {
yRadius = radius;
}
var _local6 = Math.PI / 4;
var _local7 = radius / Math.cos(_local6 / 2);
var _local8 = yRadius / Math.cos(_local6 / 2);
var _local9 = 0;
moveTo(x + radius, y);
var _local15 = 0;
for ( ; _local15 < 8 ; _local15++) {
_local9 = _local9 + _local6;
var _local10 = _local9 - (_local6 / 2);
var _local13 = x + (Math.cos(_local10) * _local7);
var _local14 = y + (Math.sin(_local10) * _local8);
var _local11 = x + (Math.cos(_local9) * radius);
var _local12 = y + (Math.sin(_local9) * yRadius);
curveTo(_local13, _local14, _local11, _local12);
}
}
function drawRect(x, y, w, h, cornerRadius) {
if (arguments.length < 4) {
return(undefined);
}
if (cornerRadius > 0) {
if (cornerRadius > (Math.min(w, h) / 2)) {
cornerRadius = Math.min(w, h) / 2;
}
var _local7 = Math.PI / 4;
moveTo(x + cornerRadius, y);
lineTo((x + w) - cornerRadius, y);
var _local8 = (-Math.PI) / 2;
var _local9 = ((x + w) - cornerRadius) + ((Math.cos(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
var _local10 = (y + cornerRadius) + ((Math.sin(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
var _local11 = ((x + w) - cornerRadius) + (Math.cos(_local8 + _local7) * cornerRadius);
var _local12 = (y + cornerRadius) + (Math.sin(_local8 + _local7) * cornerRadius);
curveTo(_local9, _local10, _local11, _local12);
_local8 = _local8 + _local7;
_local9 = ((x + w) - cornerRadius) + ((Math.cos(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local10 = (y + cornerRadius) + ((Math.sin(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local11 = ((x + w) - cornerRadius) + (Math.cos(_local8 + _local7) * cornerRadius);
_local12 = (y + cornerRadius) + (Math.sin(_local8 + _local7) * cornerRadius);
curveTo(_local9, _local10, _local11, _local12);
lineTo(x + w, (y + h) - cornerRadius);
_local8 = _local8 + _local7;
_local9 = ((x + w) - cornerRadius) + ((Math.cos(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local10 = ((y + h) - cornerRadius) + ((Math.sin(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local11 = ((x + w) - cornerRadius) + (Math.cos(_local8 + _local7) * cornerRadius);
_local12 = ((y + h) - cornerRadius) + (Math.sin(_local8 + _local7) * cornerRadius);
curveTo(_local9, _local10, _local11, _local12);
_local8 = _local8 + _local7;
_local9 = ((x + w) - cornerRadius) + ((Math.cos(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local10 = ((y + h) - cornerRadius) + ((Math.sin(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local11 = ((x + w) - cornerRadius) + (Math.cos(_local8 + _local7) * cornerRadius);
_local12 = ((y + h) - cornerRadius) + (Math.sin(_local8 + _local7) * cornerRadius);
curveTo(_local9, _local10, _local11, _local12);
lineTo(x + cornerRadius, y + h);
_local8 = _local8 + _local7;
_local9 = (x + cornerRadius) + ((Math.cos(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local10 = ((y + h) - cornerRadius) + ((Math.sin(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local11 = (x + cornerRadius) + (Math.cos(_local8 + _local7) * cornerRadius);
_local12 = ((y + h) - cornerRadius) + (Math.sin(_local8 + _local7) * cornerRadius);
curveTo(_local9, _local10, _local11, _local12);
_local8 = _local8 + _local7;
_local9 = (x + cornerRadius) + ((Math.cos(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local10 = ((y + h) - cornerRadius) + ((Math.sin(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local11 = (x + cornerRadius) + (Math.cos(_local8 + _local7) * cornerRadius);
_local12 = ((y + h) - cornerRadius) + (Math.sin(_local8 + _local7) * cornerRadius);
curveTo(_local9, _local10, _local11, _local12);
lineTo(x, y + cornerRadius);
_local8 = _local8 + _local7;
_local9 = (x + cornerRadius) + ((Math.cos(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local10 = (y + cornerRadius) + ((Math.sin(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local11 = (x + cornerRadius) + (Math.cos(_local8 + _local7) * cornerRadius);
_local12 = (y + cornerRadius) + (Math.sin(_local8 + _local7) * cornerRadius);
curveTo(_local9, _local10, _local11, _local12);
_local8 = _local8 + _local7;
_local9 = (x + cornerRadius) + ((Math.cos(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local10 = (y + cornerRadius) + ((Math.sin(_local8 + (_local7 / 2)) * cornerRadius) / Math.cos(_local7 / 2));
_local11 = (x + cornerRadius) + (Math.cos(_local8 + _local7) * cornerRadius);
_local12 = (y + cornerRadius) + (Math.sin(_local8 + _local7) * cornerRadius);
curveTo(_local9, _local10, _local11, _local12);
} else {
moveTo(x, y);
lineTo(x + w, y);
lineTo(x + w, y + h);
lineTo(x, y + h);
lineTo(x, y);
}
}
function drawPoly(centerX, centerY, numSides, radius, rotation) {
var _local7 = 360 / numSides;
var _local8 = _local7 * 0.075;
var _local9 = _local7 * 0.85;
var _local10 = radius * 0.8;
var _local13 = (Math.PI / 180) * rotation;
moveTo(centerX + (_local10 * Math.cos(((Math.PI / 180) * _local8) + _local13)), centerY + (_local10 * Math.sin(((Math.PI / 180) * _local8) + _local13)));
var _local14 = 1;
for ( ; _local14 <= numSides ; _local14++) {
var _local11 = ((Math.PI / 180) * ((_local8 * ((_local14 * 2) - 1)) + (_local9 * _local14))) + _local13;
var _local12 = ((Math.PI / 180) * ((_local8 * ((_local14 * 2) + 1)) + (_local9 * _local14))) + _local13;
lineTo(centerX + (_local10 * Math.cos(_local11)), centerY + (_local10 * Math.sin(_local11)));
curveTo(centerX + (radius * Math.cos((((Math.PI / 180) * _local7) * _local14) + _local13)), centerY + (radius * Math.sin((((Math.PI / 180) * _local7) * _local14) + _local13)), centerX + (_local10 * Math.cos(_local12)), centerY + (_local10 * Math.sin(_local12)));
}
}
}
Symbol 20481 MovieClip [__Packages.Peg] Frame 0
#initclip
if (!Peg) {
//(_global.Peg = function () {
super();
}) extends com.abowman.ABMovieClip
var _local1 = (_global.Peg /* register */).prototype;
(_global.Peg /* register */).createPeg = function (parent, depth) {
var _local4 = Peg(parent.attachMovie(Peg.symbolName, "peg" + depth, depth));
_local4.init(parent);
return(_local4);
};
_local1.init = function (parent) {
this.pastPegHoles = new Array();
this.board = PegBoard(parent);
this.render();
};
_local1.render = function () {
this.clear();
this.lineStyle(1, 0);
this.beginFill(16711731);
this.drawOval(0, 0, this.radius, this.radius);
this.endFill();
if (this.selected) {
this.lineStyle(2, 0);
this.drawOval(0, 0, this.radius + 1, this.radius + 1);
}
};
_local1.setHole = function (hole) {
this.hole = hole;
this._x = hole._x;
this._y = hole._y;
this._visible = true;
};
_local1.moveBack = function () {
this.hole.removePeg();
PegHole(this.pastPegHoles.pop()).setPeg(this);
};
_local1.removeFromHole = function () {
this.pastPegHoles.push(this.hole);
this.hole.removePeg();
this.hole = null;
this._visible = false;
};
_local1.onPress = function () {
this.board.selectPeg(this);
};
_local1.getRow = function () {
return(this.hole.row);
};
_local1.getCol = function () {
return(this.hole.col);
};
_local1.setSelected = function (selected) {
this.selected = selected;
this.render();
};
ASSetPropFlags(_local1, null, 1);
(_global.Peg /* register */).symbolName = "__Packages.Peg";
(_global.Peg /* register */).symbolLinked = Object.registerClass(Peg.symbolName, Peg);
_local1.radius = 5;
}
#endinitclip
Symbol 20482 MovieClip [__Packages.UndoButton] Frame 0
#initclip
if (!UndoButton) {
//(_global.UndoButton = function () {
super();
}) extends com.abowman.ABMovieClip
var _local1 = (_global.UndoButton /* register */).prototype;
(_global.UndoButton /* register */).createButton = function (parent, depth) {
var _local4 = UndoButton(parent.attachMovie(UndoButton.symbolName, "UndoButton" + depth, depth));
_local4.init(parent);
return(_local4);
};
_local1.init = function () {
this.broadcaster = new Object();
AsBroadcaster.initialize(this.broadcaster);
var _local2 = new TextFormat();
_local2.font = "Arial";
_local2.size = 14;
this.tip = new com.abowman.ToolTip(this, _local2, "Undo", -10, 30, 16777181);
this.render();
};
_local1.render = function () {
var _local2 = 16777215 /* 0xFFFFFF */;
var _local3 = 2;
this.lineStyle(_local3, _local2);
this.beginFill(_local2);
this.drawOval(12.4, 12.4, 12.4, 12.4);
this.endFill();
this.lineStyle(_local3, 0);
this.moveTo(19, 20);
var _local4 = this.drawArc(19, 20, 10, 280, -50);
this.lineStyle(_local3, 0);
this.moveTo(_local4.x, _local4.y);
this.beginFill(0);
this.drawPoly(_local4.x, _local4.y, 3, 3, 45);
this.endFill();
};
_local1.addListener = function (obj) {
this.broadcaster.addListener(obj);
};
_local1.onPress = function () {
this.broadcaster.broadcastMessage("onUndo");
};
ASSetPropFlags(_local1, null, 1);
(_global.UndoButton /* register */).symbolName = "__Packages.UndoButton";
(_global.UndoButton /* register */).symbolLinked = Object.registerClass(UndoButton.symbolName, UndoButton);
}
#endinitclip
Symbol 20483 MovieClip [__Packages.com.abowman.ToolTip] Frame 0
class com.abowman.ToolTip
{
var message, tiptext, ToolTipHolder;
function ToolTip (btn, tiptext, message, xoffset, yoffset, backgroundcolour, bordercolour, delay) {
btn.onRollOver = DisplayToolTip;
btn.onRollOut = CloseToolTip;
this.message = message;
this.tiptext = tiptext;
if (xoffset != undefined) {
this.xoffset = xoffset;
}
if (yoffset != undefined) {
this.yoffset = yoffset;
}
if (backgroundcolour != undefined) {
this.backgroundcolour = backgroundcolour;
}
if (bordercolour != undefined) {
this.bordercolour = bordercolour;
}
if (delay != undefined) {
this.delay = delay;
}
btn.createEmptyMovieClip("ToolTipHolder", 15900);
btn.delay = this.delay;
btn.ToolTipHolder._x = this.xoffset;
btn.ToolTipHolder._y = btn._height + this.yoffset;
btn.ToolTipHolder.createTextField("ToolTipText", 4, 2, 0, 1, 1);
with (btn.ToolTipHolder.ToolTipText) {
text = message;
setTextFormat(this.tiptext);
selectable = false;
_width = textWidth + 8;
_height = textHeight + 5;
if (_width > 200) {
multiline = true;
wordWrap = true;
_width = 200;
_height = textHeight + 5;
}
}
var bgwidth = (btn.ToolTipHolder.ToolTipText.textWidth + 9);
var bgheight = (btn.ToolTipHolder.ToolTipText.textHeight + 4);
btn.ToolTipHolder.createEmptyMovieClip("ToolTipBackground", 2);
with (btn.ToolTipHolder.ToolTipBackground) {
beginFill(this.backgroundcolour, 100);
lineStyle(1, this.bordercolour, 100);
moveTo(0, 0);
lineTo(bgwidth, 0);
lineTo(bgwidth, bgheight);
lineTo(0, bgheight);
lineTo(0, 0);
endFill();
}
btn.ToolTipHolder._visible = false;
}
function DisplayToolTip() {
var delayed = 0;
var delayfor = (delay * 12);
ToolTipHolder.ToolTipText._x = 10000;
ToolTipHolder.onEnterFrame = function () {
if (delayed < delayfor) {
delayed++;
} else {
this._visible = true;
this.ToolTipText._x = 1;
delete this.onEnterFrame;
}
};
}
function CloseToolTip() {
delete ToolTipHolder.onEnterFrame;
ToolTipHolder._visible = false;
}
var xoffset = 2;
var yoffset = 2;
var backgroundcolour = 13421772;
var bordercolour = 0;
var delay = 1;
}
Symbol 20484 MovieClip [__Packages.RefreshButton] Frame 0
#initclip
if (!RefreshButton) {
//(_global.RefreshButton = function () {
super();
}) extends com.abowman.ABMovieClip
var _local1 = (_global.RefreshButton /* register */).prototype;
(_global.RefreshButton /* register */).createButton = function (parent, depth) {
var _local4 = RefreshButton(parent.attachMovie(RefreshButton.symbolName, "RefreshButton" + depth, depth));
_local4.init(parent);
return(_local4);
};
_local1.init = function () {
this.broadcaster = new Object();
AsBroadcaster.initialize(this.broadcaster);
var _local2 = new TextFormat();
_local2.font = "Arial";
_local2.size = 14;
this.tip = new com.abowman.ToolTip(this, _local2, "Reset", -10, 30, 16777181);
this.render();
};
_local1.render = function () {
var _local2 = 16777215 /* 0xFFFFFF */;
var _local3 = 2;
this.lineStyle(_local3, _local2);
this.beginFill(_local2);
this.drawOval(12.4, 12.4, 12.4, 12.4);
this.endFill();
this.lineStyle(_local3, 0);
this.moveTo(20, 6);
var _local4 = this.drawArc(20, 6, 10, 130, 40);
this.lineStyle(_local3, _local2);
var _local5 = this.drawArc(_local4.x, _local4.y, 10, 50, 170);
this.lineStyle(_local3, 0);
this.moveTo(_local4.x, _local4.y);
this.beginFill(0);
this.drawPoly(_local4.x, _local4.y, 3, 3, 100);
this.endFill();
this.moveTo(_local5.x, _local5.y);
_local5 = this.drawArc(_local5.x, _local5.y, 10, 130, 220);
this.moveTo(_local5.x, _local5.y);
this.beginFill(0);
this.drawPoly(_local5.x, _local5.y, 3, 3, 40);
this.endFill();
};
_local1.addListener = function (obj) {
this.broadcaster.addListener(obj);
};
_local1.onPress = function () {
this.broadcaster.broadcastMessage("onRefresh");
};
ASSetPropFlags(_local1, null, 1);
(_global.RefreshButton /* register */).symbolName = "__Packages.RefreshButton";
(_global.RefreshButton /* register */).symbolLinked = Object.registerClass(RefreshButton.symbolName, RefreshButton);
}
#endinitclip
Symbol 20485 MovieClip [__Packages.Application] Frame 0
#initclip
if (!Application) {
//(_global.Application = function () {
super();
}) extends com.abowman.ABMovieClip
var _local1 = (_global.Application /* register */).prototype;
_local1.init = function () {
var _local2 = new ContextMenu();
_local2.hideBuiltInItems();
var _local3 = new ContextMenuItem("Get more games at aBowman.com", function () {
getURL ("http://aBowman.com/google-modules/", "_top");
});
var _local4 = new ContextMenuItem("Play the full-page version", function () {
getURL ("http://abowman.com/pegs.htm", "_top");
});
_local2.customItems.push(_local3, _local4);
_root.menu = _local2;
this.setUpBoard();
this.refreshButton = RefreshButton.createButton(this, this.getNextHighestDepth());
this.refreshButton._xscale = 125;
this.refreshButton._yscale = 125;
this.refreshButton._x = 165;
this.refreshButton._y = 10;
this.refreshButton.addListener(this);
this.undoButton = UndoButton.createButton(this, this.getNextHighestDepth());
this.undoButton._xscale = 125;
this.undoButton._yscale = 125;
this.undoButton._x = 210;
this.undoButton._y = 10;
this.undoButton.addListener(this);
};
_local1.onRefresh = function () {
this.board.removeMovieClip();
this.setUpBoard();
};
_local1.setUpBoard = function () {
this.depth = 1000;
this.board = PegBoard.createPegBoard(this, this.depth);
this.board._x = 5;
this.board._y = 15;
this.board._xscale = 170;
this.board._yscale = 170;
};
_local1.onUndo = function () {
this.board.undoMove();
};
(_global.Application /* register */).create = function (parent, depth) {
var _local4 = Application(parent.attachMovie(Application.symbolName, "Application" + depth, depth));
_local4.init();
return(_local4);
};
(_global.Application /* register */).main = function (mc) {
Application.create(_root, _root.getNextHighestDepth());
};
ASSetPropFlags(_local1, null, 1);
(_global.Application /* register */).symbolName = "__Packages.Application";
(_global.Application /* register */).symbolLinked = Object.registerClass(Application.symbolName, Application);
_local1.depth = 1000;
}
#endinitclip
Symbol 20486 MovieClip [__Packages.PegBoard] Frame 0
#initclip
if (!PegBoard) {
//(_global.PegBoard = function () {
super();
}) extends com.abowman.ABMovieClip
var _local1 = (_global.PegBoard /* register */).prototype;
(_global.PegBoard /* register */).createPegBoard = function (parent, depth) {
var _local4 = PegBoard(parent.attachMovie(PegBoard.symbolName, "pegBoard" + depth, depth));
_local4.init();
return(_local4);
};
_local1.init = function () {
this.pegMoveOrder = new Array();
this.render();
this.pegHoles = new Array(new Array("o", "o", "o", "o", "o", "o"), new Array("o", "o", "o", "o", "o"), new Array("o", "o", "o", "o"), new Array("o", "o", "o"), new Array("o", "o"), new Array("o"));
var _local3 = 0;
for ( ; _local3 < this.pegHoles.length ; _local3++) {
var _local4 = 0;
for ( ; _local4 < this.pegHoles[_local3].length ; _local4++) {
var _local2 = PegHole.createPegHole(_local4, _local3, this, this.holeDepth + (this.depth++));
_local2._x = (((this.spacing * 0.5) * _local3) + (this.spacing * _local4)) + this.boardX;
_local2._y = ((0.866025405 * this.spacing) * _local3) + this.boardY;
if (this.pegHoles[_local3][_local4] == "o") {
_local2.setPeg(Peg.createPeg(this, this.pegDepth + this.depth));
}
this.pegHoles[_local3][_local4] = _local2;
}
}
this._rotation = 60;
};
_local1.render = function () {
this.lineStyle(1, 5263440);
this.beginFill(15785052);
this.drawPoly((50 + this.boardX) - 0.75, (30 + this.boardY) - 0.75, 3, 90, -30);
this.endFill();
};
_local1.selectPeg = function (peg) {
if (this.pegRemoved == false) {
peg.removeFromHole();
this.pegRemoved = true;
} else if (this.selectedPeg != peg) {
this.selectedPeg.setSelected(false);
this.selectedPeg = peg;
this.selectedPeg.setSelected(true);
this.getPossibleMoves(peg);
}
};
_local1.getPossibleMoves = function (peg) {
while (this.possibleMoves.length > 0) {
this.possibleMoves.pop().setPossibleMove(false);
}
this.possibleMoves = new Array();
var _local3 = peg.getRow();
var _local4 = peg.getCol();
var _local9 = -2;
for ( ; _local9 <= 2 ; _local9 = _local9 + 2) {
var _local5 = _local3 + _local9;
var _local7 = _local3 + (_local9 / 2);
if ((_local5 < this.pegHoles.length) && (_local5 >= 0)) {
var _local10 = -2;
for ( ; _local10 <= 2 ; _local10 = _local10 + 2) {
if (!(((_local9 == -2) && (_local10 == -2)) || ((_local9 == 2) && (_local10 == 2)))) {
var _local6 = _local4 + _local10;
var _local8 = _local4 + (_local10 / 2);
if (this.pegHoles[_local7][_local8].hasPeg()) {
if (((_local6 < this.pegHoles[_local5].length) && (_local6 >= 0)) && (((_local5 != _local3) || (_local6 != _local4)) && (!this.pegHoles[_local5][_local6].hasPeg()))) {
this.possibleMoves.push(this.pegHoles[_local5][_local6]);
this.pegHoles[_local5][_local6].setPossibleMove(true);
}
}
}
}
}
}
};
_local1.movePegTo = function (pegHole) {
var _local3 = this.getPegToJump(this.selectedPeg, pegHole);
this.selectedPeg.removeFromHole();
_local3.removeFromHole();
pegHole.setPeg(this.selectedPeg);
this.pegMoveOrder.push(this.selectedPeg);
this.pegMoveOrder.push(_local3);
this.getPossibleMoves(this.selectedPeg);
};
_local1.getPegToJump = function (peg, pegHole) {
var _local4 = peg.getRow();
var _local5 = peg.getCol();
var _local6 = pegHole.getRow();
var _local7 = pegHole.getCol();
var _local8 = _local4 - ((_local4 - _local6) / 2);
var _local9 = _local5 - ((_local5 - _local7) / 2);
return(this.pegHoles[_local8][_local9].getPeg());
};
_local1.undoMove = function () {
if (this.pegRemoved) {
Peg(this.pegMoveOrder.pop()).moveBack();
var _local2 = Peg(this.pegMoveOrder.pop());
_local2.moveBack();
this.selectPeg(_local2);
this.getPossibleMoves(_local2);
}
};
ASSetPropFlags(_local1, null, 1);
(_global.PegBoard /* register */).symbolName = "__Packages.PegBoard";
(_global.PegBoard /* register */).symbolLinked = Object.registerClass(PegBoard.symbolName, PegBoard);
_local1.holeDepth = 100;
_local1.pegDepth = 200;
_local1.depth = 100;
_local1.spacing = 20;
_local1.pegRemoved = false;
_local1.boardX = 56;
_local1.boardY = -51;
}
#endinitclip
Symbol 20487 MovieClip [__Packages.PegHole] Frame 0
#initclip
if (!PegHole) {
//(_global.PegHole = function () {
super();
}) extends com.abowman.ABMovieClip
var _local1 = (_global.PegHole /* register */).prototype;
(_global.PegHole /* register */).createPegHole = function (col, row, parent, depth) {
var _local6 = PegHole(parent.attachMovie(PegHole.symbolName, "pegHole" + depth, depth));
_local6.init(parent, col, row);
return(_local6);
};
_local1.init = function (parent, col, row) {
this.board = PegBoard(parent);
this.col = col;
this.row = row;
this.render();
};
_local1.render = function () {
this.clear();
this.lineStyle(1, 0);
this.beginFill(0);
this.lineStyle(2, 15785052);
this.drawOval(0, 0, this.radius + 2, this.radius + 2);
this.endFill();
this.drawOval(0, 0, this.radius + 4, this.radius + 4);
};
_local1.setPeg = function (peg) {
this.peg = peg;
peg.setHole(this);
};
_local1.hasPeg = function () {
return(this.peg != null);
};
_local1.removePeg = function () {
this.peg = null;
};
_local1.getRow = function () {
return(this.row);
};
_local1.getCol = function () {
return(this.col);
};
_local1.setPossibleMove = function (possibleMove) {
this.possibleMove = possibleMove;
this.render();
};
_local1.onPress = function () {
if (this.possibleMove) {
this.board.movePegTo(this);
}
};
_local1.getPeg = function () {
return(this.peg);
};
ASSetPropFlags(_local1, null, 1);
(_global.PegHole /* register */).symbolName = "__Packages.PegHole";
(_global.PegHole /* register */).symbolLinked = Object.registerClass(PegHole.symbolName, PegHole);
_local1.radius = 2;
}
#endinitclip