Section 1
//credits_text_29 (meteor3_fla.credits_text_29)
package meteor3_fla {
import flash.display.*;
public dynamic class credits_text_29 extends MovieClip {
public var returnToMenu:MovieClip;
}
}//package meteor3_fla
Section 2
//game_complete_40 (meteor3_fla.game_complete_40)
package meteor3_fla {
import flash.display.*;
import flash.text.*;
public dynamic class game_complete_40 extends MovieClip {
public var submitScore:MovieClip;
public var returnToMenu:MovieClip;
public var nameInput:TextField;
}
}//package meteor3_fla
Section 3
//game_over_42 (meteor3_fla.game_over_42)
package meteor3_fla {
import flash.display.*;
import flash.text.*;
public dynamic class game_over_42 extends MovieClip {
public var submitScore:MovieClip;
public var returnToMenu:MovieClip;
public var nameInput:TextField;
}
}//package meteor3_fla
Section 4
//game_paused_33 (meteor3_fla.game_paused_33)
package meteor3_fla {
import flash.display.*;
public dynamic class game_paused_33 extends MovieClip {
public var returnToMenu:MovieClip;
}
}//package meteor3_fla
Section 5
//hub_legend_27 (meteor3_fla.hub_legend_27)
package meteor3_fla {
import flash.display.*;
public dynamic class hub_legend_27 extends MovieClip {
public function hub_legend_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package meteor3_fla
Section 6
//load_item_15 (meteor3_fla.load_item_15)
package meteor3_fla {
import flash.display.*;
public dynamic class load_item_15 extends MovieClip {
public function load_item_15(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package meteor3_fla
Section 7
//load_items_1 (meteor3_fla.load_items_1)
package meteor3_fla {
import flash.display.*;
public dynamic class load_items_1 extends MovieClip {
public var preloader:MovieClip;
public var titleLoading:MovieClip;
public function load_items_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package meteor3_fla
Section 8
//loading_bar_3 (meteor3_fla.loading_bar_3)
package meteor3_fla {
import flash.display.*;
public dynamic class loading_bar_3 extends MovieClip {
public var lbar:MovieClip;
}
}//package meteor3_fla
Section 9
//MainTimeline (meteor3_fla.MainTimeline)
package meteor3_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var loaded:Boolean;
public var particle_container:MovieClip;
public var hubDisplay:MovieClip;
public var highScore:int;
public var rock_container:MovieClip;
public var gameStarted:Boolean;
public var introLogo:MovieClip;
public var myName:String;
public var tutorialStage:int;
public var levelChange:Boolean;
public var so:SharedObject;
public var myContextMenu:ContextMenu;
public var laserTint:int;
public var i:int;
public var j:int;
public var k:int;
public var l:int;
public var blueTint:Array;
public var scoreSubmitted:Boolean;
public var xDistance:Number;
public var loadItems:MovieClip;
public var greenTint:Array;
public var chromeplay:MovieClip;
public var scoreAdd:int;
public var creditsShow:Boolean;
public var totalHealth:Number;
public var star_container:MovieClip;
public var rockTimer:int;
public var readTutorial:Boolean;
public var score_container:MovieClip;
public var musicChannel:SoundChannel;
public var laserBeam:MovieClip;
public var blackFade:MovieClip;
public var redTint:Array;
public var currentHealth:Number;
public var soundToggle:Boolean;
public var currentSecond:int;
public var gameComplete:Boolean;
public var laserJuice:Number;
public var shooting:Boolean;
public var gameTutorial:Boolean;
public var scoreChain:int;
public var slowField:MovieClip;
public var keyLetterA:Boolean;
public var item2:ContextMenuItem;
public var item4:ContextMenuItem;
public var musicMain:mxMain;
public var keyLetterP:Boolean;
public var keyLetterS:Boolean;
public var item3:ContextMenuItem;
public var keyLetterW:Boolean;
public var yDistance:Number;
public var keyLetterD:Boolean;
public var keyLetterE:Boolean;
public var currentLevel:int;
public var keyLetterQ:Boolean;
public var musicVolume:SoundTransform;
public var trail_container:MovieClip;
public var shootingTimer:int;
public var keyPressP:Boolean;
public var tutorialProgress:int;
public var totalScore:int;
public var gamePaused:Boolean;
public var mouseClicked:Boolean;
public var explosion_container:MovieClip;
public var musicToggle:Boolean;
public var gameOver:Boolean;
public var currentTime:int;
public function MainTimeline(){
addFrameScript(0, frame1, 9, frame10, 19, frame20);
}
public function laserShoot(_arg1):void{
if (currentLevel > _arg1){
if (shooting == false){
hubDisplay[("grey" + (_arg1 + 1))].alpha = 0.5;
if (laserJuice > 20){
laserJuice = (laserJuice - 20);
laserFire(_arg1);
};
shooting = true;
};
};
}
public function getURL(_arg1:String, _arg2:String){
var web:String;
var request:URLRequest;
var url = _arg1;
var method = _arg2;
web = url;
request = new URLRequest(web);
try {
navigateToURL(request, method);
} catch(e:Error) {
};
}
public function createExplode(_arg1):void{
var _local2:fxExploder;
var _local3:SoundTransform;
var _local4:Explosion;
if (soundToggle == true){
_local2 = new fxExploder();
_local3 = new SoundTransform(_arg1, 0);
_local2.play(0, 1, _local3);
};
j = 0;
while (j < 200) {
_local4 = new Explosion(rock_container.getChildAt(i).x, rock_container.getChildAt(i).y, MovieClip(rock_container.getChildAt(i)).rockTint);
explosion_container.addChild(_local4);
j++;
};
}
public function linkChromePlay(_arg1:MouseEvent):void{
getURL("http://www.chromeplay.com", "_blank");
}
function frame1(){
stop();
stage.quality = "MEDIUM";
NewgroundsAPI.linkAPI(this);
NewgroundsAPI.connectMovie(4020);
so = SharedObject.getLocal("userData");
highScore = 0;
if (so.size != 0){
highScore = so.data.highScore;
readTutorial = true;
};
loaded = false;
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseClickLoad);
this.addEventListener("enterFrame", load_bar);
chromeplay.addEventListener("click", linkChromePlay);
myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
item2 = new ContextMenuItem("Play More Games");
myContextMenu.customItems.push(item2);
item2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuSelectHandler2);
item3 = new ContextMenuItem("Game Quality: Low");
myContextMenu.customItems.push(item3);
item3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuSelectHandler3);
item4 = new ContextMenuItem("Game Quality: Normal");
myContextMenu.customItems.push(item4);
item4.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuSelectHandler4);
this.contextMenu = myContextMenu;
}
public function menuSelectHandler2(_arg1:ContextMenuEvent):void{
getURL("http://www.chromeplay.com", "_blank");
}
public function menuSelectHandler3(_arg1:ContextMenuEvent):void{
stage.quality = "LOW";
}
public function menuSelectHandler4(_arg1:ContextMenuEvent):void{
stage.quality = "MEDIUM";
}
function frame20(){
stop();
i = 0;
j = 0;
k = 0;
l = 0;
keyLetterQ = false;
keyLetterW = false;
keyLetterE = false;
keyLetterA = false;
keyLetterS = false;
keyLetterD = false;
keyLetterP = false;
keyPressP = false;
shooting = false;
shootingTimer = 0;
gameStarted = false;
gameComplete = false;
gameOver = false;
gameTutorial = false;
gamePaused = false;
readTutorial = false;
if (highScore > 0){
readTutorial = true;
};
creditsShow = false;
scoreSubmitted = false;
tutorialStage = 0;
tutorialProgress = 1;
rockTimer = 0;
myName = "My Name";
currentLevel = 1;
currentTime = 0;
currentSecond = 0;
levelChange = false;
totalHealth = 100;
currentHealth = totalHealth;
laserTint = 0;
laserJuice = 100;
scoreChain = 0;
totalScore = 0;
scoreAdd = 100;
xDistance = 0;
yDistance = 0;
mouseClicked = false;
musicToggle = true;
soundToggle = true;
star_container = new MovieClip();
addChild(star_container);
trail_container = new MovieClip();
addChild(trail_container);
rock_container = new MovieClip();
addChild(rock_container);
particle_container = new MovieClip();
addChild(particle_container);
explosion_container = new MovieClip();
addChild(explosion_container);
score_container = new MovieClip();
addChild(score_container);
laserBeam = new laser_beam();
addChild(laserBeam);
slowField = new slow_field();
addChild(slowField);
hubDisplay = new hub_display();
addChild(hubDisplay);
blackFade = new black_fade();
addChild(blackFade);
blackFade.x = 0;
blackFade.y = 0;
stage.addEventListener(Event.ENTER_FRAME, gameEnterFrame);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseClickDown);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseClickUp);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpFunction);
musicVolume = new SoundTransform(1, 0);
musicMain = new mxMain();
musicChannel = musicMain.play(0, 99, musicVolume);
i = 0;
while (i < 100) {
createStar((Math.random() * 500));
i++;
};
redTint = new Array(1, -1, -1, -1, 1, 1);
greenTint = new Array(-1, 1, -1, 1, -1, 1);
blueTint = new Array(-1, -1, 1, 1, 1, -1);
}
public function createRock(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Number):void{
var _local5:Rock;
_local5 = new Rock(_arg1, _arg2, _arg3, _arg4);
rock_container.addChild(_local5);
}
public function keyDownFunction(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 81){
keyLetterQ = true;
};
if (_arg1.keyCode == 87){
keyLetterW = true;
};
if (_arg1.keyCode == 69){
keyLetterE = true;
};
if (_arg1.keyCode == 65){
keyLetterA = true;
};
if (_arg1.keyCode == 83){
keyLetterS = true;
};
if (_arg1.keyCode == 68){
keyLetterD = true;
};
if (_arg1.keyCode == 80){
keyLetterP = true;
};
}
function frame10(){
stop();
this.addEventListener(Event.ENTER_FRAME, enterFrameIntro);
}
public function gameEnterFrame(_arg1:Event):void{
var _local2:Trail;
var _local3:Score;
var _local4:Particle;
slowField.x = mouseX;
slowField.y = mouseY;
if (keyLetterP == true){
if (keyPressP == false){
keyPressP = true;
if (gamePaused == true){
gamePaused = false;
} else {
if ((((gameStarted == true)) || ((gameTutorial == true)))){
gamePaused = true;
};
};
};
} else {
keyPressP = false;
};
if (gamePaused == true){
if (hubDisplay.gamePaused.alpha < 1){
hubDisplay.gamePaused.alpha = (hubDisplay.gamePaused.alpha + 0.1);
};
} else {
if (hubDisplay.gamePaused.alpha > 0){
hubDisplay.gamePaused.alpha = (hubDisplay.gamePaused.alpha - 0.1);
};
};
if (gameComplete == true){
hubDisplay.gameComplete.x = 0;
if (hubDisplay.gameComplete.alpha < 1){
hubDisplay.gameComplete.alpha = (hubDisplay.gameComplete.alpha + 0.1);
};
} else {
if (hubDisplay.gameComplete.alpha > 0){
hubDisplay.gameComplete.alpha = (hubDisplay.gameComplete.alpha - 0.1);
} else {
hubDisplay.gameComplete.x = 600;
};
};
if (gameOver == true){
hubDisplay.gameOver.x = 0;
if (hubDisplay.gameOver.alpha < 1){
hubDisplay.gameOver.alpha = (hubDisplay.gameOver.alpha + 0.1);
};
} else {
if (hubDisplay.gameOver.alpha > 0){
hubDisplay.gameOver.alpha = (hubDisplay.gameOver.alpha - 0.1);
} else {
hubDisplay.gameOver.x = 600;
};
};
if (musicToggle == true){
hubDisplay.musicSymbol.gotoAndStop(1);
} else {
hubDisplay.musicSymbol.gotoAndStop(2);
};
if (soundToggle == true){
hubDisplay.soundSymbol.gotoAndStop(1);
} else {
hubDisplay.soundSymbol.gotoAndStop(2);
};
hubDisplay.legend_sound.alpha = 0;
if (hubDisplay.musicSymbol.hitTestPoint(mouseX, mouseY, false)){
hubDisplay.musicSymbol.alpha = 1;
hubDisplay.legend_sound.alpha = 1;
hubDisplay.legend_sound.gotoAndStop("music");
} else {
hubDisplay.musicSymbol.alpha = 0.5;
};
if (hubDisplay.soundSymbol.hitTestPoint(mouseX, mouseY, false)){
hubDisplay.soundSymbol.alpha = 1;
hubDisplay.legend_sound.alpha = 1;
hubDisplay.legend_sound.gotoAndStop("sound");
} else {
hubDisplay.soundSymbol.alpha = 0.5;
};
if (hubDisplay.qualitySymbol.hitTestPoint(mouseX, mouseY, false)){
hubDisplay.qualitySymbol.alpha = 1;
hubDisplay.legend_sound.alpha = 1;
hubDisplay.legend_sound.gotoAndStop("pause");
} else {
hubDisplay.qualitySymbol.alpha = 0.5;
};
if (hubDisplay.chromeplayLogo.hitTestPoint(mouseX, mouseY, false)){
hubDisplay.legend_chromeplay.alpha = 1;
hubDisplay.legend_chromeplay.gotoAndStop("chromeplay");
} else {
hubDisplay.legend_chromeplay.alpha = 0;
};
if (gamePaused == true){
if (hubDisplay.gamePaused.returnToMenu.hitTestPoint(mouseX, mouseY, false)){
hubDisplay.gamePaused.returnToMenu.alpha = 1;
} else {
hubDisplay.gamePaused.returnToMenu.alpha = 0.5;
};
};
if (gameComplete == true){
if (hubDisplay.gameComplete.returnToMenu.hitTestPoint(mouseX, mouseY, false)){
hubDisplay.gameComplete.returnToMenu.alpha = 1;
} else {
hubDisplay.gameComplete.returnToMenu.alpha = 0.5;
};
if (scoreSubmitted == true){
hubDisplay.gameComplete.submitScore.alpha = 0.2;
} else {
if (hubDisplay.gameComplete.submitScore.hitTestPoint(mouseX, mouseY, false)){
hubDisplay.gameComplete.submitScore.alpha = 1;
} else {
hubDisplay.gameComplete.submitScore.alpha = 0.5;
};
};
};
if (gameOver == true){
if (hubDisplay.gameOver.returnToMenu.hitTestPoint(mouseX, mouseY, false)){
hubDisplay.gameOver.returnToMenu.alpha = 1;
} else {
hubDisplay.gameOver.returnToMenu.alpha = 0.5;
};
if (scoreSubmitted == true){
hubDisplay.gameOver.submitScore.alpha = 0.2;
} else {
if (hubDisplay.gameOver.submitScore.hitTestPoint(mouseX, mouseY, false)){
hubDisplay.gameOver.submitScore.alpha = 1;
} else {
hubDisplay.gameOver.submitScore.alpha = 0.5;
};
};
};
i = 1;
while (i <= 6) {
if ((((gameStarted == false)) && ((gameTutorial == false)))){
hubDisplay[("grey" + i)].alpha = 1;
} else {
if (currentLevel >= i){
if (hubDisplay[("grey" + i)].alpha > 0){
hubDisplay[("grey" + i)].alpha = (hubDisplay[("grey" + i)].alpha - 0.05);
};
} else {
hubDisplay[("grey" + i)].alpha = 1;
};
};
i++;
};
if (gameStarted == true){
hubDisplay.textStage.text = ("STAGE: " + currentLevel);
hubDisplay.textScore.text = ("SCORE: " + totalScore);
hubDisplay.textTime.text = ("TIME: " + currentSecond);
} else {
if (gameTutorial == true){
hubDisplay.textStage.text = "TUTORIAL";
hubDisplay.textScore.text = (("PART " + tutorialStage) + " of 8");
hubDisplay.textTime.text = "";
} else {
hubDisplay.textStage.text = "";
hubDisplay.textScore.text = "";
hubDisplay.textTime.text = "";
};
};
if ((((gameStarted == true)) || ((gameTutorial == true)))){
hubDisplay.meterDamage.scaleX = (currentHealth / totalHealth);
hubDisplay.meterDamage.gotoAndStop((100 - Math.ceil(currentHealth)));
hubDisplay.backDamage.gotoAndStop((100 - Math.ceil(currentHealth)));
hubDisplay.meterLaser.scaleX = (laserJuice / 100);
hubDisplay.meterLaser.gotoAndStop((100 - Math.ceil(laserJuice)));
hubDisplay.backLaser.gotoAndStop((100 - Math.ceil(laserJuice)));
} else {
hubDisplay.meterDamage.scaleX = 0;
hubDisplay.meterLaser.scaleX = 0;
};
if (currentHealth == 0){
(gameOver == true);
};
if ((((((gamePaused == false)) && ((gameOver == false)))) && ((gameComplete == false)))){
if (currentHealth < totalHealth){
currentHealth = (currentHealth + 0.05);
};
if (laserJuice < 100){
laserJuice = (laserJuice + 2);
};
};
if ((((((((gameComplete == false)) && ((gameOver == false)))) && ((gamePaused == false)))) && ((((gameStarted == true)) || ((gameTutorial == true)))))){
if (keyLetterA == true){
laserShoot(0);
} else {
if (keyLetterS == true){
laserShoot(1);
} else {
if (keyLetterD == true){
laserShoot(2);
} else {
if (keyLetterQ == true){
laserShoot(3);
} else {
if (keyLetterW == true){
laserShoot(4);
} else {
if (keyLetterE == true){
laserShoot(5);
} else {
shooting = false;
};
};
};
};
};
};
};
if ((((((((((mouseY > 50)) && ((mouseY < 450)))) && ((((gameStarted == true)) || ((gameTutorial == true)))))) && ((gameOver == false)))) && ((gameComplete == false)))){
Mouse.hide();
slowField.alpha = 1;
} else {
Mouse.show();
slowField.alpha = 0;
};
if (gameTutorial == true){
if (hubDisplay.tutorialBox.tutorialButtonSkip.hitTestPoint(mouseX, mouseY, true)){
hubDisplay.tutorialBox.tutorialButtonSkip.alpha = 1;
} else {
hubDisplay.tutorialBox.tutorialButtonSkip.alpha = 0.5;
};
if ((((((((tutorialStage == 1)) || ((tutorialStage == 3)))) || ((tutorialStage == 5)))) || ((tutorialStage == 7)))){
hubDisplay.tutorialBox.tutorialButtonNext.alpha = 0;
} else {
if (hubDisplay.tutorialBox.tutorialButtonNext.hitTestPoint(mouseX, mouseY, true)){
hubDisplay.tutorialBox.tutorialButtonNext.alpha = 1;
} else {
hubDisplay.tutorialBox.tutorialButtonNext.alpha = 0.5;
};
};
};
hubDisplay.tutorialBox.gotoAndStop(tutorialStage);
if (gameTutorial == true){
hubDisplay.tutorialBox.alpha = 1;
if (tutorialProgress == 0){
tutorialStage = (tutorialStage + 1);
if (tutorialStage == 7){
tutorialProgress = 2;
} else {
tutorialProgress = 1;
};
if (tutorialStage == 6){
currentLevel = (currentLevel + 1);
};
};
if (tutorialStage == 1){
rockTimer = (rockTimer + 1);
if (rockTimer == 150){
rockTimer = 0;
createRock(150, -50, 0, 4);
};
};
if (tutorialStage == 3){
rockTimer = (rockTimer + 1);
if (rockTimer == 150){
rockTimer = 0;
createRock(130, -50, 0, 4);
createRock(170, -50, 0, 4);
};
};
if (tutorialStage == 5){
rockTimer = (rockTimer + 1);
if (rockTimer == 150){
rockTimer = 0;
createRock(130, -70, 0, 4);
createRock(170, -50, 0, 5);
};
};
if (tutorialStage == 7){
rockTimer = (rockTimer + 1);
if (rockTimer == 150){
rockTimer = 0;
createRock(130, -50, 0, 4);
createRock(170, -50, 1, 4);
};
};
} else {
hubDisplay.tutorialBox.alpha = 0;
};
if ((((((((((gameStarted == false)) && ((gameTutorial == false)))) || ((gamePaused == true)))) || ((gameComplete == true)))) || ((gameOver == true)))){
if (hubDisplay.playMoreGames.alpha < 1){
hubDisplay.playMoreGames.alpha = (hubDisplay.playMoreGames.alpha + 0.1);
};
} else {
if (hubDisplay.playMoreGames.alpha > 0){
hubDisplay.playMoreGames.alpha = (hubDisplay.playMoreGames.alpha - 0.1);
};
};
if ((((gameStarted == true)) || ((gameTutorial == true)))){
if (hubDisplay.menuItems.alpha > 0){
hubDisplay.menuItems.alpha = (hubDisplay.menuItems.alpha - 0.1);
};
if ((((mouseY > 60)) && ((mouseY < 440)))){
laserBeam.y = mouseY;
} else {
if (mouseY > 60){
laserBeam.y = 440;
} else {
laserBeam.y = 60;
};
};
} else {
if (creditsShow == true){
if (hubDisplay.menuItems.alpha > 0){
hubDisplay.menuItems.alpha = (hubDisplay.menuItems.alpha - 0.1);
};
if (hubDisplay.creditsText.alpha < 1){
hubDisplay.creditsText.alpha = (hubDisplay.creditsText.alpha + 0.1);
};
} else {
hubDisplay.menuItems.highScore.text = ("High Score: " + highScore);
if (hubDisplay.menuItems.alpha < 1){
hubDisplay.menuItems.alpha = (hubDisplay.menuItems.alpha + 0.1);
};
if (hubDisplay.creditsText.alpha > 0){
hubDisplay.creditsText.alpha = (hubDisplay.creditsText.alpha - 0.1);
};
if (readTutorial == true){
hubDisplay.menuItems.menuPlay.alpha = 1;
} else {
hubDisplay.menuItems.menuPlay.alpha = 0.2;
};
if (hubDisplay.menuItems.menuPlay.hitTestPoint(mouseX, mouseY, false)){
laserBeam.y = 180;
} else {
if (hubDisplay.menuItems.menuTutorial.hitTestPoint(mouseX, mouseY, false)){
laserBeam.y = 220;
} else {
if (hubDisplay.menuItems.menuCredits.hitTestPoint(mouseX, mouseY, false)){
laserBeam.y = 260;
} else {
if (hubDisplay.menuItems.menuScores.hitTestPoint(mouseX, mouseY, false)){
laserBeam.y = 300;
} else {
if (hubDisplay.playMoreGames.hitTestPoint(mouseX, mouseY, false)){
laserBeam.y = 410;
} else {
laserBeam.y = -10;
};
};
};
};
};
};
};
if ((((((((gamePaused == false)) && ((gameStarted == true)))) && ((gameComplete == false)))) && ((gameOver == false)))){
currentTime = (currentTime + 1);
if (currentTime == 30){
currentTime = 0;
currentSecond = (currentSecond + 1);
};
if (currentSecond == (currentLevel * (30 + (currentLevel * 5)))){
if (currentLevel == 6){
gameComplete = true;
hubDisplay.gameComplete.nameInput.text = (myName + "");
checkHighScore();
} else {
currentLevel = (currentLevel + 1);
levelChange = true;
};
};
if (currentSecond == (((currentLevel - 1) * (30 + ((currentLevel - 1) * 5))) + 5)){
levelChange = false;
};
if (levelChange == true){
if (currentHealth <= 99){
currentHealth = (currentHealth + 1);
};
hubDisplay.levelUp.gotoAndStop((currentLevel - 1));
if (hubDisplay.levelUp.alpha < 1){
hubDisplay.levelUp.alpha = (hubDisplay.levelUp.alpha + 0.1);
};
} else {
if (hubDisplay.levelUp.alpha > 0){
hubDisplay.levelUp.alpha = (hubDisplay.levelUp.alpha - 0.1);
};
};
if (levelChange == false){
rockTimer = (rockTimer + 1);
};
if (rockTimer == 20){
rockTimer = 0;
createRock(((Math.random() * 450) + 50), (-50 - (Math.random() * 100)), Math.floor((Math.random() * currentLevel)), ((Math.random() * 2) + 4));
};
};
scoreChain = 0;
i = 0;
while (i < rock_container.numChildren) {
MovieClip(rock_container.getChildAt(i)).gamePaused = gamePaused;
if ((((((gameOver == true)) || ((gameComplete == true)))) || ((levelChange == true)))){
if (MovieClip(rock_container.getChildAt(i)).alive == true){
MovieClip(rock_container.getChildAt(i)).alive = false;
createExplode(0.5);
};
};
if (rock_container.getChildAt(i).y > 500){
if (MovieClip(rock_container.getChildAt(i)).alive == true){
currentHealth = (currentHealth - 10);
if (currentHealth < 0){
currentHealth = 0;
gameOver = true;
hubDisplay.gameOver.nameInput.text = (myName + "");
checkHighScore();
};
MovieClip(rock_container.getChildAt(i)).alive = false;
if (tutorialStage == 7){
tutorialProgress = 2;
};
};
};
if (MovieClip(rock_container.getChildAt(i)).alive == true){
_local2 = new Trail(MovieClip(rock_container.getChildAt(i)).x, MovieClip(rock_container.getChildAt(i)).y, MovieClip(rock_container.getChildAt(i)).width, MovieClip(rock_container.getChildAt(i)).rockTint);
trail_container.addChild(_local2);
};
if (MovieClip(rock_container.getChildAt(i)).rockTint == laserTint){
if (MovieClip(rock_container.getChildAt(i)).hitTestObject(laserBeam.laser)){
if (MovieClip(rock_container.getChildAt(i)).alive == true){
MovieClip(rock_container.getChildAt(i)).alive = false;
createExplode((0.1 + (MovieClip(rock_container.getChildAt(i)).scaleX / 2)));
scoreChain = (scoreChain + 1);
scoreAdd = ((100 * scoreChain) * scoreChain);
_local3 = new Score(rock_container.getChildAt(i).x, rock_container.getChildAt(i).y, MovieClip(rock_container.getChildAt(i)).rockTint);
score_container.addChild(_local3);
_local3.scorePlus.text = (scoreAdd + "");
if (scoreChain > 1){
_local3.scoreChain.text = (scoreChain + "X CHAIN");
if ((((((tutorialStage == 3)) || ((tutorialStage == 5)))) && ((tutorialProgress == 1)))){
tutorialProgress = 0;
};
} else {
_local3.scoreChain.text = "";
};
totalScore = (totalScore + scoreAdd);
if ((((tutorialStage == 1)) && ((tutorialProgress == 1)))){
tutorialProgress = 0;
};
if ((((tutorialStage == 7)) && ((tutorialProgress > 0)))){
tutorialProgress = (tutorialProgress - 1);
};
};
};
};
MovieClip(rock_container.getChildAt(i)).slowCheck = 0;
xDistance = (mouseX - MovieClip(rock_container.getChildAt(i)).x);
yDistance = (mouseY - MovieClip(rock_container.getChildAt(i)).y);
MovieClip(rock_container.getChildAt(i)).rockDistance = Math.sqrt(((xDistance * xDistance) + (yDistance * yDistance)));
if (mouseClicked == true){
MovieClip(rock_container.getChildAt(i)).slowCheck = 1;
} else {
MovieClip(rock_container.getChildAt(i)).slowCheck = 0;
};
i++;
};
if ((((((((((mouseClicked == true)) && ((((gameStarted == false)) || ((gameTutorial == false)))))) && ((gamePaused == false)))) && ((gameComplete == false)))) && ((gameOver == false)))){
i = 0;
while (i < 20) {
_local4 = new Particle();
particle_container.addChild(_local4);
i++;
};
particle_container.x = mouseX;
particle_container.y = mouseY;
particle_container.rotation = (particle_container.rotation + 5);
};
createStar(500);
}
public function mouseClickDown(_arg1:MouseEvent):void{
mouseClicked = true;
if ((((((((((gameStarted == false)) && ((gameTutorial == false)))) || ((gamePaused == true)))) || ((gameOver == true)))) || ((gameComplete == true)))){
if (hubDisplay.playMoreGames.hitTestPoint(mouseX, mouseY, false)){
getURL("http://www.chromeplay.com", "_blank");
};
};
if (hubDisplay.chromeplayLogo.hitTestPoint(mouseX, mouseY, false)){
getURL("http://www.chromeplay.com", "_blank");
};
if ((((gameStarted == false)) && ((gameTutorial == false)))){
if (creditsShow == false){
if (hubDisplay.menuItems.menuPlay.hitTestPoint(mouseX, mouseY, false)){
if (readTutorial == true){
laserFire(0);
gameStarted = true;
scoreSubmitted = false;
currentLevel = 1;
currentTime = 0;
currentSecond = 0;
rockTimer = 0;
totalScore = 0;
currentHealth = 100;
};
};
if (hubDisplay.menuItems.menuTutorial.hitTestPoint(mouseX, mouseY, false)){
readTutorial = true;
laserFire(1);
gameTutorial = true;
tutorialStage = 1;
currentHealth = 100;
};
if (hubDisplay.menuItems.menuCredits.hitTestPoint(mouseX, mouseY, false)){
laserFire(2);
creditsShow = true;
};
if (hubDisplay.menuItems.menuScores.hitTestPoint(mouseX, mouseY, false)){
laserFire(3);
getURL("http://rankz.armorbot.com/meteorblast/", "_blank");
};
if (hubDisplay.playMoreGames.hitTestPoint(mouseX, mouseY, false)){
laserFire(4);
};
} else {
if (hubDisplay.creditsText.returnToMenu.hitTestPoint(mouseX, mouseY, false)){
creditsShow = false;
};
};
};
if (hubDisplay.soundSymbol.hitTestPoint(mouseX, mouseY, false)){
if (soundToggle == true){
soundToggle = false;
} else {
soundToggle = true;
};
};
if (hubDisplay.musicSymbol.hitTestPoint(mouseX, mouseY, false)){
if (musicToggle == true){
musicToggle = false;
musicVolume = new SoundTransform(0, 0);
musicChannel.soundTransform = musicVolume;
} else {
musicToggle = true;
musicVolume = new SoundTransform(1, 0);
musicChannel.soundTransform = musicVolume;
};
};
if (hubDisplay.qualitySymbol.hitTestPoint(mouseX, mouseY, false)){
if (stage.quality == "MEDIUM"){
stage.quality = "LOW";
} else {
stage.quality = "MEDIUM";
};
};
if (gamePaused == true){
if (hubDisplay.gamePaused.returnToMenu.hitTestPoint(mouseX, mouseY, false)){
returnToMenu();
};
};
if (gameComplete == true){
if (hubDisplay.gameComplete.returnToMenu.hitTestPoint(mouseX, mouseY, false)){
returnToMenu();
};
if (scoreSubmitted == false){
if (hubDisplay.gameComplete.submitScore.hitTestPoint(mouseX, mouseY, false)){
scoreSubmitted = true;
myName = hubDisplay.gameComplete.nameInput.text;
submitScore();
};
};
};
if (gameOver == true){
if (hubDisplay.gameOver.returnToMenu.hitTestPoint(mouseX, mouseY, false)){
returnToMenu();
};
if (scoreSubmitted == false){
if (hubDisplay.gameOver.submitScore.hitTestPoint(mouseX, mouseY, false)){
scoreSubmitted = true;
myName = hubDisplay.gameOver.nameInput.text;
submitScore();
};
};
};
if (gameTutorial == true){
if ((((((tutorialStage == 2)) || ((tutorialStage == 4)))) || ((tutorialStage == 6)))){
if (hubDisplay.tutorialBox.tutorialButtonNext.hitTestPoint(mouseX, mouseY, true)){
tutorialProgress = 0;
};
};
if (tutorialStage == 8){
if (hubDisplay.tutorialBox.tutorialButtonNext.hitTestPoint(mouseX, mouseY, true)){
gameTutorial = false;
gamePaused = false;
};
};
if (hubDisplay.tutorialBox.tutorialButtonSkip.hitTestPoint(mouseX, mouseY, true)){
returnToMenu();
};
};
}
public function load_bar(_arg1:Event):void{
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
loaded = true;
loadItems.preloader.alpha = 0;
loadItems.titleLoading.gotoAndStop(2);
if (loadItems.hitTestPoint(mouseX, mouseY, true)){
loadItems.titleLoading.alpha = 1;
} else {
loadItems.titleLoading.alpha = 0.8;
};
} else {
loadItems.titleLoading.alpha = 0.8;
loadItems.titleLoading.gotoAndStop(1);
loadItems.preloader.lbar.scaleX = (this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal);
};
if (loadItems.currentFrame == loadItems.totalFrames){
gotoAndStop("loader");
stage.removeEventListener(MouseEvent.MOUSE_DOWN, mouseClickLoad);
this.removeEventListener("enterFrame", load_bar);
};
}
public function submitScore():void{
var _local1:URLRequest;
var _local2:URLRequest;
var _local3:URLVariables;
var _local4:Number;
var _local5:String;
_local1 = new URLRequest("http://rankz.armorbot.com/meteorblast/");
_local2 = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
_local2.method = URLRequestMethod.POST;
_local3 = new URLVariables();
_local3.flashkey = "SXlhWVltTWQ=";
_local3.SU0249 = "MzA3M2olZSVhJW4lcw==";
_local3.bmFtZTE = myName;
_local4 = totalScore;
_local5 = (_local4 + "Z");
_local3.c2NvcmUx = _local5.split("0").join("U");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("").join("A");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("AU").join("Y");
_local3.c2NvcmUx = _local3.c2NvcmUx.split("A1").join("B");
_local2.data = _local3;
sendToURL(_local2);
navigateToURL(_local1, "_blank");
}
public function mouseClickLoad(_arg1:MouseEvent):void{
if (loaded == true){
if (loadItems.hitTestPoint(mouseX, mouseY, true)){
loadItems.play();
};
};
}
public function createStar(_arg1):void{
var _local2:Star;
_local2 = new Star(_arg1);
star_container.addChild(_local2);
}
public function laserFire(_arg1):void{
var _local2:ColorTransform;
var _local3:fxLaser;
if (soundToggle == true){
_local3 = new fxLaser();
_local3.play();
};
laserTint = _arg1;
_local2 = laserBeam.transform.colorTransform;
_local2.redOffset = (50 * redTint[_arg1]);
_local2.greenOffset = (50 * greenTint[_arg1]);
_local2.blueOffset = (50 * blueTint[_arg1]);
laserBeam.transform.colorTransform = _local2;
laserBeam.play();
}
public function keyUpFunction(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 81){
keyLetterQ = false;
};
if (_arg1.keyCode == 87){
keyLetterW = false;
};
if (_arg1.keyCode == 69){
keyLetterE = false;
};
if (_arg1.keyCode == 65){
keyLetterA = false;
};
if (_arg1.keyCode == 83){
keyLetterS = false;
};
if (_arg1.keyCode == 68){
keyLetterD = false;
};
if (_arg1.keyCode == 80){
keyLetterP = false;
};
}
public function returnToMenu():void{
removeAllObjects();
gamePaused = false;
gameStarted = false;
gameTutorial = false;
gameComplete = false;
gameOver = false;
levelChange = false;
hubDisplay.levelUp.alpha = 0;
}
public function mouseClickUp(_arg1:MouseEvent):void{
mouseClicked = false;
}
public function checkHighScore():void{
if (totalScore > highScore){
highScore = totalScore;
so.data.highScore = highScore;
};
}
public function removeAllObjects():void{
while (rock_container.numChildren > 0) {
Object(rock_container.getChildAt(0)).removeSelf();
};
while (trail_container.numChildren > 0) {
Object(trail_container.getChildAt(0)).removeSelf();
};
while (particle_container.numChildren > 0) {
Object(particle_container.getChildAt(0)).removeSelf();
};
while (explosion_container.numChildren > 0) {
Object(explosion_container.getChildAt(0)).removeSelf();
};
while (score_container.numChildren > 0) {
Object(score_container.getChildAt(0)).removeSelf();
};
}
public function enterFrameIntro(_arg1:Event):void{
if (introLogo.currentFrame == introLogo.totalFrames){
gotoAndStop("game");
removeEventListener(Event.ENTER_FRAME, enterFrameIntro);
};
}
}
}//package meteor3_fla
Section 10
//menu_items_34 (meteor3_fla.menu_items_34)
package meteor3_fla {
import flash.display.*;
import flash.text.*;
public dynamic class menu_items_34 extends MovieClip {
public var highScore:TextField;
public var menuPlay:MovieClip;
public var menuCredits:MovieClip;
public var menuScores:MovieClip;
public var menuTutorial:MovieClip;
}
}//package meteor3_fla
Section 11
//meter_damage_20 (meteor3_fla.meter_damage_20)
package meteor3_fla {
import flash.display.*;
public dynamic class meter_damage_20 extends MovieClip {
public function meter_damage_20(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package meteor3_fla
Section 12
//meter_laser_21 (meteor3_fla.meter_laser_21)
package meteor3_fla {
import flash.display.*;
public dynamic class meter_laser_21 extends MovieClip {
public function meter_laser_21(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package meteor3_fla
Section 13
//NG_AD_OBJECT_6 (meteor3_fla.NG_AD_OBJECT_6)
package meteor3_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.system.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class NG_AD_OBJECT_6 extends MovieClip {
public var ng_ad:MovieClip;
public var NG_Button:SimpleButton;
public function NG_AD_OBJECT_6(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
NewgroundsAPI.loadNewgrounds();
}
public function startAd(_arg1){
var _local2:URLLoader;
_local2 = new URLLoader(new URLRequest(_arg1));
_local2.addEventListener(Event.COMPLETE, ad_Loaded);
}
function frame1(){
Security.allowDomain("70.87.128.99");
Security.allowInsecureDomain("70.87.128.99");
Security.allowDomain("ads.shizmoo.com");
Security.allowInsecureDomain("ads.shizmoo.com");
Security.allowDomain("www.cpmstar.com");
Security.allowInsecureDomain("www.cpmstar.com");
Security.allowDomain("server.cpmstar.com");
Security.allowInsecureDomain("server.cpmstar.com");
if (NewgroundsAPI.getAdURL()){
startAd(NewgroundsAPI.getAdURL());
};
NewgroundsAPI.addEventListener(NewgroundsAPI.ADS_APPROVED, startAd);
NG_Button.addEventListener(MouseEvent.CLICK, loadNGSite);
stop();
}
public function ad_Loaded(_arg1:Event){
var _local2:*;
var _local3:Loader;
_local2 = String(_arg1.target.data);
_local3 = new Loader();
_local3.load(new URLRequest(_local2));
ng_ad.addChild(_local3);
}
}
}//package meteor3_fla
Section 14
//NG_TANK_8 (meteor3_fla.NG_TANK_8)
package meteor3_fla {
import flash.events.*;
import flash.display.*;
public dynamic class NG_TANK_8 extends MovieClip {
public var NG_Logo:SimpleButton;
public function NG_TANK_8(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
NewgroundsAPI.loadNewgrounds();
}
function frame1(){
NG_Logo.addEventListener(MouseEvent.CLICK, loadNGSite);
}
}
}//package meteor3_fla
Section 15
//tutorial_box_31 (meteor3_fla.tutorial_box_31)
package meteor3_fla {
import flash.display.*;
public dynamic class tutorial_box_31 extends MovieClip {
public var tutorialButtonNext:MovieClip;
public var tutorialButtonSkip:MovieClip;
}
}//package meteor3_fla
Section 16
//black_fade (black_fade)
package {
import flash.display.*;
public dynamic class black_fade extends MovieClip {
public function black_fade(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package
Section 17
//Explosion (Explosion)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Explosion extends Sprite {
public var currentY:Number;
public var startPosX:int;
public var startPosY:int;
public var redTint:Array;
public var gravity:Number;
public var blueTint:Array;
public var startAngle:Number;
public var greenTint:Array;
public var alive:Boolean;// = true
public var moveSpeed:Number;// = 5
public var currentX:Number;
public function Explosion(_arg1, _arg2, _arg3):void{
var _local4:ColorTransform;
alive = true;
redTint = new Array(1, -1, -1, -1, 1, 1);
greenTint = new Array(-1, 1, -1, 1, -1, 1);
blueTint = new Array(-1, -1, 1, 1, 1, -1);
moveSpeed = 5;
super();
startAngle = (Math.random() * 360);
gravity = (Math.random() * -10);
x = ((_arg1 + 10) - (Math.random() * 20));
y = ((_arg2 + 10) - (Math.random() * 20));
_local4 = transform.colorTransform;
_local4.redOffset = (50 * redTint[_arg3]);
_local4.greenOffset = (50 * greenTint[_arg3]);
_local4.blueOffset = (50 * blueTint[_arg3]);
transform.colorTransform = _local4;
addEventListener("enterFrame", clipMove);
}
public function clipMove(_arg1:Event):void{
alpha = (alpha - 0.01);
gravity = (gravity + 1);
if (alpha < 0){
removeSelf();
};
x = (x + (Math.cos(startAngle) * moveSpeed));
y = (y + gravity);
}
public function removeSelf():void{
parent.removeChild(this);
this.removeEventListener("enterFrame", clipMove);
}
}
}//package
Section 18
//fxExploder (fxExploder)
package {
import flash.media.*;
public dynamic class fxExploder extends Sound {
}
}//package
Section 19
//fxLaser (fxLaser)
package {
import flash.media.*;
public dynamic class fxLaser extends Sound {
}
}//package
Section 20
//hub_display (hub_display)
package {
import flash.display.*;
import flash.text.*;
public dynamic class hub_display extends MovieClip {
public var backLaser:MovieClip;
public var musicSymbol:MovieClip;
public var grey1:MovieClip;
public var grey2:MovieClip;
public var grey4:MovieClip;
public var backDamage:MovieClip;
public var legend_chromeplay:MovieClip;
public var grey3:MovieClip;
public var grey6:MovieClip;
public var levelUp:MovieClip;
public var grey5:MovieClip;
public var legend_sound:MovieClip;
public var meterDamage:MovieClip;
public var gameComplete:MovieClip;
public var qualitySymbol:MovieClip;
public var textScore:TextField;
public var chromeplayLogo:MovieClip;
public var textTime:TextField;
public var playMoreGames:MovieClip;
public var menuItems:MovieClip;
public var tutorialBox:MovieClip;
public var meterLaser:MovieClip;
public var soundSymbol:MovieClip;
public var gamePaused:MovieClip;
public var textStage:TextField;
public var gameOver:MovieClip;
public var creditsText:MovieClip;
}
}//package
Section 21
//laser_beam (laser_beam)
package {
import flash.display.*;
public dynamic class laser_beam extends MovieClip {
public var laser:MovieClip;
public function laser_beam(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 22
//mxMain (mxMain)
package {
import flash.media.*;
public dynamic class mxMain extends Sound {
}
}//package
Section 23
//NewgroundsAPI (NewgroundsAPI)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class NewgroundsAPI {
public static const ADS_APPROVED:Number = 3;
public static const bridge:Sprite = new Sprite();
private static const STAT_NEW_VERSION:Number = 4;
private static const STAT_AUTHOR_SITE:Number = 2;
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway.php";
private static const NEWGROUNDS_URL:String = "http://www.newgrounds.com";
private static const STAT_CUSTOM_STATS:Number = 50;
private static const STAT_MOVIE_VIEWS:Number = 1;
private static const STAT_NEWGROUNDS:Number = 3;
public static const NEW_VERSION:Number = 2;
public static const DENY_HOST:Number = 1;
private static var tracker_id:Number;
private static var movie_options:Object = new Object();
private static var connected:Boolean;
private static var custom_events:Object = new Object();
private static var host:String;
private static var linked:Boolean;
private static var events:Object = new Object();
private static var debug:Boolean;
private static var version:String;
private static var custom_links:Object = new Object();
public static function getNewVersionURL(){
return (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + STAT_NEW_VERSION));
}
private static function ReadGatewayData(_arg1:Object){
var _local2:*;
var _local3:String;
var _local4:*;
var _local5:URLLoader;
for (_local2 in _arg1) {
_arg1[_local2] = unescape(_arg1[_local2]);
movie_options[_local2] = _arg1[_local2];
};
if (_arg1["settings_loaded"]){
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage((("Movie Identified as '" + movie_options["movie_name"]) + "'"));
if (movie_options["message"]){
SendMessage(movie_options["message"]);
};
if (movie_options["ad_url"]){
SendMessage("Your movie has been approved to run Flash Ads");
if (events[ADS_APPROVED]){
var _local6 = events;
_local6[ADS_APPROVED](movie_options["ad_url"]);
} else {
onAdsApproved(movie_options["ad_url"]);
};
};
if (((movie_options["movie_version"]) && (!((String(movie_options["movie_version"]) == String(version)))))){
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
if (events[NEW_VERSION]){
_local6 = events;
_local6[NEW_VERSION]({version:movie_options["movie_version"], real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onNewVersionAvailable(movie_options["movie_version"], getMovieURL(), getNewVersionURL());
};
};
if (movie_options["deny_host"]){
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
if (events[DENY_HOST]){
_local6 = events;
_local6[DENY_HOST]({host:host, real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onDenyHost(host, getMovieURL(), getNewVersionURL());
};
};
if (movie_options["request_portal_url"]){
_local3 = bridge.root.loaderInfo.url;
_local4 = ((((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_local3));
_local5 = new URLLoader(new URLRequest(_local4));
};
if (events[69]){
_local6 = events;
_local6[69]();
};
} else {
if (!movie_options["settings_loaded"]){
SendError("Could not establish connection to the API gateway.");
};
};
}
public static function setMovieVersion(_arg1){
if (!_arg1){
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = String(_arg1);
};
}
public static function loadCustomLink(_arg1:String){
if (!_arg1){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else {
if (!custom_links[_arg1]){
SendError(("Attempted to open undefined custom link: " + _arg1));
} else {
SendLink(custom_links[_arg1]);
};
};
}
public static function addCustomLink(_arg1:Number, _arg2:String){
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(((("Created custom link " + _arg1) + ": ") + _arg2));
};
};
}
public static function getMovieURL(){
if (movie_options["movie_url"]){
return (movie_options["movie_url"]);
};
return ("Newgrounds.com");
}
public static function debugMode(){
debug = true;
}
public static function getAdURL(){
return (movie_options["ad_url"]);
}
private static function SendStat(_arg1:Number, _arg2:Boolean, _arg3=null){
var target_url:*;
var XML_Loaded:Function;
var x:*;
var request:URLRequest;
var gateway_loader:URLLoader;
var stat_id = _arg1;
var open_in_browser = _arg2;
var extra = _arg3;
if (!tracker_id){
SendError("You must call NewgroundsAPI.connectMovie() with a valid movie id before using API features!");
} else {
XML_Loaded = function (_arg1:Event){
var _local2:XML;
var _local3:Object;
var _local4:XMLList;
var _local5:XML;
var _local6:*;
var _local7:*;
XML.ignoreWhitespace = true;
_local2 = XML(_arg1.target.data);
_local3 = new Object();
_local4 = _local2.children();
for each (_local5 in _local4) {
_local6 = _local5.localName();
_local7 = _local5.attribute("value");
if (_local7 == Number(_local7)){
_local7 = Number(_local7);
};
_local3[_local6] = _local7;
};
ReadGatewayData(_local3);
};
target_url = (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id) + addSeed());
if (extra){
for (x in extra) {
target_url = (target_url + ((("&" + escape(x)) + "=") + escape(extra[x])));
};
};
if (debug){
target_url = (target_url + "&debug=1");
};
if (open_in_browser){
request = new URLRequest((target_url + addSeed()));
navigateToURL(request, "_blank");
} else {
gateway_loader = new URLLoader(new URLRequest((target_url + addSeed())));
gateway_loader.addEventListener(Event.COMPLETE, XML_Loaded);
};
};
}
public static function onAdsApproved(_arg1:String){
}
public static function loadMySite(_arg1:Event=null){
SendLink(STAT_AUTHOR_SITE);
}
private static function SendMessage(_arg1:String){
trace(("[NEWGROUNDS API] :: " + _arg1));
}
public static function linkAPI(_arg1){
_arg1.addChild(bridge);
linked = true;
}
public static function loadNewgrounds(_arg1:Event=null, _arg2:String=null){
var _local3:URLRequest;
var _local4:*;
if (!tracker_id){
_local3 = new URLRequest(((NEWGROUNDS_URL + "/") + _arg2));
navigateToURL(_local3, "_blank");
} else {
_local4 = null;
if (_arg2){
_local4 = new Object();
_local4.page = _arg2;
};
SendLink(STAT_NEWGROUNDS, _local4);
};
}
private static function SendLink(_arg1, _arg2=null){
SendStat(_arg1, true, _arg2);
}
public static function logCustomEvent(_arg1:String){
if (!_arg1){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else {
if (!custom_events[_arg1]){
SendError(("Attempted to log undefined custom event: " + _arg1));
} else {
SendEvent(custom_events[_arg1]);
};
};
}
private static function SendError(_arg1:String){
trace(("[NEWGROUNDS API ERROR] :: " + _arg1));
}
public static function addCustomEvent(_arg1:Number, _arg2:String){
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(("Created custom event: " + _arg2));
};
};
}
private static function addSeed(){
return (("&seed=" + Math.random()));
}
public static function addEventListener(_arg1:Number, _arg2:Function){
events[_arg1] = _arg2;
}
private static function SendEvent(_arg1){
SendStat(_arg1, false);
}
public static function onNewVersionAvailable(_arg1:String, _arg2:String, _arg3:String){
var sw:*;
var sh:*;
var tw:*;
var th:*;
var mg:*;
var _root:*;
var overlay:MovieClip;
var overlay_x:*;
var overlay_y:*;
var close_x:*;
var blankarea:TextField;
var header:TextField;
var header_format:TextFormat;
var msgtext:TextField;
var msgtext_format:TextFormat;
var msgtext_link:TextFormat;
var version = _arg1;
var movie_url = _arg2;
var redirect_url = _arg3;
sw = bridge.stage.stageWidth;
sh = bridge.stage.stageHeight;
tw = 350;
th = 160;
mg = 20;
_root = bridge.root;
overlay = new MovieClip();
overlay.graphics.beginFill(0, 0.6);
overlay.graphics.lineStyle(0, 0);
overlay.graphics.drawRect(0, 0, sw, sh);
overlay.graphics.endFill();
overlay_x = Math.round(((sw - tw) / 2));
overlay_y = Math.round(((sh - th) / 2));
overlay.graphics.beginFill(102);
overlay.graphics.lineStyle(10, 0);
overlay.graphics.drawRect((overlay_x - mg), (overlay_y - mg), (tw + mg), (th + mg));
overlay.graphics.endFill();
overlay.close = function (_arg1:Event){
_root.removeChild(overlay);
};
close_x = new MovieClip();
close_x.graphics.beginFill(0, 0.1);
close_x.graphics.lineStyle(3, 22015);
close_x.graphics.drawRect(0, 0, 16, 16);
close_x.graphics.endFill();
close_x.graphics.moveTo(4, 4);
close_x.graphics.lineTo(13, 13);
close_x.graphics.moveTo(13, 4);
close_x.graphics.lineTo(4, 13);
close_x.x = ((overlay_x + tw) - 26);
close_x.y = (overlay_y - 10);
close_x.addEventListener(MouseEvent.CLICK, overlay.close);
blankarea = new TextField();
blankarea.x = (overlay_x - mg);
blankarea.y = (overlay_y - mg);
blankarea.width = (tw + mg);
blankarea.height = (th + mg);
blankarea.selectable = false;
header = new TextField();
header.width = tw;
header.x = overlay_x;
header.y = overlay_y;
header.height = 100;
header.selectable = false;
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.color = 0xFFFFFF;
header_format.size = 20;
header.defaultTextFormat = header_format;
header.text = "New Version Available!";
msgtext = new TextField();
msgtext.x = overlay_x;
msgtext.y = (overlay_y + 70);
msgtext.width = tw;
msgtext.height = 60;
msgtext.selectable = false;
msgtext_format = new TextFormat();
msgtext_format.font = "Arial";
msgtext_format.color = 0xFFFFFF;
msgtext_format.size = 12;
msgtext_format.bold = true;
msgtext_link = new TextFormat();
msgtext_link.font = "Arial";
msgtext_link.color = 0xFFFF00;
msgtext_link.size = 12;
msgtext_link.bold = true;
msgtext_link.url = redirect_url;
msgtext_link.target = "_blank";
if (version){
version = ("Version " + version);
} else {
version = "A new version";
};
msgtext.defaultTextFormat = msgtext_format;
msgtext.appendText((version + " is now available"));
if (movie_url){
msgtext.appendText(" at:\n");
msgtext.defaultTextFormat = msgtext_link;
msgtext.appendText(movie_url);
} else {
msgtext.appendText("!");
};
_root.addChild(overlay);
overlay.addChild(blankarea);
overlay.addChild(header);
overlay.addChild(msgtext);
overlay.addChild(close_x);
}
public static function onDenyHost(_arg1:String, _arg2:String, _arg3:String){
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:MovieClip;
var _local10:TextField;
var _local11:TextField;
var _local12:TextFormat;
var _local13:TextField;
var _local14:TextFormat;
var _local15:TextFormat;
_local4 = bridge.stage.stageWidth;
_local5 = bridge.stage.stageHeight;
_local6 = 350;
_local7 = 160;
_local8 = bridge.root;
_local9 = new MovieClip();
_local9.graphics.beginFill(0x660000);
_local9.graphics.lineStyle(20, 0);
_local9.graphics.drawRect(0, 0, _local4, _local5);
_local9.graphics.endFill();
_local10 = new TextField();
_local10.x = 0;
_local10.y = 0;
_local10.width = _local4;
_local10.height = _local5;
_local10.selectable = false;
_local11 = new TextField();
_local11.x = Math.round(((_local4 - _local6) / 2));
_local11.y = Math.round(((_local5 - _local7) / 2.5));
_local11.width = _local6;
_local11.height = 100;
_local11.selectable = false;
_local12 = new TextFormat();
_local12.font = "Arial Black";
_local12.color = 0xFF0000;
_local12.size = 38;
_local11.defaultTextFormat = _local12;
_local11.text = "ERROR!";
_local13 = new TextField();
_local13.x = Math.round(((_local4 - _local6) / 2));
_local13.y = (Math.round(((_local5 - _local7) / 2.5)) + 80);
_local13.width = _local6;
_local13.height = 80;
_local13.selectable = false;
_local14 = new TextFormat();
_local14.font = "Arial";
_local14.color = 0xFFFFFF;
_local14.size = 12;
_local14.bold = true;
_local15 = new TextFormat();
_local15.font = "Arial";
_local15.color = 0xFFFF00;
_local15.size = 12;
_local15.bold = true;
_local15.url = _arg3;
_local15.target = "_blank";
_local13.defaultTextFormat = _local14;
_local13.appendText((("This movie has not been approved for use on " + _arg1) + "\n"));
_local13.appendText("For an approved copy, please visit:\n");
_local13.defaultTextFormat = _local15;
_local13.appendText(_arg2);
_local8.addChild(_local9);
_local9.addChild(_local10);
_local9.addChild(_local11);
_local9.addChild(_local13);
}
public static function connectMovie(_arg1:Number){
var _local2:String;
var _local3:*;
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else {
if (!linked){
SendError("Attempted to call MewgroundsAPI.connectMovie() without first calling NewgroundsAPI.linkAPI(this)");
} else {
if (!tracker_id){
SendMessage("Connecting to API gateway...");
tracker_id = _arg1;
_local2 = bridge.root.loaderInfo.url;
host = _local2.split("/")[2].toLowerCase();
if (host.length < 1){
host = "localhost";
};
_local3 = new Object();
SendEvent(STAT_MOVIE_VIEWS);
};
};
};
}
public static function isInstalled(){
return (true);
}
}
}//package
Section 24
//Particle (Particle)
package {
import flash.events.*;
import flash.display.*;
public class Particle extends Sprite {
public var currentY:Number;
public var startPosX:int;
public var startPosY:int;
public var currentHyp:Number;
public var startAngle:Number;
public var alive:Boolean;// = true
public var storeHyp:Number;// = 100
public var moveSpeed:Number;// = 5
public var currentX:Number;
public function Particle():void{
alive = true;
storeHyp = 100;
moveSpeed = 5;
super();
startAngle = (Math.random() * 360);
x = (Math.cos(startAngle) * (50 + (20 * Math.random())));
y = (Math.sin(startAngle) * (50 + (20 * Math.random())));
addEventListener("enterFrame", clipMove);
}
public function clipMove(_arg1:Event):void{
alpha = (alpha - 0.1);
x = (x - (Math.cos(startAngle) * moveSpeed));
y = (y - (Math.sin(startAngle) * moveSpeed));
currentX = Math.abs(x);
currentY = Math.abs(y);
currentHyp = Math.sqrt(((currentX * currentX) + (currentY * currentY)));
if (currentHyp > storeHyp){
removeSelf();
};
storeHyp = currentHyp;
}
public function removeSelf():void{
parent.removeChild(this);
this.removeEventListener("enterFrame", clipMove);
}
}
}//package
Section 25
//redPic (redPic)
package {
import flash.display.*;
public dynamic class redPic extends MovieClip {
}
}//package
Section 26
//Rock (Rock)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Rock extends MovieClip {
public var rockTint:Number;
public var rockFrame:Number;// = 1
public var redTint:Array;
public var slowVar:Number;// = 1
public var blueTint:Array;
public var rock:MovieClip;
public var slowCheck:Number;// = 0
public var rockDistance:Number;// = 1
public var greenTint:Array;
public var alive:Boolean;// = true
public var gamePaused:Boolean;// = true
public var rockMove:Boolean;// = true
public var rockSpeed:Number;
public function Rock(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Number):void{
var _local5:ColorTransform;
gamePaused = true;
alive = true;
rockMove = true;
slowCheck = 0;
slowVar = 1;
redTint = new Array(1, -1, -1, -1, 1, 1);
greenTint = new Array(-1, 1, -1, 1, -1, 1);
blueTint = new Array(-1, -1, 1, 1, 1, -1);
rockDistance = 1;
rockFrame = 1;
super();
x = _arg1;
y = _arg2;
scaleX = (scaleY = ((Math.random() * 0.5) + 0.5));
if (Math.random() > 0.5){
scaleX = -(scaleX);
};
rockTint = _arg3;
_local5 = transform.colorTransform;
_local5.redOffset = (50 * redTint[rockTint]);
_local5.greenOffset = (50 * greenTint[rockTint]);
_local5.blueOffset = (50 * blueTint[rockTint]);
transform.colorTransform = _local5;
rockSpeed = _arg4;
addEventListener("enterFrame", clipMove);
}
public function clipMove(_arg1:Event):void{
if (gamePaused == false){
slowVar = (0.2 + (rockDistance / 70));
if ((((slowVar > 1)) || ((slowCheck == 0)))){
slowVar = 1;
};
if (rockMove == true){
y = (y + (rockSpeed * slowVar));
};
rockFrame = (rockFrame + slowVar);
if (rockFrame > 58){
rockFrame = 1;
};
rock.gotoAndStop(Math.ceil(rockFrame));
if (alive == false){
alpha = (alpha - 0.2);
if (alpha == 0){
removeSelf();
};
};
};
}
public function removeSelf():void{
parent.removeChild(this);
this.removeEventListener("enterFrame", clipMove);
}
}
}//package
Section 27
//Score (Score)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
public class Score extends MovieClip {
public var redTint:Array;
public var scorePlus:TextField;
public var scoreChain:TextField;
public var blueTint:Array;
public var greenTint:Array;
public function Score(_arg1, _arg2, _arg3):void{
var _local4:ColorTransform;
redTint = new Array(1, -1, -1, -1, 1, 1);
greenTint = new Array(-1, 1, -1, 1, -1, 1);
blueTint = new Array(-1, -1, 1, 1, 1, -1);
super();
x = _arg1;
y = _arg2;
_local4 = transform.colorTransform;
_local4.redOffset = (50 * redTint[_arg3]);
_local4.greenOffset = (50 * greenTint[_arg3]);
_local4.blueOffset = (50 * blueTint[_arg3]);
transform.colorTransform = _local4;
addEventListener("enterFrame", clipMove);
}
public function clipMove(_arg1:Event):void{
alpha = (alpha - 0.05);
if (alpha == 0){
removeSelf();
};
y = (y - 2);
}
public function removeSelf():void{
parent.removeChild(this);
this.removeEventListener("enterFrame", clipMove);
}
}
}//package
Section 28
//slow_field (slow_field)
package {
import flash.display.*;
public dynamic class slow_field extends MovieClip {
}
}//package
Section 29
//Star (Star)
package {
import flash.events.*;
import flash.display.*;
public class Star extends Sprite {
public var alive:Boolean;// = true
public var moveSpeed:Number;
public function Star(_arg1):void{
alive = true;
super();
x = (Math.random() * 550);
y = _arg1;
moveSpeed = (5 + (Math.random() * 5));
alpha = (0.5 + (Math.random() * 0.5));
addEventListener("enterFrame", clipMove);
}
public function clipMove(_arg1:Event):void{
y = (y - moveSpeed);
if (y < -50){
removeSelf();
};
}
public function removeSelf():void{
parent.removeChild(this);
this.removeEventListener("enterFrame", clipMove);
}
}
}//package
Section 30
//Trail (Trail)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Trail extends MovieClip {
public var redTint:Array;
public var blueTint:Array;
public var greenTint:Array;
public var alive:Boolean;// = true
public var moveSpeed:Number;
public function Trail(_arg1, _arg2, _arg3, _arg4):void{
var _local5:ColorTransform;
alive = true;
redTint = new Array(1, -1, -1, -1, 1, 1);
greenTint = new Array(-1, 1, -1, 1, -1, 1);
blueTint = new Array(-1, -1, 1, 1, 1, -1);
super();
x = ((_arg1 + (Math.random() * _arg3)) - (_arg3 / 2));
y = (_arg2 - (Math.random() * (_arg3 / 2)));
moveSpeed = (5 + (Math.random() * 5));
_local5 = transform.colorTransform;
_local5.redOffset = ((50 * redTint[_arg4]) + (Math.random() * 150));
_local5.greenOffset = (50 * greenTint[_arg4]);
_local5.blueOffset = (50 * blueTint[_arg4]);
transform.colorTransform = _local5;
alpha = 1;
addEventListener("enterFrame", clipMove);
}
public function clipMove(_arg1:Event):void{
y = (y - moveSpeed);
alpha = (alpha - 0.1);
if (alpha < 0){
removeSelf();
};
}
public function removeSelf():void{
parent.removeChild(this);
this.removeEventListener("enterFrame", clipMove);
}
}
}//package