Section 1
//BaseStage (BaseClass.BaseStage)
package BaseClass {
import flash.geom.*;
import Element.*;
import flash.display.*;
import flash.events.*;
import caurina.transitions.*;
import UserdefinedClass.*;
import flash.utils.*;
public class BaseStage extends MovieClip {
public var canfire:int;// = 0
public var itemMc:Itemmc;
public var len:int;
public var cannonpower:Number;
public var auntybool:Boolean;
public var cannoncount:int;// = 0
public var suc:Sprite;
public var Maxpower:Number;
public var bombtime:int;// = 0
public var armFrame:int;
public var M:Number;// = 2.909
public var StrArr:Array;
public var standby:Sprite;
public var auntyMc:MovieClip;
public var aunty:Sprite;
public var money:int;// = 0
public var bedtime:int;// = 0
public var hitlow:Boolean;
public var barcount:int;// = 1
public var way:Boolean;// = true
public var hittop:Boolean;
public var cannon:Sprite;
public var mice:Mice;
public var bullet:Sprite;
public var AddPower:Number;
public var hitmoney:int;// = 0
public var item:Sprite;
public var airtime:int;// = 0
public var hei:int;
public var background:Sprite;
public var Maxdistance:int;// = 20
public var showtimebool:Boolean;// = true
public var Spadetime:int;// = 0
public var maxhei:int;// = 0
public var Maxval:int;// = 0
public var cannontime:Number;
public var backgroundMc:Backgroundmc;
public var cannonMc:MovieClip;
public var micepoint:MovieClip;
public var delay:Timer;
public var bulletV:Number;// = 25
public var bullethittime:int;// = 0
public var gamestart:MovieClip;
public var main:Main;
public var gamestate:String;
public var game:Sprite;
public var actor:Sprite;
public var blood:Sprite;
public var hitland:int;// = 0
public function BaseStage(mainobj:Object){
cannoncount = 0;
canfire = 0;
Maxdistance = 20;
bulletV = 25;
bullethittime = 0;
hitland = 0;
hitmoney = 0;
bombtime = 0;
bedtime = 0;
Spadetime = 0;
airtime = 0;
money = 0;
maxhei = 0;
showtimebool = true;
Maxval = 0;
barcount = 1;
way = true;
M = (8727 / 3000);
StrArr = new Array();
super();
main = (mainobj as Main);
initgame();
}
public function lensuc(){
if (len >= 20000){
setsuc(24);
};
if (len >= 30000){
setsuc(25);
};
if (len >= 40000){
setsuc(26);
};
if (len >= 50000){
setsuc(27);
};
}
public function onpartdown(e:MouseEvent):void{
gamestart.aunty.gotoAndPlay("hold");
main.stage.addEventListener(MouseEvent.MOUSE_UP, onpartup);
main.stage.removeEventListener(MouseEvent.MOUSE_DOWN, onpartdown);
addEventListener(Event.ENTER_FRAME, updatapart1);
}
public function inititem():void{
backgroundMc = new Backgroundmc(MyMath.randRange(2));
background.addChild(backgroundMc);
itemMc = new Itemmc(this);
item.addChild(itemMc);
}
public function showsuc(Num:int){
var tempMc:MovieClip;
tempMc = new Suc();
tempMc.gotoAndStop(Num);
suc.addChild(tempMc);
tempMc.x = 500;
tempMc.y = 100;
tempMc.alpha = 0;
Tweener.addTween(tempMc, {alpha:1, time:1, transition:"linear"});
Tweener.addTween(tempMc, {alpha:0, delay:2, time:1, transition:"linear"});
}
public function playshuai(){
SoundData.Effect[18].playsound(1);
}
public function delayrun(time:Number, fun:Function){
Tweener.addTween(this, {delay:time, onComplete:fun});
}
public function bgupdown(speed:Number){
if (((((backgroundMc.y + speed) >= 0)) && (((backgroundMc.y + speed) <= 8520)))){
if (((!(hitlow)) && (!(hittop)))){
backgroundMc.y = (backgroundMc.y + speed);
};
} else {
if ((backgroundMc.y + speed) < 0){
backgroundMc.y = 0;
hitlow = true;
} else {
if ((backgroundMc.y + speed) > 8520){
backgroundMc.y = 8520;
hittop = true;
};
};
};
}
public function workhei():void{
hei = (((407 - mice.y) + backgroundMc.y) / M);
main.sethigh(hei);
if (maxhei < hei){
maxhei = hei;
};
flymansuc();
}
public function bombsuc(){
bombtime++;
if (bombtime == 1){
setsuc(0);
};
if (bombtime == 5){
setsuc(1);
};
if (bombtime == 10){
setsuc(2);
};
}
public function playreng(){
SoundData.Effect[20].playsound(1);
}
public function workmoney(){
var str:String;
if (len > MyData.getInstance().maxlen){
MyData.getInstance().maxlen = len;
addmaxlenpoint(mice.x, mice.y, len);
main.savelen();
};
str = workgameoverStr();
main.showGameover(len, maxhei, money, str);
}
public function onpartup(e:MouseEvent):void{
removeEventListener(Event.ENTER_FRAME, updatapart1);
if (barcount > 70){
gamestart.aunty.gotoAndPlay("hardhit");
} else {
gamestart.aunty.gotoAndPlay("hit");
};
main.stage.removeEventListener(MouseEvent.MOUSE_UP, onpartup);
delay = new Timer(100, 1);
delay.start();
delay.addEventListener(TimerEvent.TIMER, onworkmouse);
}
public function onthrow(e:TimerEvent):void{
main.gamestage = "playing";
delay.stop();
delay.removeEventListener(TimerEvent.TIMER, onthrow);
mice.onthrow();
addEventListener(Event.ENTER_FRAME, updata);
Clr.removeAllChildren(aunty);
}
public function bbqsuc(){
MyData.getInstance().bbq++;
main.savealldata();
if (MyData.getInstance().bbq == 1){
setsuc(12);
};
if (MyData.getInstance().bbq == 15){
setsuc(13);
};
if (MyData.getInstance().bbq == 40){
setsuc(14);
};
if (MyData.getInstance().bbq == 80){
setsuc(15);
};
}
public function bgdown(){
if ((backgroundMc.y + 50) <= 8520){
backgroundMc.y = (backgroundMc.y + 50);
};
}
public function onspace():void{
var tempMC:MovieClip;
if (gamestate == "showtime"){
if (canfire == Maxdistance){
SoundData.Effect[10].playsound(1);
canfire = 0;
tempMC = new Bullet();
bullet.addChild(tempMC);
tempMC.x = cannonMc.x;
tempMC.y = 413;
cannonMc.gotoAndStop(2);
};
};
}
public function rubbishsuc(){
MyData.getInstance().rubbish++;
main.savealldata();
if (MyData.getInstance().rubbish == 1){
setsuc(4);
};
if (MyData.getInstance().rubbish == 10){
setsuc(5);
};
if (MyData.getInstance().rubbish == 30){
setsuc(6);
};
if (MyData.getInstance().rubbish == 50){
setsuc(7);
};
}
public function setsuc(Num:int){
if (!MyData.getInstance().succeed[Num]){
MyData.getInstance().succeed[Num] = true;
main.savesucceed();
showsuc((Num + 1));
};
}
public function worklow(speed:Number){
if (hitlow){
if (mice.y < 240){
mice.y = 240;
hitlow = false;
};
if ((mice.y - speed) <= 407){
mice.y = (mice.y - speed);
} else {
SoundData.HIT[MyMath.randRange(3)].playsound(1);
mice.y = 407;
airtime = 0;
hitland++;
addBlood(mice.x, mice.y);
mice.y = (mice.y + speed);
mice.Vy = (mice.Vy * -0.7);
mice.Vx = (mice.Vx * 0.7);
mice.randomFrame();
if (Math.abs(mice.Vy) <= 1.5){
mice.die();
if (auntybool){
auntybool = false;
main.setmoretime(1);
mice.alpha = 0;
auntyMc = new Aunty();
aunty.addChild(auntyMc);
aunty.x = 207;
aunty.y = 146;
delay = new Timer(900, 1);
delay.start();
delay.addEventListener(TimerEvent.TIMER, onthrow);
main.gamestage = "aunty";
SoundData.Effect[19].playsound(1);
delayrun(0.1, playshuai);
delayrun(0.2, playshuai);
delayrun(0.3, playshuai);
delayrun(0.4, playshuai);
delayrun(0.5, playshuai);
delayrun(0.6, playreng);
} else {
workmoney();
};
removeEventListener(Event.ENTER_FRAME, updata);
};
};
};
}
public function worktop(speed:Number){
if (hittop){
if ((mice.y - speed) <= 240){
mice.y = (mice.y - speed);
} else {
mice.y = 240;
hittop = false;
};
if (mice.y < -50){
if (standby.numChildren){
micepoint.x = mice.x;
} else {
micepoint = new Micepoint();
standby.addChild(micepoint);
micepoint.y = 30;
};
} else {
Clr.removeAllChildren(standby);
};
};
}
public function addmaxlenpoint(x:Number, y:Number, LEN:int){
var temppoint:MovieClip;
temppoint = new Endpoint();
BaseUI.setmoney(temppoint, LEN, "l", 7);
temppoint.x = x;
temppoint.y = 408;
trace(mice.y);
if (mice.y > 403){
actor.addChild(temppoint);
};
}
public function updata(e:Event){
airtime++;
flysuc();
workhit();
bgupdown(mice.Vy);
bgleftright(mice.Vx);
mice.updata();
worktop(mice.Vy);
worklow(mice.Vy);
workhei();
worklen();
workshowtime();
itemMc.updata(mice.Vx);
workitemxy();
}
public function playglass(){
SoundData.Effect[15].playsound(1);
}
public function workgameoverStr():String{
var str:String;
var tempmoney:Array;
var count:int;
var price:Array;
var tempStr:Array;
var tempstr:String;
var tempnum:int;
var i:int;
var j:int;
str = new String();
tempmoney = new Array();
count = 0;
price = new Array(60, 50, 100, 50, 50, 50, 30, 50, 100, 100, 30, 50, 30, 30);
tempStr = new Array("oven", "eagle", "weeder", "trampoline", "trampoline", "grid", "kite", "bloody end", "banana skin", "from cash bags", "balloon", "dustbin", "bomb", "bomb", "for distance", "jumpy");
tempnum = 0;
i = 0;
while (i < 14) {
tempmoney[i] = (StrArr[i] * price[i]);
i++;
};
i = 0;
while (i < 3) {
if (tempmoney[i]){
count++;
money = (money + tempmoney[i]);
tempstr = ((("+$" + String(tempmoney[i])) + " ") + tempStr[i]);
tempnum = tempstr.length;
if ((((count > 0)) && (!((count % 2))))){
tempstr = (tempstr + "\n");
} else {
j = 0;
while (j < (25 - tempnum)) {
tempstr = (tempstr + " ");
j++;
};
};
str = (str + tempstr);
};
i++;
};
if ((tempmoney[3] + tempmoney[4])){
count++;
money = (money + (tempmoney[3] + tempmoney[4]));
tempstr = ((("+$" + String((tempmoney[3] + tempmoney[4]))) + " ") + tempStr[3]);
tempnum = tempstr.length;
if ((((count > 0)) && (!((count % 2))))){
tempstr = (tempstr + "\n");
} else {
j = 0;
while (j < (25 - tempnum)) {
tempstr = (tempstr + " ");
j++;
};
};
str = (str + tempstr);
};
i = 5;
while (i < 12) {
if (tempmoney[i]){
count++;
money = (money + tempmoney[i]);
tempstr = ((("+$" + String(tempmoney[i])) + " ") + tempStr[i]);
tempnum = tempstr.length;
if ((((count > 0)) && (!((count % 2))))){
tempstr = (tempstr + "\n");
} else {
j = 0;
while (j < (25 - tempnum)) {
tempstr = (tempstr + " ");
j++;
};
};
str = (str + tempstr);
};
i++;
};
if ((tempmoney[12] + tempmoney[13])){
count++;
money = (money + (tempmoney[12] + tempmoney[13]));
tempstr = ((("+$" + String((tempmoney[12] + tempmoney[13]))) + " ") + tempStr[12]);
tempnum = tempstr.length;
if ((((count > 0)) && (!((count % 2))))){
tempstr = (tempstr + "\n");
} else {
j = 0;
while (j < (25 - tempnum)) {
tempstr = (tempstr + " ");
j++;
};
};
str = (str + tempstr);
};
count++;
money = (money + (len / 10));
tempstr = ((("+$" + String(int((len / 10)))) + " ") + tempStr[14]);
tempnum = tempstr.length;
if ((((count > 0)) && (!((count % 2))))){
tempstr = (tempstr + "\n");
} else {
j = 0;
while (j < (25 - tempnum)) {
tempstr = (tempstr + " ");
j++;
};
};
str = (str + tempstr);
count++;
money = (money + (hitland * 10));
tempstr = ((("+$" + String((hitland * 10))) + " ") + tempStr[15]);
tempnum = tempstr.length;
if ((((count > 0)) && (!((count % 2))))){
tempstr = (tempstr + "\n");
} else {
j = 0;
while (j < (25 - tempnum)) {
tempstr = (tempstr + " ");
j++;
};
};
str = (str + tempstr);
return (str);
}
public function birdsuc(){
setsuc(23);
}
public function elesuc(){
setsuc(20);
}
public function flysuc(){
if (airtime >= (60 * 60)){
setsuc(22);
};
}
public function bgright(){
if (gamestate == "showtime"){
if (cannonMc.x > 2){
cannonMc.x = (cannonMc.x - 4);
};
};
}
public function updatapart1(e:Event):void{
if (way){
if (barcount < Maxval){
barcount++;
gamestart.powerbar.gotoAndStop(barcount);
} else {
way = false;
};
} else {
if (barcount > 1){
barcount--;
gamestart.powerbar.gotoAndStop(barcount);
} else {
way = true;
};
};
}
public function initgame(){
var i:int;
SoundControl.stopallsound();
initcontainer();
initSound();
loaddata();
playbgm();
main.stage.focus = this;
bulidpart1();
i = 0;
while (i < 14) {
StrArr.push(0);
i++;
};
}
public function spadesuc(){
Spadetime++;
if (Spadetime == 1){
setsuc(8);
};
if (Spadetime == 2){
setsuc(9);
};
if (Spadetime == 3){
setsuc(10);
};
if (Spadetime == 4){
setsuc(11);
};
}
public function playbgm(){
SoundData.BGM[MyMath.randRange(2)].playsound(10000000);
}
public function tackitemsuc(){
setsuc(3);
}
public function destory(){
removeEventListener(Event.ENTER_FRAME, onkeyfun);
removeEventListener(Event.ENTER_FRAME, updata);
Clr.removeAllChildren(background);
Clr.removeAllChildren(cannon);
Clr.removeAllChildren(bullet);
Clr.removeAllChildren(actor);
Clr.removeAllChildren(item);
Clr.removeAllChildren(standby);
Clr.removeAllChildren(aunty);
Clr.removeAllChildren(suc);
Clr.removeAllChildren(game);
Clr.removeAllChildren(this);
Clr.removeAllChildren(main.Ui);
Tweener.removeAllTweens();
SoundControl.stopallsound();
}
public function stopgame(){
removeEventListener(Event.ENTER_FRAME, updata);
}
public function onworkmouse(e:TimerEvent){
var mouseframe:int;
var TimeNum:int;
delay.stop();
delay.removeEventListener(TimerEvent.TIMER, onworkmouse);
mouseframe = gamestart.mouse.currentFrame;
TimeNum = 0;
if (mouseframe >= 176){
if (barcount < 10){
SoundData.Aunty[0].playsound(1);
gamestart.mouse.gotoAndStop(1);
gamestart.gotoAndPlay("Lhit");
delay = new Timer(2600, 1);
delay.start();
delay.addEventListener(TimerEvent.TIMER, onrestart);
} else {
if (barcount < 20){
SoundData.Aunty[0].playsound(1);
gamestart.mouse.gotoAndStop(1);
gamestart.gotoAndPlay("Mhit");
delay = new Timer(2500, 1);
delay.start();
delay.addEventListener(TimerEvent.TIMER, onrestart);
delayrun(0.2, playglass);
} else {
if (barcount > 80){
SoundData.Aunty[1].playsound(1);
} else {
SoundData.Aunty[0].playsound(1);
};
delayrun(0.2, playglass);
perfectionsuc();
gamestart.mouse.gotoAndStop(1);
gamestart.gotoAndPlay("Hhit");
delay = new Timer(1000, 1);
delay.start();
delay.addEventListener(TimerEvent.TIMER, startpart2);
};
};
} else {
SoundData.Effect[5].playsound(1);
gamestart.mouse.gotoAndStop("run");
delay = new Timer(1500, 1);
delay.start();
delay.addEventListener(TimerEvent.TIMER, onrestart);
};
}
public function workhit():void{
var len:int;
var tempMc:MovieClip;
var tempmc:MovieClip;
var i:int;
len = bullet.numChildren;
if (len == 0){
return;
};
i = 0;
while (i < len) {
tempMc = (bullet.getChildAt(i) as MovieClip);
if (tempMc.alpha){
if (HitTest.complexHitTestObject(tempMc, mice)){
tempMc.alpha = 0;
bullethittime++;
huntsuc();
mice.bullet(cannonpower);
tempmc = new Fblood();
tempmc.x = mice.x;
tempmc.y = mice.y;
actor.addChild(tempmc);
break;
};
};
i++;
};
len = item.numChildren;
if (len == 0){
return;
};
}
public function reboundsuc(){
bedtime++;
if (bedtime == 1){
setsuc(16);
};
if (bedtime == 3){
setsuc(17);
};
}
public function flymansuc(){
if (hei >= 3000){
setsuc(28);
};
}
public function onrestart(e:TimerEvent=null):void{
delay.stop();
delay.removeEventListener(TimerEvent.TIMER, onrestart);
Clr.removeAllChildren(background);
bulidpart1();
}
public function workbullet():void{
var len:int;
var tempMC:MovieClip;
var i:int;
if (gamestate == "showtime"){
len = bullet.numChildren;
if (len == 0){
return;
};
i = 0;
while (i < len) {
tempMC = (bullet.getChildAt(i) as MovieClip);
tempMC.y = (tempMC.y - bulletV);
tempMC.x = (tempMC.x - (mice.Vx / 10));
i++;
};
};
}
public function workshowtime():void{
if (showtimebool){
if (gamestate == "showtime"){
cannoncount--;
main.setuibar(((cannoncount / cannontime) * 0.25));
workbullet();
if (canfire < Maxdistance){
canfire++;
};
if (cannoncount == 0){
bullethittime = 0;
main.setcannon(2);
gamestate = "play";
Clr.removeAllChildren(bullet);
Clr.removeAllChildren(cannon);
showtimebool = false;
};
} else {
if (cannoncount < ((cannontime * 100) * 4)){
cannoncount = (cannoncount + cannontime);
main.setuibar(((cannoncount / cannontime) * 0.25));
if (cannoncount == ((cannontime * 100) * 4)){
SoundData.Effect[16].playsound(1);
};
} else {
main.setcannon(1);
};
};
};
}
public function onkeyfun(e:Event):void{
Input.keydownrunfun(Input.SPACE, onspace);
Input.keydownrunfun(Input.LEFT, bgleft);
Input.keydownrunfun(Input.RIGHT, bgright);
Input.keydownrunfun(Input.P, showItem);
}
public function worklen():void{
len = mice.len;
main.setlen(len);
lensuc();
}
public function initcontainer(){
game = new Sprite();
aunty = new Sprite();
background = new Sprite();
actor = new Sprite();
item = new Sprite();
standby = new Sprite();
cannon = new Sprite();
bullet = new Sprite();
suc = new Sprite();
addChild(game);
game.addChild(background);
game.addChild(item);
game.addChild(actor);
game.addChild(aunty);
game.addChild(cannon);
game.addChild(bullet);
game.addChild(standby);
game.addChild(suc);
}
public function showtime(){
gamestate = "showtime";
cannonMc = new Cannon();
cannon.addChild(cannonMc);
cannonMc.x = 292;
cannonMc.y = 426;
}
public function startpart2(e:TimerEvent=null){
delay.stop();
delay.removeEventListener(TimerEvent.TIMER, startpart2);
Clr.removeAllChildren(background);
inititem();
addEventListener(Event.ENTER_FRAME, updata);
addEventListener(Event.ENTER_FRAME, onkeyfun);
mice = new Mice(this, -30, 400, (((Maxpower * (barcount - 1)) * 0.01) + AddPower));
Tweener.addTween(mice, {x:320, y:240, time:1, transition:"easeOutQuint"});
actor.addChild(mice);
main.initgameUI();
}
public function loaddata():void{
armFrame = main.rearm();
Maxpower = MyData.getInstance().powerlist[(armFrame - 1)];
AddPower = MyData.getInstance().addpowerlist[(armFrame - 1)];
cannonpower = main.reattack();
cannontime = main.relasttime();
}
public function perfectionsuc(){
if (barcount == 101){
setsuc(29);
};
}
public function bgup(){
mice.setrocket(1);
}
public function workitemxy():void{
itemMc.y = backgroundMc.y;
}
public function setrocket(Num:int){
SoundData.Effect[6].playsound(1);
mice.setrocket(Num);
main.setarm(((Num - 1) + Num));
}
public function showItem(){
trace(itemMc.Statistic);
}
public function onupdownpart1(e:TimerEvent):void{
delay.stop();
delay.removeEventListener(TimerEvent.TIMER, onupdownpart1);
main.stage.addEventListener(MouseEvent.MOUSE_DOWN, onpartdown);
}
public function bulidpart1(){
gamestart = new Gamestart();
background.addChild(gamestart);
gamestart.aunty.arm.gotoAndStop(armFrame);
Maxval = main.repower();
delay = new Timer(100, 1);
delay.start();
delay.addEventListener(TimerEvent.TIMER, onupdownpart1);
gamestart.powerbar.gotoAndStop(1);
barcount = 1;
}
public function bgleft(){
if (gamestate == "showtime"){
if (cannonMc.x < 583){
cannonMc.x = (cannonMc.x + 4);
};
};
}
public function inithitstart(){
}
public function bansuc(){
setsuc(21);
}
public function huntsuc(){
if (bullethittime == 20){
setsuc(18);
};
if (bullethittime == 40){
setsuc(19);
};
}
public function bgleftright(speed:Number){
backgroundMc.updata(speed);
}
public function addBlood(x:Number, y:Number){
var p:Point;
var tempblood:MovieClip;
p = new Point(x, y);
p = backgroundMc.backGroup[14].globalToLocal(p);
tempblood = new Blood();
tempblood.gotoAndStop(MyMath.FrandRange(1, 4));
tempblood.x = p.x;
tempblood.y = p.y;
backgroundMc.backGroup[14].addChild(tempblood);
}
public function initSound(){
SoundControl.destorySdground();
}
}
}//package BaseClass
Section 2
//logo_animation_2 (BatThatRat_fla.logo_animation_2)
package BatThatRat_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.net.*;
public dynamic class logo_animation_2 extends MovieClip {
public var getURL:URLRequest;
public var urlButton:SimpleButton;
public function logo_animation_2(){
super();
addFrameScript(0, frame1, 85, frame86);
}
function frame86(){
stop();
SoundMixer.stopAll();
}
function frame1(){
getURL = new URLRequest("http://www.freeaddictinggames.com/?utm_source=games&utm_medium=battheratpr");
urlButton.addEventListener(MouseEvent.CLICK, urlClick);
}
public function urlClick(event:MouseEvent):void{
navigateToURL(getURL);
}
}
}//package BatThatRat_fla
Section 3
//MainTimeline (BatThatRat_fla.MainTimeline)
package BatThatRat_fla {
import flash.display.*;
import flash.media.*;
public dynamic class MainTimeline extends MovieClip {
public function MainTimeline(){
super();
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
SoundMixer.stopAll();
stop();
addChild(new Main());
}
function frame1(){
MochiBot.track(this, "d7bac3a8");
stop();
}
}
}//package BatThatRat_fla
Section 4
//Timeline_1 (BatThatRat_fla.Timeline_1)
package BatThatRat_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.system.*;
public dynamic class Timeline_1 extends MovieClip {
public const FRAME_RATE_ADJUST:Boolean = true;
public const LOADER_FRAME_RATE:Number = 30;
public const AUTO_PLAY:Boolean = false;
public var bar:MovieClip;
public var logoAnimation:MovieClip;
public var loadingComplete:Boolean;
public var playBtn:SimpleButton;
public var movieFrameRate:Number;
public var initialized:Boolean;
public function Timeline_1(){
super();
addFrameScript(0, frame1, 22, frame23, 36, frame37);
}
public function init():void{
if (initialized){
return;
};
gotoAndStop(1);
movieFrameRate = 0;
if (((FRAME_RATE_ADJUST) && (stage))){
movieFrameRate = stage.frameRate;
stage.frameRate = LOADER_FRAME_RATE;
};
initialized = true;
stop();
if (((root) && ((root is MovieClip)))){
MovieClip(root).stop();
};
loadingComplete = false;
addEventListener(Event.ENTER_FRAME, enterFrameHandler, false, 0, true);
if (meetsVersion([9, 0, 28, 0])){
addEventListener(Event.REMOVED_FROM_STAGE, cleanup, false, 0, true);
};
enterFrameHandler();
}
public function enterFrameHandler(e:Event=null):void{
var loaded:Number;
if (((((!(movieFrameRate)) && (FRAME_RATE_ADJUST))) && (stage))){
movieFrameRate = stage.frameRate;
stage.frameRate = LOADER_FRAME_RATE;
};
if (!loadingComplete){
loaded = 0;
if (loaderInfo){
loaded = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
};
if (bar){
bar.scaleX = loaded;
};
if (loaded == 1){
loadingComplete = true;
if (AUTO_PLAY){
startMovie();
} else {
gotoAndPlay("loaded");
};
};
};
}
public function meetsVersion(version:Array):Boolean{
var playerVersion:Array;
var i:uint;
playerVersion = String(Capabilities.version.split(" ")[1]).split(",");
i = 0;
while (i < version.length) {
if (uint(playerVersion[i]) > version[i]){
return (true);
};
if (uint(playerVersion[i]) < version[i]){
return (false);
};
i++;
};
return (true);
}
function frame1(){
initialized = false;
init();
}
function frame23(){
playBtn.addEventListener(MouseEvent.CLICK, playM);
stop();
}
function frame37(){
startMovie();
stop();
SoundMixer.stopAll();
}
public function playM(event:MouseEvent):void{
logoAnimation.stop();
SoundMixer.stopAll();
gotoAndPlay("playOut");
}
public function cleanup(e:Event=null){
if (initialized){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
if (meetsVersion([9, 0, 28, 0])){
removeEventListener(Event.REMOVED_FROM_STAGE, cleanup);
};
if (movieFrameRate){
stage.frameRate = movieFrameRate;
movieFrameRate = 0;
};
};
initialized = false;
}
public function startMovie():void{
cleanup();
if (((root) && ((root is MovieClip)))){
MovieClip(root).play();
};
dispatchEvent(new Event(Event.COMPLETE));
}
}
}//package BatThatRat_fla
Section 5
//Timeline_108 (BatThatRat_fla.Timeline_108)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_108 extends MovieClip {
public function Timeline_108(){
super();
addFrameScript(106, frame107);
}
function frame107(){
stop();
}
}
}//package BatThatRat_fla
Section 6
//Timeline_109 (BatThatRat_fla.Timeline_109)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_109 extends MovieClip {
public function Timeline_109(){
super();
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package BatThatRat_fla
Section 7
//Timeline_116 (BatThatRat_fla.Timeline_116)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_116 extends MovieClip {
public function Timeline_116(){
super();
addFrameScript(226, frame227, 227, frame228);
}
function frame227(){
gotoAndPlay("eat2");
}
function frame228(){
stop();
}
}
}//package BatThatRat_fla
Section 8
//Timeline_125 (BatThatRat_fla.Timeline_125)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_125 extends MovieClip {
public function Timeline_125(){
super();
addFrameScript(23, frame24);
}
function frame24(){
stop();
}
}
}//package BatThatRat_fla
Section 9
//Timeline_127 (BatThatRat_fla.Timeline_127)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_127 extends MovieClip {
public function Timeline_127(){
super();
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package BatThatRat_fla
Section 10
//Timeline_128 (BatThatRat_fla.Timeline_128)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_128 extends MovieClip {
public var arm:MovieClip;
public function Timeline_128(){
super();
addFrameScript(39, frame40, 86, frame87, 117, frame118, 142, frame143);
}
function frame143(){
stop();
}
function frame87(){
stop();
}
function frame118(){
stop();
}
function frame40(){
gotoAndPlay(1);
}
}
}//package BatThatRat_fla
Section 11
//Timeline_138 (BatThatRat_fla.Timeline_138)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_138 extends MovieClip {
public function Timeline_138(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 12
//Timeline_141 (BatThatRat_fla.Timeline_141)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_141 extends MovieClip {
public function Timeline_141(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 13
//Timeline_142 (BatThatRat_fla.Timeline_142)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_142 extends MovieClip {
public function Timeline_142(){
super();
addFrameScript(106, frame107);
}
function frame107(){
stop();
}
}
}//package BatThatRat_fla
Section 14
//Timeline_18 (BatThatRat_fla.Timeline_18)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_18 extends MovieClip {
public function Timeline_18(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 15
//Timeline_200 (BatThatRat_fla.Timeline_200)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_200 extends MovieClip {
public function Timeline_200(){
super();
addFrameScript(9, frame10);
}
function frame10(){
(this.parent as MovieClip).gotoAndStop(1);
}
}
}//package BatThatRat_fla
Section 16
//Timeline_207 (BatThatRat_fla.Timeline_207)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_207 extends MovieClip {
public function Timeline_207(){
super();
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package BatThatRat_fla
Section 17
//Timeline_208 (BatThatRat_fla.Timeline_208)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_208 extends MovieClip {
public function Timeline_208(){
super();
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package BatThatRat_fla
Section 18
//Timeline_209 (BatThatRat_fla.Timeline_209)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_209 extends MovieClip {
public function Timeline_209(){
super();
addFrameScript(3, frame4);
}
function frame4(){
stop();
}
}
}//package BatThatRat_fla
Section 19
//Timeline_210 (BatThatRat_fla.Timeline_210)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_210 extends MovieClip {
public function Timeline_210(){
super();
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package BatThatRat_fla
Section 20
//Timeline_33 (BatThatRat_fla.Timeline_33)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_33 extends MovieClip {
public var i5:MovieClip;
public var i4:MovieClip;
public var P1:MovieClip;
public var i1:MovieClip;
public var i2:MovieClip;
public var i6:MovieClip;
public var i7:MovieClip;
public var i8:MovieClip;
public var i3:MovieClip;
public function Timeline_33(){
super();
}
}
}//package BatThatRat_fla
Section 21
//Timeline_34 (BatThatRat_fla.Timeline_34)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_34 extends MovieClip {
public function Timeline_34(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 22
//Timeline_35 (BatThatRat_fla.Timeline_35)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_35 extends MovieClip {
public function Timeline_35(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 23
//Timeline_38 (BatThatRat_fla.Timeline_38)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_38 extends MovieClip {
public function Timeline_38(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 24
//Timeline_39 (BatThatRat_fla.Timeline_39)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_39 extends MovieClip {
public function Timeline_39(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 25
//Timeline_42 (BatThatRat_fla.Timeline_42)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_42 extends MovieClip {
public function Timeline_42(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 26
//Timeline_43 (BatThatRat_fla.Timeline_43)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_43 extends MovieClip {
public function Timeline_43(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 27
//Timeline_46 (BatThatRat_fla.Timeline_46)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_46 extends MovieClip {
public function Timeline_46(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 28
//Timeline_47 (BatThatRat_fla.Timeline_47)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_47 extends MovieClip {
public function Timeline_47(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 29
//Timeline_50 (BatThatRat_fla.Timeline_50)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_50 extends MovieClip {
public function Timeline_50(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 30
//Timeline_51 (BatThatRat_fla.Timeline_51)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_51 extends MovieClip {
public function Timeline_51(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 31
//Timeline_54 (BatThatRat_fla.Timeline_54)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_54 extends MovieClip {
public function Timeline_54(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 32
//Timeline_55 (BatThatRat_fla.Timeline_55)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_55 extends MovieClip {
public function Timeline_55(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 33
//Timeline_58 (BatThatRat_fla.Timeline_58)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_58 extends MovieClip {
public function Timeline_58(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 34
//Timeline_60 (BatThatRat_fla.Timeline_60)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_60 extends MovieClip {
public function Timeline_60(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 35
//Timeline_61 (BatThatRat_fla.Timeline_61)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_61 extends MovieClip {
public function Timeline_61(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 36
//Timeline_66 (BatThatRat_fla.Timeline_66)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_66 extends MovieClip {
public var effbar:MovieClip;
public var b2:MovieClip;
public var po1:MovieClip;
public var po2:MovieClip;
public var po3:MovieClip;
public var b1:MovieClip;
public var po0:MovieClip;
public var b0:MovieClip;
public var power:MovieClip;
public var bug_btn:SimpleButton;
public var eff_btn:SimpleButton;
public var b3:MovieClip;
public var c:MovieClip;
public var b:MovieClip;
public var e0:MovieClip;
public var e2:MovieClip;
public var a:MovieClip;
public var e3:MovieClip;
public var power_btn:SimpleButton;
public var e1:MovieClip;
public var P2:MovieClip;
public var powerbar:MovieClip;
public var cannon:MovieClip;
public function Timeline_66(){
super();
}
}
}//package BatThatRat_fla
Section 37
//Timeline_67 (BatThatRat_fla.Timeline_67)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_67 extends MovieClip {
public function Timeline_67(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 38
//Timeline_71 (BatThatRat_fla.Timeline_71)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_71 extends MovieClip {
public function Timeline_71(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 39
//Timeline_73 (BatThatRat_fla.Timeline_73)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_73 extends MovieClip {
public function Timeline_73(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 40
//Timeline_88 (BatThatRat_fla.Timeline_88)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_88 extends MovieClip {
public function Timeline_88(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 41
//Timeline_89 (BatThatRat_fla.Timeline_89)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_89 extends MovieClip {
public function Timeline_89(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 42
//Timeline_90 (BatThatRat_fla.Timeline_90)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_90 extends MovieClip {
public function Timeline_90(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 43
//Timeline_91 (BatThatRat_fla.Timeline_91)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_91 extends MovieClip {
public function Timeline_91(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 44
//Timeline_93 (BatThatRat_fla.Timeline_93)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_93 extends MovieClip {
public function Timeline_93(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package BatThatRat_fla
Section 45
//Timeline_97 (BatThatRat_fla.Timeline_97)
package BatThatRat_fla {
import flash.display.*;
public dynamic class Timeline_97 extends MovieClip {
public function Timeline_97(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package BatThatRat_fla
Section 46
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public function AuxFunctions(){
super();
}
public static function getObjectLength(p_object:Object):uint{
var totalProperties:uint;
var pName:String;
totalProperties = 0;
for (pName in p_object) {
totalProperties++;
};
return (totalProperties);
}
public static function numberToG(p_num:Number):Number{
return (((p_num & 0xFF00) >> 8));
}
public static function numberToB(p_num:Number):Number{
return ((p_num & 0xFF));
}
public static function numberToR(p_num:Number):Number{
return (((p_num & 0xFF0000) >> 16));
}
public static function concatObjects(... _args):Object{
var finalObject:Object;
var currentObject:Object;
var i:int;
var prop:String;
finalObject = {};
i = 0;
while (i < _args.length) {
currentObject = _args[i];
for (prop in currentObject) {
if (currentObject[prop] == null){
delete finalObject[prop];
} else {
finalObject[prop] = currentObject[prop];
};
};
i++;
};
return (finalObject);
}
}
}//package caurina.transitions
Section 47
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
super();
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
if (t < (1 / 2.75)){
return (((c * ((7.5625 * t) * t)) + b));
};
if (t < (2 / 2.75)){
t = (t - (1.5 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.75)) + b));
};
if (t < (2.5 / 2.75)){
t = (t - (2.25 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.9375)) + b));
};
t = (t - (2.625 / 2.75));
return (((c * (((7.5625 * t) * t) + 0.984375)) + b));
}
public static function easeInOutElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var p:Number;
var s:Number;
var a:Number;
if (t == 0){
return (b);
};
t = (t / (d / 2));
if (t == 2){
return ((b + c));
};
p = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * (0.3 * 1.5)) : p_params.period;
a = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
if (t < 1){
--t;
return (((-0.5 * ((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p)))) + b));
};
--t;
return ((((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p))) * 0.5) + c) + b));
}
public static function easeInOutQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return (((((c / 2) * t) * t) + b));
};
--t;
return ((((-(c) / 2) * ((t * (t - 2)) - 1)) + b));
}
public static function easeInOutBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (((easeInBounce((t * 2), 0, c, d) * 0.5) + b));
};
return ((((easeOutBounce(((t * 2) - d), 0, c, d) * 0.5) + (c * 0.5)) + b));
}
public static function easeInOutBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
s = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = (t / (d / 2));
if (t < 1){
s = (s * 1.525);
return ((((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b));
};
t = (t - 2);
s = (s * 1.525);
return ((((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b));
}
public static function easeOutInCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutCubic((t * 2), b, (c / 2), d, p_params));
};
return (easeInCubic(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeNone(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((c * t) / d) + b));
}
public static function easeOutBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
s = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = ((t / d) - 1);
return (((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b));
}
public static function easeInOutSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((-(c) / 2) * (Math.cos(((Math.PI * t) / d)) - 1)) + b));
}
public static function easeInBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var s:Number;
s = (((!(Boolean(p_params))) || (isNaN(p_params.overshoot)))) ? 1.70158 : p_params.overshoot;
t = (t / d);
return (((((c * t) * t) * (((s + 1) * t) - s)) + b));
}
public static function easeInQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((((c * t) * t) * t) * t) + b));
}
public static function easeOutInQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuint((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuint(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutInBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutBounce((t * 2), b, (c / 2), d, p_params));
};
return (easeInBounce(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((t)==d) ? (b + c) : (((c * 1.001) * (-(Math.pow(2, ((-10 * t) / d))) + 1)) + b));
}
public static function easeOutInBack(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutBack((t * 2), b, (c / 2), d, p_params));
};
return (easeInBack(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((t)==0) ? b : (((c * Math.pow(2, (10 * ((t / d) - 1)))) + b) - (c * 0.001)));
}
public static function easeInCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((((c * t) * t) * t) + b));
}
public static function easeInQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((((((c * t) * t) * t) * t) * t) + b));
}
public static function easeInOutCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((-(c) / 2) * (Math.sqrt((1 - (t * t))) - 1)) + b));
};
t = (t - 2);
return ((((c / 2) * (Math.sqrt((1 - (t * t))) + 1)) + b));
}
public static function easeInQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((c * t) * t) + b));
}
public static function easeInBounce(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((c - easeOutBounce((d - t), 0, c, d)) + b));
}
public static function easeOutInExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutExpo((t * 2), b, (c / 2), d, p_params));
};
return (easeInExpo(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((-(c) * ((((t * t) * t) * t) - 1)) + b));
}
public static function easeInSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return ((((-(c) * Math.cos(((t / d) * (Math.PI / 2)))) + c) + b));
}
public static function easeInOutQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return (((((((c / 2) * t) * t) * t) * t) + b));
};
t = (t - 2);
return ((((-(c) / 2) * ((((t * t) * t) * t) - 2)) + b));
}
public static function easeOutQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return ((((-(c) * t) * (t - 2)) + b));
}
public static function easeOutInElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutElastic((t * 2), b, (c / 2), d, p_params));
};
return (easeInElastic(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var p:Number;
var s:Number;
var a:Number;
if (t == 0){
return (b);
};
t = (t / d);
if (t == 1){
return ((b + c));
};
p = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * 0.3) : p_params.period;
a = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
--t;
return ((-(((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p)))) + b));
}
public static function easeOutCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * (((t * t) * t) + 1)) + b));
}
public static function easeOutQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * (((((t * t) * t) * t) * t) + 1)) + b));
}
public static function easeOutInQuad(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuad((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuad(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
return (((c * Math.sin(((t / d) * (Math.PI / 2)))) + b));
}
public static function easeInOutCubic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((((c / 2) * t) * t) * t) + b));
};
t = (t - 2);
return ((((c / 2) * (((t * t) * t) + 2)) + b));
}
public static function easeInOutQuint(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / (d / 2));
if (t < 1){
return ((((((((c / 2) * t) * t) * t) * t) * t) + b));
};
t = (t - 2);
return ((((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b));
}
public static function easeInCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = (t / d);
return (((-(c) * (Math.sqrt((1 - (t * t))) - 1)) + b));
}
public static function easeOutInSine(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutSine((t * 2), b, (c / 2), d, p_params));
};
return (easeInSine(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeInOutExpo(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t == 0){
return (b);
};
if (t == d){
return ((b + c));
};
t = (t / (d / 2));
if (t < 1){
return (((((c / 2) * Math.pow(2, (10 * (t - 1)))) + b) - (c * 0.0005)));
};
--t;
return (((((c / 2) * 1.0005) * (-(Math.pow(2, (-10 * t))) + 2)) + b));
}
public static function easeOutElastic(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
var p:Number;
var s:Number;
var a:Number;
if (t == 0){
return (b);
};
t = (t / d);
if (t == 1){
return ((b + c));
};
p = (((!(Boolean(p_params))) || (isNaN(p_params.period)))) ? (d * 0.3) : p_params.period;
a = (((!(Boolean(p_params))) || (isNaN(p_params.amplitude)))) ? 0 : p_params.amplitude;
if (((!(Boolean(a))) || ((a < Math.abs(c))))){
a = c;
s = (p / 4);
} else {
s = ((p / (2 * Math.PI)) * Math.asin((c / a)));
};
return (((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p))) + c) + b));
}
public static function easeOutCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
t = ((t / d) - 1);
return (((c * Math.sqrt((1 - (t * t)))) + b));
}
public static function easeOutInQuart(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutQuart((t * 2), b, (c / 2), d, p_params));
};
return (easeInQuart(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
public static function easeOutInCirc(t:Number, b:Number, c:Number, d:Number, p_params:Object=null):Number{
if (t < (d / 2)){
return (easeOutCirc((t * 2), b, (c / 2), d, p_params));
};
return (easeInCirc(((t * 2) - d), (b + (c / 2)), (c / 2), d, p_params));
}
}
}//package caurina.transitions
Section 48
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var originalValueComplete:Object;
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var hasModifier:Boolean;
public var valueComplete:Number;
public var extra:Object;
public var valueStart:Number;
public var modifierFunction:Function;
public var arrayIndex:Number;
public function PropertyInfoObj(p_valueStart:Number, p_valueComplete:Number, p_originalValueComplete:Object, p_arrayIndex:Number, p_extra:Object, p_isSpecialProperty:Boolean, p_modifierFunction:Function, p_modifierParameters:Array){
super();
valueStart = p_valueStart;
valueComplete = p_valueComplete;
originalValueComplete = p_originalValueComplete;
arrayIndex = p_arrayIndex;
extra = p_extra;
isSpecialProperty = p_isSpecialProperty;
hasModifier = Boolean(p_modifierFunction);
modifierFunction = p_modifierFunction;
modifierParameters = p_modifierParameters;
}
public function toString():String{
var returnStr:String;
returnStr = "\n[PropertyInfoObj ";
returnStr = (returnStr + ("valueStart:" + String(valueStart)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("valueComplete:" + String(valueComplete)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("originalValueComplete:" + String(originalValueComplete)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("arrayIndex:" + String(arrayIndex)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("extra:" + String(extra)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("isSpecialProperty:" + String(isSpecialProperty)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("hasModifier:" + String(hasModifier)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("modifierFunction:" + String(modifierFunction)));
returnStr = (returnStr + ", ");
returnStr = (returnStr + ("modifierParameters:" + String(modifierParameters)));
returnStr = (returnStr + "]\n");
return (returnStr);
}
public function clone():PropertyInfoObj{
var nProperty:PropertyInfoObj;
nProperty = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (nProperty);
}
}
}//package caurina.transitions
Section 49
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var preProcess:Function;
public var setValue:Function;
public var getValue:Function;
public function SpecialProperty(p_getFunction:Function, p_setFunction:Function, p_parameters:Array=null, p_preProcessFunction:Function=null){
super();
getValue = p_getFunction;
setValue = p_setFunction;
parameters = p_parameters;
preProcess = p_preProcessFunction;
}
public function toString():String{
var value:String;
value = "";
value = (value + "[SpecialProperty ");
value = (value + ("getValue:" + String(getValue)));
value = (value + ", ");
value = (value + ("setValue:" + String(setValue)));
value = (value + ", ");
value = (value + ("parameters:" + String(parameters)));
value = (value + ", ");
value = (value + ("preProcess:" + String(preProcess)));
value = (value + "]");
return (value);
}
}
}//package caurina.transitions
Section 50
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(p_modifyFunction:Function, p_getFunction:Function){
super();
modifyValues = p_modifyFunction;
getValue = p_getFunction;
}
public function toString():String{
var value:String;
value = "";
value = (value + "[SpecialPropertyModifier ");
value = (value + ("modifyValues:" + String(modifyValues)));
value = (value + ", ");
value = (value + ("getValue:" + String(getValue)));
value = (value + "]");
return (value);
}
}
}//package caurina.transitions
Section 51
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(p_splitFunction:Function, p_parameters:Array){
super();
splitValues = p_splitFunction;
parameters = p_parameters;
}
public function toString():String{
var value:String;
value = "";
value = (value + "[SpecialPropertySplitter ");
value = (value + ("splitValues:" + String(splitValues)));
value = (value + ", ");
value = (value + ("parameters:" + String(parameters)));
value = (value + "]");
return (value);
}
}
}//package caurina.transitions
Section 52
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
public static var autoOverwrite:Boolean = true;
private static var _engineExists:Boolean = false;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyModifierList:Object;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
super();
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(p_name:String, p_modifyFunction:Function, p_getFunction:Function):void{
var spm:SpecialPropertyModifier;
if (!_inited){
init();
};
spm = new SpecialPropertyModifier(p_modifyFunction, p_getFunction);
_specialPropertyModifierList[p_name] = spm;
}
public static function registerSpecialProperty(p_name:String, p_getFunction:Function, p_setFunction:Function, p_parameters:Array=null, p_preProcessFunction:Function=null):void{
var sp:SpecialProperty;
if (!_inited){
init();
};
sp = new SpecialProperty(p_getFunction, p_setFunction, p_parameters, p_preProcessFunction);
_specialPropertyList[p_name] = sp;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var i:int;
if (_tweenList.length == 0){
return (false);
};
i = 0;
while (i < _tweenList.length) {
if ((((_tweenList[i] == undefined)) || (!(_tweenList[i].isPaused)))){
if (!updateTweenByIndex(i)){
removeTweenByIndex(i);
};
if (_tweenList[i] == null){
removeTweenByIndex(i, true);
i--;
};
};
i++;
};
return (true);
}
public static function addCaller(p_scopes:Object=null, p_parameters:Object=null):Boolean{
var i:Number;
var rScopes:Array;
var p_obj:Object;
var rTime:Number;
var rDelay:Number;
var rTransition:Function;
var nTween:TweenListObj;
var myT:Number;
var trans:String;
if (!Boolean(p_scopes)){
return (false);
};
if ((p_scopes is Array)){
rScopes = p_scopes.concat();
} else {
rScopes = [p_scopes];
};
p_obj = p_parameters;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
rTime = (isNaN(p_obj.time)) ? 0 : p_obj.time;
rDelay = (isNaN(p_obj.delay)) ? 0 : p_obj.delay;
if (typeof(p_obj.transition) == "string"){
trans = p_obj.transition.toLowerCase();
rTransition = _transitionList[trans];
} else {
rTransition = p_obj.transition;
};
if (!Boolean(rTransition)){
rTransition = _transitionList["easeoutexpo"];
};
i = 0;
while (i < rScopes.length) {
if (p_obj.useFrames == true){
nTween = new TweenListObj(rScopes[i], (_currentTimeFrame + (rDelay / _timeScale)), (_currentTimeFrame + ((rDelay + rTime) / _timeScale)), true, rTransition, p_obj.transitionParams);
} else {
nTween = new TweenListObj(rScopes[i], (_currentTime + ((rDelay * 1000) / _timeScale)), (_currentTime + (((rDelay * 1000) + (rTime * 1000)) / _timeScale)), false, rTransition, p_obj.transitionParams);
};
nTween.properties = null;
nTween.onStart = p_obj.onStart;
nTween.onUpdate = p_obj.onUpdate;
nTween.onComplete = p_obj.onComplete;
nTween.onOverwrite = p_obj.onOverwrite;
nTween.onStartParams = p_obj.onStartParams;
nTween.onUpdateParams = p_obj.onUpdateParams;
nTween.onCompleteParams = p_obj.onCompleteParams;
nTween.onOverwriteParams = p_obj.onOverwriteParams;
nTween.onStartScope = p_obj.onStartScope;
nTween.onUpdateScope = p_obj.onUpdateScope;
nTween.onCompleteScope = p_obj.onCompleteScope;
nTween.onOverwriteScope = p_obj.onOverwriteScope;
nTween.onErrorScope = p_obj.onErrorScope;
nTween.isCaller = true;
nTween.count = p_obj.count;
nTween.waitFrames = p_obj.waitFrames;
_tweenList.push(nTween);
if ((((rTime == 0)) && ((rDelay == 0)))){
myT = (_tweenList.length - 1);
updateTweenByIndex(myT);
removeTweenByIndex(myT);
};
i++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var paused:Boolean;
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
paused = false;
i = 0;
while (i < _tweenList.length) {
pauseTweenByIndex(i);
paused = true;
i++;
};
return (paused);
}
public static function removeTweens(p_scope:Object, ... _args):Boolean{
var properties:Array;
var i:uint;
var sps:SpecialPropertySplitter;
var specialProps:Array;
var j:uint;
properties = new Array();
i = 0;
while (i < _args.length) {
if ((((typeof(_args[i]) == "string")) && ((properties.indexOf(_args[i]) == -1)))){
if (_specialPropertySplitterList[_args[i]]){
sps = _specialPropertySplitterList[_args[i]];
specialProps = sps.splitValues(p_scope, null);
j = 0;
while (j < specialProps.length) {
properties.push(specialProps[j].name);
j++;
};
} else {
properties.push(_args[i]);
};
};
i++;
};
return (affectTweens(removeTweenByIndex, p_scope, properties));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function splitTweens(p_tween:Number, p_properties:Array):uint{
var originalTween:TweenListObj;
var newTween:TweenListObj;
var i:uint;
var pName:String;
var found:Boolean;
originalTween = _tweenList[p_tween];
newTween = originalTween.clone(false);
i = 0;
while (i < p_properties.length) {
pName = p_properties[i];
if (Boolean(originalTween.properties[pName])){
originalTween.properties[pName] = undefined;
delete originalTween.properties[pName];
};
i++;
};
for (pName in newTween.properties) {
found = false;
i = 0;
while (i < p_properties.length) {
if (p_properties[i] == pName){
found = true;
break;
};
i++;
};
if (!found){
newTween.properties[pName] = undefined;
delete newTween.properties[pName];
};
};
_tweenList.push(newTween);
return ((_tweenList.length - 1));
}
public static function resumeTweenByIndex(p_tween:Number):Boolean{
var tTweening:TweenListObj;
var cTime:Number;
tTweening = _tweenList[p_tween];
if ((((tTweening == null)) || (!(tTweening.isPaused)))){
return (false);
};
cTime = getCurrentTweeningTime(tTweening);
tTweening.timeStart = (tTweening.timeStart + (cTime - tTweening.timePaused));
tTweening.timeComplete = (tTweening.timeComplete + (cTime - tTweening.timePaused));
tTweening.timePaused = undefined;
tTweening.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.33.74");
}
public static function onEnterFrame(e:Event):void{
var hasUpdated:Boolean;
updateTime();
updateFrame();
hasUpdated = false;
hasUpdated = updateTweens();
if (!hasUpdated){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(i:Number):Boolean{
var tTweening:TweenListObj;
var isOver:Boolean;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var cTime:Number;
var tProperty:Object;
var pv:Number;
var i = i;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
isOver = false;
cTime = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
//unresolved if
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
continue;
var _slot1 = e1;
handleError(tTweening, _slot1, "onUpdate");
};
} while (tTweening.timesCalled++, !(tTweening.timesCalled >= tTweening.count));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
//unresolved jump
var _slot1 = e2;
handleError(tTweening, _slot1, "onStart");
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
//unresolved jump
var _slot1 = e3;
handleError(tTweening, _slot1, "onUpdate");
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
//unresolved jump
var _slot1 = e4;
handleError(tTweening, _slot1, "onComplete");
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(p_time:Number):void{
var i:Number;
var cTime:Number;
if (isNaN(p_time)){
p_time = 1;
};
if (p_time < 1E-5){
p_time = 1E-5;
};
if (p_time != _timeScale){
if (_tweenList != null){
i = 0;
while (i < _tweenList.length) {
cTime = getCurrentTweeningTime(_tweenList[i]);
_tweenList[i].timeStart = (cTime - (((cTime - _tweenList[i].timeStart) * _timeScale) / p_time));
_tweenList[i].timeComplete = (cTime - (((cTime - _tweenList[i].timeComplete) * _timeScale) / p_time));
if (_tweenList[i].timePaused != undefined){
_tweenList[i].timePaused = (cTime - (((cTime - _tweenList[i].timePaused) * _timeScale) / p_time));
};
i++;
};
};
_timeScale = p_time;
};
}
public static function resumeAllTweens():Boolean{
var resumed:Boolean;
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
resumed = false;
i = 0;
while (i < _tweenList.length) {
resumeTweenByIndex(i);
resumed = true;
i++;
};
return (resumed);
}
private static function handleError(pTweening:TweenListObj, pError:Error, pCallBackName:String):void{
var eventScope:Object;
var pTweening = pTweening;
var pError = pError;
var pCallBackName = pCallBackName;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
//unresolved jump
var _slot1 = metaError;
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + _slot1.getStackTrace()));
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var removed:Boolean;
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
removed = false;
i = 0;
while (i < _tweenList.length) {
removeTweenByIndex(i);
removed = true;
i++;
};
return (removed);
}
public static function addTween(p_scopes:Object=null, p_parameters:Object=null):Boolean{
var i:Number;
var j:Number;
var istr:String;
var rScopes:Array;
var p_obj:Object;
var rTime:Number;
var rDelay:Number;
var rProperties:Array;
var restrictedWords:Object;
var modifiedProperties:Object;
var rTransition:Function;
var nProperties:Object;
var nTween:TweenListObj;
var myT:Number;
var splitProperties:Array;
var splitProperties2:Array;
var tempModifiedProperties:Array;
var trans:String;
if (!Boolean(p_scopes)){
return (false);
};
if ((p_scopes is Array)){
rScopes = p_scopes.concat();
} else {
rScopes = [p_scopes];
};
p_obj = TweenListObj.makePropertiesChain(p_parameters);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
rTime = (isNaN(p_obj.time)) ? 0 : p_obj.time;
rDelay = (isNaN(p_obj.delay)) ? 0 : p_obj.delay;
rProperties = new Array();
restrictedWords = {overwrite:true, time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
modifiedProperties = new Object();
for (istr in p_obj) {
if (!restrictedWords[istr]){
if (_specialPropertySplitterList[istr]){
splitProperties = _specialPropertySplitterList[istr].splitValues(p_obj[istr], _specialPropertySplitterList[istr].parameters);
i = 0;
while (i < splitProperties.length) {
if (_specialPropertySplitterList[splitProperties[i].name]){
splitProperties2 = _specialPropertySplitterList[splitProperties[i].name].splitValues(splitProperties[i].value, _specialPropertySplitterList[splitProperties[i].name].parameters);
j = 0;
while (j < splitProperties2.length) {
rProperties[splitProperties2[j].name] = {valueStart:undefined, valueComplete:splitProperties2[j].value, arrayIndex:splitProperties2[j].arrayIndex, isSpecialProperty:false};
j++;
};
} else {
rProperties[splitProperties[i].name] = {valueStart:undefined, valueComplete:splitProperties[i].value, arrayIndex:splitProperties[i].arrayIndex, isSpecialProperty:false};
};
i++;
};
} else {
if (_specialPropertyModifierList[istr] != undefined){
tempModifiedProperties = _specialPropertyModifierList[istr].modifyValues(p_obj[istr]);
i = 0;
while (i < tempModifiedProperties.length) {
modifiedProperties[tempModifiedProperties[i].name] = {modifierParameters:tempModifiedProperties[i].parameters, modifierFunction:_specialPropertyModifierList[istr].getValue};
i++;
};
} else {
rProperties[istr] = {valueStart:undefined, valueComplete:p_obj[istr]};
};
};
};
};
for (istr in rProperties) {
if (_specialPropertyList[istr] != undefined){
rProperties[istr].isSpecialProperty = true;
} else {
if (rScopes[0][istr] == undefined){
printError((((("The property '" + istr) + "' doesn't seem to be a normal object property of ") + String(rScopes[0])) + " or a registered special property."));
};
};
};
for (istr in modifiedProperties) {
if (rProperties[istr] != undefined){
rProperties[istr].modifierParameters = modifiedProperties[istr].modifierParameters;
rProperties[istr].modifierFunction = modifiedProperties[istr].modifierFunction;
};
};
if (typeof(p_obj.transition) == "string"){
trans = p_obj.transition.toLowerCase();
rTransition = _transitionList[trans];
} else {
rTransition = p_obj.transition;
};
if (!Boolean(rTransition)){
rTransition = _transitionList["easeoutexpo"];
};
i = 0;
while (i < rScopes.length) {
nProperties = new Object();
for (istr in rProperties) {
nProperties[istr] = new PropertyInfoObj(rProperties[istr].valueStart, rProperties[istr].valueComplete, rProperties[istr].valueComplete, rProperties[istr].arrayIndex, {}, rProperties[istr].isSpecialProperty, rProperties[istr].modifierFunction, rProperties[istr].modifierParameters);
};
if (p_obj.useFrames == true){
nTween = new TweenListObj(rScopes[i], (_currentTimeFrame + (rDelay / _timeScale)), (_currentTimeFrame + ((rDelay + rTime) / _timeScale)), true, rTransition, p_obj.transitionParams);
} else {
nTween = new TweenListObj(rScopes[i], (_currentTime + ((rDelay * 1000) / _timeScale)), (_currentTime + (((rDelay * 1000) + (rTime * 1000)) / _timeScale)), false, rTransition, p_obj.transitionParams);
};
nTween.properties = nProperties;
nTween.onStart = p_obj.onStart;
nTween.onUpdate = p_obj.onUpdate;
nTween.onComplete = p_obj.onComplete;
nTween.onOverwrite = p_obj.onOverwrite;
nTween.onError = p_obj.onError;
nTween.onStartParams = p_obj.onStartParams;
nTween.onUpdateParams = p_obj.onUpdateParams;
nTween.onCompleteParams = p_obj.onCompleteParams;
nTween.onOverwriteParams = p_obj.onOverwriteParams;
nTween.onStartScope = p_obj.onStartScope;
nTween.onUpdateScope = p_obj.onUpdateScope;
nTween.onCompleteScope = p_obj.onCompleteScope;
nTween.onOverwriteScope = p_obj.onOverwriteScope;
nTween.onErrorScope = p_obj.onErrorScope;
nTween.rounded = p_obj.rounded;
nTween.skipUpdates = p_obj.skipUpdates;
if (((p_obj.overwrite == undefined)) ? autoOverwrite : p_obj.overwrite){
removeTweensByTime(nTween.scope, nTween.properties, nTween.timeStart, nTween.timeComplete);
};
_tweenList.push(nTween);
if ((((rTime == 0)) && ((rDelay == 0)))){
myT = (_tweenList.length - 1);
updateTweenByIndex(myT);
removeTweenByIndex(myT);
};
i++;
};
return (true);
}
public static function registerTransition(p_name:String, p_function:Function):void{
if (!_inited){
init();
};
_transitionList[p_name] = p_function;
}
public static function printError(p_message:String):void{
trace(("## [Tweener] Error: " + p_message));
}
private static function affectTweens(p_affectFunction:Function, p_scope:Object, p_properties:Array):Boolean{
var affected:Boolean;
var i:uint;
var affectedProperties:Array;
var j:uint;
var objectProperties:uint;
var slicedTweenIndex:uint;
affected = false;
if (!Boolean(_tweenList)){
return (false);
};
i = 0;
while (i < _tweenList.length) {
if (((_tweenList[i]) && ((_tweenList[i].scope == p_scope)))){
if (p_properties.length == 0){
p_affectFunction(i);
affected = true;
} else {
affectedProperties = new Array();
j = 0;
while (j < p_properties.length) {
if (Boolean(_tweenList[i].properties[p_properties[j]])){
affectedProperties.push(p_properties[j]);
};
j++;
};
if (affectedProperties.length > 0){
objectProperties = AuxFunctions.getObjectLength(_tweenList[i].properties);
if (objectProperties == affectedProperties.length){
p_affectFunction(i);
affected = true;
} else {
slicedTweenIndex = splitTweens(i, affectedProperties);
p_affectFunction(slicedTweenIndex);
affected = true;
};
};
};
};
i++;
};
return (affected);
}
public static function getTweens(p_scope:Object):Array{
var i:uint;
var pName:String;
var tList:Array;
if (!Boolean(_tweenList)){
return ([]);
};
tList = new Array();
i = 0;
while (i < _tweenList.length) {
if (((Boolean(_tweenList[i])) && ((_tweenList[i].scope == p_scope)))){
for (pName in _tweenList[i].properties) {
tList.push(pName);
};
};
i++;
};
return (tList);
}
public static function isTweening(p_scope:Object):Boolean{
var i:uint;
if (!Boolean(_tweenList)){
return (false);
};
i = 0;
while (i < _tweenList.length) {
if (((Boolean(_tweenList[i])) && ((_tweenList[i].scope == p_scope)))){
return (true);
};
i++;
};
return (false);
}
public static function pauseTweenByIndex(p_tween:Number):Boolean{
var tTweening:TweenListObj;
tTweening = _tweenList[p_tween];
if ((((tTweening == null)) || (tTweening.isPaused))){
return (false);
};
tTweening.timePaused = getCurrentTweeningTime(tTweening);
tTweening.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(p_tweening:Object):Number{
return ((p_tweening.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(p_scope:Object):Number{
var i:uint;
var c:Number;
if (!Boolean(_tweenList)){
return (0);
};
c = 0;
i = 0;
while (i < _tweenList.length) {
if (((Boolean(_tweenList[i])) && ((_tweenList[i].scope == p_scope)))){
c = (c + AuxFunctions.getObjectLength(_tweenList[i].properties));
};
i++;
};
return (c);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(p_scope:Object, p_properties:Object, p_timeStart:Number, p_timeComplete:Number):Boolean{
var removed:Boolean;
var removedLocally:Boolean;
var i:uint;
var tl:uint;
var pName:String;
var eventScope:Object;
var p_scope = p_scope;
var p_properties = p_properties;
var p_timeStart = p_timeStart;
var p_timeComplete = p_timeComplete;
removed = false;
tl = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
//unresolved jump
var _slot1 = e;
handleError(_tweenList[i], _slot1, "onOverwrite");
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(p_name:String, p_splitFunction:Function, p_parameters:Array=null):void{
var sps:SpecialPropertySplitter;
if (!_inited){
init();
};
sps = new SpecialPropertySplitter(p_splitFunction, p_parameters);
_specialPropertySplitterList[p_name] = sps;
}
public static function removeTweenByIndex(i:Number, p_finalRemoval:Boolean=false):Boolean{
_tweenList[i] = null;
if (p_finalRemoval){
_tweenList.splice(i, 1);
};
return (true);
}
public static function resumeTweens(p_scope:Object, ... _args):Boolean{
var properties:Array;
var i:uint;
properties = new Array();
i = 0;
while (i < _args.length) {
if ((((typeof(_args[i]) == "string")) && ((properties.indexOf(_args[i]) == -1)))){
properties.push(_args[i]);
};
i++;
};
return (affectTweens(resumeTweenByIndex, p_scope, properties));
}
public static function pauseTweens(p_scope:Object, ... _args):Boolean{
var properties:Array;
var i:uint;
properties = new Array();
i = 0;
while (i < _args.length) {
if ((((typeof(_args[i]) == "string")) && ((properties.indexOf(_args[i]) == -1)))){
properties.push(_args[i]);
};
i++;
};
return (affectTweens(pauseTweenByIndex, p_scope, properties));
}
}
}//package caurina.transitions
Section 53
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var onUpdate:Function;
public var useFrames:Boolean;
public var hasStarted:Boolean;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var count:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var transition:Function;
public var timePaused:Number;
public var onCompleteParams:Array;
public var timesCalled:Number;
public var isCaller:Boolean;
public var onError:Function;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(p_scope:Object, p_timeStart:Number, p_timeComplete:Number, p_useFrames:Boolean, p_transition:Function, p_transitionParams:Object){
super();
scope = p_scope;
timeStart = p_timeStart;
timeComplete = p_timeComplete;
useFrames = p_useFrames;
transition = p_transition;
transitionParams = p_transitionParams;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(omitEvents:Boolean):TweenListObj{
var nTween:TweenListObj;
var pName:String;
nTween = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
nTween.properties = new Array();
for (pName in properties) {
nTween.properties[pName] = properties[pName].clone();
};
nTween.skipUpdates = skipUpdates;
nTween.updatesSkipped = updatesSkipped;
if (!omitEvents){
nTween.onStart = onStart;
nTween.onUpdate = onUpdate;
nTween.onComplete = onComplete;
nTween.onOverwrite = onOverwrite;
nTween.onError = onError;
nTween.onStartParams = onStartParams;
nTween.onUpdateParams = onUpdateParams;
nTween.onCompleteParams = onCompleteParams;
nTween.onOverwriteParams = onOverwriteParams;
nTween.onStartScope = onStartScope;
nTween.onUpdateScope = onUpdateScope;
nTween.onCompleteScope = onCompleteScope;
nTween.onOverwriteScope = onOverwriteScope;
nTween.onErrorScope = onErrorScope;
};
nTween.rounded = rounded;
nTween.isPaused = isPaused;
nTween.timePaused = timePaused;
nTween.isCaller = isCaller;
nTween.count = count;
nTween.timesCalled = timesCalled;
nTween.waitFrames = waitFrames;
nTween.hasStarted = hasStarted;
return (nTween);
}
public function toString():String{
var returnStr:String;
var isFirst:Boolean;
var i:String;
returnStr = "\n[TweenListObj ";
returnStr = (returnStr + ("scope:" + String(scope)));
returnStr = (returnStr + ", properties:");
isFirst = true;
for (i in properties) {
if (!isFirst){
returnStr = (returnStr + ",");
};
returnStr = (returnStr + ("[name:" + properties[i].name));
returnStr = (returnStr + (",valueStart:" + properties[i].valueStart));
returnStr = (returnStr + (",valueComplete:" + properties[i].valueComplete));
returnStr = (returnStr + "]");
isFirst = false;
};
returnStr = (returnStr + (", timeStart:" + String(timeStart)));
returnStr = (returnStr + (", timeComplete:" + String(timeComplete)));
returnStr = (returnStr + (", useFrames:" + String(useFrames)));
returnStr = (returnStr + (", transition:" + String(transition)));
returnStr = (returnStr + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
returnStr = (returnStr + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
returnStr = (returnStr + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
returnStr = (returnStr + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
returnStr = (returnStr + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
returnStr = (returnStr + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
returnStr = (returnStr + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
returnStr = (returnStr + (", onError:" + String(onError)));
};
if (onStartParams){
returnStr = (returnStr + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
returnStr = (returnStr + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
returnStr = (returnStr + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
returnStr = (returnStr + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
returnStr = (returnStr + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
returnStr = (returnStr + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
returnStr = (returnStr + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
returnStr = (returnStr + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
returnStr = (returnStr + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
returnStr = (returnStr + (", rounded:" + String(rounded)));
};
if (isPaused){
returnStr = (returnStr + (", isPaused:" + String(isPaused)));
};
if (timePaused){
returnStr = (returnStr + (", timePaused:" + String(timePaused)));
};
if (isCaller){
returnStr = (returnStr + (", isCaller:" + String(isCaller)));
};
if (count){
returnStr = (returnStr + (", count:" + String(count)));
};
if (timesCalled){
returnStr = (returnStr + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
returnStr = (returnStr + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
returnStr = (returnStr + (", hasStarted:" + String(hasStarted)));
};
returnStr = (returnStr + "]\n");
return (returnStr);
}
public static function makePropertiesChain(p_obj:Object):Object{
var baseObject:Object;
var chainedObject:Object;
var chain:Object;
var currChainObj:Object;
var len:Number;
var i:Number;
var k:Number;
baseObject = p_obj.base;
if (baseObject){
chainedObject = {};
if ((baseObject is Array)){
chain = [];
k = 0;
while (k < baseObject.length) {
chain.push(baseObject[k]);
k++;
};
} else {
chain = [baseObject];
};
chain.push(p_obj);
len = chain.length;
i = 0;
while (i < len) {
if (chain[i]["base"]){
currChainObj = AuxFunctions.concatObjects(makePropertiesChain(chain[i]["base"]), chain[i]);
} else {
currChainObj = chain[i];
};
chainedObject = AuxFunctions.concatObjects(chainedObject, currChainObj);
i++;
};
if (chainedObject["base"]){
delete chainedObject["base"];
};
return (chainedObject);
//unresolved jump
};
return (p_obj);
}
}
}//package caurina.transitions
Section 54
//Backgroundmc (Element.Backgroundmc)
package Element {
import flash.display.*;
import UserdefinedClass.*;
import flash.utils.*;
public class Backgroundmc extends MovieClip {
public var Floor:Sprite;
public var Far:Sprite;
public var backGroup:Array;
public var itemGroup:Array;
public var count:int;// = 0
public var Item:Sprite;
public var bgGroup2:Array;
public var bgGroup1:Array;
public var bg:MovieClip;
public var bgGroup3:Array;
public var Group:Array;
public var Starsp:Sprite;
public var passX:Number;// = 0
public var Bg:Sprite;
public var group:Array;
public var Cloud2:Sprite;
public var Cloud6:Sprite;
public var Cloud7:Sprite;
public var Cloud1:Sprite;
public var Cloud3:Sprite;
public var Cloud4:Sprite;
public var Cloud5:Sprite;
public var Cloud8:Sprite;
public var Cloud9:Sprite;
public var Blood:Sprite;
public var No:int;
public function Backgroundmc(Num:int){
var i:int;
bgGroup1 = new Array("BG1", "Far1", "Floor1", "Cloud", "Star");
bgGroup2 = new Array("BG2", "Far2", "Floor2", "Cloud", "Star");
bgGroup3 = new Array("BG3", "Far3", "Floor3", "Cloud", "Star");
itemGroup = new Array("Item21", "Item22", "Item23", "Item31");
Group = new Array(bgGroup1, bgGroup2, bgGroup3);
backGroup = new Array(Bg, Far, Item, Floor, Cloud1, Cloud2, Cloud3, Cloud4, Cloud5, Cloud6, Cloud7, Cloud8, Cloud9, Starsp, Blood);
passX = 0;
count = 0;
super();
No = Num;
group = new Array();
group = Group[No];
i = 0;
while (i < 15) {
backGroup[i] = new Sprite();
this.addChild(backGroup[i]);
if ((((i >= 4)) && ((i <= 12)))){
backGroup[i].y = (-800 - ((i - 4) * 630));
};
i++;
};
backGroup[0].y = -8520;
backGroup[13].y = -8520;
initmap();
}
public function newItem(Num:int, lv:int, x:Number=0, y:Number=0):Number{
var tempclass:*;
var tempmc:MovieClip;
tempclass = getDefinitionByName(itemGroup[Num]);
tempmc = (new (tempclass) as MovieClip);
backGroup[lv].addChild(tempmc);
tempmc.x = x;
tempmc.y = y;
return (tempmc.width);
}
public function runBg(speed:Number){
var tempMc:MovieClip;
var len:int;
var i:int;
tempMc = (backGroup[0].getChildAt(0) as MovieClip);
if (tempMc.x <= -(tempMc.width)){
backGroup[0].removeChildAt(0);
tempMc = (backGroup[0].getChildAt(1) as MovieClip);
newMC(0, 0, ((tempMc.x + tempMc.width) - 0.5));
};
len = backGroup[0].numChildren;
i = 0;
while (i < len) {
tempMc = (backGroup[0].getChildAt(i) as MovieClip);
tempMc.x = (tempMc.x - speed);
i++;
};
}
public function newMC(Num:int, Lv:int, x:Number=0, y:Number=0):Number{
var tempclass:*;
var tempmc:MovieClip;
tempclass = getDefinitionByName(group[Num]);
tempmc = (new (tempclass) as MovieClip);
backGroup[Lv].addChild(tempmc);
tempmc.x = x;
tempmc.y = y;
return (tempmc.width);
}
public function initmap(){
var templen:Number;
var i:int;
templen = 0;
templen = newMC(0, 0);
templen = newMC(0, 0, (templen - 0.5));
newMC(0, 0, (templen - 0.5));
templen = newMC(1, 1);
templen = newMC(1, 1, (templen - 0.5));
templen = newMC(2, 3);
templen = newMC(2, 3, (templen - 0.5));
newMC(2, 3, (templen - 0.5));
templen = newMC(4, 13);
newMC(4, 13, templen);
i = 0;
while (i < 9) {
templen = newMC(3, (i + 4));
newMC(3, (i + 4), templen);
i++;
};
}
public function runFloor(speed:Number){
var tempMc:MovieClip;
var len:int;
var i:int;
tempMc = (backGroup[3].getChildAt(0) as MovieClip);
if (tempMc.x <= -(tempMc.width)){
backGroup[3].removeChildAt(0);
tempMc = (backGroup[3].getChildAt(1) as MovieClip);
newMC(2, 3, ((tempMc.x + tempMc.width) - 0.5));
};
len = backGroup[3].numChildren;
i = 0;
while (i < len) {
tempMc = (backGroup[3].getChildAt(i) as MovieClip);
tempMc.x = (tempMc.x - speed);
i++;
};
}
public function runCloud(Num:int, speed:Number){
var tempMc:MovieClip;
var len:int;
var i:int;
tempMc = (backGroup[(Num + 4)].getChildAt(0) as MovieClip);
if (tempMc.x <= -(tempMc.width)){
backGroup[(Num + 4)].removeChildAt(0);
tempMc = (backGroup[(Num + 4)].getChildAt(0) as MovieClip);
newMC(3, (Num + 4), ((tempMc.x + tempMc.width) - 0.5));
};
len = backGroup[(Num + 4)].numChildren;
i = 0;
while (i < len) {
tempMc = (backGroup[(Num + 4)].getChildAt(i) as MovieClip);
tempMc.x = (tempMc.x - speed);
i++;
};
}
public function runItem(speed:Number){
var tempMc:MovieClip;
var len:int;
var i:int;
if (No == 0){
return;
};
builditem(int((2000 / speed)));
if (backGroup[2].numChildren){
tempMc = (backGroup[2].getChildAt(0) as MovieClip);
if (tempMc.x <= -(tempMc.width)){
backGroup[2].removeChildAt(0);
};
len = backGroup[2].numChildren;
i = 0;
while (i < len) {
tempMc = (backGroup[2].getChildAt(i) as MovieClip);
tempMc.x = (tempMc.x - speed);
i++;
};
};
}
public function runBlood(speed:Number){
var len:int;
var tempMc:MovieClip;
var i:int;
len = backGroup[14].numChildren;
if (len == 0){
return;
};
tempMc = (backGroup[14].getChildAt(0) as MovieClip);
if (tempMc.x <= -(tempMc.width)){
backGroup[14].removeChildAt(0);
};
len = backGroup[14].numChildren;
i = 0;
while (i < len) {
tempMc = (backGroup[14].getChildAt(i) as MovieClip);
tempMc.x = (tempMc.x - speed);
i++;
};
}
public function builditem(Num:int){
if (No == 1){
count++;
if (count >= Num){
count = 0;
newItem(MyMath.randRange(2), 2, 640);
};
};
if (No == 2){
count++;
if (count >= Num){
count = 0;
newItem(3, 2, 640);
};
};
}
public function runStar(speed:Number){
var tempMc:MovieClip;
var len:int;
var i:int;
tempMc = (backGroup[13].getChildAt(0) as MovieClip);
if (tempMc.x <= -(tempMc.width)){
backGroup[13].removeChildAt(0);
tempMc = (backGroup[13].getChildAt(0) as MovieClip);
newMC(4, 13, ((tempMc.x + tempMc.width) - 0.5));
};
len = backGroup[13].numChildren;
i = 0;
while (i < len) {
tempMc = (backGroup[13].getChildAt(i) as MovieClip);
tempMc.x = (tempMc.x - speed);
i++;
};
}
public function runFar(speed:Number){
var tempMc:MovieClip;
var len:int;
var i:int;
tempMc = (backGroup[1].getChildAt(0) as MovieClip);
if (tempMc.x <= -(tempMc.width)){
backGroup[1].removeChildAt(0);
tempMc = (backGroup[1].getChildAt(0) as MovieClip);
newMC(1, 1, ((tempMc.x + tempMc.width) - 0.5));
};
len = backGroup[1].numChildren;
i = 0;
while (i < len) {
tempMc = (backGroup[1].getChildAt(i) as MovieClip);
tempMc.x = (tempMc.x - speed);
i++;
};
}
public function updata(speed:Number){
passX = (passX + speed);
runBlood(speed);
runFar((speed * 0.8));
runFloor(speed);
runItem(speed);
runCloud(0, (speed * 0.7));
runCloud(1, (speed * 0.7));
runCloud(2, (speed * 0.6));
runCloud(3, (speed * 0.6));
runCloud(4, (speed * 0.5));
runCloud(5, (speed * 0.5));
runCloud(6, (speed * 0.4));
runCloud(7, (speed * 0.4));
runCloud(8, (speed * 0.3));
runStar((speed * 0.2));
}
}
}//package Element
Section 55
//Baseitem (Element.Baseitem)
package Element {
import flash.display.*;
public class Baseitem extends MovieClip {
public var firemc:MovieClip;
public var hitmc:MovieClip;
public var hit:MovieClip;
public var mc:MovieClip;
public var canhit:Boolean;// = true
public var rocket:MovieClip;
public var No:int;// = 0
public function Baseitem(){
No = 0;
canhit = true;
super();
inithit();
}
public function inithit(){
hitmc = (this.getChildByName("hit") as MovieClip);
}
}
}//package Element
Section 56
//Itemmc (Element.Itemmc)
package Element {
import flash.geom.*;
import flash.display.*;
import caurina.transitions.*;
import BaseClass.*;
import UserdefinedClass.*;
import flash.utils.*;
public class Itemmc extends MovieClip {
public var distance:int;// = 100
public var itemcount:Array;
public var Random:int;// = 2
public var count:int;// = 0
public var itemGroup:Array;
public var Statistic:Array;
public var airitem:Array;
public var passX:Number;// = 0
public var MaxItem:int;// = 3
public var group:Array;
public var landitem:Array;
public var main:BaseStage;
public function Itemmc(obj:BaseStage){
var i:int;
group = new Array("BBQitem", "Birditem", "Spadeitem", "Lrebounditem", "Arebounditem", "Eleitem", "Kiteitem", "Tackitem", "Banitem", "Moneyitem", "Ballitem", "Rubbishitem", "Sbomb", "Bbomb");
landitem = new Array("BBQitem", "Spadeitem", "Lrebounditem", "Eleitem", "Banitem", "Rubbishitem");
airitem = new Array("Birditem", "Arebounditem", "Kiteitem", "Moneyitem", "Ballitem", "Tackitem", "Sbomb", "Bbomb");
passX = 0;
count = 0;
itemGroup = new Array();
itemcount = new Array();
MaxItem = 3;
distance = 100;
Random = 2;
Statistic = new Array();
super();
main = obj;
i = 0;
while (i < 17) {
itemGroup.push(new Sprite());
this.addChild(itemGroup[i]);
itemGroup[i].y = (-480 * i);
itemcount.push(0);
i++;
};
}
public function newMC(Str:String, Lv:int, y:Number){
var tempclass:*;
var tempmc:MovieClip;
if (itemGroup[Lv].numChildren > MaxItem){
return;
};
tempclass = getDefinitionByName(Str);
tempmc = (new (tempclass) as MovieClip);
itemGroup[Lv].addChild(tempmc);
tempmc.x = 660;
tempmc.y = y;
(tempmc as Baseitem).No = (group.indexOf(Str) + 1);
}
public function newitemLv1(){
var len:int;
len = (landitem.length - 1);
len = MyMath.randRange(len);
newMC(landitem[len], 0, 0);
}
public function runItem(Lv:int, speed:Number){
var len:int;
var U:Boolean;
var tempMc:MovieClip;
var P:Point;
var i:int;
var WorkHitItem:Function;
var Lv = Lv;
var speed = speed;
WorkHitItem = function (up:Boolean){
var _local2:MovieClip;
var _local3 = main.StrArr;
var _local4 = (tempMc.No - 1);
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
switch (tempMc.No){
case 1:
SoundData.Effect[13].playsound(1);
main.bbqsuc();
main.mice.fire();
break;
case 2:
SoundData.Effect[12].playsound(1);
main.birdsuc();
main.mice.alpha = 0;
tempMc.gotoAndStop("die");
main.stopgame();
Tweener.addTween(tempMc, {x:(tempMc.x - 500), y:-200, time:3, transition:"easeInOutBack", onComplete:main.workmoney});
break;
case 3:
SoundData.Effect[0].playsound(1);
main.spadesuc();
main.mice.changeV(30, 20);
main.mice.randomFrame();
_local2 = new Fblood();
_local2.x = main.mice.x;
_local2.y = main.mice.y;
main.actor.addChild(_local2);
break;
case 4:
if (main.mice.Vy > 0){
} else {
SoundData.Effect[3].playsound(1);
main.reboundsuc();
tempMc.play();
main.mice.Vy = (main.mice.Vy * -1);
main.mice.randomFrame();
if (Math.abs(main.mice.Vy) < 30){
main.mice.changeV(5, 30);
} else {
main.mice.changeV(5, 0);
};
};
break;
case 5:
if (main.mice.Vy > 0){
} else {
SoundData.Effect[3].playsound(1);
main.reboundsuc();
tempMc.play();
main.mice.Vy = (main.mice.Vy * -1);
main.mice.randomFrame();
if (Math.abs(main.mice.Vy) < 20){
main.mice.changeV(5, 20);
} else {
main.mice.changeV(5, 0);
};
};
break;
case 6:
SoundData.Effect[4].playsound(1);
main.elesuc();
tempMc.gotoAndStop("die");
main.mice.electricity();
main.stopgame();
Tweener.addTween(main.mice, {delay:1, onComplete:main.workmoney});
break;
case 7:
SoundData.Effect[17].playsound(1);
tempMc.alpha = 0;
main.mice.fly();
break;
case 8:
SoundData.Effect[1].playsound(1);
main.tackitemsuc();
main.mice.alpha = 0;
tempMc.gotoAndStop("die");
main.stopgame();
Tweener.addTween(main.mice, {delay:1, onComplete:main.workmoney});
break;
case 9:
SoundData.Effect[8].playsound(1);
main.bansuc();
main.mice.changeV(10, 10);
main.mice.randomFrame();
break;
case 10:
SoundData.Effect[7].playsound(1);
tempMc.alpha = 0;
main.hitmoney++;
break;
case 11:
SoundData.Effect[14].playsound(1);
tempMc.play();
main.mice.changeV(2, 5);
break;
case 12:
SoundData.Effect[9].playsound(1);
main.rubbishsuc();
main.mice.alpha = 0;
tempMc.play();
main.stopgame();
Tweener.addTween(main.mice, {delay:1, onComplete:main.workmoney});
break;
case 13:
SoundData.Effect[11].playsound(1);
main.bombsuc();
tempMc.play();
if (main.mice.Vy > 0){
main.mice.Vy = (main.mice.Vy * -1);
main.mice.changeV(10, -20);
} else {
main.mice.Vy = (main.mice.Vy * -1);
main.mice.changeV(10, 20);
};
break;
case 14:
SoundData.Effect[2].playsound(1);
main.bombsuc();
tempMc.play();
if (main.mice.Vy > 0){
main.mice.Vy = (main.mice.Vy * -1);
main.mice.changeV(10, -40);
} else {
main.mice.Vy = (main.mice.Vy * -1);
main.mice.changeV(10, 40);
};
break;
};
};
len = itemGroup[Lv].numChildren;
if (len == 0){
return;
};
tempMc = (itemGroup[Lv].getChildAt(0) as MovieClip);
if (tempMc.x <= (-(tempMc.width) * 2)){
itemGroup[Lv].removeChildAt(0);
};
len = itemGroup[Lv].numChildren;
i = 0;
while (i < len) {
tempMc = (itemGroup[Lv].getChildAt(i) as MovieClip);
tempMc.x = (tempMc.x - speed);
if ((tempMc as Baseitem).No == 2){
tempMc.x = (tempMc.x - speed);
};
if ((tempMc as Baseitem).No == 3){
tempMc.x = (tempMc.x - speed);
};
if ((tempMc as Baseitem).canhit){
if (HitTest.complexHitTestObject(main.mice.hitmc, (tempMc as Baseitem).hitmc)){
(tempMc as Baseitem).canhit = false;
WorkHitItem(U);
};
};
i = (i + 1);
};
}
public function workcount(){
var ran:int;
var i:int;
if ((int(main.mice.len) - count) >= distance){
count = (count + distance);
ran = MyMath.randRange(Random);
if (ran != 0){
newitemLv1();
};
i = 1;
while (i < 17) {
ran = MyMath.randRange(Random);
if (ran == 1){
newitem(i);
};
i++;
};
};
}
public function newitem(Lv:int){
var len:int;
var tempNum:int;
len = (airitem.length - 1);
len = MyMath.randRange(len);
tempNum = MyMath.randRange(4);
if ((((len == 0)) || ((len == 5)))){
if (tempNum == 1){
newMC(airitem[len], Lv, MyMath.FrandRange(20, 410));
};
} else {
newMC(airitem[len], Lv, MyMath.FrandRange(20, 410));
};
}
public function updata(speed:Number){
var i:int;
i = 0;
while (i < 17) {
runItem(i, speed);
i++;
};
workcount();
}
}
}//package Element
Section 57
//Mice (Element.Mice)
package Element {
import flash.display.*;
import BaseClass.*;
import UserdefinedClass.*;
import flash.filters.*;
public class Mice extends MovieClip {
public var canspin:Boolean;// = true
public var rN:uint;// = 7
public var len:Number;// = 0
public var nowFrame:int;// = 0
public var flypowerx:Number;// = 0
public var firemc:MovieClip;
public var G:Number;// = 0.25
public var M:Number;// = 2.90666666666667
public var hitmc:MovieClip;
public var fireMc:MovieClip;
public var flypowery:Number;// = 0
public var flycount:int;// = 0
public var eN:uint;// = 5
public var fN:uint;// = 6
public var Angle:Number;
public var SecVx:Number;// = 0.1
public var rocket:MovieClip;
public var fireN:uint;// = 8
public var SecVy:Number;// = 0.1
public var Vy:Number;
public var Vx:Number;
public var way:int;// = 1
public var MaxVx:Number;// = 300
public var MaxVy:Number;// = 300
public var anglespeed:Number;
public var hit:MovieClip;
public var framestr:Array;
public var main:BaseStage;
public var dieN:uint;// = 4
public function Mice(obj:BaseStage=null, x0:Number=0, y0:Number=0, power:Number=0, angle:Number=45){
SecVx = 0.1;
SecVy = 0.1;
G = 0.25;
MaxVx = 300;
MaxVy = 300;
framestr = new Array("g1", "g2", "g3", "g4", "die", "e", "f", "r", "fire", "hua");
dieN = 4;
eN = 5;
fN = 6;
rN = 7;
fireN = 8;
nowFrame = 0;
len = 0;
M = (8720 / 3000);
flycount = 0;
flypowerx = 0;
flypowery = 0;
canspin = true;
way = 1;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
main = obj;
this.x = x0;
this.y = y0;
Angle = angle;
Vy = (power * Math.sin(((Angle * Math.PI) / 180)));
Vx = (Vy * 1.5);
anglespeed = (power * 0.5);
hitmc = (this.getChildByName("hit") as MovieClip);
fireMc = (this.getChildByName("firemc") as MovieClip);
}
public function setV(NumX:Number, NumY:Number){
Vx = NumX;
Vy = NumY;
}
public function fire(){
canspin = false;
this.rotation = 0;
jumpframe(8);
flycount = (60 * 3);
if ((Vy > 0)){
Vy = (Vy + 10);
} else {
Vy = (Vy - 10);
};
if ((Vx > 0)){
Vx = (Vx + 5);
} else {
Vx = (Vx - 5);
};
flypowery = 0;
flypowerx = 0;
fireMc.alpha = 1;
}
function frame3(){
stop();
}
public function workitemfly(){
if (flycount){
flycount--;
Vy = (Vy + flypowery);
Vx = (Vx + flypowerx);
if (flycount == 0){
fireMc.alpha = 0;
canspin = true;
randomFrame();
};
};
}
function frame5(){
stop();
}
public function randomFrame(){
var temp:Array;
if (flycount == 0){
temp = new Array(0, 1, 2, 3);
temp.splice(nowFrame, 1);
nowFrame = temp[MyMath.randRange(2)];
jumpframe(nowFrame);
};
}
function frame1(){
stop();
}
function frame11(){
stop();
}
function frame6(){
stop();
}
public function electricity(){
this.rotation = 0;
jumpframe(5);
}
public function onthrow(){
this.x = 320;
this.y = 240;
randomFrame();
Vx = 80;
Vy = 50;
this.alpha = 1;
}
function frame9(){
stop();
}
function frame4(){
stop();
}
public function die(){
this.rotation = 0;
Vx = 0;
Vy = 0;
jumpframe(4);
}
function frame8(){
stop();
}
function frame2(){
stop();
}
function frame7(){
stop();
}
public function workfiremc(){
var tempNum:Number;
tempNum = (((180 / Math.PI) * Math.atan((Vy / -(Vx)))) - 90);
fireMc.rotation = tempNum;
}
public function changeV(NumX:Number, NumY:Number){
Vx = (Vx + NumX);
Vy = (Vy + NumY);
}
public function fly(){
canspin = false;
this.rotation = 0;
jumpframe(6);
flycount = (60 * 3);
Vy = 0;
Vx = 0;
flypowery = 0.35;
flypowerx = 0.3;
}
public function workshake(){
var tempNum:Number;
var swing:int;
tempNum = totalV();
swing = (tempNum / 20);
way = (way * -1);
if (tempNum > 50){
this.filters = [new BlurFilter(2, 2, (swing * 2))];
} else {
this.filters = [new BlurFilter(2, 2, 0)];
};
}
function frame10(){
stop();
}
public function updata(){
if (Vx > MaxVx){
Vx = MaxVx;
};
if (Vy > MaxVy){
Vy = MaxVy;
};
Vy = (Vy - G);
len = (len + ((Vx / M) / 5));
workitemfly();
setrotation();
workfiremc();
}
public function bullet(power:Number){
if (Vy < 0){
Vy = (Vy * -0.2);
};
changeV((power / 5), power);
randomFrame();
}
public function totalV():Number{
return (Math.sqrt(((Vx * Vx) + (Vy * Vy))));
}
public function setrocket(Num:int){
canspin = false;
this.rotation = 0;
this.rocket.gotoAndStop(Num);
jumpframe(7);
flycount = (60 * 4);
Vy = 0;
flypowery = (0.3 + ((Num - 1) * 0.03));
flypowerx = (0.1 + ((Num - 1) * 0.2));
}
public function setrotation(){
if (canspin){
this.rotation = (this.rotation + anglespeed);
if (anglespeed >= 1.5){
anglespeed = (anglespeed - 0.5);
};
};
}
public function jumpframe(Num:uint){
this.gotoAndStop(framestr[Num]);
}
}
}//package Element
Section 58
//MyData (Element.MyData)
package Element {
public class MyData {
private var _succeed:Array;
private var _power:Number;
private var _rubbish:Number;
private var _Maxpower:Number;
public var addpowerlist:Array;
public var powerlist:Array;
private var _money:int;
private var _lasttime:Number;
private var _itemvalue:Array;
private var _moneyvalue:Array;
private var _maxlen:int;// = 0
private var _item:Array;
private var _bbq:Number;
public static var Str:Array = new Array("Hit\na\nbomb\none\ngame", "Hit\n5\nbombs\none\ngame", "Hit\n10\nbombs\none\ngame", "Hit\na\nbarbed\nnail", "Hit\n1\nwastebin", "Hit\n10\nwastebins", "Hit\n30\nwastebins", "Hit\n50\nwastebins", "Hit\na\nweeder\none\ngame", "Hit\n2\nweeders\none\ngame", "Hit\n3\nweeders\none\ngame", "Hit\n4\nweeders\none\ngame", "Hit\n1\noven", "Hit\n15\novens", "Hit\n40\novens", "Hit\n80\novens", "Hit\na\ntrampoline\none\ngame", "Hit\n3\ntrampolines\none\ngame", "Perfect\nhunting:\nHit\n20\ntimes", "Perfect\nhunting\n2:\nHit\n40\ntimes", "Hit\na\ngrid", "Hit\na\nbanana\nskin", "Air\ntime\n1\nminute", "Hit\na\neagle", "Reach\n2\nMiles", "Reach\n3\nMiles", "Reach\n4\nMiles", "Reach\n5\nMiles", "Flyer:\nHeight\nreach\n3000\nFoot", "Perfect\nhit");
public static var _instance:MyData;
public function MyData(){
var i:int;
_moneyvalue = new Array(1000, 2000, 3000, 5000, 8000, 0);
_itemvalue = new Array(15000, 25000, 35000, 100000, 2000, 10000, 20000, 10000);
_maxlen = 0;
powerlist = new Array(20, 30, 40, 50, 70, 100);
addpowerlist = new Array(0, 5, 10, 15, 25, 35);
super();
power = 0;
Maxpower = 0;
lasttime = 0;
money = 0;
rubbish = 0;
bbq = 0;
succeed = new Array();
item = new Array();
succeed = new Array();
i = 0;
while (i < 30) {
succeed.push(false);
i++;
};
item.push(-1);
i = 0;
while (i < 6) {
item.push(-1);
i++;
};
item[4] = -1;
item.push(0);
i = 0;
while (i < 3) {
item.push(1);
i++;
};
}
public function set money(value:int):void{
_money = value;
}
public function get power():Number{
return (_power);
}
public function set Maxpower(value:Number):void{
_Maxpower = value;
}
public function set power(value:Number):void{
_power = value;
}
public function set succeed(value:Array):void{
_succeed = value;
}
public function get item():Array{
return (_item);
}
public function set item(value:Array):void{
_item = value;
}
public function get maxlen():int{
return (_maxlen);
}
public function set rubbish(value:Number):void{
_rubbish = value;
}
public function get bbq():Number{
return (_bbq);
}
public function get itemvalue():Array{
return (_itemvalue);
}
public function get money():int{
return (_money);
}
public function get Maxpower():Number{
return (_Maxpower);
}
public function get succeed():Array{
return (_succeed);
}
public function set lasttime(value:Number):void{
_lasttime = value;
}
public function get moneyvalue():Array{
return (_moneyvalue);
}
public function get rubbish():Number{
return (_rubbish);
}
public function set bbq(value:Number):void{
_bbq = value;
}
public function get lasttime():Number{
return (_lasttime);
}
public function set moneyvalue(value:Array):void{
_moneyvalue = value;
}
public function set maxlen(value:int):void{
_maxlen = value;
}
public function set itemvalue(value:Array):void{
_itemvalue = value;
}
public static function getInstance():MyData{
if (_instance == null){
_instance = new (MyData);
};
return (_instance);
}
public static function clear(){
_instance = null;
}
}
}//package Element
Section 59
//SoundData (Element.SoundData)
package Element {
import UserdefinedClass.*;
public class SoundData {
public static var Auntygroup:Array = new Array("Smallhit", "Hardhit");
public static var BGMbool:Boolean = true;
public static var UI:Array = new Array();
public static var BGMgroup:Array = new Array("BGM1", "BGM2", "BGM3");
public static var Effectbool:Boolean = true;
public static var Aunty:Array = new Array();
public static var BGM:Array = new Array();
public static var UIgroup:Array = new Array("CoverBGM", "ShopBGM");
public static var HITgroup:Array = new Array("hitsd1", "hitsd2", "hitsd3", "hitsd4");
public static var Effectgroup:Array = new Array("sd1", "sd2", "sd3", "sd4", "sd5", "sd6", "sd7", "sd8", "sd9", "sd10", "sd11", "sd12", "sd13", "sd14", "sd15", "Glasssd", "sd16", "sd17", "sd18", "sd19", "sd20");
public static var Effect:Array = new Array();
public static var HIT:Array = new Array();
public function SoundData(){
super();
}
public static function setSound(S:Boolean){
var vol:int;
var len:int;
var i:int;
vol = (S) ? 1 : 0;
len = BGM.length;
i = 0;
while (i < len) {
BGM[i].setvolume(vol);
i++;
};
len = UI.length;
i = 0;
while (i < len) {
UI[i].setvolume(vol);
i++;
};
}
public static function setEffect(E:Boolean){
var vol:int;
var len:int;
var i:int;
vol = (E) ? 1 : 0;
len = HIT.length;
i = 0;
while (i < len) {
HIT[i].setvolume(vol);
i++;
};
len = Aunty.length;
i = 0;
while (i < len) {
Aunty[i].setvolume(vol);
i++;
};
len = Effect.length;
i = 0;
while (i < len) {
Effect[i].setvolume(vol);
i++;
};
}
public static function initsound(){
var len:int;
var i:int;
len = BGMgroup.length;
i = 0;
while (i < len) {
BGM.push(new BaseSound(BGMgroup[i]));
i++;
};
len = UIgroup.length;
i = 0;
while (i < len) {
UI.push(new BaseSound(UIgroup[i]));
i++;
};
len = HITgroup.length;
i = 0;
while (i < len) {
HIT.push(new BaseSound(HITgroup[i]));
i++;
};
len = Auntygroup.length;
i = 0;
while (i < len) {
Aunty.push(new BaseSound(Auntygroup[i]));
i++;
};
len = Effectgroup.length;
i = 0;
while (i < len) {
Effect.push(new BaseSound(Effectgroup[i]));
i++;
};
}
}
}//package Element
Section 60
//BaseSound (UserdefinedClass.BaseSound)
package UserdefinedClass {
import flash.media.*;
import flash.utils.*;
public class BaseSound {
public var sdTransform:SoundTransform;
public var sd:Sound;
public var sdChannel:SoundChannel;
public function BaseSound(soundclassname:String){
var soundclass:Object;
super();
soundclass = getDefinitionByName(soundclassname);
sd = (new (soundclass) as Sound);
sdChannel = new SoundChannel();
}
public function stopSound(){
if (sdChannel){
sdChannel.stop();
};
}
public function playsound(loop:int, st:Number=0){
sdChannel = sd.play(st, loop, sdTransform);
}
public function setvolume(volume:Number){
sdTransform = new SoundTransform();
sdTransform.volume = volume;
sdChannel.soundTransform = sdTransform;
}
}
}//package UserdefinedClass
Section 61
//BaseUI (UserdefinedClass.BaseUI)
package UserdefinedClass {
import flash.display.*;
public class BaseUI {
public static var uisp:Sprite = new Sprite();
public function BaseUI(){
super();
}
public static function setcargo(obj:MovieClip, num:int, str:String){
var temp:Array;
temp = MyMath.worknum(num);
(obj[(str + 0)] as MovieClip).gotoAndStop((temp[0] + 1));
(obj[(str + 1)] as MovieClip).gotoAndStop((temp[1] + 1));
}
public static function setWinHighScore(obj:MovieClip, Scorenum:int){
var Temp:Array;
var tempnum:Array;
var len:int;
var i:int;
Temp = new Array(obj.h0, obj.h1, obj.h2, obj.h3, obj.h4);
tempnum = MyMath.NumtoArray(Scorenum);
len = tempnum.length;
i = 0;
while (i < 5) {
if (i < len){
Temp[i].alpha = 1;
Temp[i].gotoAndStop((tempnum[i] + 1));
} else {
Temp[i].alpha = 0;
};
i++;
};
}
public static function setfloattime(Mc:MovieClip, S:Number){
var tempint:Array;
var tempdec:Array;
tempint = MyMath.worknum(int(S));
tempdec = MyMath.worknum(int(((S - int(S)) * 100)));
Mc.t2.gotoAndStop((tempint[0] + 1));
Mc.t3.gotoAndStop((tempint[1] + 1));
Mc.t0.gotoAndStop((tempdec[0] + 1));
Mc.t1.gotoAndStop((tempdec[1] + 1));
if (tempint[1] == 0){
Mc.t3.alpha = 0;
} else {
Mc.t3.alpha = 1;
};
if (tempdec[0] == 0){
Mc.t0.alpha = 0;
} else {
Mc.t0.alpha = 1;
};
}
public static function setlv(obj:MovieClip, num:int){
var temp:Array;
temp = MyMath.worknum(num);
(obj.lv0 as MovieClip).gotoAndStop((temp[0] + 1));
(obj.lv1 as MovieClip).gotoAndStop((temp[1] + 1));
}
public static function setP(Mc:MovieClip, val:int, max:int, str:String){
var tempP:Array;
var i:int;
tempP = new Array(Mc[str]["p1"], Mc[str]["p2"], Mc[str]["p3"], Mc[str]["p4"], Mc[str]["p5"], Mc[str]["p6"], Mc[str]["p7"], Mc[str]["p8"], Mc[str]["p9"], Mc[str]["p10"]);
i = 0;
while (i < 10) {
tempP[i].gotoAndStop(3);
if (i < max){
tempP[i].gotoAndStop(2);
};
if (i < val){
tempP[i].gotoAndStop(1);
};
i++;
};
}
public static function settime(Mc:MovieClip, num:int){
var timearr:Array;
var timemcname:Array;
var i:int;
timearr = MyMath.TimeFormat(num);
timemcname = new Array(Mc.t0, Mc.t1, Mc.t2, Mc.t3);
i = 0;
while (i < 4) {
(timemcname[i] as MovieClip).gotoAndStop((timearr[i] + 1));
i++;
};
}
public static function setMaxscore(Mc:MovieClip, val:int, str:String, Maxval:int){
var tempP:Array;
var i:int;
var tempnum:Array;
var len:int;
tempP = new Array();
i = 0;
while (i < Maxval) {
tempP.push(Mc[(str + i)]);
i++;
};
tempnum = MyMath.NumtoArray(val);
len = tempnum.length;
if (val == 0){
i = 0;
while (i < Maxval) {
tempP[i].alpha = 0;
i++;
};
tempP[0].alpha = 1;
return;
};
i = 0;
while (i < Maxval) {
if (i < len){
tempP[i].alpha = 1;
tempP[i].gotoAndStop((tempnum[i] + 1));
} else {
tempP[i].alpha = 0;
};
i++;
};
}
public static function setcombo(obj:MovieClip, num:int){
var temp:Array;
temp = MyMath.worknum(num);
(obj.c0 as MovieClip).alpha = 1;
if (num > 9){
(obj.c1 as MovieClip).alpha = 1;
} else {
(obj.c1 as MovieClip).alpha = 0;
};
(obj.c0 as MovieClip).gotoAndStop((temp[0] + 1));
(obj.c1 as MovieClip).gotoAndStop((temp[1] + 1));
}
public static function showscore(scnum:int, objname, Container:DisplayObjectContainer, x:Number, y:Number, size:Number=1, flushleft:Boolean=true){
var tempnum:Array;
var len:int;
var i:int;
var sc:MovieClip;
Clr.removeAllChildren(uisp);
tempnum = MyMath.NumtoArray(scnum, flushleft);
len = tempnum.length;
i = 0;
while (i < len) {
sc = (new (objname) as MovieClip);
sc.scaleX = (sc.scaleY = size);
sc.x = (sc.width * i);
if (!flushleft){
sc.x = (-(sc.width) * i);
};
sc.gotoAndStop((tempnum[i] + 1));
uisp.addChild(sc);
i++;
};
uisp.x = x;
uisp.y = y;
Container.addChild(uisp);
}
public static function setValue(obj:MovieClip, objname:String, frame:int){
obj[objname].gotoAndStop(frame);
}
public static function setScore(obj:MovieClip, Scorenum:int, str:String){
var Temp:Array;
var tempnum:Array;
var len:int;
var i:int;
Temp = new Array(obj[(str + "0")], obj[(str + "1")], obj[(str + "2")], obj[(str + "3")], obj[(str + "4")], obj[(str + "5")]);
tempnum = MyMath.NumtoArray(Scorenum);
len = tempnum.length;
i = 0;
while (i < 6) {
if (i < len){
Temp[i].alpha = 1;
Temp[i].gotoAndStop((tempnum[i] + 1));
} else {
Temp[i].alpha = 0;
};
i++;
};
}
public static function setWinScore(obj:MovieClip, Scorenum:int){
var Temp:Array;
var tempnum:Array;
var len:int;
var i:int;
Temp = new Array(obj.s0, obj.s1, obj.s2, obj.s3, obj.s4);
tempnum = MyMath.NumtoArray(Scorenum);
len = tempnum.length;
i = 0;
while (i < 5) {
if (i < len){
Temp[i].alpha = 1;
Temp[i].gotoAndStop((tempnum[i] + 1));
} else {
Temp[i].alpha = 0;
};
i++;
};
}
public static function setmax(Mc:MovieClip, val:int, max:int, str:String){
if ((max == val)){
Mc[str].gotoAndStop(2);
} else {
Mc[str].gotoAndStop(1);
};
}
public static function setalpha(alpha:Number, Mc:MovieClip, str:String, Max:int){
var tempP:Array;
var i:int;
tempP = new Array();
i = 0;
while (i < Max) {
tempP.push(Mc[(str + i)]);
i++;
};
i = 0;
while (i < Max) {
tempP[i].alpha = alpha;
i++;
};
}
public static function setnumval(Mc:MovieClip, val:int, str:String){
var tempmc:Array;
var i:int;
tempmc = new Array();
i = 1;
while (i < 11) {
tempmc.push(Mc[(str + i)]);
i++;
};
i = 0;
while (i < 10) {
if (i < val){
tempmc[i].gotoAndStop(1);
} else {
tempmc[i].gotoAndStop(2);
};
i++;
};
}
public static function setmoney(Mc:MovieClip, val:int, str:String, Maxval:int){
var tempP:Array;
var i:int;
var tempnum:Array;
var len:int;
tempP = new Array();
i = 0;
while (i < Maxval) {
tempP.push(Mc[(str + i)]);
i++;
};
tempnum = MyMath.NumtoArray(val, false);
len = tempnum.length;
if (val == 0){
i = 0;
while (i < Maxval) {
tempP[i].alpha = 0;
i++;
};
tempP[0].alpha = 1;
tempP[0].gotoAndStop(1);
return;
};
i = 0;
while (i < Maxval) {
if (i < len){
tempP[i].alpha = 1;
tempP[i].gotoAndStop((tempnum[i] + 1));
} else {
tempP[i].alpha = 0;
};
i++;
};
}
}
}//package UserdefinedClass
Section 62
//Clr (UserdefinedClass.Clr)
package UserdefinedClass {
import flash.display.*;
public class Clr {
public function Clr(){
super();
}
public static function removeAllChildren(container:DisplayObjectContainer):void{
var count:int;
var i:int;
count = container.numChildren;
i = 0;
while (i < count) {
container.removeChildAt(0);
i++;
};
}
}
}//package UserdefinedClass
Section 63
//HitTest (UserdefinedClass.HitTest)
package UserdefinedClass {
import flash.geom.*;
import flash.display.*;
public class HitTest {
public function HitTest(){
super();
}
public static function getDrawMatrix(target:DisplayObject, hitRectangle:Rectangle, accurracy:Number):Matrix{
var localToGlobal:Point;
var matrix:Matrix;
var rootConcatenatedMatrix:Matrix;
rootConcatenatedMatrix = target.root.transform.concatenatedMatrix;
localToGlobal = target.localToGlobal(new Point());
matrix = target.transform.concatenatedMatrix;
matrix.tx = (localToGlobal.x - hitRectangle.x);
matrix.ty = (localToGlobal.y - hitRectangle.y);
matrix.a = (matrix.a / rootConcatenatedMatrix.a);
matrix.d = (matrix.d / rootConcatenatedMatrix.d);
if (accurracy != 1){
matrix.scale(accurracy, accurracy);
};
return (matrix);
}
public static function complexHitTestObject(target1:DisplayObject, target2:DisplayObject, accurracy:Number=1):Boolean{
return (!((complexIntersectionRectangle(target1, target2, accurracy).width == 0)));
}
public static function complexIntersectionRectangle(target1:DisplayObject, target2:DisplayObject, accurracy:Number=1):Rectangle{
var hitRectangle:Rectangle;
var bitmapData:BitmapData;
var intersection:Rectangle;
if (accurracy <= 0){
throw (new Error("ArgumentError: Error 5001: Invalid value for accurracy", 5001));
};
if (!target1.hitTestObject(target2)){
return (new Rectangle());
};
hitRectangle = intersectionRectangle(target1, target2);
if (((((hitRectangle.width * accurracy) < 1)) || (((hitRectangle.height * accurracy) < 1)))){
return (new Rectangle());
};
bitmapData = new BitmapData((hitRectangle.width * accurracy), (hitRectangle.height * accurracy), false, 0);
bitmapData.draw(target1, HitTest.getDrawMatrix(target1, hitRectangle, accurracy), new ColorTransform(1, 1, 1, 1, 0xFF, -255, -255, 0xFF));
bitmapData.draw(target2, HitTest.getDrawMatrix(target2, hitRectangle, accurracy), new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0xFF), BlendMode.DIFFERENCE);
intersection = bitmapData.getColorBoundsRect(4294967295, 4278255615);
bitmapData.dispose();
if (accurracy != 1){
intersection.x = (intersection.x / accurracy);
intersection.y = (intersection.y / accurracy);
intersection.width = (intersection.width / accurracy);
intersection.height = (intersection.height / accurracy);
};
intersection.x = (intersection.x + hitRectangle.x);
intersection.y = (intersection.y + hitRectangle.y);
return (intersection);
}
public static function intersectionRectangle(target1:DisplayObject, target2:DisplayObject):Rectangle{
var bounds1:Rectangle;
var bounds2:Rectangle;
var intersection:Rectangle;
if (((((!(target1.root)) || (!(target2.root)))) || (!(target1.hitTestObject(target2))))){
return (new Rectangle());
};
bounds1 = target1.getBounds(target1.root);
bounds2 = target2.getBounds(target2.root);
intersection = new Rectangle();
intersection.x = Math.max(bounds1.x, bounds2.x);
intersection.y = Math.max(bounds1.y, bounds2.y);
intersection.width = Math.min(((bounds1.x + bounds1.width) - intersection.x), ((bounds2.x + bounds2.width) - intersection.x));
intersection.height = Math.min(((bounds1.y + bounds1.height) - intersection.y), ((bounds2.y + bounds2.height) - intersection.y));
return (intersection);
}
}
}//package UserdefinedClass
Section 64
//Input (UserdefinedClass.Input)
package UserdefinedClass {
import flash.display.*;
import flash.events.*;
public class Input {
public static var LEFT:uint = 39;
public static var P:uint = 80;
public static var X:uint = 88;
public static var Z:uint = 90;
public static var UP:uint = 38;
public static var key:Array = new Array();
public static var SHIFT:uint = 16;
public static var SPACE:uint = 32;
public static var sta:Stage;
public static var DOWN:uint = 40;
public static var RIGHT:uint = 37;
public function Input(){
super();
}
private static function onkeydown(e:KeyboardEvent):void{
key[e.keyCode] = true;
}
public static function removeinput(){
sta.removeEventListener(KeyboardEvent.KEY_UP, onkeyup);
sta.removeEventListener(KeyboardEvent.KEY_DOWN, onkeydown);
sta = null;
}
public static function addinput(_sta:Stage){
if (sta){
return;
};
sta = _sta;
sta.addEventListener(KeyboardEvent.KEY_UP, onkeyup);
sta.addEventListener(KeyboardEvent.KEY_DOWN, onkeydown);
}
public static function keydownrunfun(keynum:uint, fun:Function){
var f:Function;
f = fun;
((key[keynum]) && (f()));
}
public static function keyuprunfun(keynum:uint, fun:Function){
var f:Function;
f = fun;
if (key[keynum] == false){
f();
};
}
private static function onkeyup(e:KeyboardEvent):void{
key[e.keyCode] = false;
}
}
}//package UserdefinedClass
Section 65
//Mybutton (UserdefinedClass.Mybutton)
package UserdefinedClass {
import flash.display.*;
import flash.net.*;
public class Mybutton extends SimpleButton {
public var netobj:Object;
public function Mybutton(){
netobj = new Object();
super();
SoundControl.Mybtnground.push(this);
}
public function link(){
var req:URLRequest;
req = (netobj["req"] as URLRequest);
navigateToURL(req);
}
public function setlink(url:String){
netobj["req"] = new URLRequest(url);
}
}
}//package UserdefinedClass
Section 66
//MyMath (UserdefinedClass.MyMath)
package UserdefinedClass {
import flash.geom.*;
public class MyMath {
public function MyMath(){
super();
}
public static function LtoG(contain, child):Point{
var _loc_3:*;
var _loc_4:*;
_loc_3 = undefined;
_loc_4 = undefined;
_loc_3 = child.localToGlobal(new Point(0, 0));
_loc_4 = contain.globalToLocal(_loc_3);
return (new Point(_loc_4.x, _loc_4.y));
}
public static function FrandRange(min:Number, max:Number):Number{
var randomNum:Number;
randomNum = (int((Math.random() * ((max - min) + 1))) + min);
return (randomNum);
}
public static function TimeFormat(num:int):Array{
var minute:int;
var second:int;
var minutearr:Array;
var secondarr:Array;
if (num >= 6000){
num = 5999;
};
minute = (num / 60);
second = (num % 60);
minutearr = worknum(minute);
secondarr = worknum(second);
return (new Array(secondarr[0], secondarr[1], minutearr[0], minutearr[1]));
}
public static function ranRangeground(min:Number, max:Number, Num:int):Array{
var temp:Array;
var len:int;
var rearr:Array;
var _random:int;
var i:int;
temp = new Array();
len = ((max - min) + 1);
rearr = new Array();
i = 0;
while (i < len) {
temp.push((min + i));
i++;
};
while (Num) {
_random = randRange((len - 1));
rearr.push(temp[_random]);
temp.splice(_random, 1);
len--;
Num--;
};
return (rearr);
}
public static function randRange(max:Number):Number{
var randomNum:Number;
randomNum = int((Math.random() * (max + 1)));
return (randomNum);
}
public static function worknum(num:int):Array{
var ten:int;
var one:int;
ten = (num * 0.1);
one = (num % 10);
return (new Array(one, ten));
}
public static function NumtoArray(num:int, flushleft:Boolean=true):Array{
var str:String;
var len:int;
var i:int;
var array:Array;
str = String(num);
len = str.length;
i = 0;
array = new Array();
while (i < len) {
array.push(int(str.charAt(i)));
i++;
};
if (!flushleft){
array.reverse();
};
return (array);
}
}
}//package UserdefinedClass
Section 67
//MySave (UserdefinedClass.MySave)
package UserdefinedClass {
import flash.net.*;
public class MySave {
public static var shareobj:SharedObject;
public function MySave(){
super();
}
public static function init(savename:String){
shareobj = SharedObject.getLocal(savename);
}
public static function save(){
shareobj.flush();
}
public static function exist(varname:String):Boolean{
return (Boolean(((shareobj) && (shareobj.data[varname]))));
}
public static function getdata(varname:String){
return (shareobj.data[varname]);
}
public static function setdata(varname:String, vardata){
shareobj.data[varname] = vardata;
}
public static function clear(){
if (shareobj){
shareobj.clear();
};
}
public static function cleardata(varname:String){
shareobj.data[varname] = null;
delete shareobj.data[varname];
}
}
}//package UserdefinedClass
Section 68
//Mytext (UserdefinedClass.Mytext)
package UserdefinedClass {
import flash.display.*;
import flash.text.*;
public class Mytext extends MovieClip {
public var format:TextFormat;
private var mytext:TextField;
public function Mytext(size:int, str:String, font:String=null, w:Number=100, h:Number=100, color:Number=0xFFFFFF){
super();
mytext = new TextField();
format = new TextFormat();
format.color = color;
format.font = font;
format.size = size;
mytext.defaultTextFormat = format;
mytext.height = h;
mytext.width = w;
mytext.selectable = false;
mytext.wordWrap = true;
mytext.text = str;
addChild(mytext);
}
public function setstr(str:String){
mytext.text = str;
}
}
}//package UserdefinedClass
Section 69
//SoundControl (UserdefinedClass.SoundControl)
package UserdefinedClass {
import flash.media.*;
public class SoundControl {
public static var Mysdground:Array = new Array();
public static var Mybtnground:Array = new Array();
public static var buttonsound:Number = 1;
public function SoundControl(){
super();
}
public static function destorySdground(){
Mysdground = new Array();
}
public static function stopallsound(){
SoundMixer.stopAll();
}
public static function setsd(volume:Number){
var sdtransform:SoundTransform;
var i:*;
if (!Mysdground.length){
return;
};
sdtransform = new SoundTransform(volume);
for (i in Mysdground) {
(Mysdground[i] as BaseSound).sdChannel.soundTransform = sdtransform;
};
}
public static function destory(){
Mybtnground = new Array();
Mysdground = new Array();
}
public static function setbtnsound(volume:Number){
var sdtransform:SoundTransform;
var i:*;
if (!Mybtnground.length){
return;
};
sdtransform = new SoundTransform(volume);
for (i in Mybtnground) {
(Mybtnground[i] as Mybutton).soundTransform = sdtransform;
};
}
public static function setallsd(volume:Number){
var sdtransform:SoundTransform;
sdtransform = new SoundTransform();
sdtransform.volume = volume;
SoundMixer.soundTransform = sdtransform;
}
}
}//package UserdefinedClass
Section 70
//Arebounditem (Arebounditem)
package {
import Element.*;
public dynamic class Arebounditem extends Baseitem {
public function Arebounditem(){
super();
addFrameScript(0, frame1, 13, frame14);
}
function frame14(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 71
//Aunty (Aunty)
package {
import flash.display.*;
public dynamic class Aunty extends MovieClip {
public function Aunty(){
super();
addFrameScript(77, frame78);
}
function frame78(){
stop();
}
}
}//package
Section 72
//Ballitem (Ballitem)
package {
import Element.*;
public dynamic class Ballitem extends Baseitem {
public function Ballitem(){
super();
addFrameScript(0, frame1, 6, frame7);
}
function frame7(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 73
//Banitem (Banitem)
package {
import Element.*;
public dynamic class Banitem extends Baseitem {
public function Banitem(){
super();
}
}
}//package
Section 74
//Bbomb (Bbomb)
package {
import Element.*;
public dynamic class Bbomb extends Baseitem {
public function Bbomb(){
super();
addFrameScript(0, frame1, 46, frame47);
}
function frame1(){
stop();
}
function frame47(){
stop();
}
}
}//package
Section 75
//BBQitem (BBQitem)
package {
import Element.*;
public dynamic class BBQitem extends Baseitem {
public function BBQitem(){
super();
}
}
}//package
Section 76
//BG1 (BG1)
package {
import flash.display.*;
public dynamic class BG1 extends MovieClip {
public function BG1(){
super();
}
}
}//package
Section 77
//BG2 (BG2)
package {
import flash.display.*;
public dynamic class BG2 extends MovieClip {
public function BG2(){
super();
}
}
}//package
Section 78
//BG3 (BG3)
package {
import flash.display.*;
public dynamic class BG3 extends MovieClip {
public function BG3(){
super();
}
}
}//package
Section 79
//BGM1 (BGM1)
package {
import flash.media.*;
public dynamic class BGM1 extends Sound {
public function BGM1(){
super();
}
}
}//package
Section 80
//BGM2 (BGM2)
package {
import flash.media.*;
public dynamic class BGM2 extends Sound {
public function BGM2(){
super();
}
}
}//package
Section 81
//BGM3 (BGM3)
package {
import flash.media.*;
public dynamic class BGM3 extends Sound {
public function BGM3(){
super();
}
}
}//package
Section 82
//Birditem (Birditem)
package {
import Element.*;
public dynamic class Birditem extends Baseitem {
public function Birditem(){
super();
addFrameScript(22, frame23);
}
function frame23(){
gotoAndPlay(1);
}
}
}//package
Section 83
//Blood (Blood)
package {
import flash.display.*;
public dynamic class Blood extends MovieClip {
public function Blood(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 84
//Bullet (Bullet)
package {
import flash.display.*;
public dynamic class Bullet extends MovieClip {
public function Bullet(){
super();
}
}
}//package
Section 85
//Bulletitem (Bulletitem)
package {
import Element.*;
public dynamic class Bulletitem extends Baseitem {
public function Bulletitem(){
super();
}
}
}//package
Section 86
//Cannon (Cannon)
package {
import flash.display.*;
public dynamic class Cannon extends MovieClip {
public function Cannon(){
super();
}
}
}//package
Section 87
//Cg (Cg)
package {
import flash.display.*;
public dynamic class Cg extends MovieClip {
public var moregame_btn:SimpleButton;
public var next_btn:SimpleButton;
public function Cg(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 88
//Cloud (Cloud)
package {
import flash.display.*;
public dynamic class Cloud extends MovieClip {
public function Cloud(){
super();
}
}
}//package
Section 89
//Cover (Cover)
package {
import flash.display.*;
public dynamic class Cover extends MovieClip {
public var moregame_btn:SimpleButton;
public var freegame_btn:SimpleButton;
public var play_btn:SimpleButton;
public function Cover(){
super();
}
}
}//package
Section 90
//CoverBGM (CoverBGM)
package {
import flash.media.*;
public dynamic class CoverBGM extends Sound {
public function CoverBGM(){
super();
}
}
}//package
Section 91
//Eleitem (Eleitem)
package {
import Element.*;
public dynamic class Eleitem extends Baseitem {
public function Eleitem(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 92
//Endpoint (Endpoint)
package {
import flash.display.*;
public dynamic class Endpoint extends MovieClip {
public var l0:MovieClip;
public var l1:MovieClip;
public var l4:MovieClip;
public var l5:MovieClip;
public var l3:MovieClip;
public var l6:MovieClip;
public var l2:MovieClip;
public function Endpoint(){
super();
}
}
}//package
Section 93
//Far1 (Far1)
package {
import flash.display.*;
public dynamic class Far1 extends MovieClip {
public function Far1(){
super();
}
}
}//package
Section 94
//Far2 (Far2)
package {
import flash.display.*;
public dynamic class Far2 extends MovieClip {
public function Far2(){
super();
}
}
}//package
Section 95
//Far3 (Far3)
package {
import flash.display.*;
public dynamic class Far3 extends MovieClip {
public function Far3(){
super();
}
}
}//package
Section 96
//Fblood (Fblood)
package {
import flash.display.*;
public dynamic class Fblood extends MovieClip {
public function Fblood(){
super();
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package
Section 97
//Floor1 (Floor1)
package {
import flash.display.*;
public dynamic class Floor1 extends MovieClip {
public function Floor1(){
super();
}
}
}//package
Section 98
//Floor2 (Floor2)
package {
import flash.display.*;
public dynamic class Floor2 extends MovieClip {
public function Floor2(){
super();
}
}
}//package
Section 99
//Floor3 (Floor3)
package {
import flash.display.*;
public dynamic class Floor3 extends MovieClip {
public function Floor3(){
super();
}
}
}//package
Section 100
//Gameovermc (Gameovermc)
package {
import flash.display.*;
public dynamic class Gameovermc extends MovieClip {
public var moregame_btn:SimpleButton;
public var word:MovieClip;
public var retry_btn:SimpleButton;
public var m0:MovieClip;
public var m3:MovieClip;
public var m6:MovieClip;
public var m1:MovieClip;
public var m4:MovieClip;
public var m5:MovieClip;
public var m2:MovieClip;
public var w0:MovieClip;
public var w1:MovieClip;
public var w4:MovieClip;
public var w6:MovieClip;
public var w2:MovieClip;
public var shop_btn:SimpleButton;
public var w3:MovieClip;
public var w5:MovieClip;
public function Gameovermc(){
super();
}
}
}//package
Section 101
//Gamestart (Gamestart)
package {
import flash.display.*;
public dynamic class Gamestart extends MovieClip {
public var mouse:MovieClip;
public var aunty:MovieClip;
public var powerbar:MovieClip;
public function Gamestart(){
super();
addFrameScript(0, frame1, 33, frame34, 58, frame59, 75, frame76);
}
function frame76(){
stop();
}
function frame1(){
stop();
}
function frame34(){
stop();
}
function frame59(){
stop();
}
}
}//package
Section 102
//Gameui (Gameui)
package {
import flash.display.*;
public dynamic class Gameui extends MovieClip {
public var moregame_btn:SimpleButton;
public var bar:MovieClip;
public var l0:MovieClip;
public var l1:MovieClip;
public var l4:MovieClip;
public var l5:MovieClip;
public var l3:MovieClip;
public var l7:MovieClip;
public var l6:MovieClip;
public var music_btn:MovieClip;
public var l2:MovieClip;
public var effect_btn:MovieClip;
public var h1:MovieClip;
public var h2:MovieClip;
public var h4:MovieClip;
public var h0:MovieClip;
public var h3:MovieClip;
public var i1:MovieClip;
public var i2:MovieClip;
public var i3:MovieClip;
public function Gameui(){
super();
}
}
}//package
Section 103
//Glasssd (Glasssd)
package {
import flash.media.*;
public dynamic class Glasssd extends Sound {
public function Glasssd(){
super();
}
}
}//package
Section 104
//Hardhit (Hardhit)
package {
import flash.media.*;
public dynamic class Hardhit extends Sound {
public function Hardhit(){
super();
}
}
}//package
Section 105
//hitsd1 (hitsd1)
package {
import flash.media.*;
public dynamic class hitsd1 extends Sound {
public function hitsd1(){
super();
}
}
}//package
Section 106
//hitsd2 (hitsd2)
package {
import flash.media.*;
public dynamic class hitsd2 extends Sound {
public function hitsd2(){
super();
}
}
}//package
Section 107
//hitsd3 (hitsd3)
package {
import flash.media.*;
public dynamic class hitsd3 extends Sound {
public function hitsd3(){
super();
}
}
}//package
Section 108
//hitsd4 (hitsd4)
package {
import flash.media.*;
public dynamic class hitsd4 extends Sound {
public function hitsd4(){
super();
}
}
}//package
Section 109
//Howtoplay (Howtoplay)
package {
import flash.display.*;
public dynamic class Howtoplay extends MovieClip {
public var moregame_btn:SimpleButton;
public var next_btn:SimpleButton;
public function Howtoplay(){
super();
}
}
}//package
Section 110
//Item21 (Item21)
package {
import flash.display.*;
public dynamic class Item21 extends MovieClip {
public function Item21(){
super();
}
}
}//package
Section 111
//Item22 (Item22)
package {
import flash.display.*;
public dynamic class Item22 extends MovieClip {
public function Item22(){
super();
}
}
}//package
Section 112
//Item23 (Item23)
package {
import flash.display.*;
public dynamic class Item23 extends MovieClip {
public function Item23(){
super();
}
}
}//package
Section 113
//Item31 (Item31)
package {
import flash.display.*;
public dynamic class Item31 extends MovieClip {
public function Item31(){
super();
}
}
}//package
Section 114
//Kiteitem (Kiteitem)
package {
import Element.*;
public dynamic class Kiteitem extends Baseitem {
public function Kiteitem(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 115
//Lrebounditem (Lrebounditem)
package {
import Element.*;
public dynamic class Lrebounditem extends Baseitem {
public function Lrebounditem(){
super();
addFrameScript(0, frame1, 13, frame14);
}
function frame14(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 116
//Main (Main)
package {
import Element.*;
import flash.display.*;
import flash.events.*;
import caurina.transitions.*;
import BaseClass.*;
import UserdefinedClass.*;
import flash.net.*;
import flash.utils.*;
public class Main extends MovieClip {
public var gameui:MovieClip;
public var wordsize:int;// = 18
public var Game:Sprite;
public var Cue:Sprite;
public var Debug:Sprite;
public var EffectBool:Boolean;// = true
public var succeed:MovieClip;
public var gamestage:String;
public var cg:MovieClip;
public var howtoplay:MovieClip;
public var SoundBool:Boolean;// = true
public var GameClass:BaseStage;
public var URLstr:String;// = "http://www.freeaddictinggames.com/?utm_source=games&utm_medium=battheratpmg"
public var Ui:Sprite;
public var tempback:int;
public var delaytime:Timer;
public var Time:Timer;
public var shop:MovieClip;
public var tempgamestage:int;// = 0
public var Loading:Sprite;
public var sucGround:Array;
public var delayplay:Timer;
public var mydata:MyData;
public var shopstate:String;
public var cover:MovieClip;
public var gameovermc:MovieClip;
public function Main(){
SoundBool = true;
EffectBool = true;
tempgamestage = 0;
wordsize = 18;
URLstr = "http://www.freeaddictinggames.com/?utm_source=games&utm_medium=battheratpmg";
super();
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
public function setmoretime(Num:int){
gameui.i1.gotoAndStop(Num);
}
private function showCG(){
gamestage = "cg";
Clr.removeAllChildren(Ui);
Ui.addChild(cg);
}
private function showhowtoplay():void{
gamestage = "howtoplay";
Clr.removeAllChildren(Ui);
Ui.addChild(howtoplay);
}
public function savesucceed():void{
MySave.setdata("succeed", MyData.getInstance().succeed);
MySave.save();
}
public function delayrun(time:int, fun:Function){
Tweener.addTween(this, {delay:time, onComplete:fun});
}
private function showsuc(){
gamestage = "success";
Clr.removeAllChildren(Ui);
Ui.addChild(succeed);
updatasuc();
}
public function removedata(){
MySave.init("MouseKiller");
MySave.clear();
}
public function reattack():int{
return (MyData.getInstance().item[10]);
}
private function initUImc():void{
cover = new Cover();
howtoplay = new Howtoplay();
cg = new Cg();
succeed = new Succeed();
shop = new Shop();
gameui = new Gameui();
gameovermc = new Gameovermc();
initsuc();
}
private function setpage2(){
shopstate = "page2";
}
private function setpage1(){
shopstate = "page1";
}
public function setTime(T:int){
BaseUI.settime(gameui, T);
}
public function setlen(Num:int){
BaseUI.setMaxscore(gameui, Num, "l", 8);
}
public function savealldata(){
MySave.setdata("money", MyData.getInstance().money);
MySave.setdata("item", MyData.getInstance().item);
MySave.setdata("succeed", MyData.getInstance().succeed);
MySave.setdata("power", MyData.getInstance().power);
MySave.setdata("Maxpower", MyData.getInstance().Maxpower);
MySave.setdata("lasttime", MyData.getInstance().lasttime);
MySave.setdata("rubbish", MyData.getInstance().rubbish);
MySave.setdata("bbq", MyData.getInstance().bbq);
MySave.save();
}
private function onclickbtn(e:MouseEvent):void{
if (gamestage == "cover"){
if (hitbtn(cover.play_btn)){
loaddata();
showCG();
return;
};
if (hitbtn(cover.moregame_btn)){
navigateToURL(new URLRequest(URLstr));
return;
};
if (hitbtn(cover.freegame_btn)){
navigateToURL(new URLRequest(URLstr));
return;
};
};
if (gamestage == "cg"){
if (hitbtn(cg.moregame_btn)){
navigateToURL(new URLRequest(URLstr));
return;
};
if (hitbtn(cg.next_btn)){
if (cg.currentFrame == 1){
cg.nextFrame();
return;
};
cg.prevFrame();
showhowtoplay();
return;
};
};
if (gamestage == "shop"){
workshop();
return;
};
if (gamestage == "howtoplay"){
if (hitbtn(howtoplay.next_btn)){
initstage();
return;
};
if (hitbtn(howtoplay.moregame_btn)){
navigateToURL(new URLRequest(URLstr));
return;
};
};
if (gamestage == "success"){
if (hitbtn(succeed.back_btn)){
showshop();
return;
};
if (hitbtn(succeed.moregame_btn)){
navigateToURL(new URLRequest(URLstr));
return;
};
};
if (gamestage == "playing"){
if (hitbtn(gameui.moregame_btn)){
navigateToURL(new URLRequest(URLstr));
return;
};
if (hitbtn(gameui.music_btn)){
gameui.music_btn.gotoAndStop(((gameui.music_btn.currentFrame % 2) + 1));
if (SoundBool){
SoundBool = false;
} else {
SoundBool = true;
};
SoundData.setSound(SoundBool);
return;
};
if (hitbtn(gameui.effect_btn)){
gameui.effect_btn.gotoAndStop(((gameui.effect_btn.currentFrame % 2) + 1));
if (EffectBool){
EffectBool = false;
} else {
EffectBool = true;
};
SoundData.setEffect(EffectBool);
return;
};
if (hitbtn(gameui.i2)){
workgamerocket();
return;
};
if (hitbtn(gameui.i3)){
workcannon();
return;
};
};
if (gamestage == "over"){
if (hitbtn(gameovermc.retry_btn)){
GameClass.destory();
Clr.removeAllChildren(Game);
initstage();
return;
};
if (hitbtn(gameovermc.moregame_btn)){
navigateToURL(new URLRequest(URLstr));
return;
};
if (hitbtn(gameovermc.shop_btn)){
GameClass.destory();
Clr.removeAllChildren(Game);
SoundControl.stopallsound();
showshop();
return;
};
};
}
public function repower():int{
var tempNum:int;
var datanum:int;
tempNum = 0;
datanum = MyData.getInstance().item[8];
switch (datanum){
case 1:
tempNum = 51;
break;
case 2:
tempNum = 66;
break;
case 3:
tempNum = 81;
break;
case 4:
tempNum = 101;
break;
default:
break;
};
return (tempNum);
}
private function initdata():void{
gamestage = new String();
loaddata();
mydata = MyData.getInstance();
}
public function addmoney(Num:int){
if ((MyData.getInstance().money + Num) >= 9999999){
MyData.getInstance().money = 9999999;
} else {
MyData.getInstance().money = (MyData.getInstance().money + Num);
};
}
public function setarm(Num:int){
gameui.i2.gotoAndStop(Num);
}
private function resetshop(){
Tweener.removeAllTweens();
shop.page2.x = 638;
shopstate = "page1";
}
public function rerocket():int{
var tempNum:int;
var datanum:int;
var i:int;
tempNum = 0;
datanum = 0;
i = 0;
while (i < 3) {
datanum = MyData.getInstance().item[(i + 4)];
if (datanum == 1){
tempNum = i;
break;
} else {
tempNum = -1;
};
i++;
};
tempNum = (tempNum + 1);
if (tempNum < 2){
return ((tempNum + 1));
};
return ((tempNum * 2));
}
public function remoretime():int{
var tempNum:int;
tempNum = 0;
if (MyData.getInstance().item[7]){
tempNum = 2;
} else {
tempNum = 1;
};
return (tempNum);
}
private function showcover():void{
SoundControl.stopallsound();
SoundData.UI[0].playsound(10000000);
gamestage = "cover";
Clr.removeAllChildren(Ui);
Ui.addChild(cover);
}
private function initgame():void{
gamestage = "init";
addEventListener(MouseEvent.MOUSE_DOWN, onclickbtn);
addEventListener(Event.ENTER_FRAME, oncue);
Input.addinput(stage);
showcover();
}
public function sethigh(Num:int){
BaseUI.setMaxscore(gameui, Num, "h", 5);
}
private function init(e:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
initSound();
initdata();
initcontainer();
initUImc();
initgame();
stage.scaleMode = StageScaleMode.NO_SCALE;
}
public function workgamerocket(){
if (gameui.i2.currentFrame == 2){
GameClass.setrocket(1);
} else {
if (gameui.i2.currentFrame == 4){
GameClass.setrocket(2);
} else {
if (gameui.i2.currentFrame == 6){
GameClass.setrocket(3);
};
};
};
}
public function initgameUI(){
Ui.addChild(gameui);
setmoretime(remoretime());
if ((remoretime() == 1)){
GameClass.auntybool = false;
} else {
GameClass.auntybool = true;
};
setarm(rerocket());
setcannon(2);
setuibar(0);
}
public function workrocket():int{
if (MyData.getInstance().item[6] > 0){
return (5);
};
if (MyData.getInstance().item[5] > 0){
return (3);
};
if (MyData.getInstance().item[4] > 0){
return (1);
};
return (2);
}
private function initsuc(){
var i:int;
var j:int;
var tempMc:MovieClip;
sucGround = new Array();
i = 0;
while (i < 5) {
j = 0;
while (j < 6) {
tempMc = new Suc();
succeed.addChild(tempMc);
tempMc.x = (34 + (j * 74));
tempMc.y = (83 + (i * 74));
tempMc.gotoAndStop(31);
sucGround.push(tempMc);
j++;
};
i++;
};
}
private function updatashop(){
var tempPage1:Array;
var tempPage2:Array;
var btnPage2:Array;
var pagePoint:Array;
var moneyStr:Array;
var setMaxMc:Array;
var tempNum:int;
var i:int;
tempPage1 = new Array(shop.page1.i1, shop.page1.i2, shop.page1.i3, shop.page1.i4, shop.page1.i5, shop.page1.i6, shop.page1.i7, shop.page1.i8);
tempPage2 = new Array(shop.page2.power, shop.page2.effbar, shop.page2.powerbar);
btnPage2 = new Array(shop.page2.bug_btn, shop.page2.eff_btn, shop.page2.power_btn);
pagePoint = new Array(shop.page1.P1, shop.page2.P2);
BaseUI.setmoney(shop, MyData.getInstance().money, "m", 7);
moneyStr = new Array("b", "e", "po");
setMaxMc = new Array(shop.page2.a, shop.page2.b, shop.page2.c);
tempNum = 0;
i = 0;
while (i < 8) {
tempNum = MyData.getInstance().item[i];
if (tempNum == -1){
tempPage1[i].gotoAndStop(1);
} else {
if (tempNum == 0){
tempPage1[i].gotoAndStop(2);
} else {
tempPage1[i].gotoAndStop(3);
};
};
i++;
};
i = 0;
while (i < 3) {
tempNum = MyData.getInstance().item[(8 + i)];
tempPage2[i].gotoAndStop(tempNum);
BaseUI.setmoney(shop.page2, MyData.getInstance().moneyvalue[(tempNum - 1)], moneyStr[i], 4);
if (i == 0){
if (tempNum == 4){
btnPage2[0].alpha = 0;
setMaxMc[0].alpha = 0;
BaseUI.setalpha(0, shop.page2, moneyStr[0], 4);
};
} else {
if (tempNum == 6){
btnPage2[i].alpha = 0;
setMaxMc[i].alpha = 0;
BaseUI.setalpha(0, shop.page2, moneyStr[i], 4);
};
};
i++;
};
}
public function rearm():int{
var tempNum:int;
var datanum:int;
var i:int;
tempNum = 0;
datanum = 0;
i = 0;
while (i < 4) {
datanum = MyData.getInstance().item[i];
if (datanum == 1){
tempNum = i;
break;
} else {
tempNum = -1;
};
i++;
};
return ((tempNum + 2));
}
public function workcannon():void{
if (gameui.bar.currentFrame == 101){
GameClass.showtime();
};
}
public function savemoney():void{
MySave.setdata("money", MyData.getInstance().money);
MySave.save();
}
private function updatasuc():void{
var i:int;
i = 0;
while (i < 30) {
if (MyData.getInstance().succeed[i]){
sucGround[i].gotoAndStop((i + 1));
} else {
sucGround[i].gotoAndStop(31);
};
i++;
};
}
private function initcontainer():void{
Game = new Sprite();
Ui = new Sprite();
Loading = new Sprite();
Debug = new Sprite();
Cue = new Sprite();
addChild(Game);
addChild(Ui);
addChild(Cue);
addChild(Loading);
addChild(Debug);
}
private function showshop(){
SoundControl.stopallsound();
SoundData.UI[1].playsound(10000000);
gamestage = "shop";
Clr.removeAllChildren(Ui);
Ui.addChild(shop);
shopstate = "page1";
updatashop();
}
public function savelen():void{
MySave.setdata("maxlen", MyData.getInstance().maxlen);
MySave.save();
}
public function item2(bool:Boolean){
var tempnum:int;
tempnum = workrocket();
if (bool){
gameui.i2.gotoAndStop(tempnum);
} else {
gameui.i2.gotoAndStop((tempnum + 1));
};
}
public function item1(bool:Boolean){
if (bool){
gameui.i1.gotoAndStop(1);
} else {
gameui.i1.gotoAndStop(2);
};
}
private function workshop():void{
var tempPage1:Array;
var tempPage2:Array;
var btnPage2:Array;
var pagePoint:Array;
var moneyStr:Array;
var tempNum:int;
var i:int;
var tempNum1:int;
var j:int;
tempPage1 = new Array(shop.page1.i1, shop.page1.i2, shop.page1.i3, shop.page1.i4, shop.page1.i5, shop.page1.i6, shop.page1.i7, shop.page1.i8);
tempPage2 = new Array(shop.page2.power, shop.page2.effbar, shop.page2.powerbar);
btnPage2 = new Array(shop.page2.bug_btn, shop.page2.eff_btn, shop.page2.power_btn);
pagePoint = new Array(shop.page1.P1, shop.page2.P2);
moneyStr = new Array("b", "e", "po");
tempNum = 0;
if (shopstate == "page1"){
i = 7;
while (i < 8) {
tempNum = MyData.getInstance().item[i];
if (tempNum == 0){
if (hitbtn(tempPage1[i])){
if (MyData.getInstance().money >= MyData.getInstance().itemvalue[i]){
MyData.getInstance().money = (MyData.getInstance().money - MyData.getInstance().itemvalue[i]);
MyData.getInstance().item[i] = 1;
if (((((!((i == 3))) && (!((i == 6))))) && (!((i == 7))))){
MyData.getInstance().item[(i + 1)] = 0;
};
savealldata();
updatashop();
};
};
};
i++;
};
tempNum1 = 0;
i = 0;
while (i < 4) {
tempNum = MyData.getInstance().item[i];
if (tempNum == -1){
if (hitbtn(tempPage1[i])){
if (MyData.getInstance().money >= MyData.getInstance().itemvalue[i]){
j = 0;
while (j < 4) {
tempNum1 = MyData.getInstance().item[j];
if (tempNum1 == 1){
MyData.getInstance().item[j] = 0;
};
j++;
};
MyData.getInstance().money = (MyData.getInstance().money - MyData.getInstance().itemvalue[i]);
MyData.getInstance().item[i] = 1;
savealldata();
updatashop();
};
};
} else {
if (tempNum == 0){
if (hitbtn(tempPage1[i])){
j = 0;
while (j < 4) {
tempNum1 = MyData.getInstance().item[j];
if (tempNum1 == 1){
MyData.getInstance().item[j] = 0;
};
j++;
};
MyData.getInstance().item[i] = 1;
savealldata();
updatashop();
};
};
};
i++;
};
i = 4;
while (i < 7) {
tempNum = MyData.getInstance().item[i];
if (tempNum == -1){
if (hitbtn(tempPage1[i])){
if (MyData.getInstance().money >= MyData.getInstance().itemvalue[i]){
j = 4;
while (j < 7) {
tempNum1 = MyData.getInstance().item[j];
if (tempNum1 == 1){
MyData.getInstance().item[j] = 0;
};
j++;
};
MyData.getInstance().money = (MyData.getInstance().money - MyData.getInstance().itemvalue[i]);
MyData.getInstance().item[i] = 1;
savealldata();
updatashop();
};
};
} else {
if (tempNum == 0){
if (hitbtn(tempPage1[i])){
j = 4;
while (j < 7) {
tempNum1 = MyData.getInstance().item[j];
if (tempNum1 == 1){
MyData.getInstance().item[j] = 0;
};
j++;
};
MyData.getInstance().item[i] = 1;
savealldata();
updatashop();
};
};
};
i++;
};
} else {
if (shopstate == "page2"){
i = 0;
while (i < 3) {
tempNum = MyData.getInstance().item[(8 + i)];
if (i == 0){
if (tempNum < 4){
if (hitbtn(btnPage2[0])){
if (MyData.getInstance().money >= MyData.getInstance().moneyvalue[(repowernum() - 1)]){
MyData.getInstance().money = (MyData.getInstance().money - MyData.getInstance().moneyvalue[(repowernum() - 1)]);
MyData.getInstance().item[8] = (MyData.getInstance().item[8] + 1);
savealldata();
updatashop();
};
};
};
} else {
if (tempNum < 6){
if (hitbtn(btnPage2[i])){
if (MyData.getInstance().money >= MyData.getInstance().moneyvalue[(MyData.getInstance().item[(8 + i)] - 1)]){
MyData.getInstance().money = (MyData.getInstance().money - MyData.getInstance().moneyvalue[(MyData.getInstance().item[(8 + i)] - 1)]);
MyData.getInstance().item[(8 + i)] = (MyData.getInstance().item[(8 + i)] + 1);
savealldata();
updatashop();
};
};
};
};
i++;
};
};
};
if (hitbtn(pagePoint[0])){
if (shopstate == "page1"){
shopstate = "move";
Tweener.addTween(shop.page2, {x:0, time:1, transition:"easeOutCubic", onComplete:setpage2});
};
return;
};
if (hitbtn(pagePoint[1])){
if (shopstate == "page2"){
shopstate = "move";
Tweener.addTween(shop.page2, {x:638, time:1, transition:"easeOutCubic", onComplete:setpage1});
};
return;
};
if (hitbtn(shop.ach_btn)){
showsuc();
resetshop();
return;
};
if (hitbtn(shop.moregame_btn)){
navigateToURL(new URLRequest(URLstr));
return;
};
if (hitbtn(shop.play_btn)){
resetshop();
initstage();
return;
};
}
public function item3(bool:Boolean){
if (bool){
gameui.i3.gotoAndStop(1);
} else {
gameui.i3.gotoAndStop(2);
};
}
private function loaddata():void{
MySave.init("MouseKiller");
if (MySave.exist("maxlen")){
MyData.getInstance().money = MySave.getdata("money");
MyData.getInstance().item = MySave.getdata("item");
MyData.getInstance().succeed = MySave.getdata("succeed");
MyData.getInstance().power = MySave.getdata("power");
MyData.getInstance().Maxpower = MySave.getdata("Maxpower");
MyData.getInstance().lasttime = MySave.getdata("lasttime");
MyData.getInstance().rubbish = MySave.getdata("rubbish");
MyData.getInstance().maxlen = MySave.getdata("maxlen");
MyData.getInstance().bbq = MySave.getdata("bbq");
} else {
MySave.setdata("reset", true);
MySave.setdata("money", MyData.getInstance().money);
MySave.setdata("item", MyData.getInstance().item);
MySave.setdata("succeed", MyData.getInstance().succeed);
MySave.setdata("power", MyData.getInstance().power);
MySave.setdata("Maxpower", MyData.getInstance().Maxpower);
MySave.setdata("lasttime", MyData.getInstance().lasttime);
MySave.setdata("rubbish", MyData.getInstance().rubbish);
MySave.setdata("bbq", MyData.getInstance().bbq);
MySave.setdata("maxlen", MyData.getInstance().maxlen);
MySave.save();
};
}
public function repowernum():int{
return (MyData.getInstance().item[8]);
}
public function relasttime():int{
return (MyData.getInstance().item[9]);
}
public function showWin(TotalTime:int, AirTime:Number, RearWheelieTime:Number, FrontWheelieTime:Number, Forward:int, Backward:int, S:int, M:int){
}
public function setLv(LVnum:int){
BaseUI.setlv(gameui, LVnum);
}
public function setuibar(Num:int){
gameui.bar.gotoAndStop((Num + 1));
}
private function initSound():void{
SoundData.initsound();
}
public function setcannon(Num:int){
gameui.i3.gotoAndStop(Num);
}
public function savetimer():void{
MySave.setdata("rubbish", MyData.getInstance().rubbish);
MySave.setdata("bbq", MyData.getInstance().bbq);
MySave.save();
}
private function hitbtn(btn:DisplayObject):Boolean{
if (((btn) && (btn.visible))){
return (btn.hitTestPoint(mouseX, mouseY, true));
};
return (false);
}
private function initstage():void{
Clr.removeAllChildren(Ui);
GameClass = new BaseStage(this);
Game.addChild(GameClass);
gamestage = "playing";
}
public function showGameover(len:int, hei:int, money:int, str:String):void{
var tempword:Mytext;
tempword = new Mytext(wordsize, str, "Tahoma", 423, 150);
Clr.removeAllChildren(gameovermc.word);
gameovermc.word.addChild(tempword);
addmoney(money);
savealldata();
BaseUI.setMaxscore(gameovermc, money, "w", 7);
BaseUI.setMaxscore(gameovermc, MyData.getInstance().money, "m", 7);
gamestage = "over";
Ui.addChild(gameovermc);
gameovermc.x = (320 - (gameovermc.width * 0.5));
gameovermc.y = -600;
Tweener.addTween(gameovermc, {y:0, time:2, transition:"easeOutBounce"});
}
public function saveshop():void{
MySave.setdata("item", MyData.getInstance().item);
MySave.setdata("power", MyData.getInstance().power);
MySave.setdata("Maxpower", MyData.getInstance().Maxpower);
MySave.setdata("lasttime", MyData.getInstance().lasttime);
MySave.save();
}
private function oncue(e:Event):void{
var tempword:Mytext;
var tempmc:Array;
var temphitmc:Array;
var i:int;
if (gamestage == "success"){
i = 0;
while (i < 30) {
if (hitbtn(sucGround[i])){
Clr.removeAllChildren(succeed.word);
tempword = new Mytext(wordsize, MyData.Str[i], "Tahoma", 100, 284);
succeed.word.addChild(tempword);
break;
};
i++;
};
};
tempmc = new Array(shop.w1, shop.w2, shop.w3, shop.w4, shop.w5, shop.w6, shop.w7, shop.w8, shop.w9, shop.w10);
temphitmc = new Array(shop.page1.i1, shop.page1.i2, shop.page1.i3, shop.page1.i4, shop.page1.i5, shop.page1.i6, shop.page1.i7, shop.page1.i8, shop.page2.power, shop.page2.cannon);
if (gamestage == "shop"){
if (shopstate == "page1"){
i = 0;
while (i < 10) {
tempmc[i].alpha = 0;
if (hitbtn(temphitmc[i])){
tempmc[i].alpha = 1;
};
i++;
};
} else {
i = 8;
while (i < 10) {
tempmc[i].alpha = 0;
if (hitbtn(temphitmc[i])){
tempmc[i].alpha = 1;
};
i++;
};
};
};
}
private function destroy(){
Clr.removeAllChildren(Game);
Clr.removeAllChildren(Ui);
Clr.removeAllChildren(Cue);
Clr.removeAllChildren(Loading);
}
}
}//package
Section 117
//Micepoint (Micepoint)
package {
import flash.display.*;
public dynamic class Micepoint extends MovieClip {
public function Micepoint(){
super();
}
}
}//package
Section 118
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public function MochiBot(){
super();
}
public static function track(parent:Sprite, tag:String):MochiBot{
var self:MochiBot;
var server:String;
var lv:URLVariables;
var url:String;
var req:URLRequest;
var loader:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
self = new (MochiBot);
parent.addChild(self);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
server = "http://core.mochibot.com/my/core.swf";
lv = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
url = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
req = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
self.addChild(loader);
loader.load(req);
return (self);
}
}
}//package
Section 119
//Moneyitem (Moneyitem)
package {
import Element.*;
public dynamic class Moneyitem extends Baseitem {
public function Moneyitem(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 120
//Rubbishitem (Rubbishitem)
package {
import Element.*;
public dynamic class Rubbishitem extends Baseitem {
public function Rubbishitem(){
super();
addFrameScript(0, frame1, 21, frame22);
}
function frame1(){
stop();
}
function frame22(){
stop();
}
}
}//package
Section 121
//Sbomb (Sbomb)
package {
import Element.*;
public dynamic class Sbomb extends Baseitem {
public function Sbomb(){
super();
addFrameScript(0, frame1, 56, frame57);
}
function frame1(){
stop();
}
function frame57(){
stop();
}
}
}//package
Section 122
//sd1 (sd1)
package {
import flash.media.*;
public dynamic class sd1 extends Sound {
public function sd1(){
super();
}
}
}//package
Section 123
//sd10 (sd10)
package {
import flash.media.*;
public dynamic class sd10 extends Sound {
public function sd10(){
super();
}
}
}//package
Section 124
//sd11 (sd11)
package {
import flash.media.*;
public dynamic class sd11 extends Sound {
public function sd11(){
super();
}
}
}//package
Section 125
//sd12 (sd12)
package {
import flash.media.*;
public dynamic class sd12 extends Sound {
public function sd12(){
super();
}
}
}//package
Section 126
//sd13 (sd13)
package {
import flash.media.*;
public dynamic class sd13 extends Sound {
public function sd13(){
super();
}
}
}//package
Section 127
//sd14 (sd14)
package {
import flash.media.*;
public dynamic class sd14 extends Sound {
public function sd14(){
super();
}
}
}//package
Section 128
//sd15 (sd15)
package {
import flash.media.*;
public dynamic class sd15 extends Sound {
public function sd15(){
super();
}
}
}//package
Section 129
//sd16 (sd16)
package {
import flash.media.*;
public dynamic class sd16 extends Sound {
public function sd16(){
super();
}
}
}//package
Section 130
//sd17 (sd17)
package {
import flash.media.*;
public dynamic class sd17 extends Sound {
public function sd17(){
super();
}
}
}//package
Section 131
//sd18 (sd18)
package {
import flash.media.*;
public dynamic class sd18 extends Sound {
public function sd18(){
super();
}
}
}//package
Section 132
//sd19 (sd19)
package {
import flash.media.*;
public dynamic class sd19 extends Sound {
public function sd19(){
super();
}
}
}//package
Section 133
//sd2 (sd2)
package {
import flash.media.*;
public dynamic class sd2 extends Sound {
public function sd2(){
super();
}
}
}//package
Section 134
//sd20 (sd20)
package {
import flash.media.*;
public dynamic class sd20 extends Sound {
public function sd20(){
super();
}
}
}//package
Section 135
//sd3 (sd3)
package {
import flash.media.*;
public dynamic class sd3 extends Sound {
public function sd3(){
super();
}
}
}//package
Section 136
//sd4 (sd4)
package {
import flash.media.*;
public dynamic class sd4 extends Sound {
public function sd4(){
super();
}
}
}//package
Section 137
//sd5 (sd5)
package {
import flash.media.*;
public dynamic class sd5 extends Sound {
public function sd5(){
super();
}
}
}//package
Section 138
//sd6 (sd6)
package {
import flash.media.*;
public dynamic class sd6 extends Sound {
public function sd6(){
super();
}
}
}//package
Section 139
//sd7 (sd7)
package {
import flash.media.*;
public dynamic class sd7 extends Sound {
public function sd7(){
super();
}
}
}//package
Section 140
//sd8 (sd8)
package {
import flash.media.*;
public dynamic class sd8 extends Sound {
public function sd8(){
super();
}
}
}//package
Section 141
//sd9 (sd9)
package {
import flash.media.*;
public dynamic class sd9 extends Sound {
public function sd9(){
super();
}
}
}//package
Section 142
//Shop (Shop)
package {
import flash.display.*;
public dynamic class Shop extends MovieClip {
public var moregame_btn:SimpleButton;
public var ach_btn:SimpleButton;
public var m0:MovieClip;
public var m3:MovieClip;
public var m6:MovieClip;
public var m1:MovieClip;
public var m4:MovieClip;
public var m5:MovieClip;
public var page2:MovieClip;
public var m2:MovieClip;
public var page1:MovieClip;
public var w1:MovieClip;
public var w4:MovieClip;
public var w6:MovieClip;
public var w8:MovieClip;
public var w7:MovieClip;
public var w9:MovieClip;
public var w2:MovieClip;
public var w3:MovieClip;
public var play_btn:SimpleButton;
public var w10:MovieClip;
public var w5:MovieClip;
public function Shop(){
super();
}
}
}//package
Section 143
//ShopBGM (ShopBGM)
package {
import flash.media.*;
public dynamic class ShopBGM extends Sound {
public function ShopBGM(){
super();
}
}
}//package
Section 144
//Smallhit (Smallhit)
package {
import flash.media.*;
public dynamic class Smallhit extends Sound {
public function Smallhit(){
super();
}
}
}//package
Section 145
//Spadeitem (Spadeitem)
package {
import Element.*;
public dynamic class Spadeitem extends Baseitem {
public function Spadeitem(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 146
//Star (Star)
package {
import flash.display.*;
public dynamic class Star extends MovieClip {
public function Star(){
super();
}
}
}//package
Section 147
//Suc (Suc)
package {
import flash.display.*;
public dynamic class Suc extends MovieClip {
public function Suc(){
super();
}
}
}//package
Section 148
//Succeed (Succeed)
package {
import flash.display.*;
public dynamic class Succeed extends MovieClip {
public var back_btn:SimpleButton;
public var moregame_btn:SimpleButton;
public var word:MovieClip;
public function Succeed(){
super();
}
}
}//package
Section 149
//Tackitem (Tackitem)
package {
import Element.*;
public dynamic class Tackitem extends Baseitem {
public function Tackitem(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package