Frame 2
function Init() {
Score = 0;
Lines = 0;
Field = new Array(consts.FIELDHEIGHT);
var _local1 = 0;
while (consts.FIELDHEIGHT > _local1) {
Field[_local1] = new Array(consts.FIELDWIDTH);
_local1++;
}
Enabled = true;
CurrentX = -1;
CurrentY = -1;
}
function SetCellAllow(x, y) {
var _local1 = y;
var _local2 = x;
Field[_local2][_local1].Allow = ((0 == Field[_local2][_local1].State) ? 3 : 1);
Field[_local2][_local1].gotoAndStop(Field[_local2][_local1].Allow);
if (((0 < _local2) && (2 != Field[_local2 - 1][_local1].State)) && (2 == Field[_local2 - 1][_local1].Allow)) {
SetCellAllow(_local2 - 1, _local1);
}
if (((0 < _local1) && (2 != Field[_local2][_local1 - 1].State)) && (2 == Field[_local2][_local1 - 1].Allow)) {
SetCellAllow(_local2, _local1 - 1);
}
if (((consts.FIELDWIDTH > (_local2 + 1)) && (2 != Field[_local2 + 1][_local1].State)) && (2 == Field[_local2 + 1][_local1].Allow)) {
SetCellAllow(_local2 + 1, _local1);
}
if (((consts.FIELDHEIGHT > (_local1 + 1)) && (2 != Field[_local2][_local1 + 1].State)) && (2 == Field[_local2][_local1 + 1].Allow)) {
SetCellAllow(_local2, _local1 + 1);
}
}
function Unselect() {
if (0 <= CurrentX) {
Field[CurrentX][CurrentY].Ball.gotoAndStop(13);
CurrentX = (CurrentY = -1);
}
var _local2 = 0;
while (consts.FIELDHEIGHT > _local2) {
var _local1 = 0;
while (consts.FIELDWIDTH > _local1) {
Field[_local1][_local2].gotoAndStop(1);
Field[_local1][_local2].Allow = 1;
_local1++;
}
_local2++;
}
}
function Select(x, y) {
var _local3 = y;
if (!Enabled) {
} else {
CurrentX = x;
CurrentY = _local3;
Field[CurrentX][CurrentY].Ball.gotoAndPlay(14);
var _local2 = 0;
while (consts.FIELDHEIGHT > _local2) {
var _local1 = 0;
while (consts.FIELDWIDTH > _local1) {
Field[_local1][_local2].gotoAndStop(2);
Field[_local1][_local2].Allow = 2;
_local1++;
}
_local2++;
}
SetCellAllow(x, _local3);
Field[x][_local3].gotoAndStop(1);
Field[x][_local3].Allow = 1;
}
}
function FindLines(x, y) {
SameColor = Field[x][y].AColor;
var i = 0;
while (4 > i) {
if (0 == i) {
var dx = 0;
var _local3 = 1;
} else if (1 == i) {
var dx = 1;
var _local3 = 0;
} else if (2 == i) {
var dx = 1;
var _local3 = 1;
} else if (3 == i) {
var dx = 1;
var _local3 = -1;
}
var n = 1;
var _local2 = x + dx;
var _local1 = y + _local3;
while (((((SameColor == Field[_local2][_local1].AColor) && (2 == Field[_local2][_local1].State)) && (consts.FIELDHEIGHT > _local1)) && (_local1 >= 0)) && (consts.FIELDWIDTH > _local2)) {
n++;
_local2 = _local2 + dx;
_local1 = _local1 + _local3;
}
_local2 = x - dx;
_local1 = y - _local3;
while (((((SameColor == Field[_local2][_local1].AColor) && (2 == Field[_local2][_local1].State)) && (0 <= _local1)) && (consts.FIELDHEIGHT > _local1)) && (0 <= _local2)) {
n++;
_local2 = _local2 - dx;
_local1 = _local1 - _local3;
}
if (consts.LINELENGTH <= n) {
Lines++;
Score = Score + (10 + ((n - consts.LINELENGTH) * 4));
_local2 = _local2 + dx;
_local1 = _local1 + _local3;
while (((((SameColor == Field[_local2][_local1].AColor) && (2 == Field[_local2][_local1].State)) && (consts.FIELDHEIGHT > _local1)) && (_local1 >= 0)) && (consts.FIELDWIDTH > _local2)) {
Field[_local2][_local1].AColor = 0;
Field[_local2][_local1].State = 0;
Field[_local2][_local1].Ball.gotoAndPlay(29);
FreeCells++;
_local2 = _local2 + dx;
_local1 = _local1 + _local3;
}
return(true);
}
i++;
}
return(false);
}
function Pop() {
var _local1 = new Array(3);
var _local3 = 0;
var Result = false;
var i = 0;
while (consts.FIELDHEIGHT > i) {
var _local2 = 0;
while (consts.FIELDWIDTH > _local2) {
if (1 == Field[_local2][i].State) {
Field[_local2][i].State = 2;
_local1[_local3] = new Object();
_local1[_local3].X = _local2;
_local1[_local3].Y = i;
_local3++;
}
_local2++;
}
i++;
}
var i = 0;
while (_local3 > i) {
if ((!FindLines(_local1[i].X, _local1[i].Y)) && (0 != Field[_local1[i].X][_local1[i].Y].State)) {
_local1[i].Removed = false;
} else {
_local1[i].Removed = true;
Result = true;
}
i++;
}
var i = 0;
while (_local3 > i) {
if (!_local1[i].Removed) {
Field[_local1[i].X][_local1[i].Y].Ball.gotoAndPlay(8);
}
i++;
}
var i = 0;
while ((consts.MEWBALLSCOUNT > i) && (0 < FreeCells)) {
do {
var tx = Math.floor(Math.random() * consts.FIELDWIDTH);
var ty = Math.floor(Math.random() * consts.FIELDHEIGHT);
} while (0 != Field[tx][ty].State);
Field[tx][ty].State = 1;
Field[tx][ty].AColor = Math.Floor((Math.random() * consts.COLORQUANTITY) + 1);
Field[tx][ty].Ball = attachMovie("balljump", (("Ball" + tx) + "_") + ty, ((consts.FIELDWIDTH * consts.FIELDHEIGHT) + (ty * consts.FIELDHEIGHT)) + tx);
Field[tx][ty].Ball._x = 25 + (tx * 50);
Field[tx][ty].Ball._y = 25 + (ty * 50);
Field[tx][ty].Ball.AColor = Field[tx][ty].AColor;
Field[tx][ty].Ball.Ball.gotoAndStop(Field[tx][ty].AColor);
Field[tx][ty].Ball.gotoAndPlay(1);
FreeCells--;
i++;
}
if (0 == FreeCells) {
GameOver = attachMovie("gameover", "go", (consts.FIELDWIDTH * consts.FIELDHEIGHT) * 3);
GameOver._y = 200;
GameOver._x = 275;
}
return(Result);
}
function BeginGame() {
Init();
FreeCells = consts.FIELDWIDTH * consts.FIELDHEIGHT;
var _local2 = 0;
while (consts.FIELDHEIGHT > _local2) {
var _local1 = 0;
while (consts.FIELDWIDTH > _local1) {
Field[_local1][_local2] = attachMovie("id_cell", (("Cell" + _local2) + "_") + "j", (_local1 * consts.FIELDWIDTH) + _local2);
Field[_local1][_local2]._x = _local1 * 50;
Field[_local1][_local2]._y = _local2 * 50;
Field[_local1][_local2].Allow = 1;
Field[_local1][_local2].AColor = 0;
Field[_local1][_local2].State = 0;
_local1++;
}
_local2++;
}
Pop();
Pop();
}
function PathStep(targx, targy) {
Field[Path[PIndex].X][Path[PIndex].Y].PathLen = Path[PIndex].N;
if ((Path[PIndex].X == targx) && (Path[PIndex].Y == targy)) {
return(true);
}
if (((0 < Path[PIndex].X) && (2 != Field[Path[PIndex].X - 1][Path[PIndex].Y].Allow)) && (Field[Path[PIndex].X - 1][Path[PIndex].Y].PathLen > (Path[PIndex].N + 1))) {
Path[EIndex] = new Object();
Path[EIndex].X = Path[PIndex].X - 1;
Path[EIndex].Y = Path[PIndex].Y;
Path[EIndex].N = Path[PIndex].N + 1;
EIndex++;
}
if (((consts.FIELDWIDTH > (Path[PIndex].X + 1)) && (2 != Field[Path[PIndex].X + 1][Path[PIndex].Y].Allow)) && (Field[Path[PIndex].X + 1][Path[PIndex].Y].PathLen > (Path[PIndex].N + 1))) {
Path[EIndex] = new Object();
Path[EIndex].X = Path[PIndex].X + 1;
Path[EIndex].Y = Path[PIndex].Y;
Path[EIndex].N = Path[PIndex].N + 1;
EIndex++;
}
if (((0 < Path[PIndex].Y) && (2 != Field[Path[PIndex].X][Path[PIndex].Y - 1].Allow)) && (Field[Path[PIndex].X][Path[PIndex].Y - 1].PathLen > (Path[PIndex].N + 1))) {
Path[EIndex] = new Object();
Path[EIndex].X = Path[PIndex].X;
Path[EIndex].Y = Path[PIndex].Y - 1;
Path[EIndex].N = Path[PIndex].N + 1;
EIndex++;
}
if (((consts.FIELDHEIGHT > (Path[PIndex].Y + 1)) && (2 != Field[Path[PIndex].X][Path[PIndex].Y + 1].Allow)) && (Field[Path[PIndex].X][Path[PIndex].Y + 1].PathLen > (Path[PIndex].N + 1))) {
Path[EIndex] = new Object();
Path[EIndex].X = Path[PIndex].X;
Path[EIndex].Y = Path[PIndex].Y + 1;
Path[EIndex].N = Path[PIndex].N + 1;
EIndex++;
}
return(false);
}
function FindPathAndGo(x, y, targx, targy) {
var i = 0;
while (consts.FIELDHEIGHT > i) {
var j = 0;
while (consts.FIELDWIDTH > j) {
Field[j][i].PathLen = consts.FIELDWIDTH * consts.FIELDHEIGHT;
j++;
}
i++;
}
Field[x][y].PathLen = 0;
Path = new Array();
PIndex = 0;
EIndex = 1;
Path[0] = new Object();
Path[0].X = x;
Path[0].Y = y;
Path[0].N = 0;
while (!PathStep(targx, targy)) {
PIndex++;
}
var PathLength = Field[targx][targy].PathLen;
ThePath = new Array(PathLength);
var _local3 = targx;
var _local2 = targy;
ThePath[PathLength - 1] = new Object();
ThePath[PathLength - 1].X = _local3;
ThePath[PathLength - 1].Y = _local2;
var _local1 = PathLength - 2;
while (0 <= _local1) {
if ((0 < _local2) && (Field[_local3][_local2 - 1].PathLen < Field[_local3][_local2].PathLen)) {
_local2--;
ThePath[_local1] = new Object();
ThePath[_local1].X = _local3;
ThePath[_local1].Y = _local2;
_local1--;
} else if ((consts.FIELDHEIGHT > (_local2 + 1)) && (Field[_local3][_local2 + 1].PathLen < Field[_local3][_local2].PathLen)) {
_local2++;
ThePath[_local1] = new Object();
ThePath[_local1].X = _local3;
ThePath[_local1].Y = _local2;
_local1--;
} else if ((0 < _local3) && (Field[_local3 - 1][_local2].PathLen < Field[_local3][_local2].PathLen)) {
_local3--;
ThePath[_local1] = new Object();
ThePath[_local1].X = _local3;
ThePath[_local1].Y = _local2;
_local1--;
} else if ((consts.FIELDWIDTH > (_local3 + 1)) && (Field[_local3 + 1][_local2].PathLen < Field[_local3][_local2].PathLen)) {
_local3++;
ThePath[_local1] = new Object();
ThePath[_local1].X = _local3;
ThePath[_local1].Y = _local2;
_local1--;
}
}
delete Path;
}
function MoveBall(x, y) {
var _local1 = y;
var _local2 = x;
Enabled = false;
Field[_local2][_local1].AColor = Field[CurrentX][CurrentY].AColor;
Field[_local2][_local1].State = Field[CurrentX][CurrentY].State;
Field[CurrentX][CurrentY].AColor = 0;
Field[CurrentX][CurrentY].State = 0;
Field[CurrentX][CurrentY].Ball.removeMovieClip();
Field[_local2][_local1].Ball = attachMovie("ballmovie", (("Ball" + _local2) + "_") + _local1, ((consts.FIELDWIDTH * consts.FIELDHEIGHT) + (_local1 * consts.FIELDHEIGHT)) + _local2);
Field[_local2][_local1].Ball._x = (CurrentX * 50) + 25;
Field[_local2][_local1].Ball._y = (CurrentY * 50) + 25;
Field[_local2][_local1].Ball.Ball.gotoAndStop(Field[_local2][_local1].AColor);
FindPathAndGo(CurrentX, CurrentY, _local2, _local1);
Field[_local2][_local1].Ball.Path = ThePath;
Field[_local2][_local1].Ball.PathPos = 0;
Field[_local2][_local1].Ball.PathLen = Field[_local2][_local1].PathLen;
Field[_local2][_local1].Ball.gotoAndPlay(1);
}
function OnBallArrive(x, y) {
var _local1 = y;
var _local2 = x;
Field[_local2][_local1].Ball.removeMovieClip();
Field[_local2][_local1].Ball = attachMovie("balljump", (("Ball" + _local2) + "_") + _local1, ((consts.FIELDWIDTH * consts.FIELDHEIGHT) + (_local1 * consts.FIELDHEIGHT)) + _local2);
Field[_local2][_local1].Ball._x = (_local2 * 50) + 25;
Field[_local2][_local1].Ball._y = (_local1 * 50) + 25;
Field[_local2][_local1].Ball.AColor = Field[_local2][_local1].AColor;
Field[_local2][_local1].Ball.Ball.gotoAndStop(Field[_local2][_local1].AColor);
Unselect();
if ((!(FindLines(_local2, _local1) || (Pop()))) || (2 == Field[_local2][_local1].State)) {
Field[_local2][_local1].Ball.gotoAndStop(13);
}
delete ThePath;
Enabled = true;
}
function OnStartPress() {
gotoAndStop (3);
}
function OnRestartClick() {
var _local2 = 0;
while (consts.FIELDHEIGHT > _local2) {
var _local1 = 0;
while (consts.FIELDWIDTH > _local1) {
Field[_local1][_local2].Ball.removeMovieClip();
Field[_local1][_local2].removeMovieClip();
_local1++;
}
_local2++;
}
delete Field;
GameOver.removeMovieClip();
BeginGame();
gotoAndStop (3);
}
consts = new Object();
consts.FIELDWIDTH = 9;
consts.FIELDHEIGHT = 9;
consts.COLORQUANTITY = 7;
consts.MEWBALLSCOUNT = 3;
consts.LINELENGTH = 5;
stop();
Instance of Symbol 61 MovieClip [FPushButtonSymbol] "btStart" in Frame 2
//component parameters
onClipEvent (initialize) {
label = "Start";
clickHandler = "OnStartPress";
}
Frame 3
Title.gotoAndStop(15);
BeginGame();
stop();
Instance of Symbol 61 MovieClip [FPushButtonSymbol] in Frame 3
//component parameters
onClipEvent (initialize) {
label = "Restart";
clickHandler = "OnRestartClick";
}
Instance of Symbol 72 MovieClip "Title" in Frame 3
on (rollOver) {
gotoAndPlay (1);
}
on (rollOut) {
gotoAndStop (15);
}
on (release) {
getURL ("mailto:zdmitry@mail.ru");
}
Symbol 5 MovieClip [FLabelSymbol] Frame 1
#initclip 2
_global.FLabelClass = function () {
var _local1 = this;
if (_local1.hostComponent == undefined) {
_local1.hostComponent = ((_local1._parent.controller == undefined) ? (_local1._parent) : (_local1._parent.controller));
}
if (_local1.customTextStyle == undefined) {
if (_local1.hostComponent.textStyle == undefined) {
_local1.hostComponent.textStyle = new TextFormat();
}
_local1.textStyle = _local1.hostComponent.textStyle;
_local1.enable = true;
}
};
FLabelClass.prototype = new MovieClip();
Object.registerClass("FLabelSymbol", FLabelClass);
FLabelClass.prototype.setLabel = function (label) {
var _local1 = this;
var _local2 = _local1.hostComponent.styleTable.embedFonts.value;
if (_local2 != undefined) {
_local1.labelField.embedFonts = _local2;
}
_local1.labelField.setNewTextFormat(_local1.textStyle);
_local1.labelField.text = label;
_local1.labelField._height = _local1.labelField.textHeight + 2;
};
FLabelClass.prototype.setSize = function (width) {
this.labelField._width = width;
};
FLabelClass.prototype.setEnabled = function (enable) {
var _local2 = this;
var _local3 = enable;
_local2.enable = _local3;
var _local1 = _local2.hostComponent.styleTable[(_local3 ? "textColor" : "textDisabled")].value;
if (_local1 == undefined) {
_local1 = (_local3 ? 0 : 8947848);
}
_local2.setColor(_local1);
};
FLabelClass.prototype.getLabel = function () {
return(this.labelField.text);
};
FLabelClass.prototype.setColor = function (col) {
this.labelField.textColor = col;
};
#endinitclip
Symbol 14 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame3, "shadow");
component.registerSkinElement(frame1, "darkshadow");
component.registerSkinElement(frame4, "highlight");
component.registerSkinElement(frame2, "highlight3D");
Symbol 20 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame3, "shadow");
component.registerSkinElement(frame1, "darkshadow");
component.registerSkinElement(frame4, "highlight");
component.registerSkinElement(frame2, "highlight3D");
Symbol 26 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame4, "shadow");
component.registerSkinElement(frame2, "darkshadow");
component.registerSkinElement(frame3, "highlight");
component.registerSkinElement(frame1, "highlight3D");
Symbol 32 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame3, "shadow");
component.registerSkinElement(frame1, "darkshadow");
component.registerSkinElement(frame4, "highlight");
component.registerSkinElement(frame2, "highlight3D");
Symbol 33 MovieClip [fpb_states] Frame 1
stop();
Symbol 33 MovieClip [fpb_states] Frame 2
stop();
Symbol 33 MovieClip [fpb_states] Frame 3
stop();
Symbol 33 MovieClip [fpb_states] Frame 4
stop();
Symbol 34 MovieClip [FUIComponentSymbol] Frame 1
#initclip 1
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
var _local1 = this;
var _local3 = _global;
_local1.enable = true;
_local1.focused = false;
_local1.useHandCursor = false;
_local1._accImpl = new Object();
_local1._accImpl.stub = true;
_local1.styleTable = new Array();
if (_local3.globalStyleFormat == undefined) {
_local3.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_local3._focusControl = new Object();
_local3._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_local3._focusControl);
}
if (_local1._name != undefined) {
_local1._focusrect = false;
_local1.tabEnabled = true;
_local1.focusEnabled = true;
_local1.tabChildren = false;
_local1.tabFocused = true;
if (_local1.hostStyle == undefined) {
globalStyleFormat.addListener(_local1);
} else {
_local1.styleTable = _local1.hostStyle;
}
_local1.deadPreview._visible = false;
_local1.deadPreview._width = (_local1.deadPreview._height = 1);
_local1.methodTable = new Object();
_local1.keyListener = new Object();
_local1.keyListener.controller = _local1;
_local1.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
_local1.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var _local2 in _local1.styleFormat_prm) {
_local1.setStyleProperty(_local2, _local1.styleFormat_prm[_local2]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
var _local1 = this;
_local1.enable = ((arguments.length > 0) ? (enabledFlag) : true);
_local1.tabEnabled = (_local1.focusEnabled = enabledFlag);
if ((!_local1.enable) && (_local1.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
var _local1 = this;
_local1.width = w;
_local1.height = h;
_local1.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
var _local1 = this;
_local1.handlerObj = ((obj == undefined) ? (_local1._parent) : (obj));
_local1.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
var _local1 = this;
_local1.methodTable[methodName] = true;
_local1.onEnterFrame = _local1.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
var _local1 = this;
if (_local1.methodTable.setSize) {
_local1.setSize(_local1.width, _local1.height);
} else {
_local1.cleanUINotSize();
}
_local1.methodTable = new Object();
delete _local1.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
var _local1 = this;
for (var _local2 in _local1.methodTable) {
_local1[_local2]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var _local1 = this;
var _local2 = y;
var _local3 = x;
var inner = _local1.styleTable.focusRectInner.value;
var outer = _local1.styleTable.focusRectOuter.value;
if (inner == undefined) {
inner = 16777215 /* 0xFFFFFF */;
}
if (outer == undefined) {
outer = 0;
}
_local1.createEmptyMovieClip("focusRect", 1000);
_local1.focusRect.controller = _local1;
_local1.focusRect.lineStyle(1, outer);
_local1.focusRect.moveTo(_local3, _local2);
_local1.focusRect.lineTo(_local3 + w, _local2);
_local1.focusRect.lineTo(_local3 + w, _local2 + h);
_local1.focusRect.lineTo(_local3, _local2 + h);
_local1.focusRect.lineTo(_local3, _local2);
_local1.focusRect.lineStyle(1, inner);
_local1.focusRect.moveTo(_local3 + 1, _local2 + 1);
_local1.focusRect.lineTo((_local3 + w) - 1, _local2 + 1);
_local1.focusRect.lineTo((_local3 + w) - 1, (_local2 + h) - 1);
_local1.focusRect.lineTo(_local3 + 1, (_local2 + h) - 1);
_local1.focusRect.lineTo(_local3 + 1, _local2 + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
var _local1 = this;
_local1.tabFocused = false;
_local1.focusRect.removeMovieClip();
Selection.setFocus(_local1);
};
FUIComponentClass.prototype.drawFocusRect = function () {
var _local1 = this;
_local1.drawRect(-2, -2, _local1.width + 4, _local1.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
var _local1 = this;
_local1.focused = true;
Key.addListener(_local1.keyListener);
if (_local1.tabFocused) {
_local1.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
var _local1 = this;
_local1.tabFocused = true;
_local1.focused = false;
_local1.focusRect.removeMovieClip();
Key.removeListener(_local1.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
var _local1 = this;
_local1.handlerObj[_local1.changeHandler](_local1);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
var _local1 = this;
var _local2 = propName;
if (value == "") {
} else {
var tmpValue = parseInt(value);
if (!isNaN(tmpValue)) {
value = tmpValue;
}
var global = ((arguments.length > 2) ? (isGlobal) : false);
if (_local1.styleTable[_local2] == undefined) {
_local1.styleTable[_local2] = new Object();
_local1.styleTable[_local2].useGlobal = true;
}
if (_local1.styleTable[_local2].useGlobal || (!global)) {
_local1.styleTable[_local2].value = value;
if (_local1.setCustomStyleProperty(_local2, value)) {
} else if (_local2 == "embedFonts") {
_local1.invalidate("setSize");
} else if (_local2.subString(0, 4) == "text") {
if (_local1.textStyle == undefined) {
_local1.textStyle = new TextFormat();
}
var textProp = _local2.subString(4, _local2.length);
_local1.textStyle[textProp] = value;
_local1.invalidate("setSize");
} else {
for (var j in _local1.styleTable[_local2].coloredMCs) {
var _local3 = new Color(_local1.styleTable[_local2].coloredMCs[j]);
if (_local1.styleTable[_local2].value == undefined) {
var myTObj = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_local3.setTransform(myTObj);
} else {
_local3.setRGB(value);
}
}
}
_local1.styleTable[_local2].useGlobal = global;
}
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
var _local1 = this;
var _local2 = propName;
if (_local1.styleTable[_local2] == undefined) {
_local1.styleTable[_local2] = new Object();
_local1.styleTable[_local2].useGlobal = true;
}
if (_local1.styleTable[_local2].coloredMCs == undefined) {
_local1.styleTable[_local2].coloredMCs = new Object();
}
_local1.styleTable[_local2].coloredMCs[skinMCRef] = skinMCRef;
if (_local1.styleTable[_local2].value != undefined) {
var _local3 = new Color(skinMCRef);
_local3.setRGB(_local1.styleTable[_local2].value);
}
};
_global.FStyleFormat = function () {
var _local1 = arguments;
var _local2 = this;
_local2.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
_local2.listeners = new Object();
_local2.isGlobal = false;
if (_local1.length > 0) {
for (var _local3 in _local1[0]) {
_local2[_local3] = _local1[0][_local3];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var _local1 = this;
var _local2 = 0;
while (_local2 < arguments.length) {
var _local3 = arguments[_local2];
_local1.listeners[arguments[_local2]] = _local3;
for (var i in _local1) {
if (_local1.isAStyle(i)) {
_local3.updateStyleProperty(_local1, i.toString());
}
}
_local2++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
var _local1 = this;
var _local2 = component;
_local1.listeners[_local2] = undefined;
for (var prop in _local1) {
if (_local1.isAStyle(prop)) {
if (_local2.styleTable[prop].useGlobal == _local1.isGlobal) {
_local2.styleTable[prop].useGlobal = true;
var _local3 = (_local1.isGlobal ? undefined : (globalStyleFormat[prop]));
_local2.setStyleProperty(prop, _local3, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var _local1 = this;
var _local2 = arguments;
var count = 0;
for (var i in _local1.listeners) {
var _local3 = _local1.listeners[i];
if (_local2.length > 0) {
var j = 0;
while (j < _local2.length) {
if (_local1.isAStyle(_local2[j])) {
_local3.updateStyleProperty(_local1, _local2[j]);
}
j++;
}
} else {
for (var j in _local1) {
if (_local1.isAStyle(j)) {
_local3.updateStyleProperty(_local1, j.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 47 MovieClip [Ball] Frame 1
stop();
Symbol 48 MovieClip [balljump] Frame 1
function AssignBall() {
Ball.gotoAndStop(AColor);
}
AssignBall();
Symbol 48 MovieClip [balljump] Frame 7
AssignBall();
stop();
Symbol 48 MovieClip [balljump] Frame 8
function AssignBall() {
Ball.gotoAndStop(AColor);
}
AssignBall();
Symbol 48 MovieClip [balljump] Frame 13
AssignBall();
stop();
Instance of Symbol 47 MovieClip [Ball] "Ball" in Symbol 48 MovieClip [balljump] Frame 13
on (release) {
_root.Unselect();
_root.Select(Math.floor(_root._xmouse / 50), Math.floor(_root._ymouse / 50));
}
Symbol 48 MovieClip [balljump] Frame 14
AssignBall();
Symbol 48 MovieClip [balljump] Frame 18
AssignBall();
Symbol 48 MovieClip [balljump] Frame 22
AssignBall();
Symbol 48 MovieClip [balljump] Frame 25
AssignBall();
Symbol 48 MovieClip [balljump] Frame 27
gotoAndPlay (14);
Symbol 48 MovieClip [balljump] Frame 28
AssignBall();
Symbol 48 MovieClip [balljump] Frame 29
AssignBall();
Symbol 48 MovieClip [balljump] Frame 35
this.removeMovieClip();
Symbol 51 MovieClip [id_cell] Frame 1
stop();
Instance of Symbol 50 MovieClip in Symbol 51 MovieClip [id_cell] Frame 3
on (release) {
_root.MoveBall(Math.floor(_root._xmouse / 50), Math.floor(_root._ymouse / 50));
}
Symbol 58 MovieClip [FBoundingBoxSymbol] Frame 1
var component = _parent;
component.registerSkinElement(boundingBox, "background");
stop();
Symbol 58 MovieClip [FBoundingBoxSymbol] Frame 2
component.registerSkinElement(boundingBox2, "backgroundDisabled");
stop();
Symbol 61 MovieClip [FPushButtonSymbol] Frame 1
#initclip 3
function FPushButtonClass() {
this.init();
}
FPushButtonClass.prototype = new FUIComponentClass();
Object.registerClass("FPushButtonSymbol", FPushButtonClass);
FPushButtonClass.prototype.init = function () {
var _local1 = this;
super.setSize(_local1._width, _local1._height);
_local1.boundingBox_mc.unloadMovie();
_local1.attachMovie("fpb_states", "fpbState_mc", 1);
_local1.attachMovie("FLabelSymbol", "fLabel_mc", 2);
_local1.attachMovie("fpb_hitArea", "fpb_hitArea_mc", 3);
super.init();
_local1.btnState = false;
_local1.setClickHandler(_local1.clickHandler);
_local1._xscale = 100;
_local1._yscale = 100;
_local1.setSize(_local1.width, _local1.height);
if (_local1.label != undefined) {
_local1.setLabel(_local1.label);
}
_local1.ROLE_SYSTEM_PUSHBUTTON = 43;
_local1.STATE_SYSTEM_PRESSED = 8;
_local1.EVENT_OBJECT_STATECHANGE = 32778;
_local1.EVENT_OBJECT_NAMECHANGE = 32780;
_local1._accImpl.master = _local1;
_local1._accImpl.stub = false;
_local1._accImpl.get_accRole = _local1.get_accRole;
_local1._accImpl.get_accName = _local1.get_accName;
_local1._accImpl.get_accState = _local1.get_accState;
_local1._accImpl.get_accDefaultAction = _local1.get_accDefaultAction;
_local1._accImpl.accDoDefaultAction = _local1.accDoDefaultAction;
};
FPushButtonClass.prototype.setHitArea = function (w, h) {
var _local1 = this.fpb_hitArea_mc;
this.hitArea = _local1;
_local1._visible = false;
_local1._width = w;
_local1._height = ((arguments.length > 1) ? (h) : (_local1._height));
};
FPushButtonClass.prototype.setSize = function (w, h) {
var _local1 = this;
var _local2 = w;
var _local3 = h;
_local2 = ((_local2 < 6) ? 6 : (_local2));
if (arguments.length > 1) {
if (_local3 < 6) {
_local3 = 6;
}
}
super.setSize(_local2, _local3);
_local1.setLabel(_local1.getLabel());
_local1.arrangeLabel();
_local1.setHitArea(_local2, _local3);
_local1.boundingBox_mc._width = _local2;
_local1.boundingBox_mc._height = _local3;
_local1.drawFrame();
if (_local1.focused) {
super.myOnSetFocus();
}
_local1.initContentPos("fLabel_mc");
};
FPushButtonClass.prototype.arrangeLabel = function () {
var _local3 = this;
var _local1 = _local3.fLabel_mc;
var h = _local3.height;
var w = (_local3.width - 2);
var _local2 = 1;
_local3.fLabel_mc.setSize(w - (_local2 * 4));
_local1._x = _local2 * 3;
_local1._y = (h / 2) - (_local1._height / 2);
};
FPushButtonClass.prototype.getLabel = function () {
return(this.fLabel_mc.labelField.text);
};
FPushButtonClass.prototype.setLabel = function (label) {
var _local1 = this;
_local1.fLabel_mc.setLabel(label);
_local1.txtFormat();
_local1.arrangeLabel();
if (Accessibility.isActive()) {
Accessibility.sendEvent(_local1, 0, _local1.EVENT_OBJECT_NAMECHANGE);
}
};
FPushButtonClass.prototype.getEnabled = function () {
return(this.enabled);
};
FPushButtonClass.prototype.setEnabled = function (enable) {
var _local1 = this;
if (enable || (enable == undefined)) {
_local1.gotoFrame(1);
_local1.drawFrame();
_local1.flabel_mc.setEnabled(true);
_local1.enabled = true;
super.setEnabled(true);
} else {
_local1.gotoFrame(4);
_local1.drawFrame();
_local1.flabel_mc.setEnabled(false);
_local1.enabled = false;
super.setEnabled(false);
}
};
FPushButtonClass.prototype.txtFormat = function () {
var _local1 = this;
var _local2 = _local1.textStyle;
var _local3 = _local1.styleTable;
_local2.align = ((_local3.textAlign.value == undefined) ? ((_local2.align = "center")) : undefined);
_local2.leftMargin = ((_local3.textLeftMargin.value == undefined) ? ((_local2.leftMargin = 1)) : undefined);
_local2.rightMargin = ((_local3.textRightMargin.value == undefined) ? ((_local2.rightMargin = 1)) : undefined);
if (_local1.fLabel_mc._height > _local1.height) {
super.setSize(_local1.width, _local1.fLabel_mc._height);
} else {
super.setSize(_local1.width, _local1.height);
}
_local1.fLabel_mc.labelField.setTextFormat(_local1.textStyle);
_local1.setEnabled(_local1.enable);
};
FPushButtonClass.prototype.drawFrame = function () {
var _local3 = this;
var _local2 = 1;
var x1 = 0;
var y1 = 0;
var x2 = _local3.width;
var y2 = _local3.height;
var mc_array = ["up_mc", "over_mc", "down_mc", "disabled_mc"];
var frame = mc_array[_local3.fpbState_mc._currentframe - 1];
var mc = "frame";
var _local1 = 0;
while (_local1 < 6) {
x1 = x1 + ((_local1 % 2) * _local2);
y1 = y1 + ((_local1 % 2) * _local2);
x2 = x2 - (((_local1 + 1) % 2) * _local2);
y2 = y2 - (((_local1 + 1) % 2) * _local2);
var w = (Math.abs(x1 - x2) + (2 * _local2));
var h = (Math.abs(y1 - y2) + (2 * _local2));
_local3.fpbState_mc[frame][mc + _local1]._width = w;
_local3.fpbState_mc[frame][mc + _local1]._height = h;
_local3.fpbState_mc[frame][mc + _local1]._x = x1 - _local2;
_local3.fpbState_mc[frame][mc + _local1]._y = y1 - _local2;
_local1++;
}
};
FPushButtonClass.prototype.setClickHandler = function (chng, obj) {
var _local1 = this;
_local1.handlerObj = ((arguments.length < 2) ? (_local1._parent) : (obj));
_local1.clickHandler = chng;
};
FPushButtonClass.prototype.executeCallBack = function () {
var _local1 = this;
_local1.handlerObj[_local1.clickHandler](_local1);
};
FPushButtonClass.prototype.initContentPos = function (mc) {
var _local1 = this;
_local1.incrVal = 1;
_local1.initx = _local1[mc]._x - (_local1.getBtnState() * _local1.incrVal);
_local1.inity = _local1[mc]._y - (_local1.getBtnState() * _local1.incrVal);
_local1.togx = _local1.initx + _local1.incrVal;
_local1.togy = _local1.inity + _local1.incrVal;
};
FPushButtonClass.prototype.setBtnState = function (state) {
var _local1 = this;
_local1.btnState = state;
if (state) {
_local1.fLabel_mc._x = _local1.togx;
_local1.fLabel_mc._y = _local1.togy;
} else {
_local1.fLabel_mc._x = _local1.initx;
_local1.fLabel_mc._y = _local1.inity;
}
};
FPushButtonClass.prototype.getBtnState = function () {
return(this.btnState);
};
FPushButtonClass.prototype.myOnSetFocus = function () {
this.focused = true;
super.myOnSetFocus();
};
FPushButtonClass.prototype.onPress = function () {
var _local1 = this;
_local1.pressFocus();
_local1.fpbState_mc.gotoAndStop(3);
_local1.drawFrame();
_local1.setBtnState(true);
if (Accessibility.isActive()) {
Accessibility.sendEvent(_local1, 0, _local1.EVENT_OBJECT_STATECHANGE, true);
}
};
FPushButtonClass.prototype.onRelease = function () {
var _local1 = this;
_local1.fpbState_mc.gotoAndStop(2);
_local1.drawFrame();
_local1.executeCallBack();
_local1.setBtnState(false);
if (Accessibility.isActive()) {
Accessibility.sendEvent(_local1, 0, _local1.EVENT_OBJECT_STATECHANGE, true);
}
};
FPushButtonClass.prototype.onRollOver = function () {
this.fpbState_mc.gotoAndStop(2);
this.drawFrame();
};
FPushButtonClass.prototype.onRollOut = function () {
this.fpbState_mc.gotoAndStop(1);
this.drawFrame();
};
FPushButtonClass.prototype.onReleaseOutside = function () {
var _local1 = this;
_local1.setBtnState(false);
_local1.fpbState_mc.gotoAndStop(1);
_local1.drawFrame();
};
FPushButtonClass.prototype.onDragOut = function () {
var _local1 = this;
_local1.setBtnState(false);
_local1.fpbState_mc.gotoAndStop(1);
_local1.drawFrame();
};
FPushButtonClass.prototype.onDragOver = function () {
var _local1 = this;
_local1.setBtnState(true);
_local1.fpbState_mc.gotoAndStop(3);
_local1.drawFrame();
};
FPushButtonClass.prototype.myOnKeyDown = function () {
var _local1 = this;
if ((Key.getCode() == 32) && (_local1.pressOnce == undefined)) {
_local1.onPress();
_local1.pressOnce = 1;
}
};
FPushButtonClass.prototype.myOnKeyUp = function () {
if (Key.getCode() == 32) {
this.onRelease();
this.pressOnce = undefined;
}
};
FPushButtonClass.prototype.get_accRole = function (childId) {
return(this.master.ROLE_SYSTEM_PUSHBUTTON);
};
FPushButtonClass.prototype.get_accName = function (childId) {
return(this.master.getLabel());
};
FPushButtonClass.prototype.get_accState = function (childId) {
var _local1 = this;
if (_local1.pressOnce) {
return(_local1.master.STATE_SYSTEM_PRESSED);
}
return(_local1.master.STATE_SYSTEM_DEFAULT);
};
FPushButtonClass.prototype.get_accDefaultAction = function (childId) {
return("Press");
};
FPushButtonClass.prototype.accDoDefaultAction = function (childId) {
this.master.onPress();
this.master.onRelease();
};
#endinitclip
boundingBox_mc._visible = false;
deadPreview._visible = false;
Symbol 62 MovieClip [gameover] Frame 1
function OnRestartClick() {
_root.OnRestartClick();
}
Instance of Symbol 61 MovieClip [FPushButtonSymbol] in Symbol 62 MovieClip [gameover] Frame 1
//component parameters
onClipEvent (initialize) {
label = "OK";
clickHandler = "OnRestartClick";
}
Symbol 63 MovieClip [ballmovie] Frame 1
function DoStep() {
switch (_ord) {
case 0 :
_x = (_x - 17);
return;
case 1 :
_y = (_y - 17);
return;
case 2 :
_x = (_x + 17);
return;
case 3 :
_y = (_y + 17);
}
}
if (PathPos != PathLen) {
if (((Path[PathPos].X * 50) + 25) > _x) {
_ord = 2;
} else if (((Path[PathPos].X * 50) + 25) < _x) {
_ord = 0;
} else if (((Path[PathPos].Y * 50) + 25) < _y) {
_ord = 1;
} else if (((Path[PathPos].Y * 50) + 25) > _y) {
_ord = 3;
}
DoStep();
PathPos++;
} else {
var x = Path[PathLen - 1].X;
var y = Path[PathLen - 1].Y;
_x = ((x * 50) + 25);
_y = ((y * 50) + 25);
delete Path;
_root.OnBallArrive(x, y);
}
Symbol 63 MovieClip [ballmovie] Frame 2
DoStep();
Symbol 63 MovieClip [ballmovie] Frame 3
_x = ((Path[PathPos - 1].X * 50) + 25);
_y = ((Path[PathPos - 1].Y * 50) + 25);