Instance of Symbol 7 MovieClip [Loader] "loader" in Frame 1
//component parameters
onClipEvent (construct) {
SlideWidth = 100;
SlideHeight = 10;
scolor = 16777215 /* 0xFFFFFF */;
bcolor = 16754726 /* 0xFFA826 */;
fname = "Abduction";
fsize = 8;
}
Frame 2
stop();
Mouse.show();
Frame 3
function randomBetween(lower, upper) {
return(lower + Math.floor(Math.random() * ((upper - lower) + 1)));
}
function newGame() {
Mouse.hide();
startDrag ("bat", true, lw._width, bat._y, (400 - bat._width) - rw._width, bat._y);
onMouseMove = function () {
ball._x = (bat._x + (bat._width / 2)) - (ball._width / 2);
ball._y = bat._y - ball._height;
updateAfterEvent();
};
onMouseDown = function () {
releaseBall();
delete onMouseDown;
};
hitCount = 0;
createNewBlocks();
clearInterval(drop);
drop = setInterval(dropBlocks, 1000);
}
function createNewBlocks() {
var _local6 = 7;
var _local7 = numRows;
block._y = startPos;
var _local4 = block._x;
var _local5 = block._y;
var _local2 = 1;
while (_local2 <= 100) {
removeMovieClip("block" + _local2);
_local2++;
}
_local2 = 1;
while (_local2 <= (_local6 * _local7)) {
duplicateMovieClip ("block", "block" + _local2, _local2);
var _local3 = this["block" + _local2];
_local3._x = _local4;
_local3._y = _local5;
if ((_local2 % _local6) == 0) {
_local4 = block._x;
_local5 = _local5 + (block._height + 10);
} else {
_local4 = _local4 + (block._width + 5);
}
numBlocks = _local2;
_local2++;
}
block._y = 2000;
}
function releaseBall() {
delete onMouseMove;
ball.yspeed = -6;
var _local2 = new Array(1, -1);
ball.xspeed = randomBetween(1, 5) * _local2[randomBetween(0, 1)];
ball.onEnterFrame = function () {
this._y = this._y + this.yspeed;
this._x = this._x + this.xspeed;
collisionDetect();
};
}
function collisionDetect() {
if (hitBlock()) {
ball.yspeed = ball.yspeed * -1;
ball.batted = false;
} else if (ball.hitTest(bat) && (!ball.batted)) {
ball.yspeed = ball.yspeed * -1;
ball.batted = true;
} else if (ball.hitTest(lw) || (ball.hitTest(rw))) {
ball.xspeed = ball.xspeed * -1;
if (ball.xspeed < 0) {
ball._x = ball._x - 5;
}
if (ball.xspeed > 0) {
ball._x = ball._x + 5;
}
ball.batted = false;
} else if (ball.hitTest(tw)) {
ball.yspeed = ball.yspeed * -1;
if (ball.yspeed < 0) {
ball._y = ball._y - 5;
}
if (ball.yspeed > 0) {
ball._y = ball._y + 5;
}
ball.batted = false;
} else if (ball.hitTest(bw)) {
delete ball.onEnterFrame;
lives--;
if (lives == 0) {
trace("game over");
gotoAndStop (4);
hits = 0;
games = 0;
lives = 3;
numRows = 1;
}
newGame();
}
}
function hitBlock() {
var _local2 = 1;
while (_local2 <= numBlocks) {
var _local3 = this["block" + _local2];
if (ball.hitTest(_local3)) {
removeMovieClip(_local3);
hitCount++;
hits++;
if (hitCount == numBlocks) {
games++;
numRows = numRows + 2;
delete ball.onEnterFrame;
newGame();
}
return(true);
}
_local2++;
}
}
function dropBlocks() {
var _local2 = 1;
while (_local2 <= numBlocks) {
var _local3 = _root["block" + _local2];
_local3._y = _local3._y + 5;
_local2++;
}
}
stop();
numRows = 1;
startPos = 35;
games = 0;
hits = 0;
lives = 3;
newGame();
Frame 4
Mouse.show();
Symbol 7 MovieClip [Loader] Frame 1
#initclip 1
function LoaderClass() {
this.slideColor = new Color(this.slide);
this.bordColor = new Color(this.bord);
this.update();
}
LoaderClass.prototype = new MovieClip();
LoaderClass.prototype.update = function () {
this.slideColor.setRGB(this.scolor);
this.bordColor.setRGB(this.bcolor);
this.bord._width = this.SlideWidth + 4;
this.slide._width = this.SlideWidth;
this.bord._height = this.SlideHeight + 4;
this.slide._height = this.SlideHeight;
this.createTextField("mytext", 1, this.bord._x, this.bord._y, 300, 40);
delete this.mtextFormat;
this.mtextFormat = new TextFormat(this);
this.mTextFormat.font = this.fname;
this.mTextFormat.color = this.bcolor;
this.mTextFormat.size = this.fsize;
this.mytext.text = "";
this.mytext.setTextFormat(this.mtextFormat);
};
LoaderClass.prototype.setSlideWidth = function (b) {
this.SlideWidth = b;
this.update();
};
LoaderClass.prototype.getSlideWidth = function () {
return(this.SlideWidth);
};
LoaderClass.prototype.setSlideHeight = function (h) {
this.SlideHeight = h;
this.update();
};
LoaderClass.prototype.getSlideHeight = function () {
return(this.SlideHeight);
};
LoaderClass.prototype.setTintColor = function (c) {
this.tcolor = c;
this.update();
};
LoaderClass.prototype.turnOnTint = function () {
this.applyTint = true;
this.update();
};
Object.registerClass("Loader", LoaderClass);
#endinitclip
Instance of Symbol 4 MovieClip "slide" in Symbol 7 MovieClip [Loader] Frame 1
onClipEvent (load) {
_root.stop();
this.topScale = this._width;
this._xscale = 0;
ft = int(_root.getBytesTotal() / 1024);
}
onClipEvent (enterFrame) {
fl = int(_root.getBytesLoaded() / 1024);
this._xscale = (fl / ft) * this.topScale;
_parent.mytext.text = ((("LOADING " + fl) + " KB OF ") + ft) + " KB";
_parent.mytext.setTextFormat(_parent.mtextFormat);
if (fl == ft) {
_root.gotoAndPlay(_currentframe + 1);
play();
}
}
Symbol 12 Button
on (release) {
gotoAndPlay (3);
}
Symbol 36 Button
on (release) {
gotoAndStop (3);
}