Frame 1
stop();
var xod = 300;
var yod = 200;
var drawchain = false;
var firstDrop = false;
var wf = 1;
var chain_array = new Array();
var al = 150;
_root.createEmptyMovieClip("chainbox1", _root.getNextHighestDepth());
var level = 1;
onMouseMove = function () {
distance = int(Math.sqrt(((xod - _xmouse) * (xod - _xmouse)) + ((yod - _ymouse) * (yod - _ymouse))));
while (distance > 13) {
var _local3 = (((++wf) % 2) == 0) + 1;
if (_local3 == 1) {
var _local2 = _root.chainbox1.attachMovie("chain", ("chain" + level) - 2, level - 2);
} else {
var _local2 = _root.chainbox1.attachMovie("chain", "chain" + level, level);
}
level++;
chain_array.push(_local2);
_local2.gotoAndStop(_local3);
_local2._x = xod;
_local2._y = yod;
dx = _xmouse - xod;
dy = _ymouse - yod;
turretRadians = Math.atan2(dy, dx);
turretDegrees = (360 * turretRadians) / (Math.PI*2);
_local2._rotation = turretDegrees;
xhf = Math.cos(((Math.PI*2) * _local2._rotation) / 360) * 13;
yhf = Math.sin(((Math.PI*2) * _local2._rotation) / 360) * 13;
xod = _local2._x + xhf;
yod = _local2._y + yhf;
if (chain_array.length == al) {
removeMovieClip(chain_array.shift());
}
distance = int(Math.sqrt(((xod - _xmouse) * (xod - _xmouse)) + ((yod - _ymouse) * (yod - _ymouse))));
}
};
var bt = 0;
var bl = 0;
var pl = 0;
onEnterFrame = function () {
if (chain_array.length > 12) {
i = 1;
while (i <= 4) {
removeMovieClip(chain_array.shift());
i++;
}
}
bt = int(_root.getBytesTotal() / 1000);
bl = int(_root.getBytesLoaded() / 1000);
pl = int((bl / bt) * 400);
loadbar._width = pl;
if ((bt == bl) and (bt != 0)) {
_root.gotoAndStop(3);
}
};
Frame 2
stop();
Frame 3
i = 1;
while (i <= 4) {
var wc = eval ("my_btn" + i);
wc._alpha = 0;
wc.onRelease = function () {
_root.chainbox1.removeMovieClip();
delete _root.onMouseMove;
delete _root.onEnterFrame;
_root.gotoAndStop(4);
};
i++;
}
stop();
Frame 4
var hl = 50;
f4_mc.duplicateMovieClip("image4", _root.getNextHighestDepth());
f3_mc.duplicateMovieClip("image3", _root.getNextHighestDepth());
mask_mc.duplicateMovieClip("mask3", _root.getNextHighestDepth());
image3.setMask("mask3");
mask3.onEnterFrame = function () {
this._x = _xmouse - this._width;
this._y = _ymouse - this._height;
if (this._x > 0) {
this._x = 0;
}
if (this._y > 0) {
this._y = 0;
}
};
f2_mc.duplicateMovieClip("image2", _root.getNextHighestDepth());
mask_mc.duplicateMovieClip("mask2", _root.getNextHighestDepth());
image2.setMask("mask2");
mask2.onEnterFrame = function () {
this._x = _xmouse - this._width;
this._y = _ymouse;
if (this._x > 0) {
this._x = 0;
}
if (this._y < 0) {
this._y = 0;
}
};
f1_mc.duplicateMovieClip("image1", _root.getNextHighestDepth());
mask_mc.duplicateMovieClip("mask1", _root.getNextHighestDepth());
image1.setMask("mask1");
mask1.onEnterFrame = function () {
this._x = _xmouse;
this._y = _ymouse;
if (this._x < 0) {
this._x = 0;
}
if (this._y < 0) {
this._y = 0;
}
};
stages.swapDepths(_root.getNextHighestDepth());
stages.onEnterFrame = function () {
if ((hl--) < 0) {
this._alpha = this._alpha - 5;
}
};
stages.onMouseDown = function () {
this._alpha = 100;
hl = 50;
};
i = 4;
while (i > 0) {
var wc = eval (("_root.f" + i) + "_mc");
wc.swapDepths(10000);
wc.removeMovieClip();
i--;
}
mask_mc.swapDepths(10000);
mask_mc.removeMovieClip();
lineH_mc.swapDepths(10000);
lineV_mc.swapDepths(10001);
_root.onEnterFrame = function () {
lineH_mc._y = _ymouse;
if (lineH_mc._y > mask1._height) {
lineH_mc._y = mask1._height;
}
if (lineH_mc._y < 0) {
lineH_mc._y = 0;
}
lineV_mc._x = _xmouse;
if (lineV_mc._x > mask1._width) {
lineV_mc._x = mask1._width;
}
if (lineV_mc._x < 0) {
lineV_mc._x = 0;
}
};