Section 1
//assets_43 (gluefo_fla.assets_43)
package gluefo_fla {
import flash.display.*;
public dynamic class assets_43 extends MovieClip {
public function assets_43(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package gluefo_fla
Section 2
//creditsScreen_38 (gluefo_fla.creditsScreen_38)
package gluefo_fla {
import flash.display.*;
public dynamic class creditsScreen_38 extends MovieClip {
public var cont:SimpleButton;
public var soundsnap:SimpleButton;
public var irregular:SimpleButton;
public var flashkit:SimpleButton;
}
}//package gluefo_fla
Section 3
//evilGluefoWarning_4 (gluefo_fla.evilGluefoWarning_4)
package gluefo_fla {
import flash.display.*;
public dynamic class evilGluefoWarning_4 extends MovieClip {
public function evilGluefoWarning_4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package gluefo_fla
Section 4
//gameBack_2 (gluefo_fla.gameBack_2)
package gluefo_fla {
import flash.display.*;
public dynamic class gameBack_2 extends MovieClip {
public function gameBack_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package gluefo_fla
Section 5
//gameOverScreen_14 (gluefo_fla.gameOverScreen_14)
package gluefo_fla {
import flash.display.*;
public dynamic class gameOverScreen_14 extends MovieClip {
public var movHiScores:HiScores;
public var contBtn:SimpleButton;
}
}//package gluefo_fla
Section 6
//gameScreen_1 (gluefo_fla.gameScreen_1)
package gluefo_fla {
import flash.display.*;
import flash.text.*;
public dynamic class gameScreen_1 extends MovieClip {
public var levelTxt:TextField;
public var bombTxt:TextField;
public var gluetronBonus:MovieClip;
public var scoreTxt:TextField;
public var evilGluefoWarning:MovieClip;
public var livesTxt:TextField;
public var gameBack:MovieClip;
}
}//package gluefo_fla
Section 7
//gluetronBonus_3 (gluefo_fla.gluetronBonus_3)
package gluefo_fla {
import flash.display.*;
public dynamic class gluetronBonus_3 extends MovieClip {
public function gluetronBonus_3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package gluefo_fla
Section 8
//levelResultsScreen_26 (gluefo_fla.levelResultsScreen_26)
package gluefo_fla {
import flash.display.*;
import flash.text.*;
public dynamic class levelResultsScreen_26 extends MovieClip {
public var thrustersN:MovieClip;
public var gluetronN:MovieClip;
public var vacuumBought:MovieClip;
public var vacuumN:MovieClip;
public var timeTxt:TextField;
public var gluetronBtn:SimpleButton;
public var orbsTxt:TextField;
public var nextLevelBtn:SimpleButton;
public var vacuumBtn:SimpleButton;
public var rotationalBtn:SimpleButton;
public var multiTxt:TextField;
public var thrustersBought:MovieClip;
public var scoreTxt:TextField;
public var upgradeTxt:TextField;
public var lifeBtn:SimpleButton;
public var lifeN:MovieClip;
}
}//package gluefo_fla
Section 9
//loadingText_25 (gluefo_fla.loadingText_25)
package gluefo_fla {
import flash.display.*;
public dynamic class loadingText_25 extends MovieClip {
public function loadingText_25(){
addFrameScript(150, frame151);
}
function frame151(){
stop();
}
}
}//package gluefo_fla
Section 10
//menuScreen_16 (gluefo_fla.menuScreen_16)
package gluefo_fla {
import flash.display.*;
public dynamic class menuScreen_16 extends MovieClip {
public var tutorialBtn:SimpleButton;
public var irregulargamesBtn:SimpleButton;
public var playSBtn:SimpleButton;
public var creditsBtn:SimpleButton;
public var playABtn:SimpleButton;
}
}//package gluefo_fla
Section 11
//siteLockScreen_22 (gluefo_fla.siteLockScreen_22)
package gluefo_fla {
import flash.display.*;
public dynamic class siteLockScreen_22 extends MovieClip {
public var siteLockTxt:SimpleButton;
}
}//package gluefo_fla
Section 12
//titleScreen_6 (gluefo_fla.titleScreen_6)
package gluefo_fla {
import flash.display.*;
public dynamic class titleScreen_6 extends MovieClip {
public var tutorial:MovieClip;
public var playGame:SimpleButton;
public var replayTutorial:SimpleButton;
public var backMenu:SimpleButton;
public var skipTutorial:SimpleButton;
}
}//package gluefo_fla
Section 13
//tutorial_7 (gluefo_fla.tutorial_7)
package gluefo_fla {
import flash.display.*;
public dynamic class tutorial_7 extends MovieClip {
public function tutorial_7(){
addFrameScript(1370, frame1371);
}
function frame1371(){
stop();
}
}
}//package gluefo_fla
Section 14
//movAutoEntryScreen_6 (HiScores_fla.movAutoEntryScreen_6)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movAutoEntryScreen_6 extends MovieClip {
public var txtName:TextField;
public var txtMsg2:TextField;
public var btnEnterAnother:SimpleButton;
public var txtMsg1:TextField;
public var btnSubmit:SimpleButton;
}
}//package HiScores_fla
Section 15
//movEntryScreen_2 (HiScores_fla.movEntryScreen_2)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movEntryScreen_2 extends MovieClip {
public var txtName:TextField;
public var movCode:MovieClip;
public var txtMsg2:TextField;
public var btnRefreshCode:SimpleButton;
public var txtCode:TextField;
public var txtMsg1:TextField;
public var btnSubmit:SimpleButton;
}
}//package HiScores_fla
Section 16
//movInfoScreen_8 (HiScores_fla.movInfoScreen_8)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movInfoScreen_8 extends MovieClip {
public var btnView:SimpleButton;
public var txtInfo:TextField;
public var btnBack:SimpleButton;
}
}//package HiScores_fla
Section 17
//bigOrb (bigOrb)
package {
public class bigOrb extends orb {
public function bigOrb(_arg1:gluefo, _arg2:Number=250, _arg3:Number=250, _arg4:Number=5, _arg5:Number=5, _arg6:uint=20, _arg7:int=0xFF00, _arg8:uint=1, _arg9:int=0):void{
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9);
}
override public function moveOrb():void{
this.x = (this.x + this.dx);
this.y = (this.y + this.dy);
this.wrapOrb();
theGluefo.orbTrail.orbBlur(this);
}
}
}//package
Section 18
//blurTrail (blurTrail)
package {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class blurTrail extends MovieClip {
private var rectFling:Rectangle;
private var rectTiny:Rectangle;
private var effectRect:Rectangle;
private var blurEffect:BlurFilter;
private var particleSmall:BitmapData;
private var bitmapDataLayer:BitmapData;
private var effectPt:Point;
private var particleFling:BitmapData;
public var pt:Point;
private var rectBig:Rectangle;
private var rectSmall:Rectangle;
private var rectMedium:Rectangle;
private var particleBig:BitmapData;
private var blurAmount:int;// = 10
private var particleTiny:BitmapData;
private var particleMedium:BitmapData;
public function blurTrail():void{
var _local1:Bitmap;
var _local2:Shape;
blurAmount = 10;
super();
blurEffect = new BlurFilter(blurAmount, blurAmount, 1);
pt = new Point();
rectFling = new Rectangle(0, 0, (gluefo.TINYRADIUS * 2), (gluefo.TINYRADIUS * 2));
rectTiny = new Rectangle(0, 0, (gluefo.TINYRADIUS * 1.5), (gluefo.TINYRADIUS * 1.5));
rectSmall = new Rectangle(0, 0, (gluefo.SMALLRADIUS / 2), (gluefo.SMALLRADIUS / 2));
rectMedium = new Rectangle(0, 0, (gluefo.MEDIUMRADIUS / 2), (gluefo.MEDIUMRADIUS / 2));
rectBig = new Rectangle(0, 0, (gluefo.BIGRADIUS / 2), (gluefo.BIGRADIUS / 2));
effectRect = new Rectangle(0, 0, 500, 450);
effectPt = new Point(0, 0);
bitmapDataLayer = new BitmapData(500, 450, true, 0);
_local1 = new Bitmap(bitmapDataLayer);
this.addChild(_local1);
_local2 = new Shape();
_local2.graphics.beginFill(0xFFFFFF);
_local2.graphics.drawCircle(gluefo.TINYRADIUS, gluefo.TINYRADIUS, gluefo.TINYRADIUS);
particleFling = new BitmapData((gluefo.TINYRADIUS * 2), (gluefo.TINYRADIUS * 2), true, 0);
particleFling.draw(_local2);
}
public function setBlurColor():void{
var _local1:Shape;
_local1 = new Shape();
_local1.graphics.beginFill(gluefo.ORBCOLOR);
_local1.graphics.drawCircle((gluefo.TINYRADIUS * 0.75), (gluefo.TINYRADIUS * 0.75), (gluefo.TINYRADIUS * 0.75));
particleTiny = new BitmapData((gluefo.TINYRADIUS * 1.5), (gluefo.TINYRADIUS * 1.5), true, 0);
particleTiny.draw(_local1);
_local1.graphics.clear();
_local1.graphics.beginFill(gluefo.ORBCOLOR);
_local1.graphics.drawCircle((gluefo.SMALLRADIUS * 0.25), (gluefo.SMALLRADIUS * 0.25), (gluefo.SMALLRADIUS * 0.25));
particleSmall = new BitmapData((gluefo.SMALLRADIUS / 2), (gluefo.SMALLRADIUS / 2), true, 0);
particleSmall.draw(_local1);
_local1.graphics.clear();
_local1.graphics.beginFill(gluefo.ORBCOLOR);
_local1.graphics.drawCircle((gluefo.MEDIUMRADIUS * 0.25), (gluefo.MEDIUMRADIUS * 0.25), (gluefo.MEDIUMRADIUS * 0.25));
particleMedium = new BitmapData((gluefo.MEDIUMRADIUS / 2), (gluefo.MEDIUMRADIUS / 2), true, 0);
particleMedium.draw(_local1);
_local1.graphics.clear();
_local1.graphics.beginFill(gluefo.ORBCOLOR);
_local1.graphics.drawCircle((gluefo.BIGRADIUS * 0.25), (gluefo.BIGRADIUS * 0.25), (gluefo.BIGRADIUS * 0.25));
particleBig = new BitmapData((gluefo.BIGRADIUS / 2), (gluefo.BIGRADIUS / 2), true, 0);
particleBig.draw(_local1);
}
public function orbFilter():void{
bitmapDataLayer.applyFilter(bitmapDataLayer, effectRect, effectPt, blurEffect);
}
public function clearTrails():void{
var _local1:Rectangle;
_local1 = new Rectangle(0, 0, 500, 450);
bitmapDataLayer.fillRect(_local1, 0);
}
public function orbBlur(_arg1:orb):void{
switch (_arg1.radius){
case gluefo.TINYRADIUS:
if ((((_arg1.stickmode == "explode")) || ((_arg1.stickmode == "explodeEvil")))){
pt.x = (_arg1.x - gluefo.TINYRADIUS);
pt.y = (_arg1.y - gluefo.TINYRADIUS);
bitmapDataLayer.copyPixels(particleFling, rectFling, pt, null, null, true);
} else {
pt.x = (_arg1.x - (gluefo.TINYRADIUS * 0.75));
pt.y = (_arg1.y - (gluefo.TINYRADIUS * 0.75));
bitmapDataLayer.copyPixels(particleTiny, rectTiny, pt, null, null, true);
};
break;
case gluefo.SMALLRADIUS:
pt.x = (_arg1.x - (gluefo.SMALLRADIUS * 0.25));
pt.y = (_arg1.y - (gluefo.SMALLRADIUS * 0.25));
bitmapDataLayer.copyPixels(particleSmall, rectSmall, pt, null, null, true);
break;
case gluefo.MEDIUMRADIUS:
pt.x = (_arg1.x - (gluefo.MEDIUMRADIUS * 0.25));
pt.y = (_arg1.y - (gluefo.MEDIUMRADIUS * 0.25));
bitmapDataLayer.copyPixels(particleMedium, rectMedium, pt, null, null, true);
break;
case gluefo.BIGRADIUS:
pt.x = (_arg1.x - (gluefo.BIGRADIUS * 0.25));
pt.y = (_arg1.y - (gluefo.BIGRADIUS * 0.25));
bitmapDataLayer.copyPixels(particleBig, rectBig, pt, null, null, true);
break;
};
}
}
}//package
Section 19
//bombSound (bombSound)
package {
import flash.media.*;
public dynamic class bombSound extends Sound {
}
}//package
Section 20
//buttonSound (buttonSound)
package {
import flash.media.*;
public dynamic class buttonSound extends Sound {
}
}//package
Section 21
//damageSound (damageSound)
package {
import flash.media.*;
public dynamic class damageSound extends Sound {
}
}//package
Section 22
//evilGluefo (evilGluefo)
package {
import flash.display.*;
public class evilGluefo extends MovieClip {
private var dy:Number;
public var radius;// = 25
private var theGluefo:gluefo;
private var dx:Number;
public var aimode:String;// = "seek"
public static const RADIUS2 = Math.pow(evilGluefo.RADIUS, 2);
public static const RADIUS = 25;
public static const ROTVEL = 4;
public static const EXPLODEPOWER = 0.5;
private static const VEL = 3.5;
public function evilGluefo(_arg1:gluefo, _arg2:Number=250, _arg3:Number=250, _arg4:Number=5, _arg5:Number=5):void{
aimode = "seek";
radius = 25;
super();
addFrameScript(0, frame1, 23, frame24);
this.theGluefo = _arg1;
this.x = _arg2;
this.y = _arg3;
this.dx = _arg4;
this.dy = _arg5;
}
public function moveEvilGluefo():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:Number;
var _local6:Number;
if (aimode == "seek"){
_local1 = 250;
_local2 = 250;
_local3 = -1;
_local4 = 0;
while (_local4 < theGluefo.tinyOrbs.length) {
if (theGluefo.tinyOrbs[_local4].stickmode == "ready"){
_local5 = (((this.x - theGluefo.tinyOrbs[_local4].x) * (this.x - theGluefo.tinyOrbs[_local4].x)) + ((this.y - theGluefo.tinyOrbs[_local4].y) * (this.y - theGluefo.tinyOrbs[_local4].y)));
if ((((_local3 == -1)) || ((_local5 < _local3)))){
_local3 = _local5;
_local1 = theGluefo.tinyOrbs[_local4].x;
_local2 = theGluefo.tinyOrbs[_local4].y;
};
};
_local4++;
};
if (_local3 != -1){
_local6 = (Math.abs((_local1 - this.x)) + Math.abs((_local2 - this.y)));
this.dx = ((evilGluefo.VEL * (_local1 - this.x)) / _local6);
this.dy = ((evilGluefo.VEL * (_local2 - this.y)) / _local6);
};
this.x = (this.x + this.dx);
this.y = (this.y + this.dy);
wrap();
} else {
if (aimode == "rotate"){
this.dx = (this.dy = 0);
} else {
if (aimode == "dying"){
this.x = (this.x + this.dx);
this.y = (this.y + this.dy);
wrap();
};
};
};
}
function frame1(){
stop();
}
function frame24(){
stop();
}
public function wrap():void{
if ((((this.x > (gluefo.WIDTH + evilGluefo.RADIUS))) && ((this.dx > 0)))){
this.x = -(evilGluefo.RADIUS);
};
if ((((this.x < (0 - evilGluefo.RADIUS))) && ((this.dx < 0)))){
this.x = (gluefo.WIDTH + evilGluefo.RADIUS);
};
if ((((this.y > (gluefo.HEIGHT + evilGluefo.RADIUS))) && ((this.dy > 0)))){
this.y = -(evilGluefo.RADIUS);
};
if ((((this.y < (0 - evilGluefo.RADIUS))) && ((this.dy < 0)))){
this.y = (gluefo.HEIGHT + evilGluefo.RADIUS);
};
}
}
}//package
Section 23
//evilGluefoSound (evilGluefoSound)
package {
import flash.media.*;
public dynamic class evilGluefoSound extends Sound {
}
}//package
Section 24
//explodeSound (explodeSound)
package {
import flash.media.*;
public dynamic class explodeSound extends Sound {
}
}//package
Section 25
//gluefo (gluefo)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
public dynamic class gluefo extends MovieClip {
public var pauseScreen:MovieClip;
private var firstPlay:Boolean;// = true
public var siteLockScreen:MovieClip;
private var music:musicSound;
private var invincible:Boolean;// = false
public var explosionNum:uint;
private var rs:int;
public var theReadout:MovieClip;
public var orbTrail:blurTrail;
public var instructionsScreen:MovieClip;
private var mediumOrbs:Array;
public var tinyOrbs:Array;
public var movSplash:Splash;
private var bigOrbs:Array;
public var menuScreen:MovieClip;
private var totalMultiBonus:uint;
public var loadingScreen:MovieClip;
public var levelResultsScreen:MovieClip;
private var musicOn:Boolean;// = true
public var gameScreen:MovieClip;
private var livesNum:uint;
public var levelMultiBonus:uint;
private var smallOrbs:Array;
private var musicChannel:SoundChannel;
private var tutClick:Boolean;
private var sfxOn:Boolean;// = true
public var levelOrbsNum:uint;
private var levelNum:uint;
public var bombNum:uint;
public var totalOrbsNum:uint;
private var theLevel:level;
private var invincibleTime:uint;
public var creditsScreen:MovieClip;
public var scoreNum:uint;
public var theEvilGluefo:evilGluefo;// = null
private var upgradeNum:uint;
public var theUfo:ufo;
private var pauseTime:uint;
public var orbNumHit:Array;
public var gameOverScreen:MovieClip;
public static const TINYTOMEDIUM2 = Math.pow((gluefo.TINYRADIUS + gluefo.MEDIUMRADIUS), 2);
public static const BIGRADIUS = 30;
public static const GLUEFOTOMEDIUM2 = Math.pow((gluefo.RADIUS + gluefo.MEDIUMRADIUS), 2);
public static const TINYRADIUS = 3;
public static const INVINCIBLEWAIT = 2000;
public static const RADIUS = 25;
public static const GLUEFOTOTINY2 = Math.pow((gluefo.RADIUS + gluefo.TINYRADIUS), 2);
public static const SOUNDTRAN:SoundTransform = new SoundTransform();
public static const GLUEFOTOBIG2 = Math.pow((gluefo.RADIUS + gluefo.BIGRADIUS), 2);
public static const WIDTH = 500;
public static const HEIGHT = 450;
public static const GLUEFOTOSMALL2 = Math.pow((gluefo.RADIUS + gluefo.SMALLRADIUS), 2);
public static const ROT = 5;
public static const SMALLRADIUS = 15;
private static const EXPLODEPOWER = 0.5;
public static const MEDIUMRADIUS = 22;
public static const PAUSEWAIT = 5000;
public static const TINYTOBIG2 = Math.pow((gluefo.TINYRADIUS + gluefo.BIGRADIUS), 2);
public static const TINYTOGLUEFO2 = Math.pow((gluefo.RADIUS + gluefo.RADIUS), 2);
public static const RADIUS2 = Math.pow(gluefo.RADIUS, 2);
public static const GLUEFOTOGLUEFO2 = Math.pow((gluefo.RADIUS + evilGluefo.RADIUS), 2);
public static const TINYTOSMALL2 = Math.pow((gluefo.TINYRADIUS + gluefo.SMALLRADIUS), 2);
public static const ATTRACTAMOUNT = 1000;
private static var DOROTATION:Boolean;
public static var SOUNDCHANNEL:SoundChannel;
public static var ATTRACTING:Boolean;
public static var PLAYADVANCED:Boolean;
private static var PAUSESTATE:Boolean = false;
public static var ORBCOLOR;
public function gluefo():void{
theEvilGluefo = null;
tinyOrbs = [];
smallOrbs = [];
mediumOrbs = [];
bigOrbs = [];
invincible = false;
sfxOn = true;
firstPlay = true;
pauseTime = getTimer();
musicOn = true;
super();
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
public function randRange(_arg1:Number, _arg2:Number):Number{
if (Math.random() > 0.5){
return ((_arg1 + (Math.random() * _arg2)));
};
return ((-(_arg1) - (Math.random() * _arg2)));
}
private function tutorialListener(_arg1:Event):void{
if (instructionsScreen.tutorial.currentLabel == "finished"){
instructionsScreen.replayTutorial.visible = true;
instructionsScreen.replayTutorial.addEventListener(MouseEvent.MOUSE_DOWN, clickReplay);
if (!tutClick){
instructionsScreen.playGame.visible = true;
instructionsScreen.playGame.addEventListener(MouseEvent.MOUSE_DOWN, clickInstructions);
instructionsScreen.skipTutorial.visible = false;
instructionsScreen.skipTutorial.removeEventListener(MouseEvent.MOUSE_DOWN, clickInstructions);
};
removeEventListener(Event.ENTER_FRAME, tutorialListener);
};
}
private function clickGluetron(_arg1:MouseEvent):void{
var _local2:buttonSound;
if (upgradeNum >= 1){
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
bombNum++;
gameScreen.bombTxt.text = String(bombNum);
upgradeNum--;
levelResultsScreen.upgradeTxt.text = String(upgradeNum);
displayUpgrades();
};
}
function frame2(){
stop();
movSplash.addEventListener(Event.ENTER_FRAME, splashEnterFrame);
}
function frame1(){
MochiAd.showPreGameAd({clip:root, id:"697f73f1a6670e43", res:"500x500", background:39423, color:13260, outline:0xCCCCCC, no_bg:true});
}
function frame4(){
stop();
MochiBot.track(this, "8509406d");
this.startGame();
}
private function clickBack(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
hideit(instructionsScreen);
instructionsScreen.backMenu.removeEventListener(MouseEvent.MOUSE_DOWN, clickBack);
removeEventListener(Event.ENTER_FRAME, tutorialListener);
showit(menuScreen, 0, 0);
}
public function createOrbs(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:uint, _arg6:String):void{
var _local7:uint;
_local7 = 0;
while (_local7 < _arg5) {
switch (_arg6){
case "tinyOrb":
tinyOrbs[tinyOrbs.length] = new orb(this, _arg1, _arg2, _arg3, _arg4, gluefo.TINYRADIUS, gluefo.ORBCOLOR, 1, gluefo.ORBCOLOR);
addChild(tinyOrbs[(tinyOrbs.length - 1)]);
break;
case "smallOrb":
smallOrbs[smallOrbs.length] = new bigOrb(this, _arg1, _arg2, _arg3, _arg4, gluefo.SMALLRADIUS, gluefo.ORBCOLOR, 1, 0x333333);
addChild(smallOrbs[(smallOrbs.length - 1)]);
break;
case "mediumOrb":
mediumOrbs[mediumOrbs.length] = new bigOrb(this, _arg1, _arg2, _arg3, _arg4, gluefo.MEDIUMRADIUS, gluefo.ORBCOLOR, 1, 0x333333);
addChild(mediumOrbs[(mediumOrbs.length - 1)]);
break;
case "bigOrb":
bigOrbs[bigOrbs.length] = new bigOrb(this, _arg1, _arg2, _arg3, _arg4, gluefo.BIGRADIUS, gluefo.ORBCOLOR, 1, 0x333333);
addChild(bigOrbs[(bigOrbs.length - 1)]);
break;
case "default":
break;
};
_local7++;
};
}
public function createEvilGluefo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
theEvilGluefo = new evilGluefo(this, _arg1, _arg2, _arg3, _arg4);
addChild(theEvilGluefo);
}
private function clickLife(_arg1:MouseEvent):void{
var _local2:buttonSound;
if (upgradeNum >= 5){
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
livesNum++;
gameScreen.livesTxt.text = String(livesNum);
upgradeNum = (upgradeNum - 5);
levelResultsScreen.upgradeTxt.text = String(upgradeNum);
displayUpgrades();
};
}
private function clickFlashkit(_arg1:MouseEvent):void{
openUrl("http://www.flashkit.com");
}
private function clickHandler(_arg1:MouseEvent):void{
var _local2:Boolean;
var _local3:uint;
var _local4:explodeSound;
var _local5:noExplodeSound;
if (theUfo.currentLabel != "die"){
_local2 = false;
_local3 = 0;
while (_local3 < tinyOrbs.length) {
if (tinyOrbs[_local3].stickmode == "stick"){
tinyOrbs[_local3].explodeOrb(gluefo.EXPLODEPOWER, explosionNum);
_local2 = true;
};
_local3++;
};
if (_local2){
_local4 = new explodeSound();
gluefo.SOUNDCHANNEL = _local4.play(0, 1, gluefo.SOUNDTRAN);
theUfo.gotoAndPlay("explode");
explosionNum++;
} else {
_local5 = new noExplodeSound();
gluefo.SOUNDCHANNEL = _local5.play(0, 1, gluefo.SOUNDTRAN);
};
};
}
private function clickSoundsnap(_arg1:MouseEvent):void{
openUrl("http://www.soundsnap.com");
}
private function displayUpgrades():void{
levelResultsScreen.gluetronBtn.visible = false;
levelResultsScreen.rotationalBtn.visible = false;
levelResultsScreen.vacuumBtn.visible = false;
levelResultsScreen.lifeBtn.visible = false;
levelResultsScreen.gluetronN.visible = true;
levelResultsScreen.thrustersN.visible = true;
levelResultsScreen.vacuumN.visible = true;
levelResultsScreen.lifeN.visible = true;
if (upgradeNum >= 5){
levelResultsScreen.lifeBtn.visible = true;
levelResultsScreen.lifeN.visible = false;
};
if (gluefo.ATTRACTING){
levelResultsScreen.vacuumBtn.visible = false;
levelResultsScreen.vacuumN.visible = false;
levelResultsScreen.vacuumBought.visible = true;
} else {
levelResultsScreen.vacuumBought.visible = false;
if (upgradeNum >= 3){
levelResultsScreen.vacuumBtn.visible = true;
levelResultsScreen.vacuumN.visible = false;
};
};
if (gluefo.DOROTATION){
levelResultsScreen.rotationalBtn.visible = false;
levelResultsScreen.thrustersN.visible = false;
levelResultsScreen.thrustersBought.visible = true;
} else {
levelResultsScreen.thrustersBought.visible = false;
if (upgradeNum >= 2){
levelResultsScreen.rotationalBtn.visible = true;
levelResultsScreen.thrustersN.visible = false;
};
};
if (upgradeNum >= 1){
levelResultsScreen.gluetronBtn.visible = true;
levelResultsScreen.gluetronN.visible = false;
};
}
private function clickSiteLock(_arg1:MouseEvent):void{
openUrl("http://www.irregulargames.com/gluefo/");
}
private function neutronBomb():void{
var _local1:bombSound;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:noExplodeSound;
if (bombNum > 0){
_local1 = new bombSound();
gluefo.SOUNDCHANNEL = _local1.play(0, 1, gluefo.SOUNDTRAN);
bombNum--;
gameScreen.bombTxt.text = String(bombNum);
_local2 = 0;
while (_local2 < smallOrbs.length) {
createOrbs(smallOrbs[_local2].x, smallOrbs[_local2].y, randRange(1, 1), randRange(1, 1), 1, "tinyOrb");
createOrbs(smallOrbs[_local2].x, smallOrbs[_local2].y, randRange(1, 1), randRange(1, 1), 1, "tinyOrb");
removeChild(smallOrbs[_local2]);
scoreNum++;
levelOrbsNum++;
totalOrbsNum++;
rs = (rs - 8);
_local2++;
};
smallOrbs = [];
_local3 = 0;
while (_local3 < mediumOrbs.length) {
createOrbs(mediumOrbs[_local3].x, mediumOrbs[_local3].y, randRange(2, 2), randRange(2, 2), 1, "smallOrb");
createOrbs(mediumOrbs[_local3].x, mediumOrbs[_local3].y, randRange(2, 2), randRange(2, 2), 1, "smallOrb");
removeChild(mediumOrbs[_local3]);
scoreNum++;
levelOrbsNum++;
totalOrbsNum++;
rs = (rs - 8);
_local3++;
};
mediumOrbs = [];
_local4 = 0;
while (_local4 < bigOrbs.length) {
createOrbs(bigOrbs[_local4].x, bigOrbs[_local4].y, randRange(1, 2), randRange(1, 2), 1, "mediumOrb");
createOrbs(bigOrbs[_local4].x, bigOrbs[_local4].y, randRange(1, 2), randRange(1, 2), 1, "mediumOrb");
removeChild(bigOrbs[_local4]);
scoreNum++;
levelOrbsNum++;
totalOrbsNum++;
rs = (rs - 8);
_local4++;
};
bigOrbs = [];
if (theEvilGluefo != null){
theEvilGluefo.gotoAndPlay("die");
theEvilGluefo.aimode = "dying";
scoreNum++;
levelOrbsNum++;
totalOrbsNum++;
rs = (rs - 8);
};
gameScreen.scoreTxt.text = String(scoreNum);
} else {
_local5 = new noExplodeSound();
gluefo.SOUNDCHANNEL = _local5.play(0, 1, gluefo.SOUNDTRAN);
};
}
private function openUrl(_arg1:String):void{
var button:buttonSound;
var request:URLRequest;
var url = _arg1;
button = new buttonSound();
gluefo.SOUNDCHANNEL = button.play(0, 1, gluefo.SOUNDTRAN);
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
};
}
private function checkGluefoHit(_arg1:Array, _arg2:Number):void{
var _local3:uint;
var _local4:damageSound;
_local3 = 0;
while (_local3 < _arg1.length) {
if (((!((_arg1[_local3].radius == gluefo.TINYRADIUS))) || ((_arg1[_local3].stickmode == "explodeEvil")))){
if (((!(invincible)) && (((Math.pow((this.theUfo.x - _arg1[_local3].x), 2) + Math.pow((this.theUfo.y - _arg1[_local3].y), 2)) < _arg2)))){
_local4 = new damageSound();
gluefo.SOUNDCHANNEL = _local4.play(0, 1, gluefo.SOUNDTRAN);
invincible = true;
invincibleTime = getTimer();
livesNum--;
gameScreen.livesTxt.text = String(livesNum);
theUfo.gotoAndPlay("flash");
gameScreen.gameBack.gotoAndPlay(2);
};
};
_local3++;
};
}
private function clickCont(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
hideit(gameOverScreen);
gameOverScreen.contBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickCont);
newMenu();
}
private function showit(_arg1, _arg2, _arg3):void{
_arg1.x = _arg2;
_arg1.y = _arg3;
_arg1.visible = true;
}
private function contextDown(_arg1:ContextMenuEvent):void{
openUrl("http://www.irregulargames.com/");
}
private function clickTutorial(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
hideit(menuScreen);
showit(instructionsScreen, 0, 0);
instructionsScreen.tutorial.gotoAndPlay(1);
instructionsScreen.replayTutorial.visible = false;
instructionsScreen.playGame.visible = false;
instructionsScreen.skipTutorial.visible = false;
instructionsScreen.backMenu.visible = true;
instructionsScreen.backMenu.addEventListener(MouseEvent.MOUSE_DOWN, clickBack);
addEventListener(Event.ENTER_FRAME, tutorialListener);
firstPlay = false;
tutClick = true;
}
private function clickPlay(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
gluefo.PLAYADVANCED = true;
hideit(menuScreen);
if (firstPlay){
showit(instructionsScreen, 0, 0);
instructionsScreen.tutorial.gotoAndPlay(1);
instructionsScreen.replayTutorial.visible = false;
instructionsScreen.playGame.visible = false;
instructionsScreen.skipTutorial.visible = true;
instructionsScreen.backMenu.visible = false;
instructionsScreen.skipTutorial.addEventListener(MouseEvent.MOUSE_DOWN, clickInstructions);
addEventListener(Event.ENTER_FRAME, tutorialListener);
firstPlay = false;
tutClick = false;
} else {
newGame();
};
}
private function pauseGame(_arg1:Boolean):void{
if (_arg1){
if (gluefo.PLAYADVANCED){
theLevel.stopTimer();
};
gluefo.PAUSESTATE = true;
Mouse.show();
removeEventListener(Event.ENTER_FRAME, enterFrameListener);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, clickHandler);
showit(pauseScreen, 0, 0);
setChildIndex(pauseScreen, (numChildren - 1));
} else {
if (gluefo.PLAYADVANCED){
theLevel.startTimer();
};
gluefo.PAUSESTATE = false;
pauseTime = getTimer();
Mouse.hide();
hideit(pauseScreen);
addEventListener(Event.ENTER_FRAME, enterFrameListener);
stage.addEventListener(MouseEvent.MOUSE_DOWN, clickHandler);
};
}
private function checkMulti(_arg1:uint):void{
var _local2:Boolean;
var _local3:uint;
_local2 = false;
_local3 = 0;
while (_local3 < orbNumHit.length) {
if (orbNumHit[_local3] == _arg1){
_local2 = true;
levelMultiBonus++;
theReadout.multiBonusTxt.text = String(levelMultiBonus);
break;
};
_local3++;
};
if (!_local2){
orbNumHit.push(_arg1);
};
}
private function newMenu():void{
showit(menuScreen, 0, 0);
menuScreen.irregulargamesBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickIrregular);
menuScreen.tutorialBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickTutorial);
menuScreen.creditsBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickCredits);
menuScreen.playABtn.addEventListener(MouseEvent.MOUSE_DOWN, clickPlay);
menuScreen.playSBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickSimplePlay);
}
public function splashEnterFrame(_arg1:Event){
if (movSplash.isComplete()){
movSplash.removeEventListener(Event.ENTER_FRAME, splashEnterFrame);
play();
};
}
private function showSiteLock():void{
showit(siteLockScreen, 0, 0);
siteLockScreen.siteLockTxt.addEventListener(MouseEvent.MOUSE_DOWN, clickSiteLock);
}
private function enterFrameListener(_arg1:Event):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:levelSound;
var _local8:Boolean;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:ufoExplodeSound;
var _local18:splitSound;
var _local19:Array;
var _local20:ufoExplodeSound;
theUfo.dx = (theUfo.dx + (0.45 * (root.mouseX - theUfo.x)));
theUfo.dy = (theUfo.dy + (0.45 * (root.mouseY - theUfo.y)));
theUfo.dx = (theUfo.dx * 0.4);
theUfo.dy = (theUfo.dy * 0.4);
theUfo.x = (theUfo.x + theUfo.dx);
theUfo.y = (theUfo.y + theUfo.dy);
if (theUfo.x > gluefo.WIDTH){
theUfo.x = gluefo.WIDTH;
};
if (theUfo.x < 0){
theUfo.x = 0;
};
if (theUfo.y > gluefo.HEIGHT){
theUfo.y = gluefo.HEIGHT;
};
if (theUfo.y < 0){
theUfo.y = 0;
};
if (theUfo.currentLabel != "die"){
if ((((((((smallOrbs.length == 0)) && ((mediumOrbs.length == 0)))) && ((bigOrbs.length == 0)))) && ((theEvilGluefo == null)))){
_local6 = 0;
while (_local6 < tinyOrbs.length) {
removeChild(tinyOrbs[_local6]);
_local6++;
};
tinyOrbs = [];
levelNum++;
if (gluefo.PLAYADVANCED){
upgradeNum++;
levelResults();
} else {
_local7 = new levelSound();
gluefo.SOUNDCHANNEL = _local7.play(0, 1, gluefo.SOUNDTRAN);
theLevel.newLevel(levelNum);
orbTrail.setBlurColor();
};
};
if (((!((theEvilGluefo == null))) && ((theEvilGluefo.currentLabel == "dead")))){
removeChild(theEvilGluefo);
theEvilGluefo = null;
};
if (((invincible) && (((getTimer() - invincibleTime) > gluefo.INVINCIBLEWAIT)))){
invincible = false;
theUfo.gotoAndStop("normal");
};
};
_local2 = 0;
while (_local2 < tinyOrbs.length) {
tinyOrbs[_local2].moveOrb();
_local2++;
};
_local3 = 0;
while (_local3 < smallOrbs.length) {
smallOrbs[_local3].moveOrb();
_local3++;
};
_local4 = 0;
while (_local4 < mediumOrbs.length) {
mediumOrbs[_local4].moveOrb();
_local4++;
};
_local5 = 0;
while (_local5 < bigOrbs.length) {
bigOrbs[_local5].moveOrb();
_local5++;
};
if (theEvilGluefo != null){
theEvilGluefo.moveEvilGluefo();
};
if (theUfo.currentLabel != "die"){
_local8 = false;
_local9 = 0;
while (_local9 < tinyOrbs.length) {
_local10 = 0;
while (_local10 < smallOrbs.length) {
_local13 = (Math.pow((tinyOrbs[_local9].x - smallOrbs[_local10].x), 2) + Math.pow((tinyOrbs[_local9].y - smallOrbs[_local10].y), 2));
if ((((_local13 < TINYTOSMALL2)) && ((tinyOrbs[_local9].stickmode == "explode")))){
tinyOrbs[_local9].explodeToReady();
if (gluefo.PLAYADVANCED){
checkMulti(tinyOrbs[_local9].explosionNum);
};
createOrbs(smallOrbs[_local10].x, smallOrbs[_local10].y, randRange(1, 1), randRange(1, 1), 1, "tinyOrb");
createOrbs(smallOrbs[_local10].x, smallOrbs[_local10].y, randRange(1, 1), randRange(1, 1), 1, "tinyOrb");
removeChild(smallOrbs[_local10]);
smallOrbs.splice(_local10, 1);
_local8 = true;
scoreNum++;
levelOrbsNum++;
totalOrbsNum++;
rs = (rs - 8);
};
_local10++;
};
_local11 = 0;
while (_local11 < mediumOrbs.length) {
_local14 = (Math.pow((tinyOrbs[_local9].x - mediumOrbs[_local11].x), 2) + Math.pow((tinyOrbs[_local9].y - mediumOrbs[_local11].y), 2));
if ((((_local14 < TINYTOMEDIUM2)) && ((tinyOrbs[_local9].stickmode == "explode")))){
tinyOrbs[_local9].explodeToReady();
if (gluefo.PLAYADVANCED){
checkMulti(tinyOrbs[_local9].explosionNum);
};
createOrbs(mediumOrbs[_local11].x, mediumOrbs[_local11].y, randRange(2, 2), randRange(2, 2), 1, "smallOrb");
createOrbs(mediumOrbs[_local11].x, mediumOrbs[_local11].y, randRange(2, 2), randRange(2, 2), 1, "smallOrb");
removeChild(mediumOrbs[_local11]);
mediumOrbs.splice(_local11, 1);
_local8 = true;
scoreNum++;
levelOrbsNum++;
totalOrbsNum++;
rs = (rs - 8);
};
_local11++;
};
_local12 = 0;
while (_local12 < bigOrbs.length) {
_local15 = (Math.pow((tinyOrbs[_local9].x - bigOrbs[_local12].x), 2) + Math.pow((tinyOrbs[_local9].y - bigOrbs[_local12].y), 2));
if ((((_local15 < TINYTOBIG2)) && ((tinyOrbs[_local9].stickmode == "explode")))){
tinyOrbs[_local9].explodeToReady();
if (gluefo.PLAYADVANCED){
checkMulti(tinyOrbs[_local9].explosionNum);
};
createOrbs(bigOrbs[_local12].x, bigOrbs[_local12].y, randRange(1, 2), randRange(1, 2), 1, "mediumOrb");
createOrbs(bigOrbs[_local12].x, bigOrbs[_local12].y, randRange(1, 2), randRange(1, 2), 1, "mediumOrb");
removeChild(bigOrbs[_local12]);
bigOrbs.splice(_local12, 1);
_local8 = true;
scoreNum++;
levelOrbsNum++;
totalOrbsNum++;
rs = (rs - 8);
};
_local12++;
};
if (((!((theEvilGluefo == null))) && ((theEvilGluefo.currentLabel == "normal")))){
_local16 = (Math.pow((tinyOrbs[_local9].x - theEvilGluefo.x), 2) + Math.pow((tinyOrbs[_local9].y - theEvilGluefo.y), 2));
if ((((_local16 < TINYTOBIG2)) && ((tinyOrbs[_local9].stickmode == "explode")))){
_local17 = new ufoExplodeSound();
gluefo.SOUNDCHANNEL = _local17.play(0, 1, gluefo.SOUNDTRAN);
tinyOrbs[_local9].explodeToReady();
if (gluefo.PLAYADVANCED){
checkMulti(tinyOrbs[_local9].explosionNum);
};
theEvilGluefo.gotoAndPlay("die");
theEvilGluefo.aimode = "dying";
};
};
_local9++;
};
if (_local8){
_local18 = new splitSound();
gluefo.SOUNDCHANNEL = _local18.play(0, 1, gluefo.SOUNDTRAN);
gameScreen.scoreTxt.text = String(scoreNum);
};
setChildIndex(theReadout, (numChildren - 1));
setChildIndex(theUfo, (numChildren - 1));
checkGluefoHit(smallOrbs, GLUEFOTOSMALL2);
checkGluefoHit(mediumOrbs, GLUEFOTOMEDIUM2);
checkGluefoHit(bigOrbs, GLUEFOTOBIG2);
checkGluefoHit(tinyOrbs, GLUEFOTOTINY2);
if (theEvilGluefo != null){
_local19 = [];
_local19[0] = theEvilGluefo;
checkGluefoHit(_local19, GLUEFOTOGLUEFO2);
};
};
orbTrail.orbFilter();
if (livesNum <= 0){
if (theUfo.currentLabel == "dead"){
endGame();
} else {
if (theUfo.currentLabel != "die"){
_local20 = new ufoExplodeSound();
gluefo.SOUNDCHANNEL = _local20.play(0, 1, gluefo.SOUNDTRAN);
theUfo.gotoAndPlay("die");
};
};
};
}
private function clickInstructions(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
hideit(instructionsScreen);
instructionsScreen.removeEventListener(MouseEvent.MOUSE_DOWN, clickInstructions);
if (instructionsScreen.skipTutorial.visible){
removeEventListener(Event.ENTER_FRAME, tutorialListener);
} else {
instructionsScreen.replayTutorial.removeEventListener(MouseEvent.MOUSE_DOWN, clickReplay);
};
newGame();
}
private function clickContinueCredits(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
creditsScreen.cont.removeEventListener(MouseEvent.MOUSE_DOWN, clickContinueCredits);
creditsScreen.irregular.removeEventListener(MouseEvent.MOUSE_DOWN, clickIrregular);
creditsScreen.soundsnap.removeEventListener(MouseEvent.MOUSE_DOWN, clickSoundsnap);
creditsScreen.flashkit.removeEventListener(MouseEvent.MOUSE_DOWN, clickFlashkit);
hideit(creditsScreen);
showit(menuScreen, 0, 0);
}
private function clickVacuum(_arg1:MouseEvent):void{
var _local2:buttonSound;
if (upgradeNum >= 3){
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
gluefo.ATTRACTING = true;
upgradeNum = (upgradeNum - 3);
levelResultsScreen.upgradeTxt.text = String(upgradeNum);
displayUpgrades();
};
}
private function endGame():void{
var g:uint;
var h:uint;
var i:uint;
var j:uint;
Mouse.show();
orbTrail.clearTrails();
if (gluefo.PLAYADVANCED){
try {
gameOverScreen.movHiScores.setDetails(79, 1, "gluefo", false, (-(rs) / 8), String((-(rs) / 8)), "points!");
} catch(e) {
};
} else {
try {
gameOverScreen.movHiScores.setDetails(79, 0, "gluefo", false, (-(rs) / 8), String((-(rs) / 8)), "points!");
} catch(e) {
};
};
showit(gameOverScreen, 0, 0);
hideit(gameScreen);
gameOverScreen.contBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickCont);
removeEventListener(Event.ENTER_FRAME, enterFrameListener);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, clickHandler);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
removeChild(theUfo);
removeChild(theReadout);
removeChild(orbTrail);
theUfo = null;
theReadout = null;
orbTrail = null;
g = 0;
while (g < tinyOrbs.length) {
removeChild(tinyOrbs[g]);
g = (g + 1);
};
h = 0;
while (h < smallOrbs.length) {
removeChild(smallOrbs[h]);
h = (h + 1);
};
i = 0;
while (i < mediumOrbs.length) {
removeChild(mediumOrbs[i]);
i = (i + 1);
};
j = 0;
while (j < bigOrbs.length) {
removeChild(bigOrbs[j]);
j = (j + 1);
};
if (theEvilGluefo != null){
removeChild(theEvilGluefo);
theEvilGluefo = null;
};
tinyOrbs = [];
smallOrbs = [];
mediumOrbs = [];
bigOrbs = [];
theLevel.killTimer();
theLevel.killEvilTimer();
theLevel = null;
}
private function startGame():void{
var _local1:ContextMenuItem;
var _local2:ContextMenu;
music = new musicSound();
musicChannel = music.play(0, 9999);
_local1 = new ContextMenuItem("irRegularGames");
_local1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextDown);
_local2 = new ContextMenu();
_local2.hideBuiltInItems();
_local2.customItems.push(_local1);
(this as MovieClip).contextMenu = _local2;
newMenu();
hideit(loadingScreen);
}
private function clickReplay(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
instructionsScreen.tutorial.gotoAndPlay(1);
addEventListener(Event.ENTER_FRAME, tutorialListener);
instructionsScreen.replayTutorial.visible = false;
instructionsScreen.replayTutorial.removeEventListener(MouseEvent.MOUSE_DOWN, clickReplay);
if (!tutClick){
instructionsScreen.playGame.visible = false;
instructionsScreen.playGame.removeEventListener(MouseEvent.MOUSE_DOWN, clickInstructions);
instructionsScreen.skipTutorial.visible = true;
instructionsScreen.skipTutorial.addEventListener(MouseEvent.MOUSE_DOWN, clickInstructions);
};
}
private function clickNextLevel(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
addChild(orbTrail);
Mouse.hide();
showit(gameScreen, 0, 0);
showit(theUfo, 250, 250);
showit(theReadout, 0, gluefo.HEIGHT);
hideit(levelResultsScreen);
levelResultsScreen.nextLevelBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickNextLevel);
levelResultsScreen.gluetronBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickGluetron);
levelResultsScreen.rotationalBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickRotational);
levelResultsScreen.vacuumBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickVacuum);
levelResultsScreen.lifeBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickLife);
addEventListener(Event.ENTER_FRAME, enterFrameListener);
stage.addEventListener(MouseEvent.MOUSE_DOWN, clickHandler);
theLevel.newLevel(levelNum);
orbTrail.setBlurColor();
}
private function newGame():void{
menuScreen.irregulargamesBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickIrregular);
menuScreen.tutorialBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickTutorial);
menuScreen.creditsBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickCredits);
menuScreen.playABtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickPlay);
menuScreen.playSBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickSimplePlay);
showit(gameScreen, 0, 0);
hideit(menuScreen);
theUfo = new ufo();
addChild(theUfo);
theUfo.x = (theUfo.y = 250);
theUfo.dx = (theUfo.dy = 0);
theUfo.gotoAndStop("normal");
if (gluefo.PLAYADVANCED){
theReadout = MovieClip(new readout());
theReadout.rotateKeys.visible = false;
} else {
theReadout = MovieClip(new simpleReadout());
};
addChild(theReadout);
theReadout.x = 0;
theReadout.y = gluefo.HEIGHT;
orbTrail = new blurTrail();
addChild(orbTrail);
rs = 0;
scoreNum = 0;
totalOrbsNum = 0;
upgradeNum = 0;
bombNum = 3;
livesNum = 5;
levelNum = 1;
theLevel = new level(this);
theLevel.newLevel(levelNum);
orbTrail.setBlurColor();
gluefo.PAUSESTATE = false;
gluefo.ATTRACTING = false;
gluefo.DOROTATION = false;
pauseTime = getTimer();
addEventListener(Event.ENTER_FRAME, enterFrameListener);
stage.addEventListener(MouseEvent.MOUSE_DOWN, clickHandler);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
gameScreen.livesTxt.text = String(livesNum);
gameScreen.bombTxt.text = String(bombNum);
Mouse.hide();
}
private function clickSimplePlay(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
gluefo.PLAYADVANCED = false;
hideit(menuScreen);
if (firstPlay){
showit(instructionsScreen, 0, 0);
instructionsScreen.tutorial.gotoAndPlay(1);
instructionsScreen.replayTutorial.visible = false;
instructionsScreen.playGame.visible = false;
instructionsScreen.skipTutorial.visible = true;
instructionsScreen.backMenu.visible = false;
instructionsScreen.skipTutorial.addEventListener(MouseEvent.MOUSE_DOWN, clickInstructions);
addEventListener(Event.ENTER_FRAME, tutorialListener);
firstPlay = false;
tutClick = false;
} else {
newGame();
};
}
private function clickIrregular(_arg1:MouseEvent):void{
openUrl("http://www.irregulargames.com/");
}
private function clickRotational(_arg1:MouseEvent):void{
var _local2:buttonSound;
if (upgradeNum >= 2){
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
gluefo.DOROTATION = true;
theReadout.rotateKeys.visible = true;
upgradeNum = (upgradeNum - 2);
levelResultsScreen.upgradeTxt.text = String(upgradeNum);
displayUpgrades();
};
}
private function levelResults():void{
var _local1:levelSound;
_local1 = new levelSound();
gluefo.SOUNDCHANNEL = _local1.play(0, 1, gluefo.SOUNDTRAN);
removeChild(orbTrail);
orbTrail.clearTrails();
theUfo.x = (theUfo.y = 250);
Mouse.show();
hideit(theUfo);
hideit(theReadout);
displayUpgrades();
levelResultsScreen.orbsTxt.text = String(levelOrbsNum);
levelResultsScreen.timeTxt.text = String(theLevel.timeBonus);
levelResultsScreen.multiTxt.text = String(levelMultiBonus);
scoreNum = (scoreNum + (theLevel.timeBonus + levelMultiBonus));
rs = (rs - (8 * (theLevel.timeBonus + levelMultiBonus)));
levelResultsScreen.scoreTxt.text = String(((levelOrbsNum + theLevel.timeBonus) + levelMultiBonus));
levelResultsScreen.upgradeTxt.text = String(upgradeNum);
showit(levelResultsScreen, 0, 0);
hideit(gameScreen);
removeEventListener(Event.ENTER_FRAME, enterFrameListener);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, clickHandler);
levelResultsScreen.nextLevelBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickNextLevel);
levelResultsScreen.gluetronBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickGluetron);
levelResultsScreen.rotationalBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickRotational);
levelResultsScreen.vacuumBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickVacuum);
levelResultsScreen.lifeBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickLife);
}
private function keyHandler(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:uint;
if ((((_arg1.keyCode == 80)) || ((_arg1.keyCode == 27)))){
if (((gluefo.PAUSESTATE) || (((!(gluefo.PAUSESTATE)) && (((getTimer() - pauseTime) > gluefo.PAUSEWAIT)))))){
pauseGame(!(gluefo.PAUSESTATE));
};
};
if (_arg1.keyCode == 83){
if (sfxOn){
gluefo.SOUNDTRAN.volume = 0;
gluefo.SOUNDCHANNEL.soundTransform = gluefo.SOUNDTRAN;
sfxOn = false;
} else {
gluefo.SOUNDTRAN.volume = 1;
gluefo.SOUNDCHANNEL.soundTransform = gluefo.SOUNDTRAN;
sfxOn = true;
};
};
if (_arg1.keyCode == 77){
if (musicOn){
musicChannel.stop();
musicOn = false;
} else {
musicChannel = music.play(0, 9999);
musicOn = true;
};
};
if ((((_arg1.keyCode == 37)) || ((((_arg1.keyCode == 65)) && (gluefo.DOROTATION))))){
this.theUfo.rotation = (this.theUfo.rotation - gluefo.ROT);
_local2 = 0;
while (_local2 < tinyOrbs.length) {
tinyOrbs[_local2].rotateOrb(1);
_local2++;
};
};
if ((((_arg1.keyCode == 39)) || ((((_arg1.keyCode == 68)) && (gluefo.DOROTATION))))){
this.theUfo.rotation = (this.theUfo.rotation + gluefo.ROT);
_local3 = 0;
while (_local3 < tinyOrbs.length) {
tinyOrbs[_local3].rotateOrb(-1);
_local3++;
};
};
if (_arg1.keyCode == 32){
neutronBomb();
};
}
private function hideit(_arg1):void{
_arg1.x = 5000;
_arg1.y = 5000;
_arg1.visible = false;
}
private function clickCredits(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
gluefo.SOUNDCHANNEL = _local2.play(0, 1, gluefo.SOUNDTRAN);
hideit(menuScreen);
showit(creditsScreen, 0, 0);
creditsScreen.cont.addEventListener(MouseEvent.MOUSE_DOWN, clickContinueCredits);
creditsScreen.irregular.addEventListener(MouseEvent.MOUSE_DOWN, clickIrregular);
creditsScreen.soundsnap.addEventListener(MouseEvent.MOUSE_DOWN, clickSoundsnap);
creditsScreen.flashkit.addEventListener(MouseEvent.MOUSE_DOWN, clickFlashkit);
}
}
}//package
Section 26
//HiScores (HiScores)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.external.*;
public dynamic class HiScores extends MovieClip {
private var KEY:String;// = "rocket"
private var g5UserExists:Boolean;
private var autoEntryScreen:MovieClip;// = null
private var g5User:Object;
private var score:Number;
private var lowIsBest:Boolean;
private var gameId:Number;
public var movAutoEntryScreen:MovieClip;
private var infoScreen:MovieClip;// = null
public var movEntryScreen:MovieClip;
private var levelId:Number;
private var msg1:String;
private var msg2:String;
private var entryScreen:MovieClip;// = null
public var movInfoScreen:MovieClip;
private var gameCode:String;
public static var HS_SERVLET_URL:String = (SERVER_URL + "/servlet/hiServlet");
public static var SERVER_URL:String = "http://www.gimme5games.com";
public static var HI_SCORE_URL:String = (SERVER_URL + "/index.jsp?id=");
public function HiScores(){
KEY = "rocket";
entryScreen = null;
autoEntryScreen = null;
infoScreen = null;
super();
this.visible = false;
}
public function secCodeLoad():void{
var _local1:Loader;
var _local2:String;
_local1 = new Loader();
_local1.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, secCodeLoadError);
_local2 = ((HS_SERVLET_URL + "?type=genCode&cachebuster=") + new Date().getTime());
_local1.load(new URLRequest(_local2));
entryScreen["movCode"].addChild(_local1);
}
public function back():void{
entryScreen.visible = true;
infoScreen.visible = false;
}
public function submitHiScoreHandler(_arg1:Event):void{
var _local2:URLLoader;
var _local3:Number;
_local2 = URLLoader(_arg1.target);
_local3 = _local2.data.res;
if (_local3 == -1){
showInfoMessage("Could not store hi-score details. Click on back, generate a new security code and re-submit.", true);
} else {
if (_local3 == 0){
showInfoMessage("Sorry, a better score already exists with that name.", false);
} else {
if (_local3 == 1){
showInfoMessage("Congratulations! You made it into the\nhi-score table.", false);
};
};
};
}
public function showInfoMessage(_arg1:String, _arg2:Boolean):void{
infoScreen["txtInfo"].text = _arg1;
infoScreen["btnBack"].visible = _arg2;
infoScreen["btnView"].visible = !(_arg2);
}
public function enterAnotherName():void{
this.g5UserExists = false;
autoEntryScreen.visible = false;
showEntryScreen();
}
private function showEntryScreen():void{
entryScreen["txtMsg1"].text = msg1;
entryScreen["txtMsg2"].text = msg2;
entryScreen["txtName"].text = "";
entryScreen["txtCode"].text = "";
entryScreen.visible = true;
secCodeLoad();
}
public function submitScore():void{
var _local1:Boolean;
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
var _local6:URLVariables;
var _local7:URLRequest;
var _local8:URLLoader;
entryScreen.visible = false;
autoEntryScreen.visible = false;
infoScreen.visible = true;
_local1 = true;
if (((!(this.g5UserExists)) && ((entryScreen["txtName"].text.length == 0)))){
showInfoMessage("Please enter your name.", true);
} else {
if (((!(this.g5UserExists)) && (!((entryScreen["txtCode"].text.length == 5))))){
showInfoMessage("Please enter all 5 letters of the security code.", true);
} else {
showInfoMessage("Submitting hi-score details to the server, please wait.", true);
infoScreen["btnBack"].visible = false;
_local1 = false;
};
};
if (!_local1){
_local2 = "save|";
if (this.g5UserExists){
_local2 = (_local2 + ((((((("----------|-----|" + score) + "|") + gameId) + "|") + levelId) + "|") + this.g5User[0]));
} else {
_local2 = (_local2 + (((((((((entryScreen["txtName"].text + "|") + entryScreen["txtCode"].text) + "|") + score) + "|") + gameId) + "|") + levelId) + "|-----"));
};
_local3 = "";
_local4 = 0;
_local5 = 0;
while (_local4 < _local2.length) {
if (_local5 >= KEY.length){
_local5 = 0;
};
_local3 = (_local3 + String.fromCharCode(((_local2.charCodeAt(_local4) ^ KEY.charCodeAt(_local5)) + 1)));
_local4++;
_local5++;
};
_local6 = new URLVariables();
_local6.ffdata = _local3;
_local6.lowIsBest = lowIsBest;
_local7 = new URLRequest(HS_SERVLET_URL);
_local8 = new URLLoader();
_local8.dataFormat = URLLoaderDataFormat.VARIABLES;
_local7.data = _local6;
_local7.method = URLRequestMethod.POST;
_local8.addEventListener(Event.COMPLETE, submitHiScoreHandler);
_local8.addEventListener(IOErrorEvent.IO_ERROR, submitHiScoreError);
_local8.load(_local7);
};
}
public function secCodeLoadError(_arg1:IOErrorEvent):void{
entryScreen.visible = false;
infoScreen.visible = true;
showInfoMessage("Could not generate a security code. Click on back and try to refresh the code window.", true);
}
public function setDetails(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Boolean, _arg5:Number, _arg6:String, _arg7:String):void{
this.g5User = ExternalInterface.call("getG5User");
this.g5UserExists = ((g5User == null)) ? false : !(isNaN(this.g5User[0]));
this.gameId = _arg1;
this.levelId = _arg2;
this.gameCode = _arg3;
this.lowIsBest = _arg4;
this.score = _arg5;
this.msg1 = _arg6;
this.msg2 = _arg7;
entryScreen = this["movEntryScreen"];
autoEntryScreen = this["movAutoEntryScreen"];
infoScreen = this["movInfoScreen"];
entryScreen.visible = false;
autoEntryScreen.visible = false;
infoScreen.visible = false;
entryScreen["btnRefreshCode"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
entryScreen["btnSubmit"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
autoEntryScreen["btnSubmit"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
autoEntryScreen["btnEnterAnother"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnView"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnBack"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
if (this.g5UserExists){
showAutoEntryScreen();
} else {
showEntryScreen();
};
this.visible = true;
}
public function submitHiScoreError(_arg1:IOErrorEvent):void{
showInfoMessage("A serious problem was encountered with the server, please try again in a few minutes.", true);
}
public function onButtonPress(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "btnRefreshCode":
secCodeLoad();
break;
case "btnSubmit":
submitScore();
break;
case "btnEnterAnother":
enterAnotherName();
break;
case "btnView":
viewScore();
break;
case "btnBack":
back();
break;
};
}
private function showAutoEntryScreen():void{
autoEntryScreen["txtMsg1"].text = msg1;
autoEntryScreen["txtMsg2"].text = msg2;
autoEntryScreen["txtName"].text = g5User[1];
autoEntryScreen.visible = true;
}
public function viewScore():void{
var _local1:URLRequest;
_local1 = null;
if (this.g5UserExists){
_local1 = new URLRequest(((((((((HI_SCORE_URL + gameCode) + "_hs") + "&userId=") + this.g5User[0]) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime()));
} else {
_local1 = new URLRequest(((((((((HI_SCORE_URL + gameCode) + "_hs") + "&name=") + entryScreen["txtName"].text) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime()));
};
navigateToURL(_local1, "_blank");
}
}
}//package
Section 27
//level (level)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class level extends Shape {
private var channel:SoundChannel;
private var evilTimer:Timer;
private var theGluefo:gluefo;
public var timeBonus:uint;
public var theTimer:Timer;
public function level(_arg1:gluefo):void{
this.theGluefo = _arg1;
}
private function evilTimerHandler(_arg1:TimerEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (theGluefo.theEvilGluefo == null){
_local6 = (Math.random() * 4);
if (_local6 < 1){
_local2 = -20;
_local3 = ((Math.random() * 550) - 50);
_local4 = 1.5;
_local5 = (0.4 + (Math.random() * 0.3));
if (_local3 > 250){
_local5 = (_local5 * -1);
};
} else {
if (_local6 < 2){
_local2 = 520;
_local3 = ((Math.random() * 550) - 50);
_local4 = -1.5;
_local5 = (0.4 + (Math.random() * 0.3));
if (_local3 > 250){
_local5 = (_local5 * -1);
};
} else {
if (_local6 < 3){
_local3 = -20;
_local2 = ((Math.random() * 550) - 50);
_local5 = 1.5;
_local4 = (0.4 + (Math.random() * 0.3));
if (_local2 > 250){
_local4 = (_local4 * -1);
};
} else {
_local3 = 520;
_local2 = ((Math.random() * 550) - 50);
_local5 = -1.5;
_local4 = (0.4 + (Math.random() * 0.3));
if (_local2 > 250){
_local4 = (_local4 * -1);
};
};
};
};
theGluefo.createEvilGluefo(_local2, _local3, _local4, _local5);
_local7 = (22000 + (Math.random() * 14000));
evilTimer.removeEventListener("timer", evilTimerHandler);
evilTimer = new Timer(_local7, 1);
evilTimer.addEventListener("timer", evilTimerHandler);
evilTimer.start();
};
}
public function killTimer():void{
if (theTimer){
theTimer.removeEventListener("timer", timerHandler);
};
}
public function startTimer():void{
theTimer.start();
}
public function newLevel(_arg1:uint):void{
var _local2:uint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:uint;
var _local9:Number;
_local2 = (_arg1 % 8);
switch (_local2){
case 1:
gluefo.ORBCOLOR = 0xFF0000;
break;
case 2:
gluefo.ORBCOLOR = 0xFF9900;
break;
case 3:
gluefo.ORBCOLOR = 0xFFFF00;
break;
case 4:
gluefo.ORBCOLOR = 0x33CC00;
break;
case 5:
gluefo.ORBCOLOR = 52479;
break;
case 6:
gluefo.ORBCOLOR = 13311;
break;
case 7:
gluefo.ORBCOLOR = 0x990099;
break;
case 0:
gluefo.ORBCOLOR = 16737996;
break;
};
this.theGluefo.levelOrbsNum = 0;
this.theGluefo.gameScreen.levelTxt.text = String(_arg1);
this.theGluefo.gameScreen.scoreTxt.text = String(this.theGluefo.scoreNum);
if (gluefo.PLAYADVANCED){
this.theGluefo.theUfo.rotation = 0;
timeBonus = (20 + (10 * _arg1));
if (theTimer){
theTimer.removeEventListener("timer", timerHandler);
};
theTimer = new Timer(1000, timeBonus);
theTimer.addEventListener("timer", timerHandler);
theTimer.start();
this.theGluefo.theReadout.timeBonusTxt.text = String(timeBonus);
this.theGluefo.explosionNum = 1;
this.theGluefo.levelMultiBonus = 0;
this.theGluefo.theReadout.multiBonusTxt.text = String(this.theGluefo.levelMultiBonus);
this.theGluefo.orbNumHit = [];
} else {
if ((_arg1 % 3) == 0){
this.theGluefo.gameScreen.gluetronBonus.gotoAndPlay(2);
this.theGluefo.bombNum++;
this.theGluefo.gameScreen.bombTxt.text = String(this.theGluefo.bombNum);
};
};
if (_arg1 == 4){
this.theGluefo.gameScreen.evilGluefoWarning.gotoAndPlay(2);
};
if (_arg1 >= 4){
_local9 = (18000 + (Math.random() * 12000));
if (evilTimer){
evilTimer.removeEventListener("timer", evilTimerHandler);
};
evilTimer = new Timer(_local9, 1);
evilTimer.addEventListener("timer", evilTimerHandler);
evilTimer.start();
};
_local8 = 0;
while (_local8 < _arg1) {
_local7 = (Math.random() * 4);
if (_local7 < 1){
_local3 = -50;
_local4 = ((Math.random() * 550) - 50);
_local5 = 1.2;
_local6 = (0.2 + (Math.random() * 0.3));
if (_local4 > 250){
_local6 = (_local6 * -1);
};
} else {
if (_local7 < 2){
_local3 = 550;
_local4 = ((Math.random() * 550) - 50);
_local5 = -1.2;
_local6 = (0.2 + (Math.random() * 0.3));
if (_local4 > 250){
_local6 = (_local6 * -1);
};
} else {
if (_local7 < 3){
_local4 = -50;
_local3 = ((Math.random() * 550) - 50);
_local6 = 1.2;
_local5 = (0.2 + (Math.random() * 0.3));
if (_local3 > 250){
_local5 = (_local5 * -1);
};
} else {
_local4 = 550;
_local3 = ((Math.random() * 550) - 50);
_local6 = -1.2;
_local5 = (0.2 + (Math.random() * 0.3));
if (_local3 > 250){
_local5 = (_local5 * -1);
};
};
};
};
theGluefo.createOrbs(_local3, _local4, _local5, _local6, 1, "bigOrb");
_local7 = (Math.random() * 4);
if (_local7 < 1){
_local3 = -20;
_local4 = ((Math.random() * 550) - 50);
_local5 = 1.5;
_local6 = (0.4 + (Math.random() * 0.3));
if (_local4 > 250){
_local6 = (_local6 * -1);
};
} else {
if (_local7 < 2){
_local3 = 520;
_local4 = ((Math.random() * 550) - 50);
_local5 = -1.5;
_local6 = (0.4 + (Math.random() * 0.3));
if (_local4 > 250){
_local6 = (_local6 * -1);
};
} else {
if (_local7 < 3){
_local4 = -20;
_local3 = ((Math.random() * 550) - 50);
_local6 = 1.5;
_local5 = (0.4 + (Math.random() * 0.3));
if (_local3 > 250){
_local5 = (_local5 * -1);
};
} else {
_local4 = 520;
_local3 = ((Math.random() * 550) - 50);
_local6 = -1.5;
_local5 = (0.4 + (Math.random() * 0.3));
if (_local3 > 250){
_local5 = (_local5 * -1);
};
};
};
};
theGluefo.createOrbs(_local3, _local4, _local5, _local6, 1, "tinyOrb");
_local8++;
};
}
private function timerHandler(_arg1:TimerEvent):void{
timeBonus--;
this.theGluefo.theReadout.timeBonusTxt.text = String(timeBonus);
}
public function stopTimer():void{
theTimer.stop();
}
public function killEvilTimer():void{
if (evilTimer){
evilTimer.removeEventListener("timer", evilTimerHandler);
};
}
}
}//package
Section 28
//levelSound (levelSound)
package {
import flash.media.*;
public dynamic class levelSound extends Sound {
}
}//package
Section 29
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.2");
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (!this.parent.parent){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 30
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("core.mochibot.com");
Security.allowInsecureDomain("core.mochibot.com");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 31
//musicSound (musicSound)
package {
import flash.media.*;
public dynamic class musicSound extends Sound {
}
}//package
Section 32
//noExplodeSound (noExplodeSound)
package {
import flash.media.*;
public dynamic class noExplodeSound extends Sound {
}
}//package
Section 33
//orb (orb)
package {
import flash.display.*;
import flash.geom.*;
public class orb extends Shape {
public var radius:uint;
protected var dx:Number;
protected var dy:Number;
protected var theGluefo:gluefo;
public var explosionNum:uint;
private var stucky:Number;
public var stickmode:String;// = "ready"
private var stuckx:Number;
public function orb(_arg1:gluefo, _arg2:Number=250, _arg3:Number=250, _arg4:Number=5, _arg5:Number=5, _arg6:uint=5, _arg7:int=0xFF00, _arg8:uint=1, _arg9:int=0):void{
stickmode = "ready";
super();
this.theGluefo = _arg1;
this.x = _arg2;
this.y = _arg3;
this.dx = _arg4;
this.dy = _arg5;
this.radius = _arg6;
graphics.lineStyle(_arg8, _arg9);
graphics.beginFill(_arg7);
graphics.drawCircle(0, 0, _arg6);
}
public function rotateOrb(_arg1:int):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (this.stickmode == "stick"){
_local2 = Math.atan2((this.y - theGluefo.theUfo.y), (this.x - theGluefo.theUfo.x));
if (_arg1 < 0){
_local2 = (_local2 + ((gluefo.ROT * Math.PI) / 180));
} else {
_local2 = (_local2 - ((gluefo.ROT * Math.PI) / 180));
};
_local3 = (Math.sin(_local2) * gluefo.RADIUS);
_local4 = (Math.cos(_local2) * gluefo.RADIUS);
this.stuckx = _local4;
this.stucky = _local3;
this.x = (theGluefo.theUfo.x + this.stuckx);
this.y = (theGluefo.theUfo.y + this.stucky);
};
}
public function wrapOrb():void{
if ((((this.x > (gluefo.WIDTH + this.radius))) && ((this.dx > 0)))){
this.x = -(this.radius);
if ((((this.stickmode == "explode")) || ((this.stickmode == "explodeEvil")))){
this.explodeToReady();
};
};
if ((((this.x < (0 - this.radius))) && ((this.dx < 0)))){
this.x = (gluefo.WIDTH + this.radius);
if ((((this.stickmode == "explode")) || ((this.stickmode == "explodeEvil")))){
this.explodeToReady();
};
};
if ((((this.y > (gluefo.HEIGHT + this.radius))) && ((this.dy > 0)))){
this.y = -(this.radius);
if ((((this.stickmode == "explode")) || ((this.stickmode == "explodeEvil")))){
this.explodeToReady();
};
};
if ((((this.y < (0 - this.radius))) && ((this.dy < 0)))){
this.y = (gluefo.HEIGHT + this.radius);
if ((((this.stickmode == "explode")) || ((this.stickmode == "explodeEvil")))){
this.explodeToReady();
};
};
}
private function checkState(_arg1:MovieClip, _arg2:Number, _arg3:Boolean){
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = (Math.pow((this.x - _arg1.x), 2) + Math.pow((this.y - _arg1.y), 2));
if ((((_local4 < _arg2)) && ((this.stickmode == "ready")))){
if (((_arg3) && ((theGluefo.theEvilGluefo.currentLabel == "normal")))){
this.stickmode = "stickEvil";
theGluefo.theEvilGluefo.aimode = "rotate";
} else {
if (!_arg3){
this.stickmode = "stick";
};
};
_local5 = (this.x - _arg1.x);
_local6 = (this.y - _arg1.y);
_local7 = Math.sqrt((_arg2 / (1 + ((_local6 * _local6) / (_local5 * _local5)))));
if (_local5 < 0){
_local7 = (_local7 * -1);
};
_local8 = Math.sqrt((_arg2 / (1 + ((_local5 * _local5) / (_local6 * _local6)))));
if (_local6 < 0){
_local8 = (_local8 * -1);
};
this.stuckx = _local7;
this.stucky = _local8;
};
}
public function explodeOrb(_arg1:Number, _arg2:uint):void{
var _local3:ColorTransform;
if (this.stickmode == "stick"){
this.explosionNum = _arg2;
this.stickmode = "explode";
} else {
this.stickmode = "explodeEvil";
};
this.dx = (_arg1 * this.stuckx);
this.dy = (_arg1 * this.stucky);
_local3 = this.transform.colorTransform;
_local3.color = 0xFFFFFF;
this.transform.colorTransform = _local3;
}
public function moveOrb():void{
var _local1:Number;
var _local2:Number;
var _local3:evilGluefoSound;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:*;
var _local8:*;
this.checkState(theGluefo.theUfo, gluefo.RADIUS2, false);
if (theGluefo.theEvilGluefo){
this.checkState(theGluefo.theEvilGluefo, evilGluefo.RADIUS2, true);
};
if (this.stickmode == "stick"){
this.x = (theGluefo.theUfo.x + this.stuckx);
this.y = (theGluefo.theUfo.y + this.stucky);
} else {
if (this.stickmode == "stickEvil"){
if ((((theGluefo.theEvilGluefo == null)) || (!((theGluefo.theEvilGluefo.currentLabel == "normal"))))){
this.dx = theGluefo.randRange(1, 1);
this.dy = theGluefo.randRange(1, 1);
this.stickmode = "ready";
} else {
this.x = (theGluefo.theEvilGluefo.x + this.stuckx);
this.y = (theGluefo.theEvilGluefo.y + this.stucky);
_local1 = Math.atan2((this.y - theGluefo.theEvilGluefo.y), (this.x - theGluefo.theEvilGluefo.x));
_local2 = Math.atan2((theGluefo.theUfo.y - theGluefo.theEvilGluefo.y), (theGluefo.theUfo.x - theGluefo.theEvilGluefo.x));
if (Math.abs((_local1 - _local2)) < 0.05){
_local3 = new evilGluefoSound();
gluefo.SOUNDCHANNEL = _local3.play(0, 1, gluefo.SOUNDTRAN);
theGluefo.theEvilGluefo.aimode = "seek";
explodeOrb(evilGluefo.EXPLODEPOWER, 0);
} else {
if (_local1 < _local2){
_local1 = (_local1 + ((evilGluefo.ROTVEL * Math.PI) / 180));
theGluefo.theEvilGluefo.rotation = (theGluefo.theEvilGluefo.rotation + evilGluefo.ROTVEL);
} else {
_local1 = (_local1 - ((evilGluefo.ROTVEL * Math.PI) / 180));
theGluefo.theEvilGluefo.rotation = (theGluefo.theEvilGluefo.rotation - evilGluefo.ROTVEL);
};
_local4 = (Math.sin(_local1) * evilGluefo.RADIUS);
_local5 = (Math.cos(_local1) * evilGluefo.RADIUS);
this.stuckx = _local5;
this.stucky = _local4;
};
};
} else {
if ((((this.stickmode == "explode")) || ((this.stickmode == "explodeEvil")))){
this.x = (this.x + this.dx);
this.y = (this.y + this.dy);
wrapOrb();
theGluefo.orbTrail.orbBlur(this);
} else {
if (gluefo.ATTRACTING){
_local6 = (Math.pow((this.x - theGluefo.theUfo.x), 2) + Math.pow((this.y - theGluefo.theUfo.y), 2));
_local7 = ((Math.pow((theGluefo.theUfo.x - this.x), 2) / _local6) * (gluefo.ATTRACTAMOUNT / _local6));
_local8 = ((Math.pow((theGluefo.theUfo.y - this.y), 2) / _local6) * (gluefo.ATTRACTAMOUNT / _local6));
if (this.x > theGluefo.theUfo.x){
this.dx = (this.dx - _local7);
if (this.dx < -4){
this.dx = -4;
};
} else {
if (this.x < theGluefo.theUfo.x){
this.dx = (this.dx + _local7);
if (this.dx > 4){
this.dx = 4;
};
};
};
if (this.y > theGluefo.theUfo.y){
this.dy = (this.dy - _local8);
if (this.dy < -4){
this.dy = -4;
};
} else {
if (this.y < theGluefo.theUfo.y){
this.dy = (this.dy + _local8);
if (this.dy > 4){
this.dy = 4;
};
};
};
};
this.x = (this.x + this.dx);
this.y = (this.y + this.dy);
wrapOrb();
theGluefo.orbTrail.orbBlur(this);
};
};
};
}
public function explodeToReady():void{
var _local1:ColorTransform;
_local1 = this.transform.colorTransform;
_local1.color = gluefo.ORBCOLOR;
this.transform.colorTransform = _local1;
this.stickmode = "ready";
this.dx = (this.dx * 0.2);
this.dy = (this.dy * 0.2);
}
}
}//package
Section 34
//readout (readout)
package {
import flash.display.*;
import flash.text.*;
public dynamic class readout extends MovieClip {
public var multiBonusTxt:TextField;
public var timeBonusTxt:TextField;
public var rotateKeys:MovieClip;
}
}//package
Section 35
//simpleReadout (simpleReadout)
package {
import flash.display.*;
public dynamic class simpleReadout extends MovieClip {
}
}//package
Section 36
//sndSlap (sndSlap)
package {
import flash.media.*;
public dynamic class sndSlap extends Sound {
}
}//package
Section 37
//Splash (Splash)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Splash extends MovieClip {
public var hand:MovieClip;
public var btnUrl:SimpleButton;
public static var SERVER_URL:String = "http://www.gimme5games.com";
public function Splash(){
this.addEventListener(Event.ENTER_FRAME, splashEnterFrame);
this["btnUrl"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
}
public function splashEnterFrame(_arg1:Event):void{
if (this.currentFrame == this.totalFrames){
this.removeEventListener(Event.ENTER_FRAME, splashEnterFrame);
this.stop();
};
}
public function isComplete():Boolean{
return ((this.currentFrame == this.totalFrames));
}
public function onButtonPress(_arg1:MouseEvent):void{
var _local2:URLRequest;
switch (_arg1.target.name){
case "btnUrl":
_local2 = new URLRequest(SERVER_URL);
navigateToURL(_local2, "_blank");
break;
};
}
}
}//package
Section 38
//splitSound (splitSound)
package {
import flash.media.*;
public dynamic class splitSound extends Sound {
}
}//package
Section 39
//ufo (ufo)
package {
import flash.display.*;
public dynamic class ufo extends MovieClip {
public function ufo(){
addFrameScript(0, frame1, 5, frame6, 10, frame11, 30, frame31);
}
function frame6(){
this.gotoAndStop("normal");
}
function frame1(){
stop();
}
function frame31(){
stop();
}
function frame11(){
this.gotoAndPlay("flash");
}
}
}//package
Section 40
//ufoExplodeSound (ufoExplodeSound)
package {
import flash.media.*;
public dynamic class ufoExplodeSound extends Sound {
}
}//package