Section 1
//mp3 (Chaor02.mp3)
package Chaor02 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Chaor02
Section 2
//mp3 (Chaor03.mp3)
package Chaor03 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Chaor03
Section 3
//mp3 (Chaor04.mp3)
package Chaor04 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Chaor04
Section 4
//mp3 (Chaor05.mp3)
package Chaor05 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Chaor05
Section 5
//mp3 (CHDanger_MM_Loop.mp3)
package CHDanger_MM_Loop {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package CHDanger_MM_Loop
Section 6
//mp3 (ChEvilBaddy_Full.mp3)
package ChEvilBaddy_Full {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package ChEvilBaddy_Full
Section 7
//mp3 (ChEvilBaddy_Short1.mp3)
package ChEvilBaddy_Short1 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package ChEvilBaddy_Short1
Section 8
//mp3 (CHMaxxor_RS_Loop.mp3)
package CHMaxxor_RS_Loop {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package CHMaxxor_RS_Loop
Section 9
//ScrollPane (com.koodosoft.containers.ScrollPane)
package com.koodosoft.containers {
import flash.display.*;
public class ScrollPane extends MovieClip {
public var scrollBar:InstructionScrollBar;
public var content:InstructionContent;
public function ScrollPane(){
init();
}
function init(){
content.showRect.x = content.x;
content.showRect.y = content.y;
addChild(content.showRect);
content.mask = content.showRect;
scrollBar.content = content;
}
}
}//package com.koodosoft.containers
Section 10
//ScrollBar (com.koodosoft.controls.ScrollBar)
package com.koodosoft.controls {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class ScrollBar extends MovieClip {
private var _downButtonTimer:Timer;
private var _ratio:Number;// = 0
private var _scrollHeight:Number;
public var trackButton:MovieClip;
private var _bottomY:Number;
public var downButton:MovieClip;
private var _topY:Number;
private var _upButtonTimer:Timer;
private var _content:ScrollContent;// = null
public var thumbButton:MovieClip;
public var upButton:MovieClip;
public function ScrollBar(){
_content = null;
_ratio = 0;
super();
init();
}
function onUpButtonTimer(_arg1:TimerEvent):void{
ratio = (ratio - 0.01);
}
public function get ratio():Number{
return (_ratio);
}
function init(){
_topY = (upButton.y + upButton.height);
_bottomY = downButton.y;
_scrollHeight = ((_bottomY - _topY) - thumbButton.height);
thumbButton.y = _topY;
_upButtonTimer = new Timer(10, 0);
_upButtonTimer.addEventListener(TimerEvent.TIMER, onUpButtonTimer);
_downButtonTimer = new Timer(10, 0);
_downButtonTimer.addEventListener(TimerEvent.TIMER, onDownButtonTimer);
thumbButton.addEventListener(MouseEvent.MOUSE_DOWN, onThumbButtonMouseDown);
trackButton.addEventListener(MouseEvent.MOUSE_DOWN, onTrackButtonMouseDown);
upButton.addEventListener(MouseEvent.MOUSE_DOWN, onUpButtonMouseDown);
downButton.addEventListener(MouseEvent.MOUSE_DOWN, onDownButtonMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onStageMouseUp);
}
public function set bottomY(_arg1):void{
_bottomY = _arg1;
_scrollHeight = ((_bottomY - _topY) - thumbButton.height);
}
function onThumbButtonMouseDown(_arg1:Event):void{
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, onThumbMouseMove);
stage.addEventListener(MouseEvent.MOUSE_UP, onThumbButtonMouseUp);
}
public function set ratio(_arg1){
_ratio = _arg1;
if (_ratio < 0){
_ratio = 0;
} else {
if (_ratio > 1){
_ratio = 1;
};
};
thumbButton.y = (_topY + (_ratio * _scrollHeight));
_content.y = ((-(_ratio) * (_content.height - content.showHeight)) + content.showRect.y);
}
public function set topY(_arg1):void{
_topY = _arg1;
_scrollHeight = ((_bottomY - _topY) - thumbButton.height);
}
function onDownButtonTimer(_arg1:TimerEvent):void{
ratio = (ratio + 0.01);
}
function onTrackButtonMouseDown(_arg1:Event):void{
ratio = (((mouseY - (thumbButton.height * 0.5)) - _topY) / _scrollHeight);
}
public function get content():ScrollContent{
return (_content);
}
public function get bottomY():Number{
return (_bottomY);
}
protected function onThumbButtonMouseUp(_arg1:MouseEvent):void{
mouseChildren = true;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onThumbMouseMove);
stage.removeEventListener(MouseEvent.MOUSE_UP, onThumbButtonMouseUp);
}
protected function onThumbMouseMove(_arg1:MouseEvent):void{
ratio = (((mouseY - (thumbButton.height * 0.5)) - _topY) / _scrollHeight);
}
function onDownButtonMouseDown(_arg1:Event):void{
_downButtonTimer.start();
}
public function get topY():Number{
return (_topY);
}
function onUpButtonMouseDown(_arg1:Event):void{
_upButtonTimer.start();
}
function onStageMouseUp(_arg1:Event):void{
_upButtonTimer.stop();
_downButtonTimer.stop();
}
public function set content(_arg1){
_content = _arg1;
}
}
}//package com.koodosoft.controls
Section 11
//ScrollContent (com.koodosoft.controls.ScrollContent)
package com.koodosoft.controls {
import flash.display.*;
import flash.text.*;
public class ScrollContent extends MovieClip {
private var _showHeight:Number;// = 200
public var _textField:TextField;
private var _showWidth:Number;// = 200
private var _showRect:Shape;
public function ScrollContent(){
_showRect = new Shape();
_showHeight = 200;
_showWidth = 200;
super();
_showRect.graphics.beginFill(0xFFFFFF);
_showRect.graphics.drawRect(0, 0, _showWidth, _showHeight);
_showRect.graphics.endFill();
init();
}
public function set showHeight(_arg1){
_showHeight = _arg1;
}
function init(){
}
public function setSize(_arg1:Number, _arg2:Number){
_showWidth = _arg1;
_showHeight = _arg2;
_showRect.width = _arg1;
_showRect.height = _arg2;
}
public function get showHeight():Number{
return (_showHeight);
}
public function get showRect():Shape{
return (_showRect);
}
public function set showWidth(_arg1){
_showWidth = _arg1;
}
public function get showWidth():Number{
return (_showWidth);
}
}
}//package com.koodosoft.controls
Section 12
//mp3 (Die_04.mp3)
package Die_04 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Die_04
Section 13
//mp3 (Die_06.mp3)
package Die_06 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Die_06
Section 14
//mp3 (flame_tower.mp3)
package flame_tower {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package flame_tower
Section 15
//mp3 (Grook02.mp3)
package Grook02 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Grook02
Section 16
//mp3 (Grook03.mp3)
package Grook03 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Grook03
Section 17
//mp3 (Khugar01.mp3)
package Khugar01 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Khugar01
Section 18
//mp3 (Khugar02.mp3)
package Khugar02 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Khugar02
Section 19
//mp3 (Maxxor_Full.mp3)
package Maxxor_Full {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Maxxor_Full
Section 20
//mp3 (Maxxor_Short02.mp3)
package Maxxor_Short02 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Maxxor_Short02
Section 21
//_sounds_5 (PerimProtector_fla._sounds_5)
package PerimProtector_fla {
import flash.display.*;
public dynamic class _sounds_5 extends MovieClip {
public function _sounds_5(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 22
//AllmageddonBody_130 (PerimProtector_fla.AllmageddonBody_130)
package PerimProtector_fla {
import flash.display.*;
public dynamic class AllmageddonBody_130 extends MovieClip {
public var _barrel:MovieClip;
}
}//package PerimProtector_fla
Section 23
//BackButton_20 (PerimProtector_fla.BackButton_20)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BackButton_20 extends MovieClip {
public function BackButton_20(){
addFrameScript(0, frame1);
}
function frame1(){
buttonMode = true;
}
}
}//package PerimProtector_fla
Section 24
//BossChaorAnimation_28 (PerimProtector_fla.BossChaorAnimation_28)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BossChaorAnimation_28 extends MovieClip {
public function BossChaorAnimation_28(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 25
//BossChaorBody_27 (PerimProtector_fla.BossChaorBody_27)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BossChaorBody_27 extends MovieClip {
public var _animation:MovieClip;
}
}//package PerimProtector_fla
Section 26
//BossGrookAnimation_105 (PerimProtector_fla.BossGrookAnimation_105)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BossGrookAnimation_105 extends MovieClip {
public function BossGrookAnimation_105(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 27
//BossGrookBody_104 (PerimProtector_fla.BossGrookBody_104)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BossGrookBody_104 extends MovieClip {
public var _animation:MovieClip;
}
}//package PerimProtector_fla
Section 28
//BossKhugarAnimation_95 (PerimProtector_fla.BossKhugarAnimation_95)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BossKhugarAnimation_95 extends MovieClip {
public function BossKhugarAnimation_95(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 29
//BossKhugarBody_94 (PerimProtector_fla.BossKhugarBody_94)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BossKhugarBody_94 extends MovieClip {
public var _animation:MovieClip;
}
}//package PerimProtector_fla
Section 30
//BossSkithiaAnimation_100 (PerimProtector_fla.BossSkithiaAnimation_100)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BossSkithiaAnimation_100 extends MovieClip {
public function BossSkithiaAnimation_100(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 31
//BossSkithiaBody_99 (PerimProtector_fla.BossSkithiaBody_99)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BossSkithiaBody_99 extends MovieClip {
public var _animation:MovieClip;
}
}//package PerimProtector_fla
Section 32
//BossTakinomAnimation_37 (PerimProtector_fla.BossTakinomAnimation_37)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BossTakinomAnimation_37 extends MovieClip {
public function BossTakinomAnimation_37(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 33
//BossTakinomBody_36 (PerimProtector_fla.BossTakinomBody_36)
package PerimProtector_fla {
import flash.display.*;
public dynamic class BossTakinomBody_36 extends MovieClip {
public var _animation:MovieClip;
}
}//package PerimProtector_fla
Section 34
//die_31 (PerimProtector_fla.die_31)
package PerimProtector_fla {
import flash.display.*;
public dynamic class die_31 extends MovieClip {
public function die_31(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
}
}
}//package PerimProtector_fla
Section 35
//FastAnimation_121 (PerimProtector_fla.FastAnimation_121)
package PerimProtector_fla {
import flash.display.*;
public dynamic class FastAnimation_121 extends MovieClip {
public function FastAnimation_121(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 36
//FastBody_120 (PerimProtector_fla.FastBody_120)
package PerimProtector_fla {
import flash.display.*;
public dynamic class FastBody_120 extends MovieClip {
public var _animation:MovieClip;
}
}//package PerimProtector_fla
Section 37
//FlameORBBody_142 (PerimProtector_fla.FlameORBBody_142)
package PerimProtector_fla {
import flash.display.*;
public dynamic class FlameORBBody_142 extends MovieClip {
public var _barrel:MovieClip;
}
}//package PerimProtector_fla
Section 38
//FlyingAnimation_110 (PerimProtector_fla.FlyingAnimation_110)
package PerimProtector_fla {
import flash.display.*;
public dynamic class FlyingAnimation_110 extends MovieClip {
public function FlyingAnimation_110(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 39
//FlyingBody_109 (PerimProtector_fla.FlyingBody_109)
package PerimProtector_fla {
import flash.display.*;
public dynamic class FlyingBody_109 extends MovieClip {
public var _animation:MovieClip;
}
}//package PerimProtector_fla
Section 40
//GameFailScreen_23 (PerimProtector_fla.GameFailScreen_23)
package PerimProtector_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public dynamic class GameFailScreen_23 extends MovieClip {
public var _playAgain:PlayAgainButton;
public var _watchVideos:MovieClip;
public var _scoreText:TextField;
public var _moreGames:MovieClip;
public function GameFailScreen_23(){
addFrameScript(0, frame1);
}
public function onPlayAgainClick(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.PLAY_AGAIN));
}
public function onMoreGamesClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
MochiBot.track(this, "4f463af6");
_local2 = new URLRequest("http://www.4kids.tv/games/?utm_source=viral&utm_medium=game&utm_campaign=perimprotector");
navigateToURL(_local2, "_blank");
}
function frame1(){
_playAgain.buttonMode = true;
_playAgain.addEventListener(MouseEvent.CLICK, onPlayAgainClick);
_moreGames.addEventListener(MouseEvent.CLICK, onMoreGamesClick);
_watchVideos.addEventListener(MouseEvent.CLICK, onWatchVideosClick);
}
public function onWatchVideosClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
MochiBot.track(this, "a0a279ee");
_local2 = new URLRequest("http://www.4kids.tv/videos/?utm_source=viral&utm_medium=game&utm_campaign=perimprotector");
navigateToURL(_local2, "_blank");
}
}
}//package PerimProtector_fla
Section 41
//GameSuccessScreen_25 (PerimProtector_fla.GameSuccessScreen_25)
package PerimProtector_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public dynamic class GameSuccessScreen_25 extends MovieClip {
public var _playAgain:PlayAgainButton;
public var _watchVideos:MovieClip;
public var _scoreText:TextField;
public var _moreGames:MovieClip;
public function GameSuccessScreen_25(){
addFrameScript(0, frame1);
}
public function onPlayAgainClick(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.PLAY_AGAIN));
}
public function onMoreGamesClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
MochiBot.track(this, "4f463af6");
_local2 = new URLRequest("http://www.4kids.tv/games/?utm_source=viral&utm_medium=game&utm_campaign=perimprotector");
navigateToURL(_local2, "_blank");
}
function frame1(){
_playAgain.buttonMode = true;
_playAgain.addEventListener(MouseEvent.CLICK, onPlayAgainClick);
_moreGames.addEventListener(MouseEvent.CLICK, onMoreGamesClick);
_watchVideos.addEventListener(MouseEvent.CLICK, onWatchVideosClick);
}
public function onWatchVideosClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
MochiBot.track(this, "a0a279ee");
_local2 = new URLRequest("http://www.4kids.tv/videos/?utm_source=viral&utm_medium=game&utm_campaign=perimprotector");
navigateToURL(_local2, "_blank");
}
}
}//package PerimProtector_fla
Section 42
//HardAnimation_126 (PerimProtector_fla.HardAnimation_126)
package PerimProtector_fla {
import flash.display.*;
public dynamic class HardAnimation_126 extends MovieClip {
public function HardAnimation_126(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 43
//HardBody_125 (PerimProtector_fla.HardBody_125)
package PerimProtector_fla {
import flash.display.*;
public dynamic class HardBody_125 extends MovieClip {
public var _animation:MovieClip;
}
}//package PerimProtector_fla
Section 44
//IronBallsBody_134 (PerimProtector_fla.IronBallsBody_134)
package PerimProtector_fla {
import flash.display.*;
public dynamic class IronBallsBody_134 extends MovieClip {
public var _barrel:MovieClip;
}
}//package PerimProtector_fla
Section 45
//levelButton_76 (PerimProtector_fla.levelButton_76)
package PerimProtector_fla {
import flash.display.*;
public dynamic class levelButton_76 extends MovieClip {
public function levelButton_76(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
buttonMode = true;
}
function frame2(){
stop();
}
}
}//package PerimProtector_fla
Section 46
//loader_1 (PerimProtector_fla.loader_1)
package PerimProtector_fla {
import flash.display.*;
public dynamic class loader_1 extends MovieClip {
public var _body:MovieClip;
}
}//package PerimProtector_fla
Section 47
//loadercopy_2 (PerimProtector_fla.loadercopy_2)
package PerimProtector_fla {
import flash.display.*;
public dynamic class loadercopy_2 extends MovieClip {
public function loadercopy_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 48
//MainTimeline (PerimProtector_fla.MainTimeline)
package PerimProtector_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import flash.geom.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var _gameSuccessScreen:MovieClip;
public var rect:Shape;
public var sound:SoundManager;
public var _mainScreen:MainScreen;
public var _watchVideos:MovieClip;
public var _loader:MovieClip;
public var _howToPlay:HowToPlayButton;
public var _backButton:MovieClip;
public var _goButton:MovieClip;
public var _playNow:PlayNowButton;
public var _gameFailScreen:MovieClip;
public var fps:TextField;
public var _moreGames:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 59, frame60, 60, frame61, 61, frame62, 62, frame63, 63, frame64, 64, frame65);
}
function frame62(){
_goButton.addEventListener(MouseEvent.CLICK, onGoButtonClick);
MochiBot.track(this, "6c38894e");
}
function frame65(){
_mainScreen.mouseEnabled = false;
_mainScreen.mouseChildren = false;
stop();
_gameSuccessScreen._scoreText.text = int(_mainScreen.actor.score).toString();
Helper.saveCookie("score", _mainScreen.actor.score);
Helper.saveCookie("money", _mainScreen.actor.money);
}
function frame64(){
_mainScreen.mouseEnabled = false;
_mainScreen.mouseChildren = false;
stop();
_gameFailScreen._scoreText.text = int(_mainScreen.actor.score).toString();
Helper.saveCookie("score", _mainScreen.actor.score);
Helper.saveCookie("money", _mainScreen.actor.money);
}
public function onPlayNowClick(_arg1:MouseEvent):void{
gotoAndStop("intro");
}
public function dispose(){
if (_mainScreen != null){
_mainScreen.dispose();
removeChild(_mainScreen);
_mainScreen = null;
};
}
public function onSuccess(_arg1:GameEvent):void{
gotoAndPlay("success");
}
public function onGameFail(_arg1:GameEvent):void{
gotoAndStop("fail");
}
public function onMoreGamesClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
MochiBot.track(this, "8499de16");
_local2 = new URLRequest("http://www.4kids.tv/games/?utm_source=viral&utm_medium=game&utm_campaign=perimprotector");
navigateToURL(_local2, "_blank");
}
public function onBackButtonClick(_arg1:MouseEvent):void{
gotoAndStop("home");
}
public function onGameReset(_arg1:GameEvent):void{
sound.dispose();
dispose();
gotoAndPlay("home");
}
public function onPlayAgain(_arg1:GameEvent):void{
sound.dispose();
dispose();
gotoAndPlay("home");
}
function frame1(){
this.stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING);
}
public function onGoButtonClick(_arg1:MouseEvent):void{
gotoAndPlay("main");
}
public function onHowToPlayClick(_arg1:MouseEvent):void{
gotoAndStop("howToPlay");
}
public function PL_LOADING(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = Math.round(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100));
_loader._body.gotoAndStop(_local2);
if (_local2 == 100){
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, PL_LOADING);
this.gotoAndPlay(2);
};
}
function frame61(){
_backButton.addEventListener(MouseEvent.CLICK, onBackButtonClick);
}
function frame60(){
stop();
if (rect == null){
rect = new Shape();
rect.graphics.beginFill(0xFFFFFF);
rect.graphics.drawRect(0, 0, 640, 480);
rect.graphics.endFill();
addChild(rect);
this.mask = rect;
};
_playNow.addEventListener(MouseEvent.CLICK, onPlayNowClick);
_howToPlay.addEventListener(MouseEvent.CLICK, onHowToPlayClick);
_moreGames.addEventListener(MouseEvent.CLICK, onMoreGamesClick);
_watchVideos.addEventListener(MouseEvent.CLICK, onWatchVideosClick);
if (sound == null){
sound = SoundManager.create();
};
if (sound.backgroundName != Data.sound[0]){
sound.dispose();
sound.backgroundName = Data.sound[0];
};
}
function frame63(){
stop();
dispose();
_mainScreen = new MainScreen();
addChildAt(_mainScreen, 0);
_mainScreen.init();
addEventListener(GameEvent.RESET, onGameReset);
addEventListener(GameEvent.FAIL, onGameFail);
addEventListener(GameEvent.SUCCESS, onSuccess);
addEventListener(GameEvent.PLAY_AGAIN, onPlayAgain);
}
public function onWatchVideosClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
MochiBot.track(this, "d33284bf");
_local2 = new URLRequest("http://www.4kids.tv/videos/?utm_source=viral&utm_medium=game&utm_campaign=perimprotector");
navigateToURL(_local2, "_blank");
}
}
}//package PerimProtector_fla
Section 49
//MoreGamesButton_8 (PerimProtector_fla.MoreGamesButton_8)
package PerimProtector_fla {
import flash.events.*;
import flash.display.*;
public dynamic class MoreGamesButton_8 extends MovieClip {
public function MoreGamesButton_8(){
addFrameScript(0, frame1, 1, frame2);
}
public function onMouseOver(_arg1:MouseEvent):void{
gotoAndStop("active");
}
function frame1(){
stop();
buttonMode = true;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
public function onMouseOut(_arg1:MouseEvent):void{
gotoAndStop("normal");
}
function frame2(){
stop();
}
}
}//package PerimProtector_fla
Section 50
//NormalAnimation_116 (PerimProtector_fla.NormalAnimation_116)
package PerimProtector_fla {
import flash.display.*;
public dynamic class NormalAnimation_116 extends MovieClip {
public function NormalAnimation_116(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package PerimProtector_fla
Section 51
//NormalBody_115 (PerimProtector_fla.NormalBody_115)
package PerimProtector_fla {
import flash.display.*;
public dynamic class NormalBody_115 extends MovieClip {
public var _animation:MovieClip;
}
}//package PerimProtector_fla
Section 52
//RockWaveBody_138 (PerimProtector_fla.RockWaveBody_138)
package PerimProtector_fla {
import flash.display.*;
public dynamic class RockWaveBody_138 extends MovieClip {
public var _barrel:MovieClip;
}
}//package PerimProtector_fla
Section 53
//SounButton_75 (PerimProtector_fla.SounButton_75)
package PerimProtector_fla {
import flash.display.*;
public dynamic class SounButton_75 extends MovieClip {
public function SounButton_75(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
buttonMode = true;
}
function frame2(){
stop();
}
}
}//package PerimProtector_fla
Section 54
//StoryGoButton_22 (PerimProtector_fla.StoryGoButton_22)
package PerimProtector_fla {
import flash.display.*;
public dynamic class StoryGoButton_22 extends MovieClip {
public function StoryGoButton_22(){
addFrameScript(0, frame1);
}
function frame1(){
buttonMode = true;
}
}
}//package PerimProtector_fla
Section 55
//TowerSelectionButton1_68 (PerimProtector_fla.TowerSelectionButton1_68)
package PerimProtector_fla {
import flash.display.*;
public dynamic class TowerSelectionButton1_68 extends MovieClip {
public function TowerSelectionButton1_68(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
buttonMode = true;
}
function frame2(){
stop();
}
}
}//package PerimProtector_fla
Section 56
//TowerSelectionButton2_69 (PerimProtector_fla.TowerSelectionButton2_69)
package PerimProtector_fla {
import flash.display.*;
public dynamic class TowerSelectionButton2_69 extends MovieClip {
public function TowerSelectionButton2_69(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
buttonMode = true;
}
function frame2(){
stop();
}
}
}//package PerimProtector_fla
Section 57
//TowerSelectionButton3_70 (PerimProtector_fla.TowerSelectionButton3_70)
package PerimProtector_fla {
import flash.display.*;
public dynamic class TowerSelectionButton3_70 extends MovieClip {
public function TowerSelectionButton3_70(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
buttonMode = true;
}
function frame2(){
stop();
}
}
}//package PerimProtector_fla
Section 58
//TowerSelectionButton4_71 (PerimProtector_fla.TowerSelectionButton4_71)
package PerimProtector_fla {
import flash.display.*;
public dynamic class TowerSelectionButton4_71 extends MovieClip {
public function TowerSelectionButton4_71(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
buttonMode = true;
}
function frame2(){
stop();
}
}
}//package PerimProtector_fla
Section 59
//TowerSelectionButton5_72 (PerimProtector_fla.TowerSelectionButton5_72)
package PerimProtector_fla {
import flash.display.*;
public dynamic class TowerSelectionButton5_72 extends MovieClip {
public function TowerSelectionButton5_72(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
buttonMode = true;
}
function frame2(){
stop();
}
}
}//package PerimProtector_fla
Section 60
//WatchVideosButton_10 (PerimProtector_fla.WatchVideosButton_10)
package PerimProtector_fla {
import flash.events.*;
import flash.display.*;
public dynamic class WatchVideosButton_10 extends MovieClip {
public function WatchVideosButton_10(){
addFrameScript(0, frame1, 1, frame2);
}
public function onMouseOver(_arg1:MouseEvent):void{
gotoAndStop("active");
}
function frame1(){
stop();
buttonMode = true;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
public function onMouseOut(_arg1:MouseEvent):void{
gotoAndStop("normal");
}
function frame2(){
stop();
}
}
}//package PerimProtector_fla
Section 61
//WindSlashBody_146 (PerimProtector_fla.WindSlashBody_146)
package PerimProtector_fla {
import flash.display.*;
public dynamic class WindSlashBody_146 extends MovieClip {
public var _barrel:MovieClip;
}
}//package PerimProtector_fla
Section 62
//mp3 (Skithia01.mp3)
package Skithia01 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Skithia01
Section 63
//mp3 (Taki01.mp3)
package Taki01 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Taki01
Section 64
//mp3 (Taki02.mp3)
package Taki02 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package Taki02
Section 65
//mp3 (tower01.mp3)
package tower01 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package tower01
Section 66
//mp3 (TowerFire_01.mp3)
package TowerFire_01 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package TowerFire_01
Section 67
//mp3 (TowerFire_05.mp3)
package TowerFire_05 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package TowerFire_05
Section 68
//mp3 (TowerFire_06.mp3)
package TowerFire_06 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package TowerFire_06
Section 69
//mp3 (TowerFire_14.mp3)
package TowerFire_14 {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package TowerFire_14
Section 70
//Actor (Actor)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
public class Actor {
private var _money:Number;// = 100
private var _mainScreen:MainScreen;
private var _interest:Number;// = 0
private var _score:Number;// = 0
public function Actor(){
_score = 0;
_money = 100;
_interest = 0;
super();
}
public function get money():Number{
return (_money);
}
public function get mainScreen():MainScreen{
return (_mainScreen);
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
public function set score(_arg1){
_score = int(_arg1);
}
public function get interest():Number{
return (_interest);
}
public function get score():Number{
return (_score);
}
public function set interest(_arg1){
_interest = _arg1;
}
public function set money(_arg1){
_money = _arg1;
}
public static function create(_arg1:MainScreen):Actor{
var _local2:*;
_local2 = new (Actor);
_local2.mainScreen = _arg1;
_local2.interest = Math.round(((Data.level[0][2] * _local2.money) * 0.01));
return (_local2);
}
}
}//package
Section 71
//Allmageddon (Allmageddon)
package {
public dynamic class Allmageddon extends Tower {
public function Allmageddon(){
addFrameScript(0, frame1, 3, frame4, 4, frame5, 10, frame11, 14, frame15, 15, frame16, 19, frame20);
}
function frame15(){
gotoAndPlay("canAdded");
}
function frame1(){
stop();
_rangeShow.visible = false;
}
function frame4(){
gotoAndPlay("normal");
}
function frame5(){
_rangeShow.visible = true;
}
function frame20(){
gotoAndPlay("canNotAdded");
}
function frame16(){
_rangeShow.gotoAndStop("canNotAdded");
_rangeShow.visible = true;
}
function frame11(){
_rangeShow.gotoAndStop("canAdded");
_rangeShow.visible = true;
}
}
}//package
Section 72
//AllmageddonDescription (AllmageddonDescription)
package {
import flash.display.*;
import flash.text.*;
public dynamic class AllmageddonDescription extends MovieClip {
public var _towerText:TextField;
public var _moneyText:TextField;
}
}//package
Section 73
//AllmageddonProjectile (AllmageddonProjectile)
package {
public dynamic class AllmageddonProjectile extends Projectile {
}
}//package
Section 74
//AllmageddonRange (AllmageddonRange)
package {
import flash.display.*;
public dynamic class AllmageddonRange extends MovieClip {
public function AllmageddonRange(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 75
//Bank (Bank)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Bank extends MovieClip {
private var _mainScreen;
public var _interestText:TextField;
private var _currentLevel:int;// = 1
public var _moneyText:TextField;
private var _money:int;
private var _rate:int;// = 0
public function Bank(){
_currentLevel = 1;
_rate = 0;
super();
}
function updateInterest(){
var _local1:*;
update();
_rate = Data.level[(_currentLevel - 1)][2];
_local1 = ((((_rate.toString() + "% x $") + _moneyText.text) + "\n= $") + _mainScreen.actor.interest.toString());
_interestText.text = _local1;
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
updateMoney(_mainScreen.actor.money);
updateInterest();
}
function updateMoney(_arg1:int){
_money = _arg1;
_moneyText.text = _mainScreen.actor.money.toString();
}
protected function set money(_arg1){
_money = _arg1;
}
public function get mainScreen(){
return (_mainScreen);
}
public function update(){
if (((!((_currentLevel == _mainScreen.currentLevel))) || (!((money == _mainScreen.actor.money))))){
if (((!((_currentLevel == _mainScreen.currentLevel))) && ((_mainScreen.currentLevel > 0)))){
_currentLevel = _mainScreen.currentLevel;
};
if (_money != _mainScreen.actor.money){
updateMoney(_mainScreen.actor.money);
};
};
}
protected function get money(){
return (_money);
}
}
}//package
Section 76
//BossChaor (BossChaor)
package {
public dynamic class BossChaor extends Ruffian {
}
}//package
Section 77
//BossChaorThumb (BossChaorThumb)
package {
import flash.display.*;
public dynamic class BossChaorThumb extends MovieClip {
}
}//package
Section 78
//BossGrook (BossGrook)
package {
public dynamic class BossGrook extends Ruffian {
}
}//package
Section 79
//BossGrookThumb (BossGrookThumb)
package {
import flash.display.*;
public dynamic class BossGrookThumb extends MovieClip {
}
}//package
Section 80
//BossKhugar (BossKhugar)
package {
public dynamic class BossKhugar extends Ruffian {
}
}//package
Section 81
//BossKhugarThumb (BossKhugarThumb)
package {
import flash.display.*;
public dynamic class BossKhugarThumb extends MovieClip {
}
}//package
Section 82
//BossSkithia (BossSkithia)
package {
public dynamic class BossSkithia extends Ruffian {
}
}//package
Section 83
//BossSkithiaThumb (BossSkithiaThumb)
package {
import flash.display.*;
public dynamic class BossSkithiaThumb extends MovieClip {
}
}//package
Section 84
//BossTakinom (BossTakinom)
package {
public dynamic class BossTakinom extends Ruffian {
}
}//package
Section 85
//BossTakinomThumb (BossTakinomThumb)
package {
import flash.display.*;
public dynamic class BossTakinomThumb extends MovieClip {
}
}//package
Section 86
//Container (Container)
package {
import flash.display.*;
public dynamic class Container extends MovieClip {
}
}//package
Section 87
//Data (Data)
package {
public class Data {
private static var _level:Array = new Array([20, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [20, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [20, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [20, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [20, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [1, 50, 10, "Khugar02.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [30, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [30, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [1, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [30, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [30, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [35, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [35, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [35, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [1, 50, 10, "Grook03.mp3", "Maxxor_Short02.mp3"], [35, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [35, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [35, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [40, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [40, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [25, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [1, 50, 10, "Taki01.mp3", "Maxxor_Short02.mp3"], [40, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [40, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [50, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [50, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [50, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [50, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [50, 50, 10, "ChEvilBaddy_Short1.mp3", "Maxxor_Short02.mp3"], [1, 50, 10, "Chaor04.mp3", "Maxxor_Short02.mp3"]);
private static var _tower:Array = new Array([3, "Iron Balls", "IronBalls", "IronBallsProjectile", 0, 10, [[40, 75, 100, 15, 15, 0], [70, 75, 110, 16, 30, 0], [120, 75, 120, 17, 50, 0]], [10, 10, 10, 10], "IronBallsDescription", "tower01.mp3", "TowerFire_14.mp3", "Hudson's", "fast,low damage attacks against all ruffians."], [2, "Wild Slash", "WindSlash", "WindSlashProjectile", 50, 10, [[50, 75, 100, 12, 50, 0], [90, 75, 120, 13, 150, 0], [130, 75, 120, 15, 250, 0]], [15, 10, 5, 10], "WindSlashDescription", "tower01.mp3", "TowerFire_05.mp3", "Les's", "only works against Flying ruffians."], [3, "Rock Wave", "RockWave", "RockWaveProjectile", 0, 8, [[150, 75, 80, 20, 15, 5], [300, 75, 85, 25, 30, 10], [500, 75, 100, 35, 100, 15]], [10, 10, 10, 10], "RockWaveDescription", "tower01.mp3", "TowerFire_06.mp3", "Franklin's", "slows down all ruffians with splash damage."], [1, "Fire Orb", "FlameORB", "FlameORBProjectile", 100, 10, [[300, 75, 100, 8, 100, 0], [500, 75, 120, 8, 300, 0], [1000, 75, 140, 8, 500, 0]], [10, 10, 10, 10], "FlameORBDescription", "tower01.mp3", "flame_tower.mp3", "Paulie's", "high power land-only attacks with splash damage."], [3, "Allmageddon", "Allmageddon", "AllmageddonProjectile", 0, 12, [[1000, 75, 120, 6, 500, 0], [1300, 75, 140, 7, 2000, 0], [2500, 75, 160, 8, 5000, 0]], [15, 15, 15, 0], "AllmageddonDescription", "tower01.mp3", "TowerFire_01.mp3", "Fergy's", "slows down all ruffians with the huge damage."]);
private static var _sound:Array = new Array("CHMaxxor_RS_Loop.mp3", "CHDanger_MM_Loop.mp3", "ChEvilBaddy_Full.mp3", "Maxxor_Full.mp3", "Chaor04.mp3");
private static var _ruffian:Array = new Array([1, "normal", "NormalRuffian", "NormalRuffianThumb", 10, 2, 1.75, "Die_04.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 30, 2, 1.75, "Die_04.mp3", "Chaor05.mp3"], [1, "fast", "FastRuffian", "FastRuffianThumb", 40, 2, 2.5, "Die_04.mp3", "Chaor05.mp3"], [1, "hard", "HardRuffian", "HardRuffianThumb", 150, 3, 1.25, "Die_04.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 80, 3, 1.75, "Die_04.mp3", "Chaor05.mp3"], [2, "flying", "FlyingRuffian", "FlyingRuffianThumb", 100, 3, 2, "Die_06.mp3", "Chaor05.mp3"], [1, "fast", "FastRuffian", "FastRuffianThumb", 120, 3, 2.5, "Die_04.mp3", "Chaor05.mp3"], [1, "Khugar", "BossKhugar", "BossKhugarThumb", 1000, 200, 1.5, "Khugar01.mp3", "Chaor05.mp3"], [1, "fast", "FastRuffian", "FastRuffianThumb", 150, 3, 2.5, "Die_04.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 250, 3, 1.75, "Die_04.mp3", "Chaor05.mp3"], [2, "flying", "FlyingRuffian", "FlyingRuffianThumb", 350, 3, 2, "Die_06.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 450, 3, 1.75, "Die_04.mp3", "Chaor05.mp3"], [2, "flying", "FlyingRuffian", "FlyingRuffianThumb", 550, 4, 2, "Die_06.mp3", "Chaor05.mp3"], [1, "hard", "HardRuffian", "HardRuffianThumb", 800, 4, 1.25, "Die_04.mp3", "Chaor05.mp3"], [1, "fast", "FastRuffian", "FastRuffianThumb", 650, 4, 2.5, "Die_04.mp3", "Chaor05.mp3"], [1, "Skithia", "BossSkithia", "BossSkithiaThumb", 5000, 500, 2, "Skithia01.mp3", "Chaor05.mp3"], [1, "hard", "HardRuffian", "HardRuffianThumb", 1000, 4, 1.25, "Die_04.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 800, 4, 1.75, "Die_04.mp3", "Chaor05.mp3"], [1, "fast", "FastRuffian", "FastRuffianThumb", 900, 4, 2.5, "Die_04.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 1000, 4, 1.75, "Die_04.mp3", "Chaor05.mp3"], [2, "flying", "FlyingRuffian", "FlyingRuffianThumb", 1300, 5, 2, "Die_06.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 1700, 5, 1.75, "Die_04.mp3", "Chaor05.mp3"], [1, "hard", "HardRuffian", "HardRuffianThumb", 2500, 5, 1.25, "Die_04.mp3", "Chaor05.mp3"], [1, "Grook", "BossGrook", "BossGrookThumb", 10000, 1000, 1.5, "Grook02.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 2000, 5, 1.75, "Die_04.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 3000, 6, 1.75, "Die_04.mp3", "Chaor05.mp3"], [1, "hard", "HardRuffian", "HardRuffianThumb", 6000, 6, 1.25, "Die_04.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 5000, 6, 1.75, "Die_04.mp3", "Chaor05.mp3"], [1, "fast", "FastRuffian", "FastRuffianThumb", 5000, 6, 2.5, "Die_04.mp3", "Chaor05.mp3"], [2, "flying", "FlyingRuffian", "FlyingRuffianThumb", 5500, 6, 2, "Die_06.mp3", "Chaor05.mp3"], [1, "hard", "HardRuffian", "HardRuffianThumb", 15000, 7, 1.25, "Die_04.mp3", "Chaor05.mp3"], [2, "Takinom", "BossTakinom", "BossTakinomThumb", 50000, 10000, 2.5, "Taki02.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 10000, 7, 1.75, "Die_04.mp3", "Chaor05.mp3"], [2, "flying", "FlyingRuffian", "FlyingRuffianThumb", 15000, 7, 2, "Die_06.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 20000, 7, 1.75, "Die_04.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 25000, 10, 1.75, "Die_04.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 30000, 10, 1.75, "Die_04.mp3", "Chaor05.mp3"], [1, "normal", "NormalRuffian", "NormalRuffianThumb", 35000, 10, 1.75, "Die_04.mp3", "Chaor05.mp3"], [2, "flying", "FlyingRuffian", "FlyingRuffianThumb", 40000, 10, 2, "Die_06.mp3", "Chaor05.mp3"], [1, "Chaor", "BossChaor", "BossChaorThumb", 2500000, 50000, 2.5, "Chaor03.mp3", "Chaor05.mp3"]);
private static var _map:Array = new Array("Map1", [[640, 395, 3], [550, 390, 4], [555, 330, 3], [475, 335, 2], [480, 370, 3], [315, 365, 4], [320, 280, 1], [400, 285, 4], [395, 170, 1], [510, 175, 4], [505, 75, 3], [310, 80, 2], [315, 205, 3], [220, 200, 2], [225, 330, 3], [105, 325, 4], [110, 170, 4]], [[[125, 175], [90, 310]], [[90, 310], [240, 345]], [[205, 185], [240, 345]], [[205, 185], [330, 220]], [[295, 100], [330, 220]], [[295, 100], [490, 60]], [[485, 60], [520, 190]], [[380, 155], [520, 190]], [[380, 155], [415, 300]], [[335, 265], [415, 300]], [[300, 385], [335, 265]], [[300, 385], [495, 350]], [[460, 350], [570, 315]], [[535, 375], [570, 315]], [[535, 375], [640, 410]], [[0, 0], [295, 185]], [[0, 285], [90, 415]], [[0, 415], [430, 480]], [[430, 440], [640, 480]], [[295, 0], [640, 30]], [[565, 30], [640, 340]], [[545, 30], [565, 55]]]);
public static function get level():Array{
return (_level);
}
public static function get tower():Array{
return (_tower);
}
public static function get sound():Array{
return (_sound);
}
public static function get ruffian():Array{
return (_ruffian);
}
public static function get map():Array{
return (_map);
}
}
}//package
Section 88
//FastRuffian (FastRuffian)
package {
public dynamic class FastRuffian extends Ruffian {
}
}//package
Section 89
//FastRuffianThumb (FastRuffianThumb)
package {
import flash.display.*;
public dynamic class FastRuffianThumb extends MovieClip {
}
}//package
Section 90
//FlameORB (FlameORB)
package {
public dynamic class FlameORB extends Tower {
public function FlameORB(){
addFrameScript(0, frame1, 3, frame4, 4, frame5, 10, frame11, 14, frame15, 15, frame16, 19, frame20);
}
function frame15(){
gotoAndPlay("canAdded");
}
function frame1(){
stop();
_rangeShow.visible = false;
}
function frame4(){
gotoAndPlay("normal");
}
function frame5(){
_rangeShow.visible = true;
}
function frame20(){
gotoAndPlay("canNotAdded");
}
function frame16(){
_rangeShow.gotoAndStop("canNotAdded");
_rangeShow.visible = true;
}
function frame11(){
_rangeShow.gotoAndStop("canAdded");
_rangeShow.visible = true;
}
}
}//package
Section 91
//FlameORBDescription (FlameORBDescription)
package {
import flash.display.*;
import flash.text.*;
public dynamic class FlameORBDescription extends MovieClip {
public var _towerText:TextField;
public var _moneyText:TextField;
}
}//package
Section 92
//FlameORBProjectile (FlameORBProjectile)
package {
public dynamic class FlameORBProjectile extends Projectile {
}
}//package
Section 93
//FlameORBRange (FlameORBRange)
package {
import flash.display.*;
public dynamic class FlameORBRange extends MovieClip {
public function FlameORBRange(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 94
//FlyingRuffian (FlyingRuffian)
package {
public dynamic class FlyingRuffian extends Ruffian {
}
}//package
Section 95
//FlyingRuffianThumb (FlyingRuffianThumb)
package {
import flash.display.*;
public dynamic class FlyingRuffianThumb extends MovieClip {
}
}//package
Section 96
//GameEvent (GameEvent)
package {
import flash.events.*;
public class GameEvent extends Event {
public static const SUCCESS:String = "success";
public static const FAIL:String = "fail";
public static const SUBMIT_SCORE:String = "submitScore";
public static const RESET:String = "reset";
public static const PLAY_AGAIN:String = "palyAgain";
public static const NEXT_LEVEL:String = "nextLevel";
public function GameEvent(_arg1:String):void{
super(_arg1, true);
}
}
}//package
Section 97
//HardRuffian (HardRuffian)
package {
public dynamic class HardRuffian extends Ruffian {
}
}//package
Section 98
//HardRuffianThumb (HardRuffianThumb)
package {
import flash.display.*;
public dynamic class HardRuffianThumb extends MovieClip {
}
}//package
Section 99
//Helper (Helper)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class Helper {
public static function saveCookie(_arg1, _arg2):void{
var _local3:*;
_local3 = SharedObject.getLocal("tv.4kids.PinataTowers", "/");
_local3.data[_arg1] = _arg2;
_local3.flush();
}
public static function loadCookie(_arg1):Object{
var _local2:*;
_local2 = SharedObject.getLocal("tv.4kids.PinataTowers", "/");
return (_local2.data[_arg1]);
}
}
}//package
Section 100
//HowToPlayButton (HowToPlayButton)
package {
import flash.events.*;
import flash.display.*;
public dynamic class HowToPlayButton extends MovieClip {
public function HowToPlayButton(){
addFrameScript(0, frame1, 1, frame2);
}
public function onMouseOver(_arg1:MouseEvent):void{
gotoAndStop("active");
}
function frame1(){
stop();
buttonMode = true;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
public function onMouseOut(_arg1:MouseEvent):void{
gotoAndStop("normal");
}
function frame2(){
stop();
}
}
}//package
Section 101
//InstructionContent (InstructionContent)
package {
import com.koodosoft.controls.*;
public dynamic class InstructionContent extends ScrollContent {
public function InstructionContent(){
addFrameScript(0, frame1);
}
function frame1(){
setSize(400, 300);
}
}
}//package
Section 102
//InstructionPane (InstructionPane)
package {
import com.koodosoft.containers.*;
public dynamic class InstructionPane extends ScrollPane {
}
}//package
Section 103
//InstructionScrollBar (InstructionScrollBar)
package {
import com.koodosoft.controls.*;
public dynamic class InstructionScrollBar extends ScrollBar {
public function InstructionScrollBar(){
addFrameScript(0, frame1);
}
function frame1(){
buttonMode = true;
}
}
}//package
Section 104
//IronBalls (IronBalls)
package {
public dynamic class IronBalls extends Tower {
public function IronBalls(){
addFrameScript(0, frame1, 3, frame4, 4, frame5, 10, frame11, 14, frame15, 15, frame16, 19, frame20);
}
function frame15(){
gotoAndPlay("canAdded");
}
function frame1(){
stop();
_rangeShow.visible = false;
}
function frame4(){
gotoAndPlay("normal");
}
function frame5(){
_rangeShow.visible = true;
}
function frame20(){
gotoAndPlay("canNotAdded");
}
function frame16(){
_rangeShow.gotoAndStop("canNotAdded");
_rangeShow.visible = true;
}
function frame11(){
_rangeShow.gotoAndStop("canAdded");
_rangeShow.visible = true;
}
}
}//package
Section 105
//IronBallsDescription (IronBallsDescription)
package {
import flash.display.*;
import flash.text.*;
public dynamic class IronBallsDescription extends MovieClip {
public var _towerText:TextField;
public var _moneyText:TextField;
}
}//package
Section 106
//IronBallsProjectile (IronBallsProjectile)
package {
public dynamic class IronBallsProjectile extends Projectile {
}
}//package
Section 107
//IronBallsRange (IronBallsRange)
package {
import flash.display.*;
public dynamic class IronBallsRange extends MovieClip {
public function IronBallsRange(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 108
//MainScreen (MainScreen)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
import flash.geom.*;
public class MainScreen extends MovieClip {
private var _sound:SoundManager;// = null
public var _levelButton:MovieClip;
public var _moreGamesSmall:SimpleButton;
public var _ruffianIndicatorPanel:RuffianIndicatorPanel;
public var _shield:Shield;
private var _data:Array;// = null
public var _towerSelectionPanel:TowerSelectionPanel;
private var _mapFullData:Array;
private var _map:Map;
public var _watchVideosSmall:SimpleButton;
private var _actor:Actor;
private var _ruffians:Array;
public var _container:Container;
public var _bank:Bank;
private var _status:int;// = 0
private var _towerCanAdded:Boolean;// = false
private var _difficulty:uint;// = 2
private var _currentLevel:uint;// = 0
private var showRuffianHealth:Boolean;// = false
private var _willAddedTower:Tower;// = null
public var _towerOperationPanel:TowerOperationPanel;
public var _resetButton:ResetButton;
private var _towers:Array;
private var _roadsWidth:Array;
public var _playerPanel:PlayerPanel;
private var _projectiles:Array;
public function MainScreen(){
_data = null;
_status = 0;
_willAddedTower = null;
_projectiles = new Array();
_currentLevel = 0;
_difficulty = 2;
_ruffians = new Array();
_towers = new Array();
showRuffianHealth = false;
_roadsWidth = new Array();
_sound = null;
_towerCanAdded = false;
super();
addFrameScript(0, frame1);
}
public function set sound(_arg1):void{
_sound = _arg1;
}
public function dispose(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeEventListener(GameEvent.FAIL, onGameFail);
_container.removeEventListener(MouseEvent.MOUSE_DOWN, onContainerMouseDown);
_levelButton.removeEventListener(MouseEvent.CLICK, onLevelButtonClick);
_resetButton.removeEventListener(MouseEvent.CLICK, onResetButtonClick);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
_sound = null;
SoundMixer.stopAll();
}
public function onMoreGamesClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
MochiBot.track(this, "cffe6bf3");
_local2 = new URLRequest("http://www.4kids.tv/games/?utm_source=viral&utm_medium=game&utm_campaign=perimprotector");
navigateToURL(_local2, "_blank");
}
public function get bank():Bank{
return (_bank);
}
public function get towerOperationPanel():TowerOperationPanel{
return (_towerOperationPanel);
}
public function nextLevel(){
_ruffians.length = 0;
_currentLevel++;
if (_currentLevel > Data.level.length){
this.dispatchEvent(new GameEvent(GameEvent.SUCCESS));
return;
};
_data = Data.level[(_currentLevel - 1)];
_ruffianIndicatorPanel.update();
initRuffians();
_levelButton.visible = false;
_sound.backgroundName = _data[3];
_sound.addEventListener(Event.SOUND_COMPLETE, onBackSoundComplete);
}
function frame1(){
_shield.mouseEnabled = false;
_bank.mouseEnabled = false;
_ruffianIndicatorPanel.mouseEnabled = false;
_moreGamesSmall.addEventListener(MouseEvent.CLICK, onMoreGamesClick);
_watchVideosSmall.addEventListener(MouseEvent.CLICK, onWatchVideosClick);
}
public function get towers():Array{
return (_towers);
}
public function get container():MovieClip{
return (_container);
}
public function onSuccessSoundComplete(_arg1:Event):void{
_sound.backgroundName = Data.sound[0];
_sound.removeEventListener(Event.SOUND_COMPLETE, onSuccessSoundComplete);
}
function onResetButtonClick(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.RESET));
}
public function set willAddedTower(_arg1):void{
var _local2:*;
_local2 = true;
if (_willAddedTower != null){
if (_arg1 != null){
if (getQualifiedClassName(_willAddedTower) == getQualifiedClassName(_arg1)){
_local2 = false;
};
};
};
if (((!((_arg1 == null))) && (_local2))){
if (_willAddedTower != null){
_container.removeChild(_willAddedTower);
};
_willAddedTower = _arg1;
_container.addChildAt(_arg1, 1);
_willAddedTower.visible = false;
_arg1.gotoAndStop("canAdded");
_arg1.mainScreen = this;
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
} else {
if (((hasEventListener(MouseEvent.MOUSE_MOVE)) && ((_arg1 == null)))){
removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
};
};
}
function onKeyDown(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:*;
_local2 = _arg1.keyCode;
if (_local2 == Keyboard.SPACE){
for each (_local3 in ruffians) {
if (!_local3.isBeginDie){
_local3.pointsBar.visible = !(_local3.pointsBar.visible);
};
};
showRuffianHealth = !(showRuffianHealth);
} else {
if (_local2 == Keyboard.ESCAPE){
if (_willAddedTower != null){
_container.removeChild(_willAddedTower);
_willAddedTower = null;
};
};
};
}
function onEnterFrame(_arg1:Event):void{
update();
}
public function onWatchVideosClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
MochiBot.track(this, "5a0d8030");
_local2 = new URLRequest("http://www.4kids.tv/videos/?utm_source=viral&utm_medium=game&utm_campaign=perimprotector");
navigateToURL(_local2, "_blank");
}
function update(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Number;
var _local7:*;
var _local8:*;
if (_status == 1){
_local1 = 0;
while (_local1 < ruffians.length) {
_local5 = ruffians[_local1];
if (_local5.currentIndex >= (_map.data[1].length - 1)){
if (!((_local5.willDie) || (_local5.isBeginDie))){
_sound.playSound(_local5.leakSound);
_local5.leaked = true;
if (contains(_local5)){
_container.removeChild(_local5);
};
if (_ruffians.indexOf(_local5) >= 0){
_ruffians.splice(_ruffians.indexOf(_local5), 1);
_local1--;
};
_shield.damage(5);
};
} else {
_local6 = _roadsWidth[_local5.currentIndex];
switch (_map.data[1][_local5.currentIndex][2]){
case 1:
_local5.x = (_local5.x + _local5.speed);
if (_local5.x > (_map.data[1][(_local5.currentIndex + 1)][0] - _local6)){
if (_local5.x < _map.data[1][(_local5.currentIndex + 1)][0]){
if (Math.random() < (_local5.speed / _local6)){
_local5.currentIndex++;
};
} else {
_local5.x = _map.data[1][(_local5.currentIndex + 1)][0];
_local5.currentIndex++;
};
};
break;
case 2:
_local5.y = (_local5.y + _local5.speed);
if (_local5.y > (_map.data[1][(_local5.currentIndex + 1)][1] - _local6)){
if (_local5.y < _map.data[1][(_local5.currentIndex + 1)][1]){
if (Math.random() < (_local5.speed / _local6)){
_local5.currentIndex++;
};
} else {
_local5.y = _map.data[1][(_local5.currentIndex + 1)][1];
_local5.currentIndex++;
};
};
break;
case 3:
_local5.x = (_local5.x - _local5.speed);
if (_local5.x < (_map.data[1][(_local5.currentIndex + 1)][0] + _local6)){
if (_local5.x > _map.data[1][(_local5.currentIndex + 1)][0]){
if (Math.random() < (_local5.speed / _local6)){
_local5.currentIndex++;
};
} else {
_local5.x = _map.data[1][(_local5.currentIndex + 1)][0];
_local5.currentIndex++;
};
};
break;
case 4:
_local5.y = (_local5.y - _local5.speed);
if (_local5.y < (_map.data[1][(_local5.currentIndex + 1)][1] + _local6)){
if (_local5.y > _map.data[1][(_local5.currentIndex + 1)][1]){
if (Math.random() < (_local5.speed / _local6)){
_local5.currentIndex++;
};
} else {
_local5.y = _map.data[1][(_local5.currentIndex + 1)][1];
_local5.currentIndex++;
};
};
break;
};
for each (_local7 in towers) {
if ((((((_local5.x > 0)) && ((_local5.y > 0)))) && (((((_local5.x - _local7.x) * (_local5.x - _local7.x)) + ((_local5.y - _local7.y) * (_local5.y - _local7.y))) <= (_local7.range * _local7.range))))){
if (_local5.currentIndex < (_map.data[1].length - 1)){
_local7.shot(_local5);
};
};
};
};
_local1++;
};
_local2 = _towers.length;
_local1 = 0;
while (_local1 < _local2) {
_towers[_local1].update();
if (_local2 > _towers.length){
_local2 = _towers.length;
_local1--;
};
_local1++;
};
_local3 = _projectiles.length;
_local1 = 0;
while (_local1 < _local3) {
_projectiles[_local1].update();
if (_local3 > _projectiles.length){
_local3 = _projectiles.length;
_local1--;
};
_local1++;
};
_local4 = _ruffians.length;
_local1 = 0;
while (_local1 < _local4) {
_ruffians[_local1].update();
if (_local4 > _ruffians.length){
_local4 = _ruffians.length;
_local1--;
};
_local1++;
};
if (_ruffians.length == 0){
_actor.money = (_actor.money + _actor.interest);
_actor.score = (_actor.score + (_actor.money * 0.1));
_actor.interest = Math.round(((_data[2] * _actor.money) * 0.01));
_levelButton.visible = true;
if (_currentLevel == Data.level.length){
if (_status != 4){
_sound.backgroundName = Data.sound[3];
_sound.addEventListener(Event.SOUND_COMPLETE, onSuccessSoundComplete);
dispatchEvent(new GameEvent(GameEvent.SUCCESS));
_status = 4;
return;
};
};
if (((!((_status == 0))) && ((_shield.health > 0)))){
_status = 0;
_sound.backgroundName = _data[4];
_sound.addEventListener(Event.SOUND_COMPLETE, onBackSoundComplete);
};
if (_projectiles.length > 0){
for each (_local8 in projectiles) {
_container.removeChild(_local8);
};
_projectiles.length = 0;
};
_bank.updateInterest();
};
};
_playerPanel.update();
_bank.update();
_towerSelectionPanel.update();
_towerOperationPanel.update();
}
function initRuffians(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
ruffians.length = 0;
_local2 = _map.data[1][0][1];
_local3 = (_map.data[1][1][1] - _map.data[1][0][1]);
_local4 = 0;
while (_local4 < _data[0]) {
_local1 = Ruffian.create(this);
_local1.x = ((_local4 * _data[1]) + 640);
_local1._body._animation.gotoAndStop(1);
_local1.y = (_local2 + (_local3 * Math.random()));
_local1.pointsBar.visible = showRuffianHealth;
ruffians.push(_local1);
_local1.mainScreen = this;
_container.addChild(_local1);
_local4++;
};
}
public function sellTower(_arg1:Tower){
var _local2:int;
_local2 = 0;
while (_local2 < towers.length) {
if (towers[_local2] == _arg1){
towers.splice(_local2, 1);
};
_local2++;
};
}
function onMouseMove(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:Boolean;
var _local13:Boolean;
var _local14:Boolean;
var _local15:Boolean;
if (_willAddedTower != null){
_towerCanAdded = true;
if ((((((((_arg1.stageX > _container.x)) && ((_arg1.stageX < (_container.x + _map.width))))) && ((_arg1.stageY > _container.y)))) && ((_arg1.stageY < (_container.y + _map.height))))){
_willAddedTower.visible = true;
_willAddedTower.play();
_willAddedTower.x = ((_arg1.stageX - _container.x) - x);
_willAddedTower.y = ((_arg1.stageY - _container.y) - y);
_local2 = _willAddedTower.x;
_local3 = _willAddedTower.y;
_local4 = _map.data[2];
for each (_local5 in _local4) {
_local6 = _local5[0][0];
_local7 = _local5[1][0];
_local8 = _local5[0][1];
_local9 = _local5[1][1];
_local10 = ((Math.abs((_local2 - _local6)) + Math.abs((_local2 - _local7))) <= Math.abs((_local7 - _local6)));
_local11 = ((Math.abs((_local3 - _local8)) + Math.abs((_local3 - _local9))) <= Math.abs((_local9 - _local8)));
if (_local2 > _local6){
_local12 = ((_local2 - _local6) <= _willAddedTower.data[7][3]);
} else {
_local12 = ((_local6 - _local2) <= _willAddedTower.data[7][1]);
};
if (_local2 > _local7){
_local13 = ((_local2 - _local7) <= _willAddedTower.data[7][3]);
} else {
_local13 = ((_local7 - _local2) <= _willAddedTower.data[7][1]);
};
if (_local3 > _local8){
_local14 = ((_local3 - _local8) <= _willAddedTower.data[7][0]);
} else {
_local14 = ((_local8 - _local3) <= _willAddedTower.data[7][2]);
};
if (_local3 > _local9){
_local15 = ((_local3 - _local9) <= _willAddedTower.data[7][0]);
} else {
_local15 = ((_local9 - _local3) <= _willAddedTower.data[7][2]);
};
if (((_local10) && (_local11))){
_towerCanAdded = false;
break;
} else {
if (_local10){
if (((_local14) || (_local15))){
_towerCanAdded = false;
break;
};
};
if (_local11){
if (((_local12) || (_local13))){
_towerCanAdded = false;
break;
};
};
};
};
if (_towerCanAdded){
_willAddedTower.gotoAndPlay("canAdded");
} else {
_willAddedTower.gotoAndPlay("canNotAdded");
};
} else {
_willAddedTower.visible = false;
};
};
}
public function init(){
var _local1:*;
_actor = Actor.create(this);
_map = Map.create(this, Data.map);
_container.addChild(_map);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
addEventListener(GameEvent.FAIL, onGameFail);
_container.addEventListener(MouseEvent.MOUSE_DOWN, onContainerMouseDown);
_levelButton.addEventListener(MouseEvent.CLICK, onLevelButtonClick);
_resetButton.addEventListener(MouseEvent.CLICK, onResetButtonClick);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
_towerOperationPanel.visible = false;
_towerSelectionPanel.visible = true;
_playerPanel.mainScreen = this;
_bank.mainScreen = this;
_towerOperationPanel.mainScreen = this;
_towerSelectionPanel.mainScreen = this;
_ruffianIndicatorPanel.mainScreen = this;
_shield.mainScreen = this;
_ruffianIndicatorPanel.update();
_local1 = 0;
while (_local1 < (_map.data[1].length - 1)) {
_roadsWidth[_local1] = Math.abs((_map.data[1][_local1][((_local1 + 1) % 2)] - _map.data[1][(_local1 + 1)][((_local1 + 1) % 2)]));
_local1++;
};
if (_sound == null){
_sound = SoundManager.getInstance();
};
if (_sound.backgroundName != Data.sound[0]){
_sound.backgroundName = Data.sound[0];
};
}
public function get sound():SoundManager{
return (_sound);
}
function onGameFail(_arg1:GameEvent):void{
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
_sound.playByClassName(Data.sound[4]);
_sound.backgroundName = Data.sound[2];
}
public function get towerSelectionPanel():TowerSelectionPanel{
return (_towerSelectionPanel);
}
function onLevelButtonClick(_arg1:MouseEvent):void{
if (_status == 0){
nextLevel();
_status = 1;
};
}
public function get willAddedTower():Tower{
return (_willAddedTower);
}
public function get map():Map{
return (_map);
}
public function get shield(){
return (_shield);
}
public function set difficulty(_arg1){
_difficulty = _arg1;
}
public function get currentLevel():uint{
return (_currentLevel);
}
public function get ruffians():Array{
return (_ruffians);
}
public function get projectiles():Array{
return (_projectiles);
}
function onContainerMouseDown(_arg1:MouseEvent):void{
var _local2:Tower;
var _local3:Tower;
_local2 = null;
_local3 = null;
for each (_local2 in _towers) {
if (_local2.body.hitTestPoint(_arg1.stageX, _arg1.stageY)){
if (_towerOperationPanel.tower != _local2){
_towerOperationPanel.tower = _local2;
};
if (_willAddedTower != null){
_container.removeChild(_willAddedTower);
_willAddedTower = null;
};
_towerOperationPanel.visible = true;
_towerSelectionPanel.visible = false;
if (_local3 != null){
if (_container.getChildIndex(_local3) < _container.getChildIndex(_local2)){
_local3 = _local2;
};
} else {
_local3 = _local2;
};
};
_local2.gotoAndStop("normal");
};
if (_local3 != null){
_local3.gotoAndStop("operation");
_container.swapChildrenAt(_container.getChildIndex(_local3), (_container.numChildren - 1));
};
if (((!((_willAddedTower == null))) && (_towerCanAdded))){
_towers.push(_willAddedTower);
removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_container.setChildIndex(_willAddedTower, (_container.numChildren - 1));
_actor.money = (_actor.money - _willAddedTower.cost);
_willAddedTower.gotoAndStop("normal");
_sound.playSound(_willAddedTower.placeSound);
_willAddedTower = null;
} else {
if (_local3 == null){
_towerOperationPanel.visible = false;
_towerSelectionPanel.visible = true;
};
};
}
public function onBackSoundComplete(_arg1:Event):void{
_sound.backgroundName = Data.sound[1];
_sound.removeEventListener(Event.SOUND_COMPLETE, onBackSoundComplete);
}
public function get playerPanel():PlayerPanel{
return (_playerPanel);
}
public function get difficulty():uint{
return (_difficulty);
}
public function get actor():Actor{
return (_actor);
}
}
}//package
Section 109
//Map (Map)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Map extends MovieClip {
private var _mainScreen;
protected var _data:Array;
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
public function get mainScreen(){
return (_mainScreen);
}
public function get data():Array{
return (_data);
}
public static function create(_arg1:MainScreen, _arg2:Array):Map{
var MapClass:*;
var map:*;
var main = _arg1;
var data = _arg2;
MapClass = (getDefinitionByName(Data.map[0]) as Class);
map = (new (MapClass) as Map);
var _local4 = map;
with (_local4) {
_data = data;
};
return (map);
}
}
}//package
Section 110
//Map1 (Map1)
package {
public dynamic class Map1 extends Map {
public function Map1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 111
//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("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 112
//NormalRuffian (NormalRuffian)
package {
public dynamic class NormalRuffian extends Ruffian {
}
}//package
Section 113
//NormalRuffianThumb (NormalRuffianThumb)
package {
import flash.display.*;
public dynamic class NormalRuffianThumb extends MovieClip {
}
}//package
Section 114
//PlayAgainButton (PlayAgainButton)
package {
import flash.events.*;
import flash.display.*;
public class PlayAgainButton extends MovieClip {
public function PlayAgainButton(){
addFrameScript(0, frame1, 1, frame2);
addEventListener(MouseEvent.CLICK, onClick);
}
public function onMouseOver(_arg1:MouseEvent):void{
gotoAndStop("active");
}
function frame1(){
buttonMode = true;
stop();
buttonMode = true;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
public function onMouseOut(_arg1:MouseEvent):void{
gotoAndStop("normal");
}
function frame2(){
stop();
}
function onClick(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.PLAY_AGAIN));
}
}
}//package
Section 115
//PlayerPanel (PlayerPanel)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class PlayerPanel extends MovieClip {
protected var _mainScreen;
public var _soundButton:MovieClip;
protected var _currentLevel:int;
public var _scoreText:TextField;
protected var _score:Number;
public var _currentLevelText:TextField;
public function PlayerPanel(){
_scoreText.text = "SCORE: 0";
_currentLevelText.text = "LEVEL: 0";
_soundButton.addEventListener(MouseEvent.CLICK, onClick);
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
protected function set currentLevel(_arg1){
_currentLevel = _arg1;
_currentLevelText.text = ("LEVEL: " + _mainScreen.currentLevel.toString());
}
protected function set score(_arg1){
_score = _arg1;
_scoreText.text = ("SCORE: " + int(_mainScreen.actor.score).toString());
}
public function get mainScreen(){
return (_mainScreen);
}
protected function get score(){
return (_score);
}
protected function get currentLevel(){
return (_currentLevel);
}
public function update(){
if (score != _mainScreen.actor.score){
score = _mainScreen.actor.score;
};
if (currentLevel != _mainScreen.currentLevel){
currentLevel = _mainScreen.currentLevel;
};
}
function onClick(_arg1:MouseEvent):void{
_mainScreen.sound.isSoundOpen = !(_mainScreen.sound.isSoundOpen);
if ((_mainScreen.sound.isSoundOpen == true)){
_soundButton.gotoAndStop("close");
} else {
_soundButton.gotoAndStop("open");
};
}
}
}//package
Section 116
//PlayNowButton (PlayNowButton)
package {
import flash.events.*;
import flash.display.*;
public dynamic class PlayNowButton extends MovieClip {
public function PlayNowButton(){
addFrameScript(0, frame1, 1, frame2);
}
public function onMouseOver(_arg1:MouseEvent):void{
gotoAndStop("active");
}
function frame1(){
stop();
buttonMode = true;
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
public function onMouseOut(_arg1:MouseEvent):void{
gotoAndStop("normal");
}
function frame2(){
stop();
}
}
}//package
Section 117
//PointsBar (PointsBar)
package {
import flash.display.*;
public class PointsBar extends MovieClip {
public var _lastPointsBar:MovieClip;
private var _full:int;
private var _last:int;
private var _fullWidth:Number;
public function PointsBar(){
_fullWidth = this.width;
}
public function set full(_arg1):void{
_full = _arg1;
}
public function set last(_arg1):void{
_last = _arg1;
if (_last < 0){
_last = 0;
};
_lastPointsBar.width = ((_last / _full) * _fullWidth);
}
public function get last():int{
return (_last);
}
public function get full():int{
return (_full);
}
}
}//package
Section 118
//Projectile (Projectile)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Projectile extends MovieClip {
protected var _mainScreen;
protected var _damageSeed;// = 0.7
protected var _speed:Number;// = 10
protected var _damage:Number;// = 20
protected var _splash:Number;// = 0
protected var _aims:Array;
protected var _slow:Number;// = 0
public function Projectile(){
_damage = 20;
_damageSeed = 0.7;
_splash = 0;
_speed = 10;
_slow = 0;
_aims = new Array();
super();
}
public function get slow():Number{
return (_slow);
}
public function set slow(_arg1):void{
_slow = _arg1;
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
public function get speed():Number{
return (_speed);
}
public function get damage():Number{
return (_damage);
}
public function get splash():Number{
return (_splash);
}
public function get damageSeed():Number{
return (_damageSeed);
}
public function get mainScreen(){
return (_mainScreen);
}
public function set speed(_arg1):void{
_speed = _arg1;
}
public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
if (_aims.length > 0){
_local1 = _aims[0];
_local2 = (x - _local1.x);
_local3 = (y - _local1.y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if (_local4 > _speed){
x = (x - ((_local2 / _local4) * _speed));
y = (y - ((_local3 / _local4) * _speed));
} else {
_local5 = _damage;
_local1.speed = (_local1.speed * ((100 - _slow) * 0.01));
_local6 = 0;
while (_local6 < _aims.length) {
_local7 = _aims[_local6];
if (_mainScreen.container.contains(_local7)){
_local7.lastPoints = (_local7.lastPoints - _local7.willLostPoints);
_local7.willLostPoints = 0;
if (_local7.lastPoints <= 0){
_aims.splice(_aims.indexOf(_local7), 1);
_local6--;
};
_local7.projectiles.splice(_local7.projectiles.indexOf(this), 1);
};
_local6++;
};
if (_mainScreen.container.contains(this)){
_mainScreen.container.removeChild(this);
};
if (_mainScreen.projectiles.indexOf(this) >= 0){
_mainScreen.projectiles.splice(_mainScreen.projectiles.indexOf(this), 1);
};
};
};
}
public function set splash(_arg1):void{
_splash = _arg1;
}
public function get aims():Array{
return (_aims);
}
public function set damage(_arg1){
_damage = _arg1;
}
public static function create(_arg1:String, _arg2:MainScreen):Projectile{
var _local3:Class;
var _local4:*;
_local3 = (getDefinitionByName(_arg1) as Class);
_local4 = new (_local3);
_local4.mainScreen = _arg2;
return (_local4);
}
}
}//package
Section 119
//ResetButton (ResetButton)
package {
import flash.display.*;
public dynamic class ResetButton extends SimpleButton {
}
}//package
Section 120
//RockWave (RockWave)
package {
public dynamic class RockWave extends Tower {
public function RockWave(){
addFrameScript(0, frame1, 3, frame4, 4, frame5, 10, frame11, 14, frame15, 15, frame16, 19, frame20);
}
function frame15(){
gotoAndPlay("canAdded");
}
function frame1(){
stop();
_rangeShow.visible = false;
}
function frame4(){
gotoAndPlay("normal");
}
function frame5(){
_rangeShow.visible = true;
}
function frame20(){
gotoAndPlay("canNotAdded");
}
function frame16(){
_rangeShow.gotoAndStop("canNotAdded");
_rangeShow.visible = true;
}
function frame11(){
_rangeShow.gotoAndStop("canAdded");
_rangeShow.visible = true;
}
}
}//package
Section 121
//RockWaveDescription (RockWaveDescription)
package {
import flash.display.*;
import flash.text.*;
public dynamic class RockWaveDescription extends MovieClip {
public var _towerText:TextField;
public var _moneyText:TextField;
}
}//package
Section 122
//RockWaveProjectile (RockWaveProjectile)
package {
public dynamic class RockWaveProjectile extends Projectile {
}
}//package
Section 123
//RockWaveRange (RockWaveRange)
package {
import flash.display.*;
public dynamic class RockWaveRange extends MovieClip {
public function RockWaveRange(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 124
//Ruffian (Ruffian)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Ruffian extends MovieClip {
protected var _isBeginDie:Boolean;// = false
private var _projectiles:Array;
protected var _currentIndex:uint;// = 0
private var _previousIndex:uint;// = 0
protected var _willDie:Boolean;// = false
protected var _mainScreen;
private var _type:uint;// = 0
protected var _primarySpeed:Number;// = 2
protected var _speed:Number;// = 2
public var _body:MovieClip;
private var _data:Array;// = null
private var _rallyTimer:int;// = 0
public var _pointsBar:PointsBar;
protected var _money:int;// = 2
protected var _dieSound:Sound;// = null
protected var _lastPoints:Number;
protected var _willLostSpeed:Number;// = 0
private var _originalRotation:Number;// = 0
protected var _willLostPoints:Number;// = 0
protected var _leakSound:Sound;// = null
protected var _fullPoints:Number;// = 20
public var leaked;// = false
public function Ruffian(){
_data = null;
_isBeginDie = false;
_willDie = false;
_type = 0;
_fullPoints = 20;
_money = 2;
_dieSound = null;
_leakSound = null;
_lastPoints = _fullPoints;
_willLostPoints = 0;
_willLostSpeed = 0;
_projectiles = new Array();
_speed = 2;
_primarySpeed = 2;
leaked = false;
_previousIndex = 0;
_currentIndex = 0;
_originalRotation = 0;
_rallyTimer = 0;
super();
_originalRotation = _body.rotation;
}
public function set leakSound(_arg1){
_leakSound = _arg1;
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
public function get pointsBar():PointsBar{
return (_pointsBar);
}
public function get lastPoints():Number{
return (_lastPoints);
}
public function get willDie(){
return (_willDie);
}
public function set lastPoints(_arg1):void{
_lastPoints = _arg1;
_pointsBar.last = _arg1;
}
public function get fullPoints():Number{
return (_fullPoints);
}
public function set willLostPoints(_arg1):void{
_willLostPoints = _arg1;
if ((_lastPoints - _willLostPoints) <= 0){
_willDie = true;
} else {
_willDie = false;
};
}
public function get isBeginDie(){
return (_isBeginDie);
}
public function get dieSound():Sound{
return (_dieSound);
}
public function get leakSound():Sound{
return (_leakSound);
}
public function get primarySpeed():Number{
return (_primarySpeed);
}
public function set speed(_arg1){
_speed = _arg1;
_rallyTimer = 0;
}
public function get willLostPoints():Number{
return (_willLostPoints);
}
public function get mainScreen(){
return (_mainScreen);
}
public function set willLostSpeed(_arg1):void{
_willLostSpeed = _arg1;
}
public function get type():uint{
return (_type);
}
public function get projectiles():Array{
return (_projectiles);
}
public function get speed():Number{
return (_speed);
}
public function set primarySpeed(_arg1){
_primarySpeed = _arg1;
}
public function get money():int{
return (_money);
}
public function get willLostSpeed():Number{
return (_willLostSpeed);
}
public function set currentIndex(_arg1){
_currentIndex = _arg1;
_originalRotation = _body.rotation;
}
public function get currentIndex():uint{
return (_currentIndex);
}
public function set dieSound(_arg1){
_dieSound = _arg1;
}
public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
_pointsBar.last = _lastPoints;
if (_lastPoints <= 0){
if (!_isBeginDie){
if (!leaked){
_body._animation.gotoAndPlay("beginDie");
_mainScreen.sound.playSound(_dieSound);
_isBeginDie = true;
_pointsBar.visible = false;
};
} else {
if (_body._animation.currentLabel == "endDie"){
if (_mainScreen.container.contains(this)){
_mainScreen.container.removeChild(this);
};
if (_mainScreen.ruffians.indexOf(this) >= 0){
_mainScreen.ruffians.splice(_mainScreen.ruffians.indexOf(this), 1);
};
_mainScreen.actor.score = (_mainScreen.actor.score + (((Math.sqrt((_mainScreen.actor.money * 0.01)) + (_money * 0.5)) + ((_mainScreen.currentLevel * _mainScreen.shield.health) * 0.01)) + 1));
_mainScreen.actor.money = (_mainScreen.actor.money + _money);
};
};
};
if (_speed < _primarySpeed){
if (_speed < 0.5){
_speed = 0.5;
};
if (_rallyTimer < 200){
_rallyTimer++;
} else {
_speed = (_speed + 0.01);
if (_speed > _primarySpeed){
_rallyTimer = 0;
_speed = _primarySpeed;
};
};
};
if (_previousIndex != _currentIndex){
_local1 = _mainScreen.map.data[1][_previousIndex][2];
_local2 = _mainScreen.map.data[1][_currentIndex][2];
_local3 = (_local2 - _local1);
if (_local3 > 2){
_local3 = -1;
} else {
if (_local3 < -2){
_local3 = 1;
};
};
if (Math.abs((_body.rotation - _originalRotation)) < 90){
_body.rotation = (_body.rotation + ((_speed * _local3) * 3));
if (Math.abs((_body.rotation - _originalRotation)) >= 90){
_body.rotation = (_originalRotation + (90 * _local3));
_originalRotation = _body.rotation;
_previousIndex = _currentIndex;
};
};
};
}
public static function create(_arg1:MainScreen):Ruffian{
var RuffianClass:Class;
var ruffian:Ruffian;
var DieSoundClass:*;
var LeakSoundClass:*;
var main = _arg1;
RuffianClass = (getDefinitionByName(Data.ruffian[(main.currentLevel - 1)][2]) as Class);
ruffian = (new (RuffianClass) as Ruffian);
var _local3 = ruffian;
with (_local3) {
_mainScreen = main;
_data = Data.ruffian[(_mainScreen.currentLevel - 1)];
_type = _data[0];
_pointsBar.full = (_fullPoints = (_lastPoints = _data[4]));
_money = _data[5];
_primarySpeed = (_speed = (_data[6] * 0.8));
DieSoundClass = (getDefinitionByName(_data[7]) as Class);
_dieSound = new (DieSoundClass);
LeakSoundClass = (getDefinitionByName(_data[8]) as Class);
leakSound = new (LeakSoundClass);
};
return (ruffian);
}
}
}//package
Section 125
//RuffianDescriptionPanel (RuffianDescriptionPanel)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class RuffianDescriptionPanel extends MovieClip {
private var _mainScreen;
private var _description:MovieClip;// = null
private var _currentLevel:int;// = 1
public function RuffianDescriptionPanel(){
_currentLevel = 1;
_description = null;
super();
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
public function get mainScreen(){
return (_mainScreen);
}
public function update(){
var _local1:*;
var _local2:*;
if (_currentLevel == _mainScreen.currentLevel){
return;
};
_local1 = _mainScreen.currentLevel;
if (_local1 < 1){
_local1 = 1;
};
_local2 = (getDefinitionByName(Data.ruffian[(_currentLevel - 1)][5]) as Class);
_description = (new (_local2) as MovieClip);
}
}
}//package
Section 126
//RuffianDetails (RuffianDetails)
package {
import flash.display.*;
import flash.text.*;
public class RuffianDetails extends MovieClip {
public var _container:Container;
public var _icons:MovieClip;
private var _typeName:String;
private var _speed:int;
public var _typeNameText:TextField;
public var _speedText:TextField;
public var _moneyText:TextField;
private var _feature:MovieClip;
public var _fullPointsText:TextField;
private var _money:int;
private var _fullPoints:int;
public function set feature(_arg1){
if (_feature != null){
_container.removeChild(_feature);
};
if (_arg1 != null){
_container.addChild(_arg1);
_feature = _arg1;
};
}
public function get speed():int{
return (_speed);
}
public function RuffianFeature(){
}
public function get fullPoints():int{
return (_fullPoints);
}
public function set money(_arg1){
_money = _arg1;
_moneyText.text = _arg1;
}
public function set speed(_arg1){
_speed = _arg1;
_speedText.text = _arg1;
}
public function set fullPoints(_arg1){
_fullPoints = _arg1;
_fullPointsText.text = _arg1;
}
public function set typeName(_arg1){
_typeName = _arg1;
_typeNameText.text = _arg1;
}
public function get money():int{
return (_money);
}
public function get typeName():String{
return (_typeName);
}
public function get feature():MovieClip{
return (_feature);
}
}
}//package
Section 127
//RuffianIndicatorPanel (RuffianIndicatorPanel)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class RuffianIndicatorPanel extends MovieClip {
private var _mainScreen;
private var _currentLevel:int;// = 1
private var _levelCount:int;// = 0
public var _current:RuffianDetails;
public var _next:RuffianDetails;
public function RuffianIndicatorPanel(){
_currentLevel = 1;
_levelCount = 0;
super();
_levelCount = Data.level.length;
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
public function get mainScreen(){
return (_mainScreen);
}
public function update(){
var _local1:*;
var _local2:*;
if (_currentLevel == _mainScreen.currentLevel){
return;
};
if (_mainScreen.currentLevel > 0){
_currentLevel = _mainScreen.currentLevel;
};
_local1 = Data.ruffian[(_currentLevel - 1)];
_local2 = (getDefinitionByName(_local1[3]) as Class);
_current.feature = (new (_local2) as MovieClip);
_current.fullPoints = _local1[4];
_current.money = _local1[5];
_current.speed = (_local1[6] * 4);
_current.typeName = _local1[1];
if (_currentLevel < _levelCount){
_local1 = Data.ruffian[_currentLevel];
_local2 = (getDefinitionByName(_local1[3]) as Class);
_next.feature = (new (_local2) as MovieClip);
_next.fullPoints = _local1[4];
_next.money = _local1[5];
_next.speed = (_local1[6] * 4);
_next.typeName = _local1[1];
} else {
_next.feature = new WinThumb();
_next._icons.visible = false;
_next._fullPointsText.visible = false;
_next._moneyText.visible = false;
_next._speedText.visible = false;
_next._typeNameText.visible = false;
};
}
}
}//package
Section 128
//SellButton (SellButton)
package {
import flash.display.*;
import flash.text.*;
public class SellButton extends MovieClip {
public var _sellText:TextField;
public function SellButton(){
addFrameScript(0, frame1);
}
public function get text():String{
return (_sellText.text);
}
public function set text(_arg1):void{
_sellText.text = _arg1;
}
function frame1(){
buttonMode = true;
_sellText.mouseEnabled = false;
}
}
}//package
Section 129
//Shield (Shield)
package {
import flash.display.*;
public class Shield extends MovieClip {
protected var _mainScreen;
private var _health;// = 100
public function Shield(){
_health = 100;
super();
addFrameScript(0, frame1);
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
public function get health(){
return (_health);
}
function frame1(){
stop();
}
public function damage(_arg1){
var _local2:*;
_health = (_health - _arg1);
_local2 = (this.currentFrame + _arg1);
if (_local2 >= this.totalFrames){
_local2 = this.totalFrames;
this.dispatchEvent(new GameEvent(GameEvent.FAIL));
};
gotoAndStop(_local2);
}
public function get mainScreen(){
return (_mainScreen);
}
}
}//package
Section 130
//SoundManager (SoundManager)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class SoundManager extends EventDispatcher {
private var channels:Array;
private var _background:Sound;// = null
private var _backgroundVolume:Number;// = 0.3
private var _backgroundChannel:SoundChannel;// = null
private var _isSoundOpen:Boolean;// = true
private var _backgroundName:String;// = ""
private static var _instance = null;
public function SoundManager(){
channels = new Array();
_background = null;
_backgroundName = "";
_backgroundVolume = 0.3;
_backgroundChannel = null;
_isSoundOpen = true;
super();
}
public function playSound(_arg1:Sound){
var _local2:*;
var _local3:SoundTransform;
_local2 = _arg1.play();
if (_local2 != null){
if (!_isSoundOpen){
_local3 = _local2.soundTransform;
_local3.volume = 0;
_local2.soundTransform = _local3;
};
channels.push(_local2);
_local2.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
};
}
public function onSoundComplete(_arg1:Event):void{
var _local2:*;
_local2 = channels.indexOf(_arg1.target);
if (_local2 >= 0){
channels.splice(_local2, 1);
};
}
public function init(){
}
public function get backgroundName(){
return (_backgroundName);
}
public function set background(_arg1){
var _local2:SoundTransform;
if (_background != null){
_backgroundChannel.stop();
};
if (_arg1 == null){
if (_backgroundChannel != null){
_backgroundChannel.stop();
};
return;
};
_background = _arg1;
_backgroundChannel = _background.play();
_local2 = _backgroundChannel.soundTransform;
if (_isSoundOpen){
_local2.volume = _backgroundVolume;
} else {
_local2.volume = 0;
};
_backgroundChannel.soundTransform = _local2;
_backgroundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundComplete);
}
public function set isSoundOpen(_arg1){
var _local2:*;
var _local3:SoundTransform;
_isSoundOpen = _arg1;
if (!_isSoundOpen){
for each (_local2 in channels) {
_local3 = _local2.soundTransform;
_local3.volume = 0;
_local2.soundTransform = _local3;
};
if (_background != null){
if (_backgroundChannel != null){
_local3 = _backgroundChannel.soundTransform;
_local3.volume = 0;
_backgroundChannel.soundTransform = _local3;
};
};
} else {
if (_background != null){
if (_backgroundChannel != null){
_local3 = _backgroundChannel.soundTransform;
_local3.volume = _backgroundVolume;
_backgroundChannel.soundTransform = _local3;
};
};
for each (_local2 in channels) {
_local3 = _local2.soundTransform;
_local3.volume = 1;
_local2.soundTransform = _local3;
};
};
}
public function dispose(){
var _local1:*;
for each (_local1 in channels) {
_local1.stop();
};
channels = new Array();
if (_background != null){
if (_backgroundChannel != null){
_backgroundChannel.stop();
};
};
_backgroundName = "";
_background = null;
}
public function onBackgroundComplete(_arg1:Event):void{
var _local2:SoundTransform;
_backgroundChannel = _background.play();
if (_backgroundChannel != null){
_local2 = _backgroundChannel.soundTransform;
if (_isSoundOpen){
_local2.volume = _backgroundVolume;
} else {
_local2.volume = 0;
};
_backgroundChannel.soundTransform = _local2;
_backgroundChannel.addEventListener(Event.SOUND_COMPLETE, onBackgroundComplete);
dispatchEvent(_arg1);
};
}
public function get background(){
return (_background);
}
public function get isSoundOpen():Boolean{
return (_isSoundOpen);
}
public function set backgroundName(_arg1){
var _local2:*;
_backgroundName = _arg1;
_local2 = (getDefinitionByName(_arg1) as Class);
background = new (_local2);
}
public function get backgroundChannel(){
return (_backgroundChannel);
}
public function playByClassName(_arg1:String){
var _local2:*;
var _local3:*;
_local2 = (getDefinitionByName(_arg1) as Class);
_local3 = new (_local2);
playSound(_local3);
}
public static function getInstance(){
if (_instance == null){
_instance = new (SoundManager);
_instance.init();
};
return (_instance);
}
public static function create():SoundManager{
_instance = new (SoundManager);
_instance.init();
return (_instance);
}
}
}//package
Section 131
//SubmitScoreButton (SubmitScoreButton)
package {
import flash.events.*;
import flash.display.*;
public class SubmitScoreButton extends MovieClip {
public function SubmitScoreButton(){
addFrameScript(0, frame1, 1, frame2);
addEventListener(MouseEvent.CLICK, onClick);
}
public function onMouseOver(_arg1:MouseEvent):void{
gotoAndStop("active");
}
function frame1(){
stop();
buttonMode = true;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
buttonMode = true;
}
public function onMouseOut(_arg1:MouseEvent):void{
gotoAndStop("normal");
}
function frame2(){
stop();
}
function onClick(_arg1:MouseEvent):void{
dispatchEvent(new GameEvent(GameEvent.SUBMIT_SCORE));
}
}
}//package
Section 132
//Tower (Tower)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.ui.*;
import flash.geom.*;
public class Tower extends MovieClip {
protected var _mainScreen;
private var _type:uint;// = 0
private var _sell:uint;// = 0
protected var _range;// = 500
protected var _typeName:String;
protected var _description:String;// = ""
public var _rangeShow:AllmageddonRange;
public var _body:MovieClip;
private var _data:Array;// = null
private var _timer:int;// = 0
private var _cost:uint;// = 0
protected var _currentLevel:uint;// = 1
protected var _projectile:Projectile;
protected var _character:String;
protected var _shotSound:Sound;// = null
protected var _rate;// = 200
private var _upgrade:uint;// = 0
protected var _placeSound:Sound;// = null
public function Tower(){
_data = null;
_description = "";
_shotSound = null;
_placeSound = null;
_type = 0;
_cost = 0;
_sell = 0;
_upgrade = 0;
_currentLevel = 1;
_timer = 0;
_rate = 200;
_range = 500;
super();
buttonMode = true;
}
public function shot(_arg1:Ruffian){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
if ((((_timer == 0)) && (((_type & _arg1.type) > 0)))){
if (_projectile == null){
_projectile = Projectile.create(_data[3], _mainScreen);
_projectile.splash = _data[4];
_projectile.speed = _data[5];
_projectile.damage = _data[6][(_currentLevel - 1)][4];
_projectile.slow = _data[6][(_currentLevel - 1)][5];
_projectile.x = this.x;
_projectile.y = this.y;
};
if (!_arg1.willDie){
if (_projectile.aims.indexOf(_arg1) < 0){
_projectile.aims.push(_arg1);
};
if (_arg1.projectiles.indexOf(_projectile) < 0){
_arg1.projectiles.push(_projectile);
};
if (_mainScreen.projectiles.indexOf(_projectile) < 0){
_mainScreen.container.addChild(_projectile);
_mainScreen.projectiles.push(_projectile);
};
_local2 = _projectile.aims[0];
if (_projectile.slow > 0){
if (_local2.speed < _local2.primarySpeed){
_local3 = _projectile.aims.length;
_local4 = 0;
_local5 = (_local3 - 1);
while (_local5 >= 0) {
_local6 = (_projectile.aims[_local5].speed - _projectile.aims[_local5].willLostSpeed);
_local7 = (_local2.speed - _local2.willLostSpeed);
_local8 = _projectile.aims[_local5];
if (_local6 > _local7){
if (_local6 == _local8.primarySpeed){
_local9 = _local2;
_local2 = (_projectile.aims[0] = _local8);
_projectile.aims[_local5] = _local9;
break;
} else {
if (_local6 > (_projectile.aims[_local4].speed - _projectile.aims[_local4].willLostSpeed)){
_local4 = 0;
};
};
};
_local5--;
};
if (((!((_local4 == 0))) && ((_local5 == 0)))){
_local9 = _local2;
_local2 = (_projectile.aims[0] = _projectile.aims[_local4]);
_projectile.aims[_local5] = _local2;
};
};
};
if (_arg1 == _local2){
if (((!((_body == null))) && (!((_body._barrel == null))))){
_projectile.rotation = (_body._barrel.rotation = (((Math.atan2((_local2.y - y), (_local2.x - x)) * 180) / Math.PI) + 90));
};
_arg1.willLostPoints = (_arg1.willLostPoints + _projectile.damage);
_mainScreen.sound.playSound(_shotSound);
} else {
if ((((_arg1.x - _local2.x) * (_arg1.x - _local2.x)) + ((_arg1.y - _local2.y) * (_arg1.y - _local2.y))) <= (_projectile.splash * _projectile.splash)){
_arg1.willLostPoints = (_arg1.willLostPoints + (_projectile.damage * Math.pow(_projectile.damageSeed, _projectile.aims.indexOf(_arg1))));
};
};
};
};
}
public function get description():String{
return (_description);
}
private function upgradeToLevel(_arg1:int){
var _local2:*;
if (_arg1 <= _data[6].length){
_cost = 0;
_local2 = 0;
while (_local2 < _arg1) {
_cost = (_cost + _data[6][_local2][0]);
_local2++;
};
_sell = ((_data[6][(_arg1 - 1)][1] * _cost) * 0.01);
_range = _data[6][(_arg1 - 1)][2];
_rangeShow.width = (_rangeShow.height = (_range * 2));
_rate = _data[6][(_arg1 - 1)][3];
_timer = (100 * Math.random());
if (_arg1 < _data[6].length){
_upgrade = _data[6][_arg1][0];
} else {
_upgrade = 0;
};
_currentLevel = _arg1;
};
}
public function get upgrade():uint{
return (_upgrade);
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
public function get character():String{
return (_character);
}
public function gotoNextLevel(){
upgradeToLevel((_currentLevel + 1));
}
public function get shotSound():Sound{
return (_shotSound);
}
public function get timer():int{
return (_timer);
}
public function get placeSound():Sound{
return (_placeSound);
}
public function set character(_arg1):void{
_character = _arg1;
}
public function set shotSound(_arg1){
_shotSound = _arg1;
}
public function get range():Number{
return (_range);
}
public function get sell():uint{
return (_sell);
}
public function set timer(_arg1):void{
_timer = (_arg1 % _rate);
}
public function get currentLevel():uint{
return (_currentLevel);
}
public function get mainScreen(){
return (_mainScreen);
}
public function set placeSound(_arg1){
_placeSound = _arg1;
}
public function get barrel():MovieClip{
return (_body._barrel);
}
public function get type():uint{
return (_type);
}
public function get data():Array{
return (_data);
}
public function update(){
_timer++;
_timer = (_timer % Math.round(((stage.frameRate * 10) / _rate)));
_projectile = null;
}
public function set typeName(_arg1):void{
_typeName = _arg1;
}
public function get cost():uint{
return (_cost);
}
public function get body():MovieClip{
return (_body);
}
public function set projectile(_arg1):void{
_projectile = _arg1;
}
public function get typeName():String{
return (_typeName);
}
public function get projectile():Projectile{
return (_projectile);
}
public function get rate():int{
return (_rate);
}
public function set description(_arg1):void{
_description = _arg1;
}
public static function create(_arg1:Array, _arg2:MainScreen):Tower{
var TowerClass:*;
var tower:Tower;
var PlaceSoundClass:*;
var ShotSoundClass:*;
var data = _arg1;
var main = _arg2;
TowerClass = (getDefinitionByName(data[2]) as Class);
tower = (new (TowerClass) as Tower);
var _local4 = tower;
with (_local4) {
_mainScreen = main;
_data = data;
_type = _data[0];
_typeName = _data[1];
upgradeToLevel(1);
_character = _data[11];
_description = _data[12];
PlaceSoundClass = (getDefinitionByName(_data[9]) as Class);
_placeSound = new (PlaceSoundClass);
ShotSoundClass = (getDefinitionByName(_data[10]) as Class);
_shotSound = new (ShotSoundClass);
};
return (tower);
}
}
}//package
Section 133
//TowerOperationPanel (TowerOperationPanel)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class TowerOperationPanel extends MovieClip {
public var _descriptionText:TextField;
public var _currentDamageText:TextField;
private var _mainScreen;
public var _nextRateText:TextField;
public var _nextLevelText:TextField;
private var _tower:Tower;// = null
public var _nextRangeText:TextField;
public var _upgradeButton:UpgradeButton;
public var _currentRateText:TextField;
public var _typeNameText:TextField;
public var _nextDamageText:TextField;
public var _currentLevelText:TextField;
public var _sellButton:SellButton;
private var _canUpgrade:Boolean;// = false
public var _currentRangeText:TextField;
public function TowerOperationPanel(){
_tower = null;
_canUpgrade = false;
super();
_upgradeButton.gotoAndStop("able");
_upgradeButton.addEventListener(MouseEvent.CLICK, onUpgradeClick);
_sellButton.addEventListener(MouseEvent.CLICK, onSellClick);
}
public function get tower():Tower{
return (_tower);
}
function init(){
_typeNameText.text = (((_tower.typeName.toUpperCase() + " (") + _tower.currentLevel.toString()) + ")");
_descriptionText.text = _tower.description;
_currentLevelText.text = _tower.currentLevel.toString();
_currentDamageText.text = _tower.data[6][(_tower.currentLevel - 1)][4];
_currentRangeText.text = _tower.range.toString();
_currentRateText.text = _tower.rate.toString();
_sellButton.text = _tower.sell.toString();
if (_tower.currentLevel < _tower.data[6].length){
_upgradeButton.visible = true;
_nextLevelText.text = (_tower.currentLevel + 1).toString();
_nextDamageText.text = _tower.data[6][_tower.currentLevel][4];
_nextRangeText.text = _tower.data[6][_tower.currentLevel][2];
_nextRateText.text = _tower.data[6][_tower.currentLevel][3];
_upgradeButton.text = _tower.upgrade.toString();
} else {
_nextLevelText.text = "---";
_nextDamageText.text = "---";
_nextRangeText.text = "---";
_nextRateText.text = "---";
_upgradeButton.visible = false;
};
}
public function set tower(_arg1){
if (_arg1 != _tower){
_tower = _arg1;
init();
};
}
public function get sellButton(){
return (_sellButton);
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
function onUpgradeClick(_arg1:MouseEvent):void{
if (_canUpgrade){
if (_tower.currentLevel < _tower.data[6].length){
_mainScreen.actor.money = (_mainScreen.actor.money - _tower.upgrade);
_tower.gotoNextLevel();
init();
};
};
}
function onSellClick(_arg1:MouseEvent):void{
_mainScreen.towers.splice(_mainScreen.towers.indexOf(_tower), 1);
_mainScreen.container.removeChild(_tower);
_mainScreen.actor.money = (_mainScreen.actor.money + _tower.sell);
this.visible = false;
_mainScreen.towerSelectionPanel.visible = true;
}
public function get upgradeButton(){
return (_upgradeButton);
}
public function get mainScreen(){
return (_mainScreen);
}
public function update(){
if (((!(visible)) || ((_tower == null)))){
return;
};
if (_mainScreen.actor.money < _tower.upgrade){
_upgradeButton.gotoAndStop("unable");
_canUpgrade = false;
} else {
_upgradeButton.gotoAndStop("able");
_canUpgrade = true;
};
}
}
}//package
Section 134
//TowerSelectionPanel (TowerSelectionPanel)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.geom.*;
import flash.filters.*;
public class TowerSelectionPanel extends MovieClip {
private var _mainScreen;
public var _tower3:MovieClip;
public var _tower4:MovieClip;
public var _tower5:MovieClip;
private var useable:Array;
public var _tower1:MovieClip;
public var _tower2:MovieClip;
private var _data:Array;
private var _activeDescription;// = null
private var _towers:Array;
private var _descriptions:Array;
public function TowerSelectionPanel(){
var _local1:*;
_descriptions = new Array();
_activeDescription = null;
super();
addEventListener(MouseEvent.CLICK, onClick);
_towers = new Array(_tower1, _tower2, _tower3, _tower4, _tower5);
useable = new Array(false, false, false, false, false, false);
_local1 = 0;
while (_local1 < _towers.length) {
_descriptions[_local1] = (new ((getDefinitionByName(Data.tower[_local1][8]) as Class)) as MovieClip);
addChild(_descriptions[_local1]);
_descriptions[_local1]._towerText.text = Data.tower[_local1][1];
_descriptions[_local1]._moneyText.text = Data.tower[_local1][6][0][0];
_descriptions[_local1].x = _towers[_local1].x;
_descriptions[_local1].y = _towers[_local1].y;
_local1++;
};
HiddenAllDescriptions();
_data = new Array();
_local1 = 0;
while (_local1 < _towers.length) {
_data[_local1] = Data.tower[_local1][6][0][0];
_local1++;
};
}
function onMouseMove(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
HiddenAllDescriptions();
_local2 = 0;
while (_local2 < _towers.length) {
_local3 = _towers[_local2];
if (ButtonHitPoint(_local3, mouseX, mouseY)){
_descriptions[_local2].visible = true;
break;
};
_local2++;
};
}
function HiddenAllDescriptions(){
var _local1:*;
for each (_local1 in _descriptions) {
_local1.visible = false;
};
}
public function set mainScreen(_arg1){
_mainScreen = _arg1;
}
function ButtonHitPoint(_arg1:MovieClip, _arg2:Number, _arg3:Number):Boolean{
return ((((((((_arg2 > (_arg1.x + 15))) && ((_arg2 < ((_arg1.x + _arg1.width) - 15))))) && ((_arg3 > _arg1.y)))) && ((_arg3 < (_arg1.y + _arg1.height)))));
}
public function get mainScreen(){
return (_mainScreen);
}
public function update(){
var _local1:Actor;
var _local2:*;
var _local3:*;
var _local4:*;
if (!visible){
return;
};
_local1 = _mainScreen.actor;
_local2 = 0;
while (_local2 < _towers.length) {
_local3 = _data[_local2];
if (_local1.money >= _local3){
_towers[_local2].gotoAndStop("able");
useable[_local2] = true;
} else {
_towers[_local2].gotoAndStop("unable");
useable[_local2] = false;
};
_local2++;
};
if ((((((((mouseX > 0)) && ((mouseX < width)))) && ((mouseY > 0)))) && ((mouseY < height)))){
_local2 = 0;
while (_local2 < _towers.length) {
_local4 = _towers[_local2];
if (((ButtonHitPoint(_local4, mouseX, mouseY)) && (!((_activeDescription == _descriptions[_local2]))))){
if (_activeDescription != null){
_activeDescription.visible = false;
};
_descriptions[_local2].visible = true;
_activeDescription = _descriptions[_local2];
break;
};
_local2++;
};
} else {
if (_activeDescription != null){
_activeDescription.visible = false;
_activeDescription = null;
};
};
}
function onClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < _towers.length) {
_local3 = _towers[_local2];
if (((ButtonHitPoint(_local3, mouseX, mouseY)) && (useable[_local2]))){
_mainScreen.willAddedTower = Tower.create(Data.tower[_local2], _mainScreen);
};
_local2++;
};
}
}
}//package
Section 135
//UpgradeButton (UpgradeButton)
package {
import flash.display.*;
import flash.text.*;
public class UpgradeButton extends MovieClip {
public var _upgradeText:TextField;
public function UpgradeButton(){
addFrameScript(0, frame1, 1, frame2);
}
public function get text():String{
return (_upgradeText.text);
}
public function set text(_arg1):void{
_upgradeText.text = _arg1;
}
function frame1(){
stop();
_upgradeText.visible = true;
buttonMode = true;
_upgradeText.mouseEnabled = false;
}
function frame2(){
stop();
}
}
}//package
Section 136
//WindSlash (WindSlash)
package {
public dynamic class WindSlash extends Tower {
public function WindSlash(){
addFrameScript(0, frame1, 3, frame4, 4, frame5, 10, frame11, 14, frame15, 15, frame16, 19, frame20);
}
function frame15(){
gotoAndPlay("canAdded");
}
function frame1(){
stop();
_rangeShow.visible = false;
}
function frame4(){
gotoAndPlay("normal");
}
function frame5(){
_rangeShow.visible = true;
}
function frame20(){
gotoAndPlay("canNotAdded");
}
function frame16(){
_rangeShow.gotoAndStop("canNotAdded");
_rangeShow.visible = true;
}
function frame11(){
_rangeShow.gotoAndStop("canAdded");
_rangeShow.visible = true;
}
}
}//package
Section 137
//WindSlashDescription (WindSlashDescription)
package {
import flash.display.*;
import flash.text.*;
public dynamic class WindSlashDescription extends MovieClip {
public var _towerText:TextField;
public var _moneyText:TextField;
}
}//package
Section 138
//WindSlashProjectile (WindSlashProjectile)
package {
public dynamic class WindSlashProjectile extends Projectile {
}
}//package
Section 139
//WindSlashRange (WindSlashRange)
package {
import flash.display.*;
public dynamic class WindSlashRange extends MovieClip {
public function WindSlashRange(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 140
//WinThumb (WinThumb)
package {
import flash.display.*;
public dynamic class WinThumb extends MovieClip {
}
}//package