Section 1
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 2
//Elastic (fl.transitions.easing.Elastic)
package fl.transitions.easing {
public class Elastic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
}
}//package fl.transitions.easing
Section 3
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 4
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 5
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 6
//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 7
//movInfoScreen_6 (HiScores_fla.movInfoScreen_6)
package HiScores_fla {
import flash.display.*;
import flash.text.*;
public dynamic class movInfoScreen_6 extends MovieClip {
public var btnView:SimpleButton;
public var txtInfo:TextField;
public var btnBack:SimpleButton;
}
}//package HiScores_fla
Section 8
//logo_3 (shooot2_fla.logo_3)
package shooot2_fla {
import flash.display.*;
public dynamic class logo_3 extends MovieClip {
public function logo_3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package shooot2_fla
Section 9
//MainTimeline (shooot2_fla.MainTimeline)
package shooot2_fla {
import flash.display.*;
import flash.events.*;
public dynamic class MainTimeline extends MovieClip {
public var mygame:Game;
public var movSplash:Splash;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function splashEnterFrame(_arg1:Event){
if (movSplash.isComplete()){
movSplash.removeEventListener(Event.ENTER_FRAME, splashEnterFrame);
gotoAndStop(3);
};
}
function frame3(){
MochiBot.track(this, "ac514510");
mygame = new Game(this);
stop();
}
function frame1(){
MochiAd.showPreGameAd({clip:root, id:"abca7db4dabce3ac", res:"600x450"});
stop();
}
function frame2(){
movSplash.addEventListener(Event.ENTER_FRAME, splashEnterFrame);
stop();
}
}
}//package shooot2_fla
Section 10
//pauseMC_9 (shooot2_fla.pauseMC_9)
package shooot2_fla {
import flash.display.*;
public dynamic class pauseMC_9 extends MovieClip {
public function pauseMC_9(){
addFrameScript(0, frame1);
}
function frame1(){
this.mouseEnabled = false;
stop();
}
}
}//package shooot2_fla
Section 11
//showbonus_10 (shooot2_fla.showbonus_10)
package shooot2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class showbonus_10 extends MovieClip {
public var txt:TextField;
}
}//package shooot2_fla
Section 12
//soundsMC_16 (shooot2_fla.soundsMC_16)
package shooot2_fla {
import flash.display.*;
public dynamic class soundsMC_16 extends MovieClip {
public function soundsMC_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package shooot2_fla
Section 13
//startbut_7 (shooot2_fla.startbut_7)
package shooot2_fla {
import flash.display.*;
public dynamic class startbut_7 extends MovieClip {
public var startBut:SimpleButton;
}
}//package shooot2_fla
Section 14
//bonusMC (bonusMC)
package {
import flash.display.*;
public dynamic class bonusMC extends MovieClip {
public function bonusMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 15
//bulletMC (bulletMC)
package {
import flash.display.*;
public dynamic class bulletMC extends MovieClip {
}
}//package
Section 16
//enemyMC (enemyMC)
package {
import flash.display.*;
public dynamic class enemyMC extends MovieClip {
public function enemyMC(){
addFrameScript(2, frame3, 21, frame22);
}
function frame3(){
gotoAndStop(1);
}
function frame22(){
stop();
}
}
}//package
Section 17
//enemyMC2 (enemyMC2)
package {
import flash.display.*;
public dynamic class enemyMC2 extends MovieClip {
public function enemyMC2(){
addFrameScript(2, frame3, 21, frame22);
}
function frame3(){
gotoAndStop(1);
}
function frame22(){
stop();
}
}
}//package
Section 18
//Game (Game)
package {
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.motion.*;
import flash.geom.*;
import fl.transitions.easing.*;
import flash.media.*;
import flash.net.*;
import flash.external.*;
public class Game {
private var logomc:MovieClip;
private var stageH:Number;
private var keys:Object;
private var playH:Number;
private var stageW:Number;
private var myClip:Sprite;
private var backBmp:Bitmap;
private var myTween:Tween;
private var playW:Number;
private var mainClip:Sprite;
private var myColors:Object;
private var gameData:Object;
private var myParent;
private var hero:Object;
public function Game(_arg1:Sprite){
myParent = _arg1;
prepareGame();
}
private function addBullet(_arg1:Number):void{
var _local2:*;
gameData.bulletCounter++;
if (gameData.bulletCounter > 1000){
gameData.bulletCounter = 1;
};
gameData.bullets[("b" + gameData.bulletCounter)] = new Object();
_local2 = gameData.bullets[("b" + gameData.bulletCounter)];
_local2.spr = getMCClass("bulletMC");
gameData.bulSpr.addChild(_local2.spr);
_local2.myx = hero.myx;
_local2.myy = hero.myy;
_local2.speed = gameData.bulletSpeed;
_local2.dx = Math.cos(((hero.myrot + _arg1) * gameData.degToRad));
_local2.dy = Math.sin(((hero.myrot + _arg1) * gameData.degToRad));
_local2.spr.rotation = (hero.myrot + _arg1);
}
private function moveOb(_arg1:Object):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
_arg1.targetx = mainClip.mouseX;
_arg1.targety = mainClip.mouseY;
if (_arg1.targetx < _arg1.sz){
_arg1.targetx = _arg1.sz;
} else {
if (_arg1.targetx > (gameData.playW - _arg1.sz)){
_arg1.targetx = (gameData.playW - _arg1.sz);
};
};
if (_arg1.targety < _arg1.sz){
_arg1.targety = _arg1.sz;
} else {
if (_arg1.targety > (gameData.playH - _arg1.sz)){
_arg1.targety = (gameData.playH - _arg1.sz);
};
};
_arg1.dx = (_arg1.targetx - _arg1.myx);
_arg1.dy = (_arg1.targety - _arg1.myy);
if (((!((_arg1.dx == 0))) || (!((_arg1.dy == 0))))){
_arg1.dist = Math.sqrt(((_arg1.dx * _arg1.dx) + (_arg1.dy * _arg1.dy)));
_arg1.maxDist = (gameData.timeStep * _arg1.speed);
if (_arg1.dist < _arg1.maxDist){
_arg1.myx = _arg1.targetx;
_arg1.myy = _arg1.targety;
} else {
_arg1.dx = (((_arg1.dx * gameData.timeStep) * _arg1.speed) / _arg1.dist);
_arg1.dy = (((_arg1.dy * gameData.timeStep) * _arg1.speed) / _arg1.dist);
_arg1.myx = (_arg1.myx + _arg1.dx);
_arg1.myy = (_arg1.myy + _arg1.dy);
};
};
if (gameData.bonusOb.onStage == true){
_local6 = (gameData.bonusOb.myx - _arg1.myx);
_local7 = (gameData.bonusOb.myy - _arg1.myy);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
if (_local8 < (_arg1.sz / 2)){
gameData.bonusOb.spr.visible = false;
gameData.bonusOb.onStage = false;
if ((((_arg1.guns < _arg1.maxguns)) && (((Math.random() * 5) < 1)))){
addSound("sh1");
_arg1.guns++;
showHP();
gameData.textMC.txt.text = "UPGRADE";
gameData.textMC.x = gameData.bonusOb.myx;
gameData.textMC.y = gameData.bonusOb.myy;
backBmp.bitmapData.draw(gameData.textMC, gameData.textMC.transform.matrix, gameData.myColT1);
} else {
if ((((_arg1.guns > 2)) && (((Math.random() * 4) < 1)))){
if ((Math.random() * 2) < 1){
_arg1.spreadAngle = 30;
logomc.bonus.txt.text = "Focus";
} else {
_arg1.spreadAngle = 150;
logomc.bonus.txt.text = "Spread";
};
_arg1.quickFire = 1;
gameData.enSlowRate = 1;
gameData.doublePoints = 1;
addSound("sh4");
gameData.bonusTime = (gameData.newTime + gameData.bonusEffectTime);
} else {
if ((Math.random() * 3) < 1){
hero.shootTime = gameData.newTime;
_arg1.quickFire = 3;
gameData.enSlowRate = 1;
_arg1.spreadAngle = 90;
gameData.doublePoints = 1;
addSound("sh2");
logomc.bonus.txt.text = "Caffeine";
gameData.bonusTime = (gameData.newTime + gameData.bonusEffectTime);
} else {
if ((Math.random() * 2) < 1){
gameData.enSlowRate = 10;
_arg1.quickFire = 1;
_arg1.spreadAngle = 90;
gameData.doublePoints = 1;
addSound("sh3");
logomc.bonus.txt.text = "Naptime";
gameData.bonusTime = (gameData.newTime + gameData.bonusEffectTime);
} else {
gameData.enSlowRate = 1;
_arg1.quickFire = 1;
_arg1.spreadAngle = 90;
gameData.doublePoints = 2;
addSound("sh3");
logomc.bonus.txt.text = "Doubler";
gameData.bonusTime = (gameData.newTime + gameData.bonusEffectTime);
};
};
};
};
};
};
_local2 = new Object();
if (gameData.boss.bossOb != undefined){
if ((((gameData.newTime > _arg1.hurtTime)) && ((_arg1.guns > 0)))){
_local2 = gameData.boss.bossOb;
_local6 = (_local2.myx - _arg1.myx);
_local7 = (_local2.myy - _arg1.myy);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
if (_local8 < (_local2.sz + (_arg1.sz / 2))){
_arg1.hurtTime = (_arg1.hurtRate + gameData.newTime);
addSound("shurt");
_arg1.hurt = true;
_arg1.guns--;
showHP();
};
};
};
_local3 = Math.floor((_arg1.myx / gameData.gridStep));
_local4 = Math.floor((_arg1.myy / gameData.gridStep));
_local5 = -1;
while (_local5 < 2) {
_local9 = -1;
while (_local9 < 2) {
_local10 = ((("g" + (_local4 + _local9)) + "_") + (_local3 + _local5));
_local11 = gameData.grid[_local10];
if (_local11 != null){
for (_local12 in _local11) {
if ((((gameData.newTime > _arg1.hurtTime)) && ((_arg1.guns > 0)))){
_local2 = _local11[_local12];
_local6 = (_local2.myx - _arg1.myx);
_local7 = (_local2.myy - _arg1.myy);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
if (_local8 < (_local2.sz + (_arg1.sz / 2))){
_arg1.hurtTime = (_arg1.hurtRate + gameData.newTime);
addSound("shurt");
_arg1.hurt = true;
_arg1.guns--;
showHP();
};
};
};
};
_local9 = (_local9 + 1);
};
_local5 = (_local5 + 1);
};
if (hero.hurt == true){
_local13 = new Color();
if (gameData.newTime > _arg1.hurtTime){
_arg1.hurt = false;
if (_arg1.guns > 0){
_local14 = "white";
} else {
gameData.gameover = true;
_arg1.spr.visible = false;
gameData.sounds.channel.stop();
};
} else {
_local15 = ["red", "blue", "green", "yellow", "purple"];
_local16 = Math.round((Math.random() * _local15.length));
_local14 = _local15[_local16];
};
_local13.setTint(myColors[_local14], 1);
_arg1.spr.transform.colorTransform = _local13;
};
placeOb(_arg1);
}
private function moveEnemies():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
for (_local1 in gameData.en) {
_local2 = gameData.en[_local1];
if (_local2.dead == true){
if (_local2.spr.currentFrame == _local2.spr.totalFrames){
gameData.enSpr.removeChild(_local2.spr);
delete gameData.en[_local1];
gameData.curEnCount--;
if (_local2.iAmBoss){
gameData.boss = new Object();
};
};
} else {
if (gameData.gameover == true){
_local3 = (((_local2.dx * gameData.timeStep) * _local2.speed) / gameData.enSlowRate);
_local4 = (((_local2.dy * gameData.timeStep) * _local2.speed) / gameData.enSlowRate);
_local2.myx = (_local2.myx + _local3);
_local2.myy = (_local2.myy + _local4);
if ((((((((_local2.myx < -(_local2.sz))) || ((_local2.myx > (gameData.playW + _local2.sz))))) || ((_local2.myy < -(_local2.sz))))) || ((_local2.myy > (gameData.playH + _local2.sz))))){
gameData.enSpr.removeChild(_local2.spr);
delete gameData.en[_local1];
gameData.curEnCount--;
} else {
placeOb(_local2);
};
} else {
if (_local2.col == "purple"){
_local3 = (hero.myx - _local2.myx);
_local4 = (hero.myy - _local2.myy);
_local5 = (50 * Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
_local2.dx = (_local2.dx + (_local3 / _local5));
_local2.dy = (_local2.dy + (_local4 / _local5));
_local5 = Math.sqrt(((_local2.dx * _local2.dx) + (_local2.dy * _local2.dy)));
_local2.dx = (_local2.dx / _local5);
_local2.dy = (_local2.dy / _local5);
};
_local3 = (((_local2.dx * gameData.timeStep) * _local2.speed) / gameData.enSlowRate);
_local4 = (((_local2.dy * gameData.timeStep) * _local2.speed) / gameData.enSlowRate);
_local2.myx = (_local2.myx + _local3);
_local2.myy = (_local2.myy + _local4);
if (_local2.onStage == true){
_local6 = false;
if (_local2.hor == 1){
if (_local2.myx < _local2.sz){
_local2.myx = _local2.sz;
_local2.dx = (_local2.dx * -1);
_local6 = true;
} else {
if (_local2.myx > (gameData.playW - _local2.sz)){
_local2.myx = (gameData.playW - _local2.sz);
_local2.dx = (_local2.dx * -1);
_local6 = true;
};
};
};
if (_local2.ver == 1){
if (_local2.myy < _local2.sz){
_local2.myy = _local2.sz;
_local2.dy = (_local2.dy * -1);
_local6 = true;
} else {
if (_local2.myy > (gameData.playH - _local2.sz)){
_local2.myy = (gameData.playH - _local2.sz);
_local2.dy = (_local2.dy * -1);
_local6 = true;
};
};
};
if ((((_local6 == true)) && ((_local2.col == "yellow")))){
_local3 = (hero.myx - _local2.myx);
_local4 = (hero.myy - _local2.myy);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
_local2.dx = (_local3 / _local5);
_local2.dy = (_local4 / _local5);
};
} else {
if ((((((((_local2.myx > _local2.sz)) && ((_local2.myx < (gameData.playW - _local2.sz))))) && ((_local2.myy > _local2.sz)))) && ((_local2.myy < (gameData.playH - _local2.sz))))){
_local2.onStage = true;
};
};
if (_local2.myx < -(_local2.sz)){
_local2.myx = (gameData.playW + _local2.sz);
} else {
if (_local2.myx > (gameData.playW + _local2.sz)){
_local2.myx = -(_local2.sz);
};
};
if (_local2.myy < -(_local2.sz)){
_local2.myy = (gameData.playH + _local2.sz);
} else {
if (_local2.myy > (gameData.playH + _local2.sz)){
_local2.myy = -(_local2.sz);
};
};
if (((_local2.iAmBoss) && ((_local2.shootTime < gameData.newTime)))){
_local2.shootTime = (gameData.bossShootRate + gameData.newTime);
addEnemy(_local2.col, 1, _local2.myx, _local2.myy);
};
placeOb(_local2);
addToGrid(_local2, _local1);
};
};
};
}
private function pauseGame(_arg1:MouseEvent):void{
var _local2:*;
if (gameData.gameStatus == "playing"){
logomc.pauseMC.gotoAndStop(2);
gameData.gameStatus = "paused";
gameData.pausedTime = gameData.lastTime;
gameData.sounds.channel.stop();
} else {
gameData.gameStatus = "playing";
logomc.pauseMC.gotoAndStop(1);
gameData.now = new Date();
_local2 = gameData.now.getTime();
gameData.pausedTime = (_local2 - gameData.pausedTime);
if (gameData.pausedTime < 0){
gameData.pausedTime = 0;
};
if (gameData.gameover != true){
addLoop();
};
myParent.stage.focus = mainClip;
};
}
private function runGame(_arg1:Event):void{
var _local2:Number;
if (gameData.gameStatus == "playing"){
gameData.now = new Date();
gameData.newTime = (gameData.now.getTime() - gameData.pausedTime);
gameData.timeStep = ((gameData.newTime - gameData.lastTime) / 10);
if (gameData.bonusTime != 0){
if (gameData.bonusTime < gameData.newTime){
gameData.bonusTime = 0;
hero.quickFire = 1;
gameData.enSlowRate = 1;
hero.spreadAngle = 90;
gameData.doublePoints = 1;
logomc.bonus.graphics.clear();
logomc.bonus.txt.text = "";
} else {
_local2 = ((gameData.bonusTime - gameData.newTime) / gameData.bonusEffectTime);
logomc.bonus.graphics.clear();
logomc.bonus.graphics.lineStyle(2, myColors.white, 1, true, "none", null, null, 3);
logomc.bonus.graphics.drawRect(0, 0, 100, 10);
logomc.bonus.graphics.beginFill(myColors.white);
logomc.bonus.graphics.drawRect(0, 0, (_local2 * 100), 10);
};
};
hero.myrot = (hero.myrot + (hero.rotspeed * gameData.timeStep));
if (keys[90].down == 1){
hero.myrot = (hero.myrot + ((2 * gameData.timeStep) / 10));
} else {
if (keys[88].down == 1){
hero.myrot = (hero.myrot - ((2 * gameData.timeStep) / 10));
};
};
if (hero.myrot > 360){
hero.myrot = (hero.myrot - 360);
};
hero.spr.rotation = hero.myrot;
moveOb(hero);
gameData.grid = new Object();
newLevel();
moveEnemies();
shoot();
moveBullets();
makeEyeCandy();
gameData.lastTime = gameData.newTime;
};
}
private function prepareGame(){
stageW = 600;
stageH = 450;
myColors = new Object();
myColors.black = 0;
myColors.white = 0xFFFFFF;
myColors.red = 0xFF3300;
myColors.blue = 6737151;
myColors.green = 0x33CC00;
myColors.yellow = 16777011;
myColors.purple = 16724991;
myClip = new Sprite();
myClip.graphics.lineStyle(2, myColors.white, 1, true, "none", null, null, 3);
myClip.graphics.beginFill(myColors.black);
myClip.graphics.drawRect(4, 4, (stageW - 8), (stageH - 8));
myParent.addChildAt(myClip, 0);
showIntro();
}
private function restartGame(_arg1:MouseEvent):void{
logomc.endbut.removeEventListener(MouseEvent.CLICK, restartGame);
myClip.removeChildAt(0);
mainClip.removeChild(backBmp);
showIntro();
}
private function shoot():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
if (gameData.newTime > hero.shootTime){
hero.shootTime = ((hero.shootRate / hero.quickFire) + gameData.newTime);
if (gameData.bulletHit == true){
gameData.bulletPoint++;
} else {
gameData.bulletPoint = 1;
};
gameData.bulletHit = false;
_local1 = (hero.guns % 2);
if ((hero.guns % 2) == 0){
_local4 = (hero.guns / 2);
_local5 = (hero.guns / 2);
} else {
_local4 = Math.ceil((hero.guns / 2));
_local5 = Math.floor((hero.guns / 2));
};
_local2 = (hero.spreadAngle / (_local4 + 1));
_local3 = 1;
while (_local3 <= _local4) {
addBullet(((-(hero.spreadAngle) / 2) + (_local3 * _local2)));
_local3++;
};
_local2 = (hero.spreadAngle / (_local5 + 1));
_local3 = 1;
while (_local3 <= _local5) {
addBullet(((180 - (hero.spreadAngle / 2)) + (_local3 * _local2)));
_local3++;
};
};
}
private function moveBullets():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
for (_local1 in gameData.bullets) {
_local2 = gameData.bullets[_local1];
_local3 = (_local2.dx / Math.abs(_local2.dx));
_local4 = (_local2.dy / Math.abs(_local2.dy));
_local5 = Math.floor((_local2.myx / gameData.gridStep));
_local6 = Math.floor((_local2.myy / gameData.gridStep));
_local2.grids = new Object();
if (gameData.boss.bossOb != undefined){
_local2.grids.boss = gameData.boss.bossOb;
};
_local7 = 0;
while (_local7 < 2) {
_local9 = 0;
while (_local9 < 2) {
_local10 = ((("g" + (_local6 + (_local4 * _local9))) + "_") + (_local5 + (_local3 * _local7)));
_local11 = gameData.grid[_local10];
if (_local11 != null){
for (_local12 in _local11) {
_local2.grids[_local12] = _local11[_local12];
};
};
_local9++;
};
_local7++;
};
_local8 = false;
for (_local12 in _local2.grids) {
_local13 = _local2.grids[_local12];
if ((((_local13.dead == null)) && ((_local8 == false)))){
_local14 = new Object();
_local14.vx = ((_local13.dx * gameData.timeStep) * _local13.speed);
_local14.vy = ((_local13.dy * gameData.timeStep) * _local13.speed);
_local14.p1 = new Object();
_local14.p1.x = _local13.myx;
_local14.p1.y = _local13.myy;
_local15 = new Object();
_local15.vx = ((_local2.dx * gameData.timeStep) * _local2.speed);
_local15.vy = ((_local2.dy * gameData.timeStep) * _local2.speed);
_local15.p1 = new Object();
_local15.p1.x = (_local2.myx + _local15.vx);
_local15.p1.y = (_local2.myy + _local15.vy);
_local15.p0 = new Object();
_local15.p0.x = _local2.myx;
_local15.p0.y = _local2.myy;
_local15.dx = _local2.dx;
_local15.dy = _local2.dy;
_local15.lx = _local15.dy;
_local15.ly = -(_local15.dx);
_local16 = findIntersection(_local14, _local15);
_local16.len = Math.sqrt(((_local16.vx * _local16.vx) + (_local16.vy * _local16.vy)));
_local17 = (_local13.sz - _local16.len);
if (_local17 >= 0){
_local13.hp--;
_local8 = true;
gameData.bulletHit = true;
if (_local13.hp < 0){
_local13.spr.gotoAndPlay(4);
_local13.dead = true;
if (_local13.iAmBoss == true){
_local18 = 0;
while (_local18 < gameData.bossSize) {
addEnemy(_local13.col, 1, _local13.myx, _local13.myy);
_local18++;
};
addSound("se2");
} else {
if (_local13.baseSize > 1){
addEnemy(_local13.col, (_local13.baseSize - 1), _local13.myx, _local13.myy);
addEnemy(_local13.col, (_local13.baseSize - 1), _local13.myx, _local13.myy);
addEnemy(_local13.col, (_local13.baseSize - 1), _local13.myx, _local13.myy);
addSound("se2");
} else {
addSound("se1");
if (gameData.bonusOb.onStage == false){
if ((((((((_local13.myx > (hero.sz * 2))) && ((_local13.myy > (hero.sz * 2))))) && ((_local13.myx < (gameData.playW - (hero.sz * 2)))))) && ((_local13.myy < (gameData.playH - (hero.sz * 2)))))){
if ((Math.random() * 10) < 3){
gameData.bonusOb.myx = _local13.myx;
gameData.bonusOb.myy = _local13.myy;
placeOb(gameData.bonusOb);
gameData.bonusOb.spr.visible = true;
gameData.bonusOb.spr.gotoAndPlay(2);
gameData.bonusOb.onStage = true;
};
};
};
};
};
} else {
_local13.spr.gotoAndPlay(2);
addSound("sh");
};
gameData.textMC.txt.text = ("+" + (gameData.bulletPoint * gameData.doublePoints));
gameData.textMC.x = _local13.myx;
gameData.textMC.y = _local13.myy;
backBmp.bitmapData.draw(gameData.textMC, gameData.textMC.transform.matrix, gameData.myColT1);
gameData.myScore = (gameData.myScore + (gameData.bulletPoint * gameData.doublePoints));
logomc.txt.text = gameData.myScore;
};
};
};
_local2.myx = (_local2.myx + ((_local2.dx * gameData.timeStep) * _local2.speed));
_local2.myy = (_local2.myy + ((_local2.dy * gameData.timeStep) * _local2.speed));
if ((((((((((_local2.myx < -20)) || ((_local2.myy < -20)))) || ((_local2.myx > (gameData.playW + 20))))) || ((_local2.myy > (gameData.playH + 20))))) || ((_local8 == true)))){
gameData.bulSpr.removeChild(_local2.spr);
delete gameData.bullets[_local1];
} else {
placeOb(_local2);
};
};
}
private function setVolume(_arg1:MouseEvent):void{
var _local2:SoundTransform;
addSound("sclick");
_local2 = gameData.sounds.channel.soundTransform;
if (_local2.volume == 0){
_local2.volume = 1;
} else {
_local2.volume = (_local2.volume - 0.2);
};
gameData.sounds.channel.soundTransform = _local2;
saveso();
showVolume();
}
private function upKeys(_arg1:KeyboardEvent):void{
if (keys[_arg1.keyCode] != undefined){
keys[_arg1.keyCode].down = 0;
};
}
private function saveso():void{
var _local1:SharedObject;
_local1 = SharedObject.getLocal("shooot2");
_local1.data.soundVolume = gameData.sounds.channel.soundTransform.volume;
_local1.flush();
}
private function downKeys(_arg1:KeyboardEvent):void{
if (keys[_arg1.keyCode] != undefined){
keys[_arg1.keyCode].down = 1;
};
}
private function placeOb(_arg1:Object):void{
_arg1.spr.x = _arg1.myx;
_arg1.spr.y = _arg1.myy;
}
private function makeEyeCandy():void{
if (gameData.gameover == true){
return;
};
if (gameData.newTime > gameData.drawTime){
gameData.drawTime = (gameData.newTime + 120);
backBmp.bitmapData.draw(gameData.bulSpr, gameData.myMatrix, gameData.myColT1);
};
backBmp.bitmapData.colorTransform(backBmp.bitmapData.rect, gameData.myColT2);
}
private function newLevel():void{
var _local1:*;
var _local2:*;
if (gameData.curEnCount > 0){
return;
};
if (gameData.gameover == true){
gameData.gameStatus = "gameover";
mainClip.removeEventListener(Event.ENTER_FRAME, runGame);
mainClip.removeEventListener(MouseEvent.CLICK, pauseGame);
mainClip.removeEventListener(KeyboardEvent.KEY_DOWN, downKeys);
mainClip.removeEventListener(KeyboardEvent.KEY_UP, upKeys);
logomc.gotoAndStop(4);
mainClip.removeChild(gameData.bonusOb.spr);
delete gameData.bonusOb;
mainClip.removeChild(gameData.enSpr);
delete gameData.enSpr;
mainClip.removeChild(gameData.bulSpr);
delete gameData.bulSpr;
mainClip.removeChild(hero.spr);
delete gameData.textMC;
logomc.mouseEnabled = true;
logomc.mouseChildren = true;
logomc.sc = gameData.myScore;
logomc.endbut.y = 195;
logomc.endbut.addEventListener(MouseEvent.CLICK, restartGame);
return;
};
showHP();
logomc.txt.text = gameData.myScore;
gameData.curLvl++;
logomc.lvlbox.txt.text = gameData.curLvl;
_local1 = gameData.levels[("l" + gameData.curLvl)];
if (_local1 == null){
_local1 = gameData.levels.l0;
};
gameData.boss = new Object();
gameData.sounds.curSound = [];
_local2 = 0;
while (_local2 < _local1.length) {
addEnemy(_local1[_local2], _local1[(_local2 + 1)], -1000, -1000);
if (_local1[_local2] == "red"){
gameData.sounds.curSound.push("s3");
} else {
if (_local1[_local2] == "blue"){
gameData.sounds.curSound.push("s4");
} else {
if (_local1[_local2] == "green"){
gameData.sounds.curSound.push("s5");
} else {
if (_local1[_local2] == "yellow"){
gameData.sounds.curSound.push("s1");
} else {
if (_local1[_local2] == "purple"){
gameData.sounds.curSound.push("s2");
};
};
};
};
};
_local2 = (_local2 + 2);
};
if (gameData.curLvl == 1){
gameData.sounds.channel.stop();
addLoop();
};
}
private function showHP():void{
var _local1:*;
logomc.bullets.graphics.clear();
logomc.bullets.graphics.beginFill(myColors.white);
_local1 = 0;
while (_local1 < hero.guns) {
logomc.bullets.graphics.drawRect((_local1 * 8), 0, 4, 8);
_local1++;
};
}
private function hideIntro(_arg1:MouseEvent):void{
addSound("sclick");
logomc.logo.gotoAndStop(1);
logomc.gotoAndStop(1);
logomc.startBut.visible = false;
logomc.sndBut.visible = false;
myTween = new Tween(logomc.logo, "y", Regular.easeOut, 0, -400, 1, true);
myTween.addEventListener(TweenEvent.MOTION_FINISH, startGame, false, 0, true);
}
private function projectVector(_arg1:Object, _arg2:Number, _arg3:Number):Object{
var _local4:*;
var _local5:*;
_local4 = ((_arg1.vx * _arg2) + (_arg1.vy * _arg3));
_local5 = new Object();
_local5.vx = (_local4 * _arg2);
_local5.vy = (_local4 * _arg3);
return (_local5);
}
private function endTween(_arg1:TweenEvent):void{
gameData = new Object();
logomc.logo.gotoAndStop(2);
logomc.gotoAndStop(2);
logomc.startBut.visible = true;
logomc.sndBut.visible = true;
logomc.startBut.addEventListener(MouseEvent.CLICK, hideIntro, false, 0, true);
logomc.sndBut.addEventListener(MouseEvent.CLICK, setVolume, false, 0, true);
myParent.stage.stageFocusRect = false;
myParent.stage.focus = myClip;
gameData.sounds = new Object();
gameData.sounds.curSound = ["s1", "s2"];
gameData.sounds.soundCounter = 0;
addLoop();
readso();
}
private function soundLoop(_arg1:Event):void{
addLoop();
}
private function findIntersection(_arg1:Object, _arg2:Object):Object{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local3 = new Object();
_local4 = _local3;
_local3.vx = (_arg1.p1.x - _arg2.p0.x);
_local3.vy = (_arg1.p1.y - _arg2.p0.y);
_local5 = ((_local3.vx * _arg2.dx) + (_local3.vy * _arg2.dy));
if (_local5 < 0){
_local4 = _local3;
} else {
_local6 = new Object();
_local6.vx = (_arg1.p1.x - _arg2.p1.x);
_local6.vy = (_arg1.p1.y - _arg2.p1.y);
_local5 = ((_local6.vx * _arg2.dx) + (_local6.vy * _arg2.dy));
if (_local5 > 0){
_local4 = _local6;
} else {
_local4 = projectVector(_local3, _arg2.lx, _arg2.ly);
};
};
return (_local4);
}
private function addLoop():void{
var _local1:*;
var _local2:SoundTransform;
_local1 = Math.floor((Math.random() * gameData.sounds.curSound.length));
_local2 = new SoundTransform(1, 0);
if (gameData.sounds.channel != null){
_local2 = gameData.sounds.channel.soundTransform;
};
gameData.sounds.sloop = getMCClass(gameData.sounds.curSound[_local1]);
gameData.sounds.channel = gameData.sounds.sloop.play(0, 4);
gameData.sounds.channel.soundTransform = _local2;
gameData.sounds.channel.addEventListener(Event.SOUND_COMPLETE, soundLoop, false, 0, true);
}
private function addEnemy(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:*;
var _local6:*;
var _local7:*;
gameData.enCounter++;
if (gameData.enCounter > 1000){
gameData.enCounter = 1;
};
gameData.curEnCount++;
gameData.en[("e" + gameData.enCounter)] = new Object();
_local5 = gameData.en[("e" + gameData.enCounter)];
if (_arg2 == gameData.bossSize){
_local5.iAmBoss = true;
gameData.boss.bossOb = _local5;
_local5.hp = gameData.bossSize;
_local5.shootTime = (gameData.bossShootRate + gameData.newTime);
_local5.spr = getMCClass("enemyMC2");
} else {
_local5.iAmBoss = false;
_local5.hp = Math.floor((gameData.curLvl / 20));
_local5.spr = getMCClass("enemyMC");
};
gameData.enSpr.addChild(_local5.spr);
_local5.sz = (_arg2 * gameData.enSize);
_local5.baseSize = _arg2;
_local5.spr.width = (_local5.sz * 2);
_local5.spr.height = (_local5.sz * 2);
_local5.col = _arg1;
_local6 = new Color();
_local6.setTint(myColors[_arg1], 1);
_local5.spr.transform.colorTransform = _local6;
if (_arg3 == -1000){
if (Math.random() < 0.5){
if (Math.random() < 0.5){
_local5.myy = -(_local5.sz);
} else {
_local5.myy = (gameData.playH + _local5.sz);
};
_local5.myx = (gameData.playW * Math.random());
} else {
if (Math.random() < 0.5){
_local5.myx = -(_local5.sz);
} else {
_local5.myx = (gameData.playW + _local5.sz);
};
_local5.myy = (gameData.playH * Math.random());
};
} else {
_local5.myx = _arg3;
_local5.myy = _arg4;
};
_local5.speed = ((gameData.enSpeed + (gameData.curLvl / 30)) + ((Math.random() * 0.2) - 0.1));
_local5.onStage = false;
_local5.hor = gameData[("en_" + _arg1)][0];
_local5.ver = gameData[("en_" + _arg1)][1];
_local5.dx = ((Math.random() * 0.6) + 0.2);
if (Math.random() < 0.5){
_local5.dx = (_local5.dx * -1);
};
_local5.dy = ((Math.random() * 0.6) + 0.2);
if (Math.random() < 0.5){
_local5.dy = (_local5.dy * -1);
};
if (((!((gameData.boss.bossOb == undefined))) && ((gameData.boss.bossOb.dead == null)))){
if (_local5.iAmBoss == true){
_local5.dx = ((gameData.playW / 2) - _local5.myx);
_local5.dy = ((gameData.playH / 2) - _local5.myy);
} else {
_local5.dx = (hero.myx - _local5.myx);
_local5.dy = (hero.myy - _local5.myy);
};
};
_local7 = Math.sqrt(((_local5.dx * _local5.dx) + (_local5.dy * _local5.dy)));
_local5.dx = (_local5.dx / _local7);
_local5.dy = (_local5.dy / _local7);
addToGrid(_local5, ("e" + gameData.enCounter));
}
private function getBMPClass(_arg1:String){
var _local2:Class;
var _local3:*;
var _local4:*;
_local2 = (myParent.loaderInfo.applicationDomain.getDefinition(_arg1) as Class);
_local3 = new _local2(0, 0);
_local4 = new Bitmap(_local3);
return (_local4);
}
private function getMCClass(_arg1:String){
var _local2:Class;
var _local3:*;
_local2 = (myParent.loaderInfo.applicationDomain.getDefinition(_arg1) as Class);
_local3 = new (_local2);
return (_local3);
}
private function addSound(_arg1:String):void{
var _local2:SoundTransform;
var _local3:*;
gameData.sounds.soundCounter++;
if (gameData.sounds.soundCounter == 20){
gameData.sounds.soundCounter = 0;
};
gameData.sounds[("s" + gameData.sounds.soundCounter)] = getMCClass(_arg1);
_local2 = gameData.sounds.channel.soundTransform;
_local3 = gameData.sounds[("s" + gameData.sounds.soundCounter)].play();
_local3.soundTransform = _local2;
}
private function showIntro():void{
if (myClip.numChildren > 0){
myClip.removeChildAt(0);
};
logomc = getMCClass("intro");
logomc.startBut.visible = false;
logomc.sndBut.visible = false;
myClip.addChildAt(logomc, 0);
logomc.x = (stageW / 2);
logomc.y = (stageH / 2);
logomc.logo.startTween;
myTween = new Tween(logomc.logo, "y", Elastic.easeOut, 260, 0, 3, true);
myTween.addEventListener(TweenEvent.MOTION_FINISH, endTween);
}
private function addToGrid(_arg1:Object, _arg2:String):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local3 = Math.floor((_arg1.myx / gameData.gridStep));
_local4 = Math.floor((_arg1.myy / gameData.gridStep));
_local5 = -1;
while (_local5 < 2) {
_local6 = -1;
while (_local6 < 2) {
_local7 = ((("g" + (_local4 + _local6)) + "_") + (_local3 + _local5));
if (gameData.grid[_local7] == null){
gameData.grid[_local7] = new Object();
};
gameData.grid[_local7][_arg2] = _arg1;
_local6 = (_local6 + 1);
};
_local5 = (_local5 + 1);
};
}
private function readso(){
var _local1:SharedObject;
var _local2:SoundTransform;
_local1 = SharedObject.getLocal("shooot2");
_local2 = gameData.sounds.channel.soundTransform;
if (_local1.data.soundVolume != null){
_local2.volume = _local1.data.soundVolume;
};
gameData.sounds.channel.soundTransform = _local2;
showVolume();
}
private function startGame(_arg1:TweenEvent):void{
logomc.gotoAndStop(3);
gameData.playL = 5;
gameData.playU = 5;
gameData.playW = (stageW - 10);
gameData.playH = (stageH - 10);
gameData.levels = new Object();
gameData.levels.l0 = ["red", 3, "green", 3, "blue", 3, "yellow", 3, "purple", 3];
gameData.levels.l1 = ["red", 2];
gameData.levels.l2 = ["blue", 3];
gameData.levels.l3 = ["green", 3, "green", 3, "green", 3];
gameData.levels.l4 = ["red", 2, "green", 2, "blue", 2];
gameData.levels.l5 = ["red", 3, "green", 3, "blue", 3];
gameData.levels.l6 = ["red", 12];
gameData.levels.l7 = ["yellow", 2, "yellow", 2, "yellow", 2];
gameData.levels.l8 = ["red", 2, "green", 2, "blue", 2, "yellow", 2];
gameData.levels.l9 = ["purple", 2];
gameData.levels.l10 = ["purple", 2, "purple", 2, "blue", 2, "blue", 2];
gameData.levels.l11 = ["green", 12];
gameData.levels.l12 = ["yellow", 3, "purple", 2];
gameData.levels.l13 = ["red", 2, "green", 2, "blue", 2, "yellow", 2, "purple", 2];
gameData.levels.l14 = ["red", 3, "green", 3, "blue", 3];
gameData.levels.l15 = ["blue", 4, "purple", 3, "blue", 1, "purple", 1];
gameData.levels.l16 = ["blue", 12];
gameData.levels.l17 = ["green", 2, "green", 2, "purple", 4];
gameData.levels.l18 = ["blue", 4, "green", 4, "yellow", 4, "red", 2];
gameData.levels.l19 = ["yellow", 4, "purple", 4];
mainClip = new Sprite();
mainClip.x = gameData.playL;
mainClip.y = gameData.playU;
myClip.addChildAt(mainClip, 0);
mainClip.scrollRect = new Rectangle(0, 0, gameData.playW, gameData.playH);
mainClip.cacheAsBitmap = true;
backBmp = new Bitmap(new BitmapData(gameData.playW, gameData.playH, true, 0));
mainClip.mouseChildren = false;
mainClip.addChildAt(backBmp, 0);
gameData.textMC = getMCClass("textMC");
myParent.stage.focus = mainClip;
hero = new Object();
hero.spr = getMCClass("heroMC");
hero.sz = 30;
hero.speed = 2;
hero.myrot = 0;
hero.guns = 2;
hero.maxguns = 12;
hero.rotspeed = (3 / 10);
hero.shootRate = 1800;
hero.quickFire = 1;
hero.spreadAngle = 90;
hero.hurtRate = 3600;
hero.hurt = false;
hero.spr.width = hero.sz;
hero.spr.height = hero.sz;
hero.myx = (gameData.playW / 2);
hero.myy = (gameData.playH / 2);
hero.targetx = mainClip.mouseX;
hero.targety = mainClip.mouseY;
placeOb(hero);
mainClip.addChildAt(hero.spr, 1);
gameData.curLvl = 0;
gameData.myScore = 0;
gameData.doublePoints = 1;
gameData.gameover = false;
gameData.gameStatus = "playing";
gameData.bullets = new Object();
gameData.bulletCounter = 0;
gameData.bulletSpeed = 3;
gameData.bulSpr = new Sprite();
mainClip.addChildAt(gameData.bulSpr, 1);
gameData.en = new Object();
gameData.en_red = [0, 0];
gameData.en_blue = [1, 0];
gameData.en_green = [0, 1];
gameData.en_yellow = [1, 1];
gameData.en_purple = [1, 1];
gameData.enCounter = 0;
gameData.curEnCount = 0;
gameData.enSpeed = 1;
gameData.enSize = 15;
gameData.bossSize = 12;
gameData.bossShootRate = (hero.shootRate * 2);
gameData.boss = new Object();
gameData.enSpr = new Sprite();
mainClip.addChildAt(gameData.enSpr, 2);
gameData.now = new Date();
gameData.lastTime = gameData.now.getTime();
gameData.newTime = 0;
gameData.pausedTime = 0;
gameData.timeStep = 0;
gameData.degToRad = (Math.PI / 180);
hero.shootTime = (hero.shootRate + gameData.lastTime);
hero.hurtTime = 0;
gameData.bonusTime = 0;
gameData.bonusEffectTime = 10000;
gameData.enSlowRate = 1;
gameData.drawTime = (gameData.lastTime + 50);
gameData.myMatrix = new Matrix();
gameData.myColT1 = new ColorTransform(1, 1, 1, 0.6, 0, 0, 0, 0);
gameData.myColT2 = new ColorTransform(1, 1, 1, 0.95, 0, 0, 0, 0);
gameData.fpscount = 0;
gameData.fpstime = 0;
gameData.grid = new Object();
gameData.gridStep = 30;
gameData.bonusOb = new Object();
gameData.bonusOb.spr = getMCClass("bonusMC");
gameData.bonusOb.onStage = false;
mainClip.addChildAt(gameData.bonusOb.spr, 1);
gameData.bonusOb.spr.visible = false;
mainClip.addEventListener(Event.ENTER_FRAME, runGame, false, 0, true);
mainClip.addEventListener(MouseEvent.CLICK, pauseGame, false, 0, true);
mainClip.addEventListener(KeyboardEvent.KEY_DOWN, downKeys);
mainClip.addEventListener(KeyboardEvent.KEY_UP, upKeys);
logomc.mouseEnabled = false;
logomc.mouseChildren = false;
keys = new Object();
keys[90] = {down:0};
keys[88] = {down:0};
}
private function showVolume():void{
var _local1:SoundTransform;
_local1 = gameData.sounds.channel.soundTransform;
logomc.sndBut.graphics.clear();
logomc.sndBut.graphics.beginFill(myColors.white);
logomc.sndBut.graphics.drawRect(5, (-10 * _local1.volume), 4, (20 * _local1.volume));
}
}
}//package
Section 19
//heroMC (heroMC)
package {
import flash.display.*;
public dynamic class heroMC extends MovieClip {
}
}//package
Section 20
//HiScores (HiScores)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class HiScores extends MovieClip {
private var KEY:String;// = "rocket"
private var score:Number;
private var lowIsBest:Boolean;
private var gameId:Number;
private var infoScreen:MovieClip;// = null
public var movEntryScreen:MovieClip;
private var levelId:Number;
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 INDEX_URL:String = (SERVER_URL + "/index.jsp?id=");
public function HiScores(){
KEY = "rocket";
infoScreen = null;
entryScreen = 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 submitDetails():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;
infoScreen.visible = true;
_local1 = true;
if (entryScreen["txtName"].text.length == 0){
showInfoMessage("Please enter your name.", true);
} else {
if (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|" + 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 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 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.gameId = _arg1;
this.levelId = _arg2;
this.gameCode = _arg3;
this.lowIsBest = _arg4;
this.score = _arg5;
this.entryScreen = this["movEntryScreen"];
this.infoScreen = this["movInfoScreen"];
entryScreen["txtMsg1"].text = _arg6;
entryScreen["txtMsg2"].text = _arg7;
entryScreen["txtName"].text = "";
entryScreen["txtCode"].text = "";
entryScreen.visible = true;
infoScreen.visible = false;
secCodeLoad();
entryScreen["btnRefreshCode"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
entryScreen["btnSubmit"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnView"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnBack"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
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":
submitDetails();
break;
case "btnView":
viewScore();
break;
case "btnBack":
back();
break;
};
}
public function viewScore():void{
var _local1:URLRequest;
_local1 = new URLRequest(((((((((INDEX_URL + gameCode) + "_hs") + "&name=") + entryScreen["txtName"].text) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime()));
navigateToURL(_local1, "_blank");
}
}
}//package
Section 21
//intro (intro)
package {
import flash.display.*;
import flash.text.*;
public dynamic class intro extends MovieClip {
public var pauseMC:MovieClip;
public var bonus:MovieClip;
public var sc:Number;
public var sndBut:MovieClip;
public var lvlbox:textMC;
public var txt:TextField;
public var bullets:MovieClip;
public var fpsbox:textMC;
public var logo:MovieClip;
public var movHiScores:HiScores;
public var endbut:MovieClip;
public var startBut:MovieClip;
public function intro(){
addFrameScript(0, frame1, 3, frame4);
}
function frame1(){
sc = 0;
stop();
}
function frame4(){
movHiScores.setDetails(36, 0, "shooot2", false, sc, sc.toString(), "points!");
}
}
}//package
Section 22
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.1");
}
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);
};
if (clip._mochiad_loaded){
return (null);
};
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{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
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];
};
};
_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++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
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();
};
_arg1.removeChild(_arg1._mochiad);
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{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
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{
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;
_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.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
_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{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
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;
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{
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.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;
_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 {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 23
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
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("*");
Security.allowInsecureDomain("*");
_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 24
//s1 (s1)
package {
import flash.media.*;
public dynamic class s1 extends Sound {
}
}//package
Section 25
//s2 (s2)
package {
import flash.media.*;
public dynamic class s2 extends Sound {
}
}//package
Section 26
//s3 (s3)
package {
import flash.media.*;
public dynamic class s3 extends Sound {
}
}//package
Section 27
//s4 (s4)
package {
import flash.media.*;
public dynamic class s4 extends Sound {
}
}//package
Section 28
//s5 (s5)
package {
import flash.media.*;
public dynamic class s5 extends Sound {
}
}//package
Section 29
//sclick (sclick)
package {
import flash.media.*;
public dynamic class sclick extends Sound {
}
}//package
Section 30
//se1 (se1)
package {
import flash.media.*;
public dynamic class se1 extends Sound {
}
}//package
Section 31
//se2 (se2)
package {
import flash.media.*;
public dynamic class se2 extends Sound {
}
}//package
Section 32
//sh (sh)
package {
import flash.media.*;
public dynamic class sh extends Sound {
}
}//package
Section 33
//sh1 (sh1)
package {
import flash.media.*;
public dynamic class sh1 extends Sound {
}
}//package
Section 34
//sh2 (sh2)
package {
import flash.media.*;
public dynamic class sh2 extends Sound {
}
}//package
Section 35
//sh3 (sh3)
package {
import flash.media.*;
public dynamic class sh3 extends Sound {
}
}//package
Section 36
//sh4 (sh4)
package {
import flash.media.*;
public dynamic class sh4 extends Sound {
}
}//package
Section 37
//shurt (shurt)
package {
import flash.media.*;
public dynamic class shurt extends Sound {
}
}//package
Section 38
//sndSlap (sndSlap)
package {
import flash.media.*;
public dynamic class sndSlap extends Sound {
}
}//package
Section 39
//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 40
//textMC (textMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class textMC extends MovieClip {
public var txt:TextField;
}
}//package