Section 1
//MainTimeline (MultiBall_fla.MainTimeline)
package MultiBall_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var left:Boolean;
public var swords:MovieClip;
public var submit:TextField;
public var right:Boolean;
public var scoreStyle:TextFormat;
public var blueMod:Number;
public var creditStyle:TextFormat;
public var linesDown:Array;
public var balls:Array;
public var linesRight:Array;
public var i:int;
public var j:int;
public var k:int;
public var finalScoreStyle:TextFormat;
public var n:int;
public var tc:Number;
public var moreGames:Sprite;
public var m:int;
public var playTxtStyle:TextFormat;
public var screen:Sprite;
public var scoreTxt:TextField;
public var breaking:Boolean;
public var dudeName:String;
public var submitStyle:TextFormat;
public var score:Number;
public var credits:TextField;
public var playTxt:TextField;
public var instructStyle:TextFormat;
public var sponsorStyle:TextFormat;
public var redMod:Number;
public var ballsPending:Number;
public var oldMouse:Number;
public var finalScore:TextField;
public var sendIt:MovieClip;
public var back:Sprite;
public var bouncer:Sprite;
public var news:Sprite;
public var userName:TextField;
public var lines:Array;
public var greenMod:Number;
public var baseColor:Number;
public var oldRed:Number;
public var tempNum:Number;
public var sponsor:TextField;
public var oldGreen:Number;
public var viewScores:MovieClip;
public var asteroids:Array;
public var oldBlue:Number;
public var unbug:Number;
public var counts:Number;
public var timer:Number;
public var targetRed:Number;
public var sounds:Array;
public var tempAng:Number;
public var playIt:MovieClip;
public var targetBlue:Number;
public var oldTime:Number;
public var colorTimer:Number;
public var exactColor:Number;
public var instructions:TextField;
public var linesLeft:Array;
public var nameStyle:TextFormat;
public var targetGreen:Number;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2);
}
public function critisize():String{
if (score < 143){
return ("How the did you<br>even manage that???");
};
if (Math.floor(score) == 143){
return ("You meant to do that..<br> right?");
};
if (score < 400){
return ("Were they giving away<br>free failure in a can?");
};
if (score < 600){
return ("Your performance is<br>unacceptable");
};
if (score < 800){
return ("Please tell me you<br>can do better.");
};
if (score < 1000){
return ("Over already?");
};
if (score < 1200){
return ("Not good");
};
if (score < 1500){
return ("Try harder next time");
};
if (score < 2000){
return ("Not half bad.");
};
if (score < 2500){
return ("Almost acceptable");
};
if (score < 3000){
return ("Not too shabby");
};
if (score < 3500){
return ("Good work");
};
if (score < 4000){
return ("Alright!");
};
if (score < 4500){
return ("You're doing<br>quite well.");
};
if (score < 5000){
return ("Great score.");
};
if (score < 6000){
return ("Excellent!");
};
if (score < 9000){
return ("Crazy good!");
};
if (score < 15000){
return ("AMAZING!");
};
if (score < 25000){
return ("GOD-LIKE!!");
};
if (score < 50000){
return ("HOLY SHIT!");
};
if (score < 100000){
return ("FATALITY!");
};
return ("OVERKILL!");
}
public function addBall(){
balls.push(new MovieClip());
do {
balls[(balls.length - 1)].xvel = ((Math.random() * 4) - 2);
} while (balls[(balls.length - 1)].xvel == 0);
balls[(balls.length - 1)].yvel = -12;
balls[(balls.length - 1)].x = bouncer.x;
balls[(balls.length - 1)].y = 570;
balls[(balls.length - 1)].graphics.beginFill(0xFFFFFF);
balls[(balls.length - 1)].graphics.drawCircle(0, 0, 5);
balls[(balls.length - 1)].graphics.endFill();
stage.addChild(balls[(balls.length - 1)]);
}
public function newsClick(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.armorblog.com"), "_blank");
}
function frame1(){
swords.addEventListener(MouseEvent.MOUSE_DOWN, urlClick);
stop();
back = new Sprite();
targetRed = Math.floor(((Math.random() * 150) + 25));
targetBlue = Math.floor(((Math.random() * 150) + 25));
targetGreen = Math.floor(((Math.random() * 150) + 25));
baseColor = (((targetRed * 65536) + (targetBlue * 0x0100)) + targetGreen);
back.graphics.beginFill(baseColor);
back.graphics.drawRect(0, 0, 350, 600);
back.graphics.endFill();
stage.addChildAt(back, 0);
}
function frame2(){
timer = 0;
oldMouse = 0;
oldTime = 0;
counts = 0;
sounds = new Array();
tc = 0;
dudeName = "";
viewScores = new MovieClip();
viewScores.x = 100;
viewScores.y = 270;
viewScores.graphics.beginFill(0, 0);
viewScores.graphics.drawRect(0, 0, 150, 30);
viewScores.graphics.endFill();
stage.addChild(viewScores);
userName = new TextField();
userName.type = TextFieldType.INPUT;
userName.background = true;
userName.maxChars = 20;
userName.width = 150;
userName.height = 20;
userName.x = 1000;
userName.y = 200;
nameStyle = new TextFormat("Times New Roman", 12, 0, false, false, false, null, null, "center");
userName.defaultTextFormat = nameStyle;
sendIt = new MovieClip();
sendIt.x = 100;
sendIt.y = 230;
sendIt.graphics.beginFill(0, 0);
sendIt.graphics.drawRect(0, 0, 150, 30);
sendIt.graphics.endFill();
stage.addChild(sendIt);
submit = new TextField();
submitStyle = new TextFormat("Segoe Print", 12, 0xFFFFFF, true, false, false, null, null, "center");
submit.defaultTextFormat = submitStyle;
submit.x = 1000;
submit.multiline = true;
submit.width = 150;
submit.height = 200;
submit.selectable = false;
scoreTxt = new TextField();
score = 0;
scoreStyle = new TextFormat("Segoe Print", 20, 0, true);
scoreTxt.defaultTextFormat = scoreStyle;
finalScore = new TextField();
finalScoreStyle = new TextFormat("Segoe Print", 25, 0xFFFF00, true, false, false, null, null, "center");
finalScore.defaultTextFormat = finalScoreStyle;
playTxt = new TextField();
playTxtStyle = new TextFormat("Sylfaen", 27, 0xFF0000, true);
playTxt.defaultTextFormat = playTxtStyle;
instructions = new TextField();
instructStyle = new TextFormat("Sylfaen", 16, 0xFFFFFF, false, false, false, null, null, "center");
instructions.defaultTextFormat = instructStyle;
sponsor = new TextField();
sponsorStyle = new TextFormat("Times New Roman", 16, 0xFFFFFF, false, false, false, null, null, "left");
sponsor.defaultTextFormat = sponsorStyle;
credits = new TextField();
creditStyle = new TextFormat("Times New Roman", 8, 0xFFFFFF, false, false, false, null, null, "left");
credits.defaultTextFormat = creditStyle;
sponsor.multiline = true;
sponsor.htmlText = "Play More Games<br>Gaming News";
sponsor.x = 230;
sponsor.y = 550;
sponsor.width = 150;
stage.addChild(sponsor);
moreGames = new Sprite();
moreGames.graphics.beginFill(0, 0);
moreGames.graphics.drawRect(0, 0, 100, 20);
moreGames.graphics.endFill();
moreGames.x = 230;
moreGames.y = 550;
stage.addChild(moreGames);
news = new Sprite();
news.graphics.beginFill(0, 0);
news.graphics.drawRect(0, 0, 100, 20);
news.graphics.endFill();
news.x = 230;
news.y = 575;
stage.addChild(news);
news.addEventListener(MouseEvent.MOUSE_DOWN, newsClick);
moreGames.addEventListener(MouseEvent.MOUSE_DOWN, moreGamesClick);
instructions.width = 350;
instructions.height = 300;
playIt = new MovieClip();
screen = new Sprite();
bouncer = new Sprite();
ballsPending = 3;
lines = new Array();
asteroids = new Array();
balls = new Array();
colorTimer = 0;
redMod = 0;
blueMod = 0;
greenMod = 0;
linesDown = new Array();
linesRight = new Array();
linesLeft = new Array();
screen.graphics.beginFill(0);
screen.graphics.drawRect(0, 0, 350, 600);
screen.graphics.endFill();
bouncer.x = 175;
bouncer.y = 600;
bouncer.graphics.beginFill(0xFFFFFF);
bouncer.graphics.drawEllipse(-50, -25, 100, 50);
bouncer.graphics.endFill();
stage.addChild(bouncer);
stage.addChild(scoreTxt);
scoreTxt.x = 40;
scoreTxt.y = 0;
scoreTxt.alpha = 1;
scoreTxt.width = 300;
scoreTxt.autoSize = "right";
stage.addChild(credits);
stage.addChild(userName);
stage.addChild(submit);
credits.text = "Created by: Ryan Brady (AKA Arby)";
credits.width = 350;
credits.x = 0;
credits.y = 585;
instructions.multiline = true;
instructions.htmlText = "<b>INSTRUCTIONS</b><br><br>Control your paddle with your <br>mouse or keyboard and bounce<br> the balls up to break through the bricks.<br><br>Do not let your paddle touch the bricks<br> or you will die.<br><br>If you smash enough bricks,<br> you may get extra balls.<br><br>Good luck.<br>You will need it.";
stage.addChild(instructions);
instructions.x = 0;
instructions.y = 25;
stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, dammit);
stage.addChildAt(screen, 1);
screen.alpha = 0.5;
playIt.graphics.beginFill(0);
playIt.graphics.drawRect(-55, -20, 110, 40);
playIt.graphics.endFill();
playIt.x = 175;
playIt.y = 500;
stage.addChild(playIt);
playIt.addChild(playTxt);
playTxt.text = "Play";
playTxt.x = -50;
playTxt.y = -25;
playTxt.autoSize = "center";
playTxt.selectable = false;
playIt.addEventListener(MouseEvent.MOUSE_UP, letsGo);
stage.addChild(finalScore);
}
public function moreGamesClick(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.armorgames.com"), "_blank");
}
public function letsGo(_arg1:Event){
playIt.removeEventListener(MouseEvent.MOUSE_UP, letsGo);
stage.addEventListener(Event.ENTER_FRAME, go);
timer = 0;
i = 0;
while (i < lines.length) {
j = 0;
while (j < lines[i].length) {
stage.removeChild(lines[i][j]);
j++;
};
i++;
};
i = 0;
while (i < balls.length) {
stage.removeChild(balls[i]);
i++;
};
stage.removeChild(sponsor);
stage.removeChild(sendIt);
stage.removeChild(userName);
stage.removeChild(submit);
stage.removeChild(credits);
stage.removeChild(instructions);
balls = new Array();
lines = new Array();
j = 0;
while (j < 15) {
newLine();
j++;
};
stage.removeChild(finalScore);
score = 0;
stage.removeChild(screen);
stage.removeChild(playIt);
ballsPending = 3;
}
public function dammit(_arg1:FocusEvent){
if (_arg1.relatedObject.name == "instance19"){
_arg1.preventDefault();
};
}
public function end(_arg1:Number, _arg2:Number){
sounds[tc] = new buzzer();
sounds[tc].play();
tc++;
if (tc > 30){
tc = 0;
};
playIt.addEventListener(MouseEvent.MOUSE_UP, letsGo);
stage.addChild(screen);
screen.alpha = 0.5;
stage.setChildIndex(bouncer, stage.getChildIndex(screen));
stage.setChildIndex(lines[_arg1][_arg2], stage.getChildIndex(bouncer));
lines[_arg1][_arg2].graphics.lineStyle(1, 0xFF0000);
lines[_arg1][_arg2].graphics.drawRect(-25, -15, 50, 30);
stage.addChild(playIt);
playTxt.text = "Replay?";
stage.addChild(finalScore);
finalScore.multiline = true;
finalScore.htmlText = ("You obtained a score of:<br>" + String(Math.floor(score)));
finalScore.autoSize = "center";
finalScore.x = 20;
finalScore.y = 100;
stage.addChild(userName);
stage.addChild(submit);
stage.addChild(sendIt);
sendIt.addEventListener(MouseEvent.MOUSE_DOWN, sendScore);
stage.addChild(instructions);
stage.addChild(sponsor);
submit.x = 100;
submit.y = 230;
submit.htmlText = ("Submit High Score!<br><br>" + critisize());
userName.x = 100;
userName.y = 200;
instructions.x = 500;
stage.addChild(credits);
userName.text = "Type Name Here!";
if (dudeName != ""){
userName.text = dudeName;
};
}
public function go(_arg1:Event){
Key.initialize(stage);
score = (score + (Math.pow(timer, 0.9) / 700));
scoreTxt.text = ("Score: " + String(Math.floor(score)));
if (lines[(lines.length - 1)][0].y > -40){
newLine();
};
if ((((ballsPending > 0)) && (((timer % 30) == 0)))){
addBall();
ballsPending--;
sounds[tc] = new spawn();
sounds[tc].play();
tc++;
if (tc > 30){
tc = 0;
};
};
timer = (timer + 2);
i = 0;
while (i < lines.length) {
if (lines[i].length == 0){
lines.splice(i, 1);
} else {
j = 0;
while (j < lines[i].length) {
lines[i][j].y = (lines[i][j].y + (Math.floor((1 + (Math.pow(timer, 1.13) / 1000))) * 0.5));
if (lines[i][j].y > 650){
stage.removeChild(lines[i][j]);
lines[i].splice(j, 1);
} else {
if ((((lines[i][j].y > 560)) && ((lines[i][j].y < 610)))){
if (Math.abs((lines[i][j].x - bouncer.x)) < 50){
stage.removeEventListener(Event.ENTER_FRAME, go);
end(i, j);
} else {
if ((((Math.abs((lines[i][j].x - bouncer.x)) < 70)) && ((lines[i][j].y > (560 + (Math.sin(((Math.abs((lines[i][j].x - bouncer.x)) - 50) / 25)) * 25)))))){
stage.removeEventListener(Event.ENTER_FRAME, go);
end(i, j);
};
};
};
};
j++;
};
};
i++;
};
k = 0;
while (k < balls.length) {
balls[k].x = (balls[k].x + balls[k].xvel);
balls[k].y = (balls[k].y + balls[k].yvel);
balls[k].yvel = (balls[k].yvel + 0.3);
breaking = false;
i = 0;
while (i < lines.length) {
if (breaking){
break;
};
j = 0;
while (j < lines[i].length) {
if (Math.abs((balls[k].y - lines[i][0].y)) <= 20){
if ((balls[k].y - lines[i][0].y) > 0){
breaking = true;
};
if ((((Math.abs((balls[k].x - lines[i][j].x)) < 30)) && ((Math.abs((balls[k].y - lines[i][j].y)) < 20)))){
stage.removeChild(lines[i][j]);
lines[i].splice(j, 1);
if (lines[i].length == 0){
lines.splice(i, 1);
};
sounds[31] = new blip();
sounds[31].play();
tc++;
if (tc > 30){
tc = 0;
};
score = (score + (timer / 700));
if ((Math.random() * (20 + (0.5 * Math.pow((balls.length + ballsPending), 1.8)))) < 1){
ballsPending++;
};
break;
};
};
j++;
};
i++;
};
if (balls[k].y > 550){
if (pytha((balls[k].x - bouncer.x), (balls[k].y - bouncer.y)) < (30 + (25 * Math.abs(Math.cos(Math.atan2((balls[k].y - bouncer.y), (balls[k].x - bouncer.x))))))){
while (pytha((balls[k].x - bouncer.x), (balls[k].y - bouncer.y)) < (30 + (25 * Math.abs(Math.cos(Math.atan2((balls[k].y - bouncer.y), (balls[k].x - bouncer.x))))))) {
balls[k].y--;
};
tempNum = pytha(balls[k].xvel, balls[k].yvel);
tempNum = (tempNum + 1);
tempNum = (tempNum * 0.95);
tempAng = Math.atan2((balls[k].y - bouncer.y), (balls[k].x - bouncer.x));
balls[k].xvel = (tempNum * Math.cos(tempAng));
balls[k].yvel = (tempNum * Math.sin(tempAng));
sounds[tc] = new thunk2();
sounds[tc].play();
tc++;
if (tc > 30){
tc = 0;
};
};
};
if (balls[k].x < 5){
balls[k].x = 5;
balls[k].xvel = Math.abs(balls[k].xvel);
sounds[tc] = new loudblip();
sounds[tc].play();
tc++;
if (tc > 30){
tc = 0;
};
} else {
if (balls[k].x > 345){
balls[k].x = 345;
balls[k].xvel = (-1 * Math.abs(balls[k].xvel));
sounds[tc] = new loudblip();
sounds[tc].play();
tc++;
if (tc > 30){
tc = 0;
};
};
};
if (balls[k].y < 5){
balls[k].y = 5;
balls[k].yvel = Math.abs(balls[k].yvel);
} else {
if (balls[k].y > 605){
stage.removeChild(balls[k]);
balls.splice(k, 1);
sounds[tc] = new fall();
sounds[tc].play();
tc++;
if (tc > 30){
tc = 0;
};
};
};
k++;
};
colorTimer++;
if (colorTimer == 300){
colorTimer = 0;
oldRed = targetRed;
oldBlue = targetBlue;
oldGreen = targetGreen;
baseColor = (((targetRed * 65536) + (targetBlue * 0x0100)) + targetGreen);
targetRed = Math.floor((Math.random() * 200));
targetBlue = Math.floor((Math.random() * 200));
targetGreen = Math.floor((Math.random() * 200));
redMod = ((targetRed - oldRed) / 300);
blueMod = ((targetBlue - oldBlue) / 300);
greenMod = ((targetGreen - oldGreen) / 300);
};
back.graphics.clear();
back.graphics.beginFill((((baseColor + (Math.floor((redMod * colorTimer)) * 65536)) + (Math.floor((blueMod * colorTimer)) * 0x0100)) + Math.floor((greenMod * colorTimer))));
back.graphics.drawRect(0, 0, 350, 600);
back.graphics.endFill();
if (oldMouse != mouseX){
bouncer.x = mouseX;
};
oldMouse = mouseX;
if (Key.isDown(39)){
bouncer.x = (bouncer.x + 15);
};
if (Key.isDown(37)){
bouncer.x = (bouncer.x - 15);
};
if (bouncer.x > 300){
bouncer.x = 300;
} else {
if (bouncer.x < 50){
bouncer.x = 50;
};
};
}
public function fps(_arg1:Event){
counts++;
if (counts == 60){
scoreTxt.text = String((60 / ((getTimer() - oldTime) / 1000)));
oldTime = getTimer();
counts = 0;
};
}
public function urlClick(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.armorgames.com"), "_blank");
}
public function newLine(){
unbug = lines.length;
lines[unbug] = new Array(7);
i = 0;
while (i < 7) {
lines[unbug][i] = new Sprite();
lines[unbug][i].x = ((i * 50) + 25);
if (unbug >= 1){
lines[unbug][i].y = (lines[(unbug - 1)][0].y - 30);
} else {
lines[unbug][i].y = 300;
};
lines[unbug][i].graphics.lineStyle(1, 0xFFFFFF);
lines[unbug][i].graphics.beginFill((((Math.floor(((Math.random() * 150) + 100)) * 65536) + (Math.floor(((Math.random() * 150) + 100)) * 0x0100)) + Math.floor(((Math.random() * 150) + 100))));
lines[unbug][i].graphics.drawRect(-25, -15, 50, 30);
lines[unbug][i].graphics.endFill();
stage.addChildAt(lines[unbug][i], 1);
i++;
};
}
public function pytha(_arg1, _arg2):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
public function sendScore(_arg1:Event){
var abrazor30Data:URLRequest;
var variables:URLVariables;
var verbs:Number;
var viper:String;
var loader:URLLoader;
var urlRequest:URLRequest;
var dataOnLoad:Function;
var lol = _arg1;
if (((!((userName.text == "Type Name here"))) && (!((userName.text == ""))))){
dataOnLoad = function (_arg1:Event){
};
dudeName = userName.text;
sendIt.removeEventListener(MouseEvent.MOUSE_DOWN, sendScore);
instructions.htmlText = "<b>In case you've forgotten:</b><br><br>Use your paddle (located at the bottom) to bounce<br> the balls up and break through the bricks.<br><br>Do not let your paddle touch the bricks<br> or you will die.<br><br>If you smash enough bricks,<br> you may get extra balls.<br><br>Good luck.<br>You will need it.";
abrazor30Data = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
abrazor30Data.method = URLRequestMethod.POST;
variables = new URLVariables();
variables.flashkey = "YWJ5THFaWVA=";
variables.SU0249 = "MjE1M2olZSVhJW4lcw==";
variables.bmFtZTE = userName.text;
verbs = score;
viper = (verbs + "Z");
variables.c2NvcmUx = viper.split("0").join("U");
variables.c2NvcmUx = variables.c2NvcmUx.split("").join("A");
variables.c2NvcmUx = variables.c2NvcmUx.split("AU").join("Y");
variables.c2NvcmUx = variables.c2NvcmUx.split("A1").join("B");
variables.c2NvcmUx = variables.c2NvcmUx.split(".").join("N");
abrazor30Data.data = variables;
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, dataOnLoad);
loader.load(abrazor30Data);
urlRequest = new URLRequest("http://rankz.armorbot.com/MultiBall/");
navigateToURL(urlRequest, "_blank");
};
}
}
}//package MultiBall_fla
Section 2
//xczcxzc_1 (MultiBall_fla.xczcxzc_1)
package MultiBall_fla {
import flash.display.*;
public dynamic class xczcxzc_1 extends MovieClip {
public function xczcxzc_1(){
addFrameScript(125, frame126);
}
function frame126(){
MovieClip(parent).nextFrame();
}
}
}//package MultiBall_fla
Section 3
//blip (blip)
package {
import flash.media.*;
public dynamic class blip extends Sound {
}
}//package
Section 4
//buzzer (buzzer)
package {
import flash.media.*;
public dynamic class buzzer extends Sound {
}
}//package
Section 5
//fall (fall)
package {
import flash.media.*;
public dynamic class fall extends Sound {
}
}//package
Section 6
//Key (Key)
package {
import flash.display.*;
import flash.events.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public static function initialize(_arg1:Stage){
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(_arg1:Event):void{
keysDown = new Object();
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((_arg1 in keysDown)));
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
}
}//package
Section 7
//loudblip (loudblip)
package {
import flash.media.*;
public dynamic class loudblip extends Sound {
}
}//package
Section 8
//spawn (spawn)
package {
import flash.media.*;
public dynamic class spawn extends Sound {
}
}//package
Section 9
//thunk2 (thunk2)
package {
import flash.media.*;
public dynamic class thunk2 extends Sound {
}
}//package