Section 1
//Mc (basic.Mc)
package basic {
import flash.display.*;
import flash.events.*;
public class Mc extends MovieClip {
public function Mc(){
this.addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
this.addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
}
public function added(_arg1:Event=null):void{
this.removeEventListener(Event.ADDED_TO_STAGE, added);
}
public function removed(_arg1:Event=null):void{
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
}
}
}//package basic
Section 2
//Obj (basic.Obj)
package basic {
public class Obj {
public function clear():void{
trace(("clear " + this));
}
}
}//package basic
Section 3
//KeyCatcher (ctrl.KeyCatcher)
package ctrl {
import flash.events.*;
import basic.*;
public class KeyCatcher extends Mc {
private var keyFlags:Array;
public var onKeyUp:Function;
public var onKeyDown:Function;
public function KeyCatcher(){
keyFlags = new Array(0x0100);
super();
this.focusRect = false;
this.addEventListener(KeyboardEvent.KEY_DOWN, keyDown, false, 0, true);
this.addEventListener(KeyboardEvent.KEY_UP, keyUp, false, 0, true);
this.addEventListener(FocusEvent.FOCUS_OUT, onFocusOut, false, 0, true);
onKeyDown = function ():void{
};
}
override public function added(_arg1:Event=null):void{
super.added();
stage.focus = this;
}
public function isDown(_arg1:int):Boolean{
return (keyFlags[_arg1]);
}
override public function removed(_arg1:Event=null):void{
this.removeEventListener(KeyboardEvent.KEY_DOWN, keyDown);
this.removeEventListener(KeyboardEvent.KEY_UP, keyUp);
this.removeEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
super.removed();
stage.focus = null;
keyFlags = null;
onKeyDown = null;
onKeyUp = null;
}
private function keyUp(_arg1:KeyboardEvent):void{
keyFlags[_arg1.keyCode] = false;
}
private function onFocusOut(_arg1:FocusEvent){
stage.focus = this;
}
private function keyDown(_arg1:KeyboardEvent):void{
if (keyFlags[_arg1.keyCode]){
} else {
onKeyDown(_arg1.keyCode);
keyFlags[_arg1.keyCode] = true;
};
}
}
}//package ctrl
Section 4
//FadeEffect (effect.FadeEffect)
package effect {
import flash.events.*;
import basic.*;
public class FadeEffect extends Mc {
public var onShow:Function;
public var onHide:Function;
public function FadeEffect(){
super();
onShow = function ():void{
};
onHide = function ():void{
};
}
override public function removed(_arg1:Event=null):void{
super.removed();
onShow = null;
onHide = null;
}
public function fadeRun(_arg1:Event):void{
}
public function hide():void{
}
public function fadeShow():void{
}
public function fadeHide():void{
}
public function show():void{
}
}
}//package effect
Section 5
//SimpleFade (effect.SimpleFade)
package effect {
public class SimpleFade extends FadeEffect {
public function SimpleFade(){
addFrameScript(0, frame1, 14, frame15, 30, frame31);
}
override public function hide():void{
gotoAndStop("hide");
}
function frame15(){
onHide();
}
function frame1(){
stop();
}
override public function fadeShow():void{
gotoAndPlay("fadeShow");
}
function frame31(){
onShow();
}
override public function fadeHide():void{
gotoAndPlay("fadeHide");
}
override public function show():void{
gotoAndStop("show");
}
}
}//package effect
Section 6
//_3Btn (FWG._3Btn)
package FWG {
import flash.display.*;
import flash.events.*;
import basic.*;
import ui.*;
public class _3Btn extends Mc {
public var btnM:BtnM;
public var btnQ:BtnQ;
public var btnS:BtnS;
public function _3Btn(){
super();
btnQ.onRollOver = function ():void{
Alt.show("Quality");
};
btnQ.onPress = function ():void{
Common.main.showQualitySetting();
Alt.hide();
};
btnQ.onRollOut = function ():void{
Alt.hide();
};
btnM.onRollOver = function ():void{
if (Common.main.musicOn){
Alt.show("Music Off");
} else {
Alt.show("Music On");
};
};
btnM.onPress = function ():void{
if (Common.main.musicOn){
Common.main.musicOn = false;
btnM.gotoAndStop(2);
} else {
Common.main.musicOn = true;
btnM.gotoAndStop(1);
};
Alt.hide();
};
btnM.onRollOut = function ():void{
Alt.hide();
};
if (Common.main.musicOn){
btnM.gotoAndStop(1);
} else {
btnM.gotoAndStop(2);
};
btnS.onRollOver = function ():void{
if (Common.main.soundOn){
Alt.show("Sound Off");
} else {
Alt.show("Sound On");
};
};
btnS.onPress = function ():void{
if (Common.main.soundOn){
Common.main.soundOn = false;
btnS.gotoAndStop(2);
} else {
Common.main.soundOn = true;
btnS.gotoAndStop(1);
};
Alt.hide();
};
btnS.onRollOut = function ():void{
Alt.hide();
};
if (Common.main.soundOn){
btnS.gotoAndStop(1);
} else {
btnS.gotoAndStop(2);
};
}
}
}//package FWG
Section 7
//BasicGame (FWG.BasicGame)
package FWG {
import flash.events.*;
import basic.*;
public class BasicGame extends Mc {
public var onTimeUp:Function;
public var onStageClear:Function;
public var stageNum:int;
public var runArr:Array;
public var onGameOver:Function;
public function BasicGame(){
Common.game = this;
runArr = new Array();
}
public function init():void{
}
public function stopRun():void{
stage.removeEventListener(Event.ENTER_FRAME, runAll);
}
public function addRun(_arg1:Function):void{
runArr.push(_arg1);
}
public function runAll(_arg1:Event):void{
var _local2:Function;
if (Common.pause){
return;
};
for each (_local2 in runArr) {
_local2();
};
}
override public function removed(_arg1:Event=null):void{
stopRun();
super.removed();
runArr = null;
onStageClear = null;
onGameOver = null;
onTimeUp = null;
Common.game = null;
}
public function delRun(_arg1:Function):Boolean{
var _local2:int;
var _local3:Function;
_local2 = 0;
for each (_local3 in runArr) {
if (_local3 == _arg1){
runArr.splice(_local2, 1);
return (true);
};
_local2++;
};
return (false);
}
public function playAgain():void{
}
public function startRun():void{
stopRun();
stage.addEventListener(Event.ENTER_FRAME, runAll, false, 0, true);
}
public function gameOver():void{
Common.pause = true;
onGameOver();
}
public function stageClear():void{
Common.pause = true;
onStageClear();
}
}
}//package FWG
Section 8
//BasicMain (FWG.BasicMain)
package FWG {
import flash.media.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import media.*;
import basic.*;
import ui.*;
import ctrl.*;
import flash.utils.*;
public class BasicMain extends Mc {
private var _soundOn:Boolean;
public var isActivate:Boolean;
public var qualitySetting:QualitySetting;
private var delayFrameId;
public var fadeMain;
private var __currentScore:int;
private var delayMc:MovieClip;
private var __score:int;
public var keySetting:KeySetting;
public var gotoMenuShowAlert:Boolean;
public var stageHei:Number;
public var playerInfo:PlayerInfo;
private var keyCatcher:KeyCatcher;
private var keyDownFArr:Array;
private var sndBg:SndBg;
private var __stageNum:int;
private var sndBgChannel:SoundChannel;
public var gameName:String;
private var _musicOn:Boolean;
public var gameInfo:GameInfo;
private var stageData:StageData;
public var fadeLabel:String;
public var btnSs:BtnSs;
public var isMouseLeave:Boolean;
public var stageWid:Number;
public var isFirstPlay:Boolean;
public function BasicMain(_arg1:String){
var _gameName = _arg1;
super();
Common.main = this;
gameName = _gameName;
MovSnd.stage = this.stage;
MovSnd.stageWid = (stageWid = stage.stageWidth);
MovSnd.stageHei = (stageHei = stage.stageHeight);
playerInfo = new PlayerInfo();
gameInfo = new GameInfo();
isFirstPlay = true;
this.addChild((keyCatcher = new KeyCatcher()));
keyDownFArr = new Array(0x0100);
keyCatcher.onKeyDown = function (_arg1:int):void{
if (keyDownFArr[_arg1] != null){
trace(_arg1);
var _local2 = keyDownFArr;
_local2[_arg1](_arg1);
};
};
stage.addEventListener(Event.MOUSE_LEAVE, mouseLeave, false, 0, true);
stage.addEventListener(Event.ACTIVATE, activate, false, 0, true);
stage.addEventListener(Event.DEACTIVATE, deactivate, false, 0, true);
currentScore = 0;
score = 0;
stageNum = 1;
}
public function fadeTo(_arg1:String):void{
var label = _arg1;
fadeLabel = label;
fadeMain.fadeHide();
fadeMain.onHide = function ():void{
gotoAndStop(fadeLabel);
fadeMain.fadeShow();
fadeMain.onHide = function ():void{
};
fadeMain.onShow = function ():void{
};
};
}
public function showSubmitScore():void{
SubmitScore.show();
}
public function keyIsDown(_arg1:int):Boolean{
return (keyCatcher.isDown(_arg1));
}
public function restartStage():void{
stageData.restartStage();
}
public function playSound(_arg1:String, _arg2=null):void{
MovSnd.playSound(_arg1, _arg2);
}
private function deactivate(_arg1:Event):void{
isActivate = false;
}
public function addKeyDownF(_arg1:int, _arg2:Function):void{
keyDownFArr[_arg1] = _arg2;
}
public function playAgain():void{
stageData.resetGameData();
playGame();
}
public function initStageData(_arg1:Array):void{
stageData = new StageData(_arg1);
}
public function get score():int{
return (__score);
}
public function set soundOn(_arg1:Boolean){
MovSnd.soundOn = (_soundOn = _arg1);
}
public function get currentScore():int{
return (__currentScore);
}
public function showQualitySetting():void{
Common.pause = true;
qualitySetting.show();
qualitySetting.onHide = function (){
Common.pause = false;
};
}
public function showCredits():void{
this["musicCredits"].show();
}
public function showInst():void{
fadeTo("instructions");
}
public function get musicOn():Boolean{
return (_musicOn);
}
private function activate(_arg1:Event):void{
isActivate = true;
}
public function hideCredits():void{
this["musicCredits"].hide();
}
private function mouseLeave(_arg1:Event):void{
stage.addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
isMouseLeave = true;
}
public function init():void{
sndBg = new SndBg();
musicOn = true;
soundOn = true;
fadeMain = this["fadeMain_mc"];
}
private function mouseOver(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);
isMouseLeave = false;
}
public function resetGameData():void{
stageData.resetGameData();
}
public function initBtn(_arg1:Btn):void{
var btn = _arg1;
switch (btn.label){
case "Play Game":
case "Play":
case "Skip":
btn.onPress = function ():void{
if (isFirstPlay){
showInst();
} else {
playGame();
};
};
break;
case "Next Stage":
btn.onPress = function ():void{
nextStage();
};
break;
case "Play Again":
btn.onPress = function ():void{
playAgain();
};
break;
case "Instructions":
btn.onPress = function ():void{
fadeTo("instructions");
};
break;
case "Key Setting":
btn.onPress = function ():void{
fadeTo("keySetting");
};
break;
case "View Highscores":
btn.onPress = function ():void{
Common.getURL(("http://www.freeworldgroup.com/score/index.asp?game=" + gameName));
};
break;
case "Download Games":
btn.onPress = function ():void{
Common.getURL("http://www.ifungames.com");
};
break;
case "More Online Games":
btn.onPress = function ():void{
Common.getURL("http://www.freeworldgroup.com");
};
break;
case "Add Games to Your Site":
btn.onPress = function ():void{
Common.getURL("http://www.freeworldgroup.com/koalafiles.htm");
};
break;
case "Copyright 2007 freeworldgroup.com":
btn.onPress = function ():void{
Common.getURL("http://www.freeworldgroup.com");
};
break;
case "Credits":
btn.onPress = function ():void{
showCredits();
};
break;
case "Menu":
gotoMenuShowAlert = true;
btn.onRollOver = function ():void{
Alt.show("Back To Main Menu");
};
btn.onRollOut = function ():void{
Alt.hide();
};
btn.onPress = function ():void{
Alt.hide();
gotoMenu();
};
break;
case "Submit Score":
btn.onPress = function ():void{
if (score <= 0){
Alt.show("Your score is 0 !");
} else {
showSubmitScore();
};
};
btn.onRollOut = function ():void{
Alt.hide();
};
break;
};
}
public function set currentScore(_arg1:int):void{
__currentScore = _arg1;
}
public function set score(_arg1:int):void{
__score = _arg1;
}
public function resetStageData():void{
__currentScore = 0;
}
public function playGame():void{
fadeTo("options");
}
public function get soundOn():Boolean{
return (_soundOn);
}
public function set stageNum(_arg1:int):void{
__stageNum = _arg1;
}
public function gotoMenu():void{
Common.pause = true;
if (gotoMenuShowAlert){
Alert.show("Back To Main Menu?", gotoMenuHandler);
} else {
gotoMenuHandler(true);
};
}
private function goto(_arg1:Event):void{
stage.removeEventListener(Event.ENTER_FRAME, goto);
delayMc.gotoAndStop(delayFrameId);
delayMc = null;
delayFrameId = null;
}
public function gotoMenuHandler(_arg1:Boolean):void{
if (_arg1){
fadeTo("menu");
} else {
Common.pause = false;
};
}
public function playMovingSound(_arg1:String, _arg2=null, _arg3:Boolean=false):MovSnd{
return (new MovSnd(_arg1, _arg2, _arg3));
}
public function delayGoto(_arg1:MovieClip, _arg2):void{
stage.addEventListener(Event.ENTER_FRAME, goto, false, 0, true);
delayMc = _arg1;
delayFrameId = _arg2;
}
public function get stageNum():int{
return (__stageNum);
}
public function set musicOn(_arg1:Boolean){
_musicOn = _arg1;
if (_musicOn){
sndBgChannel = sndBg.play(0, 10000);
} else {
sndBgChannel.stop();
};
}
public function nextStage():void{
stageNum++;
stageData.update();
stageData.initByObj();
fadeTo("game");
}
public function stageClear():void{
score = Common.game.score;
stageData.update();
}
}
}//package FWG
Section 9
//Btn (FWG.Btn)
package FWG {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import ui.*;
import flash.filters.*;
public class Btn extends SBtn {
private var __label;
private var rollOutFilters:Array;
private var __selected:Boolean;
private var rollOverFilters:Array;
private static const glowFilter:GlowFilter = new GlowFilter(0xFFCC00);
public function Btn(){
var _local1:*;
super();
this.buttonMode = true;
this.graphics.clear();
this.graphics.beginFill(0xFF0000, 0);
_local1 = this.getBounds(this);
this.graphics.drawRect(_local1.x, _local1.y, _local1.width, _local1.height);
rollOverFilters = [glowFilter].concat(this.filters);
rollOutFilters = this.filters.slice();
}
public function get label():String{
return (__label);
}
public function set selected(_arg1:Boolean):void{
__selected = _arg1;
if (__selected){
this.mouseEnabled = false;
this.mouseChildren = false;
rollOverEffect();
} else {
this.mouseEnabled = true;
this.mouseChildren = true;
rollOutEffect();
};
}
override public function press(_arg1:MouseEvent):void{
if (selected){
return;
};
if (selectAble){
rollOutEffect();
super.press(null);
} else {
if (onErrorPress != null){
onErrorPress();
};
};
}
override public function removed(_arg1:Event=null):void{
super.removed();
rollOverFilters = null;
rollOutFilters = null;
}
override public function rollOut(_arg1:MouseEvent):void{
if (selected){
return;
};
if (selectAble){
rollOutEffect();
super.rollOut(null);
};
}
private function rollOutEffect():void{
this.alpha = 1;
this.filters = rollOutFilters;
}
public function get selected():Boolean{
return (__selected);
}
public function set label(_arg1:String):void{
__label = _arg1;
Common.main.initBtn(this);
}
private function rollOverEffect():void{
this.alpha = 0.8;
this.filters = rollOverFilters;
}
override public function rollOver(_arg1:MouseEvent):void{
if (selected){
return;
};
if (selectAble){
rollOverEffect();
super.rollOver(null);
};
}
}
}//package FWG
Section 10
//BtnAgtys (FWG.BtnAgtys)
package FWG {
public class BtnAgtys extends Btn {
public function BtnAgtys(){
label = "Add Games to Your Site";
}
}
}//package FWG
Section 11
//BtnBack (FWG.BtnBack)
package FWG {
public class BtnBack extends Btn {
}
}//package FWG
Section 12
//BtnCopyright (FWG.BtnCopyright)
package FWG {
public class BtnCopyright extends Btn {
public function BtnCopyright(){
label = "Copyright 2007 freeworldgroup.com";
}
}
}//package FWG
Section 13
//BtnCrazy (FWG.BtnCrazy)
package FWG {
public class BtnCrazy extends Btn {
}
}//package FWG
Section 14
//BtnCredits (FWG.BtnCredits)
package FWG {
public class BtnCredits extends Btn {
public function BtnCredits(){
label = "Credits";
}
}
}//package FWG
Section 15
//BtnDg (FWG.BtnDg)
package FWG {
public class BtnDg extends Btn {
public function BtnDg(){
label = "Download Games";
}
}
}//package FWG
Section 16
//BtnEasy (FWG.BtnEasy)
package FWG {
public class BtnEasy extends Btn {
}
}//package FWG
Section 17
//BtnHard (FWG.BtnHard)
package FWG {
public class BtnHard extends Btn {
}
}//package FWG
Section 18
//BtnInstructions (FWG.BtnInstructions)
package FWG {
public class BtnInstructions extends Btn {
public function BtnInstructions(){
label = "Instructions";
}
}
}//package FWG
Section 19
//BtnM (FWG.BtnM)
package FWG {
public class BtnM extends Btn {
}
}//package FWG
Section 20
//BtnMenu (FWG.BtnMenu)
package FWG {
public class BtnMenu extends Btn {
public function BtnMenu(){
label = "Menu";
}
}
}//package FWG
Section 21
//BtnMog (FWG.BtnMog)
package FWG {
public class BtnMog extends Btn {
public function BtnMog(){
label = "More Online Games";
}
}
}//package FWG
Section 22
//BtnNext (FWG.BtnNext)
package FWG {
public class BtnNext extends Btn {
}
}//package FWG
Section 23
//BtnNo (FWG.BtnNo)
package FWG {
public class BtnNo extends Btn {
}
}//package FWG
Section 24
//BtnNormal (FWG.BtnNormal)
package FWG {
public class BtnNormal extends Btn {
}
}//package FWG
Section 25
//BtnNs (FWG.BtnNs)
package FWG {
public class BtnNs extends Btn {
public function BtnNs(){
label = "Next Stage";
}
}
}//package FWG
Section 26
//BtnOK (FWG.BtnOK)
package FWG {
public class BtnOK extends Btn {
}
}//package FWG
Section 27
//BtnPa (FWG.BtnPa)
package FWG {
public class BtnPa extends Btn {
public function BtnPa(){
label = "Play Again";
}
}
}//package FWG
Section 28
//BtnPg (FWG.BtnPg)
package FWG {
public class BtnPg extends Btn {
public function BtnPg(){
label = "Play Game";
}
}
}//package FWG
Section 29
//BtnPlay (FWG.BtnPlay)
package FWG {
public class BtnPlay extends Btn {
public function BtnPlay(){
label = "Play";
}
}
}//package FWG
Section 30
//BtnPowerUp (FWG.BtnPowerUp)
package FWG {
public class BtnPowerUp extends Btn {
}
}//package FWG
Section 31
//BtnQ (FWG.BtnQ)
package FWG {
public class BtnQ extends Btn {
}
}//package FWG
Section 32
//BtnQ0 (FWG.BtnQ0)
package FWG {
public class BtnQ0 extends Btn {
public function BtnQ0(){
label = "LOW";
}
}
}//package FWG
Section 33
//BtnQ1 (FWG.BtnQ1)
package FWG {
public class BtnQ1 extends Btn {
public function BtnQ1(){
label = "MEDIUM";
}
}
}//package FWG
Section 34
//BtnQ2 (FWG.BtnQ2)
package FWG {
public class BtnQ2 extends Btn {
public function BtnQ2(){
label = "HIGH";
}
}
}//package FWG
Section 35
//BtnQ3 (FWG.BtnQ3)
package FWG {
public class BtnQ3 extends Btn {
public function BtnQ3(){
label = "BEST";
}
}
}//package FWG
Section 36
//BtnS (FWG.BtnS)
package FWG {
public class BtnS extends Btn {
}
}//package FWG
Section 37
//BtnSkip (FWG.BtnSkip)
package FWG {
public class BtnSkip extends Btn {
public function BtnSkip(){
label = "Skip";
}
}
}//package FWG
Section 38
//BtnSs (FWG.BtnSs)
package FWG {
import flash.events.*;
public class BtnSs extends Btn {
public function BtnSs(){
label = "Submit Score";
}
override public function added(_arg1:Event=null):void{
Common.main.btnSs = this;
}
override public function removed(_arg1:Event=null):void{
Common.main.btnSs = null;
super.removed();
}
}
}//package FWG
Section 39
//BtnSubmit (FWG.BtnSubmit)
package FWG {
public class BtnSubmit extends Btn {
}
}//package FWG
Section 40
//BtnVh (FWG.BtnVh)
package FWG {
public class BtnVh extends Btn {
public function BtnVh(){
label = "View Highscores";
}
}
}//package FWG
Section 41
//BtnX (FWG.BtnX)
package FWG {
public class BtnX extends Btn {
}
}//package FWG
Section 42
//BtnYes (FWG.BtnYes)
package FWG {
public class BtnYes extends Btn {
}
}//package FWG
Section 43
//GameInfo (FWG.GameInfo)
package FWG {
public class GameInfo extends LocalSetting {
public var heroColor:int;// = 0xFF00
public var heroHeadId:int;// = 3
public var heroBodyId:int;// = 3
public function GameInfo(){
heroColor = 0xFF00;
heroBodyId = 3;
heroHeadId = 3;
super("Tank2008GameInfo");
}
}
}//package FWG
Section 44
//Instructions (FWG.Instructions)
package FWG {
import flash.display.*;
import basic.*;
public class Instructions extends Mc {
public var btnBack:BtnBack;
public var btnNext:BtnNext;
public var btnSkip:BtnSkip;
public var body:MovieClip;
public var btnPlay:BtnPlay;
public var numsBg:MovieClip;
public var btnMenu:BtnMenu;
public function Instructions(){
super();
stop();
setPos();
Common.main.isFirstPlay = false;
btnNext.onPress = function ():void{
nextFrame();
setPos();
};
btnBack.onPress = function ():void{
prevFrame();
setPos();
};
}
private function setPos():void{
btnPlay.visible = (this.currentFrame == this.totalFrames);
btnSkip.visible = (btnNext.visible = !((this.currentFrame == this.totalFrames)));
btnBack.visible = !((this.currentFrame == 1));
btnMenu.visible = (this.currentFrame == 1);
}
}
}//package FWG
Section 45
//KeySetting (FWG.KeySetting)
package FWG {
public class KeySetting extends LocalSetting {
public var keyCodeArr:Array;
private static const str:String = "AWDSJILKVB ";
public function KeySetting(){
keyCodeArr = [str.charCodeAt(0), str.charCodeAt(1), str.charCodeAt(2), str.charCodeAt(3), str.charCodeAt(4), str.charCodeAt(5), str.charCodeAt(6), str.charCodeAt(7), str.charCodeAt(8), str.charCodeAt(9), str.charCodeAt(10)];
super("Tank2008KeySetting");
}
public function getCode(_arg1:int):int{
return (keyCodeArr[_arg1]);
}
public function saveCode(_arg1:int, _arg2:int):void{
trace("save");
keyCodeArr[_arg1] = _arg2;
}
}
}//package FWG
Section 46
//LocalSetting (FWG.LocalSetting)
package FWG {
import flash.net.*;
public class LocalSetting {
private var varName:String;
private var lso:SharedObject;
private var vars:Array;
public function LocalSetting(_arg1:String){
lso = SharedObject.getLocal(_arg1, "/");
varName = "";
for (varName in lso.data.dataObj) {
this[varName] = lso.data.dataObj[varName];
};
if (varName == ""){
trace((_arg1 + " 第一次设定"));
lso.data.defaultDataObj = Common.cloneObj(this);
};
lso.data.dataObj = this;
}
public function setDefault():void{
var _local1:String;
for (_local1 in lso.data.defaultDataObj) {
this[_local1] = Common.cloneObj(lso.data.defaultDataObj[_local1]);
};
}
public function getDefault():Object{
return (lso.data.defaultDataObj);
}
}
}//package FWG
Section 47
//Logo (FWG.Logo)
package FWG {
import ui.*;
public class Logo extends SBtn {
public function Logo(){
super();
this.buttonMode = true;
onPress = function ():void{
Common.getURL("http://www.freeworldgroup.com/");
};
}
}
}//package FWG
Section 48
//Main (FWG.Main)
package FWG {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import mathAttack.*;
import ui.*;
import effect.*;
import flash.utils.*;
public class Main extends BasicMain {
public var gameOverMc:MovieClip;
public var totalTotal:int;
public var i:int;
public var scoreTxt:TextField;
public var powerUpNumList:Array;
public var musicCredits:MusicCredits;
public var life:int;
public var doctorMc:MovieClip;
public var gamePad:GamePad;
public var btn0:BtnEasy;
public var btn1:BtnNormal;
public var btn2:BtnHard;
public var btn3:BtnCrazy;
public var btnNs:BtnNs;
public var speedDifficulty:String;
public var IQ:int;
public var numsIQ:Word;
public var fadeMain_mc:SimpleFade;
public var stageClearMc:MovieClip;
public var game:Game;
public var timeUpMc:MovieClip;
public function Main(){
addFrameScript(1, frame2, 2, frame3, 4, frame5, 19, frame20, 35, frame36, 36, frame37, 37, frame38);
super("math_attack");
powerUpNumList = [0, 0, 0, 0, 0];
life = 5;
totalTotal = 0;
initStageData(["life", "currentScore", "score", "stageNum", "powerUpNumList", "totalTotal", "IQ"]);
}
function frame3(){
stop();
resetGameData();
}
function frame5(){
i = 0;
while (i < 4) {
this[("btn" + i)].label = Game.diffStrArr[i];
this[("btn" + i)].onPress = function ():void{
speedDifficulty = this.label;
fadeTo("game");
};
i++;
};
}
function frame20(){
game.onGetPowerUp = function (_arg1:int):void{
gamePad.getPowerUp(_arg1);
var _local2 = powerUpNumList;
var _local3 = _arg1;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
};
game.onEat = function (_arg1:int, _arg2:int):void{
IQ = _arg2;
gamePad.totalEat = _arg1;
gamePad.IQ = IQ;
trace(("IQ=" + IQ));
};
gamePad.IQ = IQ;
gamePad.stageNum = stageNum;
gamePad.life = life;
game.speedDifficulty = speedDifficulty;
game.stageNum = stageNum;
game.score = score;
game.onStageClear = function ():void{
stageClear();
};
gamePad.onUsePowerUp = function (_arg1:int):String{
var _local2 = powerUpNumList;
var _local3 = _arg1;
var _local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
return (game.usePowerUp(_arg1));
};
game.onLoseLife = function (_arg1:int):void{
gamePad.life = _arg1;
};
gamePad.onRemovePowerUp = game.removePowerUp;
gamePad.onPowerUpEffect = game.powerUpEffect;
game.onInit = function ():void{
gamePad.timeStart();
};
gamePad.onTimeUp = function ():void{
IQ = game.IQ;
game.lose("timeUp");
timeUpMc.play();
timeUpMc.onFinish = function ():void{
fadeTo("lose");
};
};
game.onGameOver = function ():void{
IQ = game.IQ;
game.lose();
gameOverMc.play();
gameOverMc.onFinish = function ():void{
fadeTo("lose");
};
};
}
function frame2(){
init();
}
override public function playAgain():void{
IQ = 0;
super.playAgain();
}
function frame36(){
doctorMc.gotoAndStop(stageNum);
scoreTxt.text = String(IQ);
if (stageNum >= 10){
btnNs.visible = false;
setTimeout(function ():void{
fadeTo("win");
}, 4000);
};
}
function frame38(){
numsIQ.text = IQ;
score = IQ;
}
function frame37(){
numsIQ.text = IQ;
score = IQ;
}
override public function stageClear():void{
super.stageClear();
stageClearMc.play();
stageClearMc.onFinish = function ():void{
fadeTo("stageClear");
};
}
}
}//package FWG
Section 49
//MochiAd (FWG.MochiAd)
package FWG {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("1.5");
}
public static function showTimedAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
var _local2:MovieClip;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
_local2 = this.parent.parent;
MochiAd.unload(_local2);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
_arg1.removeChild(_arg1._mochiad);
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
if (clip.loaderInfo.loaderURL.indexOf("http") != 0){
options.no_page = true;
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
mc["onEnterFrame"] = function ():void{
if (!this._mochiad_ctr){
delete this["onEnterFrame"];
MochiAd.unload(this.parent);
};
};
doOnEnterFrame(mc);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f, false, 0, true);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreloaderAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
var _local2:MovieClip;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
_local2 = this.parent.parent;
MochiAd.unload(_local2);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
_local1 = this.parent.parent.root;
if (!_local1){
delete this["onEnterFrame"];
return;
};
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if ((((((_local5 > 0)) && ((_local6 >= _local5)))) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f, false, 0, true);
}
}
}//package FWG
Section 50
//MusicCredits (FWG.MusicCredits)
package FWG {
import flash.display.*;
import flash.events.*;
import basic.*;
import motion.*;
public class MusicCredits extends Mc {
private var alphaFade:AlphaFade;
public var btnBack:BtnBack;
public function MusicCredits(){
super();
alphaFade = new AlphaFade(this);
alphaFade.hide();
btnBack.onPress = function ():void{
Common.main.hideCredits();
};
}
override public function removed(_arg1:Event=null):void{
super.removed();
alphaFade = null;
}
public function hide():void{
alphaFade.fadeHide();
}
public function show():void{
alphaFade.fadeShow();
}
}
}//package FWG
Section 51
//PlayerInfo (FWG.PlayerInfo)
package FWG {
public class PlayerInfo extends LocalSetting {
public var playerName:String;// = "MrNoName"
public static const DEFAULT_PLAYERNAME:String = "MrNoName";
public function PlayerInfo(){
playerName = DEFAULT_PLAYERNAME;
super("FWGPlayerInfo");
}
}
}//package FWG
Section 52
//QualitySetting (FWG.QualitySetting)
package FWG {
import flash.display.*;
import flash.events.*;
import basic.*;
import motion.*;
public class QualitySetting extends Mc {
private var alphaFade:AlphaFade;
public var btnOK:BtnOK;
public var btn3:BtnQ3;
public var btn0:BtnQ0;
public var btn2:BtnQ2;
public var btn1:BtnQ1;
public var onHide:Function;
public var hitRec:MovieClip;
public function QualitySetting(){
var i:int;
super();
quality = stage.quality;
onHide = function ():void{
};
alphaFade = new AlphaFade(this);
alphaFade.hide();
i = 0;
while (i < 4) {
this[("btn" + i)].onPress = function ():void{
quality = this.label;
};
i = (i + 1);
};
hitRec.addEventListener(MouseEvent.MOUSE_DOWN, hide, false, 0, true);
btnOK.onPress = function ():void{
hide();
};
Common.main.qualitySetting = this;
}
public function show():void{
alphaFade.fadeShow();
}
public function set quality(_arg1:String):void{
var _local2:int;
var _local3:*;
_local2 = 0;
while (_local2 < 4) {
_local3 = this[("btn" + _local2)];
if (_local3.label == _arg1){
_local3.selected = true;
} else {
_local3.selected = false;
};
_local2++;
};
stage.quality = _arg1;
}
override public function removed(_arg1:Event=null):void{
hitRec.removeEventListener(MouseEvent.MOUSE_DOWN, hide);
super.removed();
Common.main.qualitySetting = null;
onHide = null;
alphaFade = null;
}
public function hide(_arg1:MouseEvent=null):void{
var event = _arg1;
alphaFade.fadeHide();
alphaFade.onHide = function ():void{
onHide();
};
}
}
}//package FWG
Section 53
//RunMc (FWG.RunMc)
package FWG {
import flash.display.*;
import flash.events.*;
import basic.*;
public class RunMc extends Mc {
public var runAble:Boolean;
public function RunMc(_arg1:Boolean=false):void{
runAble = _arg1;
}
override public function added(_arg1:Event=null):void{
super.added();
if (runAble){
addRun();
};
}
public function addRun(_arg1:Function=null):void{
if (_arg1 == null){
_arg1 = run;
};
Common.game.addRun(_arg1);
}
override public function removed(_arg1:Event=null):void{
delRun();
super.removed();
}
public function delRun(_arg1:Function=null):void{
if (_arg1 == null){
_arg1 = run;
};
if (Common.game == null){
trace(("当game为空时remove" + this));
} else {
Common.game.delRun(_arg1);
};
}
public function run():void{
}
}
}//package FWG
Section 54
//StageData (FWG.StageData)
package FWG {
import basic.*;
public class StageData extends Obj {
public var dataObj0:Object;
public var prevDataObj:Object;
public var dataObj:Object;
public var varNameList:Array;
public function StageData(_arg1:Array){
var _local2:*;
super();
varNameList = _arg1;
dataObj0 = copyMain();
prevDataObj = copyMain();
dataObj = copyMain();
for (_local2 in dataObj) {
trace(((_local2 + "=") + dataObj[_local2]));
};
}
public function resetGameData():void{
initByObj(dataObj0);
}
public function copyMain():Object{
var _local1:Object;
var _local2:String;
_local1 = new Object();
for each (_local2 in varNameList) {
_local1[_local2] = Common.cloneObj(Common.main[_local2]);
};
return (_local1);
}
public function restartStage():void{
initByObj(prevDataObj);
}
public function initByObj(_arg1:Object=null):void{
var _local2:*;
if (_arg1 == null){
_arg1 = dataObj;
};
for (_local2 in _arg1) {
Common.main[_local2] = Common.cloneObj(_arg1[_local2]);
trace(((_local2 + "=") + Common.main[_local2]));
};
}
public function update():void{
prevDataObj = (dataObj = copyMain());
}
override public function clear():void{
super.clear();
varNameList = null;
dataObj0 = null;
prevDataObj = null;
dataObj = null;
}
}
}//package FWG
Section 55
//SubmitScore (FWG.SubmitScore)
package FWG {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import basic.*;
import flash.net.*;
import ui.*;
public class SubmitScore extends Mc {
private var loader:URLLoader;
private var variables:URLVariables;
public var btnX:BtnX;
private var request:URLRequest;
public var btnSubmit:BtnSubmit;
public var scoreTxt:TextField;
private var game_name:String;
public var nameTxt:TextField;
private static var submitScore:SubmitScore;
public function SubmitScore(){
this.stop();
this.visible = false;
submitScore = this;
}
private function _show():void{
this.visible = true;
game_name = Common.main.gameName;
nameTxt.text = Common.main.playerInfo.playerName;
scoreTxt.text = String(Common.main.score);
Common.selectTxt(nameTxt);
trace(((("playerName=" + nameTxt.text) + ",score=") + Common.main.score));
variables = new URLVariables();
request = new URLRequest("http://www.freeworldgroup.com/score/score_test.asp");
variables.game = game_name;
scoreTxt.text = String(Common.main.score);
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, completeHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler, false, 0, true);
nameTxt.addEventListener(MouseEvent.MOUSE_DOWN, hideAlt, false, 0, true);
btnSubmit.onPress = function ():void{
var _local1:Point;
_local1 = this.localToGlobal(new Point(nameTxt.x, nameTxt.y));
Common.selectTxt(nameTxt);
trace(("p=" + _local1));
switch (nameTxt.text){
case "":
case PlayerInfo.DEFAULT_PLAYERNAME:
trace(("Alt.show=" + Alt.show));
Alt.show("Your Name, please", _local1.x, _local1.y);
return;
};
submit();
};
btnX.onPress = function ():void{
_hide();
};
}
private function hideAlt(_arg1:MouseEvent):void{
Alt.hide();
}
private function errorHandler(_arg1:IOErrorEvent):void{
trace(("error: " + _arg1));
}
public function _hide():void{
this.visible = false;
this.gotoAndStop(1);
loader.removeEventListener(Event.COMPLETE, completeHandler);
loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
nameTxt.removeEventListener(MouseEvent.MOUSE_DOWN, hideAlt);
variables = null;
request = null;
loader = null;
}
private function submit():void{
variables.score = scoreTxt.text;
Common.main.playerInfo.playerName = (variables.name = nameTxt.text);
request.data = variables;
request.method = URLRequestMethod.POST;
trace(((("sendToURL: " + request.url) + "?") + request.data));
sendToURL(request);
loader.load(request);
gotoAndStop(2);
Common.main.btnSs.visible = false;
}
override public function removed(_arg1:Event=null):void{
super.removed();
variables = null;
request = null;
loader = null;
submitScore = null;
}
private function completeHandler(_arg1:Event):void{
gotoAndStop(3);
}
public static function show():void{
submitScore._show();
}
public static function hide():void{
submitScore._hide();
}
}
}//package FWG
Section 56
//Bullet (mathAttack.Bullet)
package mathAttack {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class Bullet extends Char {
private var target:MovieClip;
private var vp:Point;
public var onHitTarget:Function;
private static const v:Number = 20;
public function Bullet(_arg1:MovieClip, _arg2:Number, _arg3:Number){
var _local4:Point;
var _local5:Number;
super();
addFrameScript(9, frame10);
target = _arg1;
this.x = _arg2;
this.y = _arg3;
_local4 = new Point((target.y - this.y), (target.x - this.x));
_local5 = Math.atan2(_local4.x, _local4.y);
this.rotation = (_local5 * Common.a2r);
vp = Point.polar(v, _local5);
}
function frame10(){
stop();
}
override public function removed(_arg1:Event=null):void{
super.removed();
target = null;
vp = null;
onHitTarget = null;
}
override public function run():void{
var _local1:Point;
if (target == null){
if ((this.alpha = (this.alpha - 0.1)) < 0.1){
this.parent.removeChild(this);
return;
};
} else {
_local1 = new Point((target.y - this.y), (target.x - this.x));
if (vp.length >= _local1.length){
onHitTarget(target);
target = null;
};
};
this.x = (this.x + vp.x);
this.y = (this.y + vp.y);
}
}
}//package mathAttack
Section 57
//Char (mathAttack.Char)
package mathAttack {
import FWG.*;
public class Char extends RunMc {
public function Char(){
runAble = true;
}
}
}//package mathAttack
Section 58
//Game (mathAttack.Game)
package mathAttack {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import FWG.*;
import flash.utils.*;
public class Game extends BasicGame {
private var diffArr:Array;
public var iqRate:Number;
public var bg:MovieClip;
public var score:int;
private var uv:Number;
public var bulletArea:MovieClip;
public var onLoseLife:Function;
private var mathCore:MathCore;
private var __life:int;
public var infoMc:InfoMc;
public var tank:Tank;
private var time0:int;
public var onEat:Function;
public var virusArea:MovieClip;
public var IQ:int;
private var damageValue:Number;
public var totalEat:int;
public var onGetPowerUp:Function;
public var onInit:Function;
private var __virusAction:String;
private var difficulty:int;
public var effectArea:MovieClip;
public var totalTarget:int;// = 20
private static const total:int = 6;
public static const pCenter:Point = new Point(250, 260);
private static const diffMap:Array = [[0.9, 0.1, 0, 0], [0.8, 0.2, 0, 0], [0.7, 0.2, 0.1, 0], [0.6, 0.3, 0.1, 0], [0.5, 0.3, 0.2, 0], [0.4, 0.3, 0.3, 0], [0.3, 0.3, 0.3, 0.1], [0.2, 0.4, 0.3, 0.1], [0.1, 0.4, 0.3, 0.2], [0, 0.3, 0.3, 0.4]];
public static const diffStrArr:Array = ["Easy", "Normal", "Hard", "Crazy"];
public function Game(){
totalTarget = 20;
super();
addFrameScript(2, frame3);
totalTarget = (19 + Common.main.stageNum);
if (Common.main.stageNum == 1){
Common.main.totalTotal = 0;
} else {
Common.main.totalTotal = 1;
};
}
private function setQ():void{
var movChar:MovChar;
var closeMovChar:MovChar;
var minDistance:Number;
var ran:Number;
var num:Number;
var num2:Number;
var q:String;
if (virusArea.numChildren == 0){
return;
};
this.mouseChildren = true;
minDistance = Infinity;
Common.forEachChild(virusArea, function (_arg1, _arg2:int, _arg3:Array):void{
var _local4:Point;
movChar = MovChar(_arg1);
_local4 = new Point((movChar.x - tank.x), (movChar.y - tank.y));
if (_local4.length < minDistance){
minDistance = _local4.length;
closeMovChar = movChar;
};
});
if (minDistance < 115){
movChar = closeMovChar;
} else {
movChar = MovChar(virusArea.getChildAt(Common.random(virusArea.numChildren)));
};
ran = Math.random();
num = 0;
difficulty = 1;
for each (num2 in diffArr) {
num = (num + num2);
if (ran < num){
break;
};
difficulty++;
};
while ((q = mathCore.getQ(movChar.num, difficulty)) == null) {
difficulty--;
if (difficulty <= 0){
difficulty = 4;
};
};
infoMc.question = q;
}
public function powerUpEffect(_arg1):void{
switch (_arg1){
case 1:
killAll(2);
break;
case 3:
if (++life > 5){
life = 5;
};
trace(("life=" + life));
break;
case 4:
life--;
killAll(0);
break;
};
}
override public function removed(_arg1:Event=null):void{
var event = _arg1;
Common.forEachChild(this, function (_arg1, _arg2:int, _arg3:Array):void{
_arg1.parent.removeChild(_arg1);
});
super.removed();
mathCore.clear();
mathCore = null;
onInit = null;
onGetPowerUp = null;
onEat = null;
virusArea.virusArr = null;
onLoseLife = null;
}
function frame3(){
stop();
init();
}
private function stopEnemy():void{
virusAction = "stop";
}
public function set speedDifficulty(_arg1:String):void{
switch (_arg1){
case "Easy":
uv = 0.5;
iqRate = 0.9;
break;
case "Normal":
uv = 0.75;
iqRate = 1;
break;
case "Hard":
uv = 1.125;
iqRate = 1.125;
break;
default:
uv = 1.3;
iqRate = 1.25;
break;
};
}
private function removeVirus(_arg1):void{
virusArea.virusArr[_arg1.posId] = null;
_arg1.parent.removeChild(_arg1);
}
private function addVirus(_arg1:int):void{
var p:Point;
var virus:*;
var hasPowerUp:Boolean;
var childIndex:int;
var num:Number;
var ran:*;
var num2:*;
var posId = _arg1;
p = pCenter.add(Point.polar(190, ((((posId / total) * Math.PI) * 2) + ((Math.random() - 0.5) * 0.8))));
hasPowerUp = Common.someChild(virusArea, function (_arg1, _arg2:int, _arg3:Array):Boolean{
return ((_arg1 is PowerUp));
});
childIndex = virusArea.numChildren;
for each (virus in Common.getAllChildrenByOrder(virusArea, "y")) {
if (virus.y >= p.y){
childIndex = virusArea.getChildIndex(virus);
break;
};
};
if ((((Math.random() < 0.15)) && (!(hasPowerUp)))){
virus = new PowerUp(p.x, p.y, posId, virusAction, (uv * (0.5 + ((0.5 * stageNum) / 5))), Common.random(5));
} else {
virus = new Virus(p.x, p.y, posId, virusAction, (uv * (0.5 + ((0.5 * stageNum) / 5))));
};
virusArea.addChildAt(virus, childIndex);
virus.onDamage = function ():void{
doDamage();
};
do {
ran = Math.random();
difficulty = 1;
num = 0;
for each (num2 in diffArr) {
num = (num + num2);
if (ran < num){
break;
};
difficulty++;
};
num = mathCore.getNum(difficulty);
} while (Common.someChild(virusArea, function (_arg1, _arg2:int, _arg3:Array):Boolean{
return ((num == MovChar(_arg1).num));
}));
virus.num = num;
virus.onPress = function ():void{
checkHit(this);
};
virusArea.virusArr[posId] = virus;
}
public function usePowerUp(_arg1:int):String{
trace(("use power up id=" + _arg1));
switch (_arg1){
case 0:
slowDownEnemy();
return ("time");
case 1:
return ("");
case 2:
stopEnemy();
return ("time");
case 3:
return ("addLife");
case 4:
return ("delLife");
};
return ("");
}
public function get life():int{
return (__life);
}
override public function init():void{
var _local1:int;
Common.pause = false;
virusAction = "";
mathCore = new MathCore();
virusArea.virusArr = new Array(total);
_local1 = 0;
while (_local1 < total) {
addVirus(_local1);
_local1++;
};
setQ();
startRun();
totalEat = 0;
life = 5;
diffArr = diffMap[(stageNum - 1)];
time0 = int((getTimer() / 1000));
onInit();
damageValue = 0;
}
private function slowDownEnemy():void{
virusAction = "slow";
}
public function lose(_arg1:String=""):void{
trace(("lose, action=" + _arg1));
switch (_arg1){
case "timeUp":
break;
default:
break;
};
stopRun();
}
public function set virusAction(_arg1:String):void{
var _virusAction = _arg1;
__virusAction = _virusAction;
Common.forEachChild(virusArea, function (_arg1, _arg2:int, _arg3:Array):void{
MovChar(_arg1).action = __virusAction;
});
}
private function setIq():void{
Common.main.totalTotal++;
trace(("score=" + score));
trace(("totalTotal=" + Common.main.totalTotal));
IQ = (score / Common.main.totalTotal);
onEat(totalEat, IQ);
}
override public function runAll(_arg1:Event):void{
var _local2:Function;
if (Common.pause){
return;
};
for each (_local2 in runArr) {
_local2();
};
}
private function eat(_arg1):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = int((getTimer() / 1000));
_local3 = (_local2 - time0);
if (_local3 <= 0){
_local3 = 1;
} else {
if (_local3 > 10){
_local3 = 10;
};
};
_local4 = (((((((10 - _local3) / 10) * 0.5) + (((difficulty - 1) / 3) * 0.35)) * 125) * iqRate) + 75);
trace(("dScore=" + _local4));
effectArea.addChild(new PopUp(_arg1.x, _arg1.y, diffStrArr[(difficulty - 1)], (_local2 - time0), _local4));
score = (score + _local4);
time0 = _local2;
removeVirus(_arg1);
_local5 = 0;
while (_local5 < total) {
if (virusArea.virusArr[_local5] == null){
addVirus(_local5);
};
_local5++;
};
setQ();
if ((_arg1 is PowerUp)){
onGetPowerUp(_arg1.id);
};
totalEat++;
setIq();
if (totalEat >= totalTarget){
stageClear();
} else {
infoMc.close();
};
}
private function killAll(_arg1:int):void{
var i:int;
var totalKill:int;
var restNum = _arg1;
i = 0;
totalKill = (total - restNum);
Common.everyChild(virusArea, function (_arg1, _arg2:int, _arg3:Array):Boolean{
var _local4:MovChar;
_local4 = MovChar(_arg1);
if (!(((((_local4 is PowerUp)) && ((restNum > 0)))) || ((_local4.num == mathCore.num)))){
removeVirus(_local4);
effectArea.addChild(_local4);
effectArea.addChild(new Ghost(_local4.x, _local4.y));
_local4.exp();
i++;
};
return ((i < totalKill));
});
}
private function checkHit(_arg1):void{
var dp:Point;
var bullet:Bullet;
var virus = _arg1;
if (virus.num == mathCore.num){
this.mouseChildren = false;
infoMc.question = "";
dp = Point.polar(60, (tank.rotation / Common.a2r));
bullet = new Bullet(virus, (tank.x + dp.x), (tank.y + dp.y));
bullet.onHitTarget = function (_arg1):void{
eat(_arg1);
};
bulletArea.addChild(bullet);
tank.gun.gotoAndPlay(2);
} else {
score = (score + 75);
setIq();
infoMc.angry();
};
}
public function removePowerUp():void{
virusAction = "";
}
public function get virusAction():String{
return (__virusAction);
}
private function doDamage():void{
damageValue = (damageValue + 0.01);
if (damageValue > 1){
damageValue = 0;
if (--life <= 0){
gameOver();
};
if ((IQ = (IQ - 2)) < 75){
IQ = 75;
};
onLoseLife(life);
};
trace(("damageValue=" + damageValue));
}
override public function stageClear():void{
trace("stageClear");
score = IQ;
Common.main.totalTotal = 1;
stopRun();
onStageClear();
}
public function set life(_arg1:int){
__life = _arg1;
bg.gotoAndStop((6 - __life));
}
}
}//package mathAttack
Section 59
//GamePad (mathAttack.GamePad)
package mathAttack {
import flash.display.*;
import flash.events.*;
import basic.*;
import ui.*;
public class GamePad extends Mc {
public var totalTarget:int;
private var __IQ;
public var clock:Clock;
public var onTimeUp:Function;
public var powerUpEffect:PowerUpEffect;
public var onUsePowerUp:Function;
public var numsTotalEat:Word;
private var __totalEat:int;
public var powerUpClock:PowerUpClock;
private var currentPowerUpId:int;
public var numsStageNum:Word;
public var item0:PowerUpItem;
public var item3:PowerUpItem;
public var item4:PowerUpItem;
public var numsIQ:Word;
public var item2:PowerUpItem;
public var onPowerUpEffect:Function;
public var numLife:Letter;
private var __stageNum:int;
public var item1:PowerUpItem;
public var onRemovePowerUp:Function;
private var __life:int;
private static const totalItem:int = 5;
public function GamePad(){
var i:int;
var item:PowerUpItem;
super();
totalTarget = (19 + Common.main.stageNum);
i = 0;
while (i < totalItem) {
item = this[("item" + i)];
item.id = i;
item.onUsePowerUp = usePowerUp;
item.value = Common.main.powerUpNumList[i];
i = (i + 1);
};
powerUpClock.onTimeUp = removePowerUp;
powerUpEffect.onEffect = function ():void{
onPowerUpEffect(currentPowerUpId);
};
totalEat = 0;
IQ = 0;
clock.init(120);
clock.onTimeUp = function ():void{
onTimeUp();
};
}
public function usePowerUp(_arg1:int):void{
var id = _arg1;
currentPowerUpId = id;
trace(("currentPowerUpId=" + currentPowerUpId));
switch (currentPowerUpId){
case 0:
case 2:
powerUpEffect.onFinish = function (){
};
break;
default:
powerUpEffect.onFinish = removePowerUp;
break;
};
switch (onUsePowerUp(currentPowerUpId)){
case "time":
powerUpClock.play();
break;
case "addLife":
life++;
break;
case "delLife":
life--;
break;
default:
break;
};
powerUpEffect.effect(id);
itemsEnabled = false;
}
public function get life():int{
return (__life);
}
public function set IQ(_arg1:int):void{
numsIQ.text = (__IQ = _arg1);
}
public function set stageNum(_arg1:int):void{
numsStageNum.text = (__stageNum = _arg1);
}
override public function removed(_arg1:Event=null):void{
super.removed();
onUsePowerUp = null;
onRemovePowerUp = null;
onPowerUpEffect = null;
onTimeUp = null;
}
public function removePowerUp():void{
onRemovePowerUp();
itemsEnabled = true;
}
public function getPowerUp(_arg1:int):void{
this[("item" + _arg1)].value++;
}
public function get totalEat():int{
return (__totalEat);
}
public function get IQ():int{
return (__IQ);
}
public function timeStart():void{
clock.start();
}
public function get stageNum():int{
return (__stageNum);
}
public function set itemsEnabled(_arg1:Boolean):void{
var _local2:int;
_local2 = 0;
while (_local2 < totalItem) {
if (this[("item" + _local2)].value > 0){
this[("item" + _local2)].selectAble = _arg1;
};
_local2++;
};
}
public function set totalEat(_arg1:int):void{
__totalEat = _arg1;
numsTotalEat.text = ((__totalEat + "/") + totalTarget);
}
public function set life(_arg1:int):void{
__life = _arg1;
if (__life > 5){
__life = 5;
};
numLife.text = __life;
}
}
}//package mathAttack
Section 60
//Ghost (mathAttack.Ghost)
package mathAttack {
import basic.*;
public class Ghost extends Mc {
public function Ghost(_arg1:Number, _arg2:Number){
addFrameScript(29, frame30);
this.x = _arg1;
this.y = _arg2;
}
function frame30(){
stop();
this.parent.removeChild(this);
}
}
}//package mathAttack
Section 61
//InfoMc (mathAttack.InfoMc)
package mathAttack {
import flash.display.*;
import basic.*;
import ui.*;
import flash.utils.*;
public class InfoMc extends Mc {
public var txt:Word;
public var angryIcon:MovieClip;
public var monsterHead:MonsterHead;
public var question:String;
public function InfoMc(){
super();
angryIcon.gotoAndStop(1);
txt.align = "center";
monsterHead.onClose = function ():void{
txt.text = question;
};
}
private function gotoNormal():void{
if (angryIcon.currentFrame > 1){
angryIcon.gotoAndStop(1);
};
}
public function angry():void{
angryIcon.gotoAndStop((Common.random((angryIcon.totalFrames - 1)) + 2));
setTimeout(gotoNormal, 1000);
}
public function close():void{
monsterHead.close();
}
}
}//package mathAttack
Section 62
//MathCore (mathAttack.MathCore)
package mathAttack {
import basic.*;
public class MathCore extends Obj {
private var question:Question;
private var diffQArr:Array;
public function MathCore(){
var _local1:Array;
var _local2:int;
var _local3:Question;
var _local4:int;
super();
_local1 = getAllQ();
diffQArr = [null, new Array(100), new Array(100), new Array(100), new Array(100)];
_local2 = 1;
while (_local2 <= 4) {
_local4 = 0;
while (_local4 < 100) {
diffQArr[_local2][_local4] = new Array();
_local4++;
};
_local2++;
};
for each (_local3 in _local1) {
diffQArr[_local3.difficulty][_local3.num].push(_local3);
};
}
public function get difficulty():int{
return (question.difficulty);
}
public function get num2():int{
return (question.num2);
}
public function get op():String{
return (question.op);
}
public function get num1():int{
return (question.num1);
}
override public function clear():void{
super.clear();
diffQArr = null;
}
public function getNum(_arg1:int):int{
var _local2:int;
var _local3:int;
var _local4:Number;
if (_arg1 == 1){
if (Math.random() < 0.7){
return (Common.random(10));
};
};
_local2 = Common.random(100);
_local3 = 0;
while (_local3 < 100) {
_local4 = ((_local2 + _local3) % 100);
if (diffQArr[_arg1][_local4].length > 0){
return (_local4);
};
_local3++;
};
return (0);
}
public function getQ(_arg1:int, _arg2:int):String{
var _local3:Array;
_local3 = diffQArr[_arg2][_arg1];
if (_local3.length == 0){
question = null;
return (null);
};
question = _local3[Common.random(_local3.length)];
return (question.toString());
}
public function getAllQ():Array{
var _local1:int;
var _local2:int;
var _local3:Array;
_local3 = new Array();
_local1 = 0;
while (_local1 < 100) {
_local2 = 0;
while (_local2 < (100 - _local1)) {
_local3.push(new Question(_local1, "+", _local2));
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < 100) {
_local2 = 0;
while (_local2 <= _local1) {
_local3.push(new Question(_local1, "-", _local2));
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < 100) {
_local2 = 0;
while ((((_local2 < 100)) && ((_local2 <= (99 / _local1))))) {
_local3.push(new Question(_local1, "*", _local2));
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < 100) {
_local2 = 1;
while (_local2 <= _local1) {
if ((_local1 % _local2) == 0){
_local3.push(new Question(_local1, "/", _local2));
};
_local2++;
};
_local1++;
};
return (_local3);
}
public function get num():int{
return (question.num);
}
}
}//package mathAttack
class Question {
public var op:String;
public var num:int;
public var difficulty:int;
public var num1:int;
private var step:int;
public var num2:int;
private function Question(_arg1:int, _arg2:String, _arg3:int){
num1 = _arg1;
op = _arg2;
num2 = _arg3;
switch (op){
case "+":
num = (num1 + num2);
break;
case "-":
num = (num1 - num2);
break;
case "*":
num = (num1 * num2);
break;
case "/":
num = (num1 / num2);
break;
};
if ((((op == "+")) || ((op == "*")))){
step = getStep(num1, op, num2);
} else {
if (op == "-"){
step = getStep(num, "+", num2);
} else {
step = getStep(num, "*", num2);
};
};
if (step == 0){
step = 1;
};
if (num1 >= 10){
step++;
};
if (num2 >= 10){
step++;
};
switch (step){
case 1:
difficulty = 1;
break;
case 2:
case 3:
difficulty = 2;
break;
case 4:
case 5:
difficulty = 3;
break;
default:
difficulty = 4;
break;
};
}
public function numToArr(_arg1:int):Array{
var _local2:Array;
_local2 = new Array();
while (_arg1 > 0) {
_local2.push((_arg1 % 10));
_arg1 = (_arg1 / 10);
};
return (_local2);
}
public function toString():String{
return ((((num1 + op) + num2) + "=?"));
}
public function getStep(_arg1:int, _arg2:String, _arg3:int):int{
var _local4:Array;
var _local5:Array;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:Array;
var _local14:int;
if ((((((_arg1 == 0)) || ((_arg3 == 0)))) || ((((_arg2 == "*")) && ((((((((_arg1 == 1)) || ((_arg3 == 1)))) || (((_arg1 % 10) == 0)))) || (((_arg3 % 10) == 0)))))))){
return (1);
};
_local4 = numToArr(_arg1);
_local5 = numToArr(_arg3);
_local6 = 0;
switch (_arg2){
case "+":
_local11 = Math.max(_local4.length, _local5.length);
_local7 = 0;
while (_local7 < _local11) {
if (_local4.length < _local11){
_local4.push(0);
};
if (_local5.length < _local11){
_local5.push(0);
};
_local7++;
};
_local12 = 0;
_local7 = 0;
while (_local7 < _local11) {
_local9 = _local4[_local7];
_local10 = _local5[_local7];
if (((_local9 + _local10) + _local12) == 0){
} else {
if ((((_local9 == 0)) || ((_local10 == 0)))){
} else {
_local6++;
};
if (_local12 > 0){
_local6++;
};
if (((_local9 + _local10) + _local12) >= 10){
_local12 = 1;
_local6++;
} else {
_local12 = 0;
};
};
_local7++;
};
break;
case "*":
_local13 = new Array();
_local7 = 0;
for each (_local9 in _local4) {
if (_local9 == 0){
} else {
_local8 = 0;
for each (_local10 in _local5) {
if (_local10 == 0){
} else {
_local13.push(((_local9 * _local10) * Math.pow(10, (_local7 + _local8))));
_local6++;
_local8++;
};
};
_local7++;
};
};
_local11 = _local13.length;
_local14 = _local13[0];
_local7 = 1;
while (_local7 < _local11) {
_local6 = (_local6 + getStep(_local14, "+", _local13[_local7]));
_local7++;
};
break;
};
return (_local6);
}
}
Section 63
//MonsterHead (mathAttack.MonsterHead)
package mathAttack {
import flash.events.*;
import basic.*;
public class MonsterHead extends Mc {
public var onClose:Function;
public function MonsterHead(){
addFrameScript(1, frame2, 10, frame11);
}
override public function removed(_arg1:Event=null):void{
super.removed();
onClose = null;
}
public function open():void{
gotoAndPlay("open");
}
function frame2(){
onClose();
}
function frame11(){
stop();
}
public function close():void{
gotoAndPlay("close");
}
}
}//package mathAttack
Section 64
//MovChar (mathAttack.MovChar)
package mathAttack {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
public class MovChar extends Char {
private var stopDelayTime:int;
public var onDamage:Function;
public var action:String;
private var posX:Number;
private var uv:Number;
public var onPress:Function;
private var __num:int;
public var posId:int;
public var dp:Point;
private var posY:Number;
private var slowDelayTime:int;
private var delayTime:int;
private static const glowFilter:GlowFilter = new GlowFilter(0xFFCC00);
public function MovChar(_arg1:Number, _arg2:Number, _arg3:int, _arg4:String, _arg5:Number){
posX = (this.x = _arg1);
posY = (this.y = _arg2);
posId = _arg3;
action = _arg4;
uv = _arg5;
this.alpha = 0;
onDamage = null;
}
override public function added(_arg1:Event=null):void{
super.added();
this.addEventListener(MouseEvent.MOUSE_OVER, rollOver, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_OUT, rollOut, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_DOWN, press, false, 0, true);
delayTime = 0;
slowDelayTime = 0;
stopDelayTime = 0;
this.buttonMode = true;
this["nums"].align = "center";
}
public function set num(_arg1:int):void{
this["nums"].text = (__num = _arg1);
}
public function exp():void{
this.removeChild(this["numsBg"]);
this.removeChild(this["nums"]);
addRun(removeRun);
}
private function press(_arg1:MouseEvent):void{
onPress();
this.filters = null;
}
override public function removed(_arg1:Event=null):void{
this.removeEventListener(MouseEvent.MOUSE_OVER, rollOver);
this.removeEventListener(MouseEvent.MOUSE_OUT, rollOut);
this.removeEventListener(MouseEvent.MOUSE_DOWN, press);
super.removed();
onPress = null;
}
private function removeRun():void{
if ((this.alpha = (this.alpha - 0.2)) < 0.1){
this.parent.removeChild(this);
delRun(removeRun);
};
}
private function rollOut(_arg1:MouseEvent):void{
this.filters = null;
}
public function get num():int{
return (__num);
}
override public function run():void{
if (this.alpha < 1){
this.alpha = (this.alpha + 0.1);
};
}
public function movRun():void{
var _local1:Point;
dp = Game.pCenter.subtract(new Point(this.x, this.y));
if (dp.length < 75){
onDamage();
return;
};
_local1 = dp.clone();
switch (action){
case "stop":
return;
case "slow":
_local1.normalize(0.05);
break;
default:
_local1.normalize(0.1);
break;
};
posX = (posX + (_local1.x * uv));
posY = (posY + (_local1.y * uv));
this.x = posX;
this.y = posY;
}
private function rollOver(_arg1:MouseEvent):void{
this.filters = [glowFilter];
}
}
}//package mathAttack
Section 65
//PopUp (mathAttack.PopUp)
package mathAttack {
import flash.display.*;
import flash.text.*;
import basic.*;
public class PopUp extends Mc {
public var body:MovieClip;
public function PopUp(_arg1:Number, _arg2:Number, _arg3:String, _arg4:int, _arg5:int){
addFrameScript(39, frame40);
this.x = _arg1;
this.y = _arg2;
body.diffTxt.text = _arg3;
body.timeTxt.text = (String(_arg4) + "s");
body.scoreTxt.text = String(_arg5);
}
function frame40(){
stop();
this.parent.removeChild(this);
}
}
}//package mathAttack
Section 66
//PowerUp (mathAttack.PowerUp)
package mathAttack {
import flash.display.*;
import ui.*;
public class PowerUp extends MovChar {
public var body:MovieClip;
public var nums:Word;
private var __id:int;
public var numsBg:MovieClip;
public function PowerUp(_arg1:Number, _arg2:Number, _arg3:int, _arg4:String, _arg5:Number, _arg6:int){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
id = _arg6;
}
public function get id():int{
return (__id);
}
public function set id(_arg1:int):void{
__id = _arg1;
body.gotoAndStop((__id + 1));
}
override public function run():void{
super.run();
movRun();
}
}
}//package mathAttack
Section 67
//PowerUpClock (mathAttack.PowerUpClock)
package mathAttack {
import basic.*;
public class PowerUpClock extends Mc {
public var onTimeUp:Function;
public function PowerUpClock(){
addFrameScript(0, frame1, 299, frame300);
}
public function timeUp():void{
onTimeUp();
}
function frame1(){
stop();
}
function frame300(){
timeUp();
}
}
}//package mathAttack
Section 68
//PowerUpEffect (mathAttack.PowerUpEffect)
package mathAttack {
import flash.display.*;
import basic.*;
public class PowerUpEffect extends Mc {
public var onEffect:Function;
public var onFinish:Function;
public var icon:MovieClip;
public function PowerUpEffect(){
addFrameScript(0, frame1, 39, frame40, 59, frame60);
icon.stop();
}
function frame1(){
stop();
}
public function effect(_arg1:int):void{
icon.gotoAndStop((_arg1 + 1));
this.play();
}
function frame40(){
onEffect();
}
function frame60(){
onFinish();
}
}
}//package mathAttack
Section 69
//PowerUpItem (mathAttack.PowerUpItem)
package mathAttack {
import flash.events.*;
import FWG.*;
import basic.*;
import ui.*;
public class PowerUpItem extends Mc {
public var onUsePowerUp:Function;
public var btn:BtnPowerUp;
private var __id:int;
public var num:Letter;
private var __value:int;
public static const infoArr:Array = ["Vitamin", "Antibiotic", "Vaccine", "Surgery", "Radiation"];
public function PowerUpItem(){
super();
value = 0;
btn.onRollOver = function ():void{
Alt.show(infoArr[id]);
};
btn.onRollOut = function ():void{
Alt.hide();
};
btn.onPress = function ():void{
Alt.hide();
value--;
onUsePowerUp(id);
};
}
public function set selectAble(_arg1:Boolean):void{
btn.selectAble = _arg1;
}
public function set id(_arg1:int):void{
__id = _arg1;
btn.gotoAndStop((_arg1 + 1));
}
public function get id():int{
return (__id);
}
override public function removed(_arg1:Event=null):void{
super.removed();
onUsePowerUp = null;
}
public function get value():int{
return (__value);
}
public function set value(_arg1:int):void{
if (_arg1 > 9){
_arg1 = 9;
};
num.text = (__value = _arg1);
selectAble = (__value > 0);
}
}
}//package mathAttack
Section 70
//Tank (mathAttack.Tank)
package mathAttack {
import flash.display.*;
public class Tank extends Char {
public var gun:MovieClip;
private var a:Number;
override public function run():void{
a = Math.atan2(this.mouseY, this.mouseX);
this.rotation = (this.rotation + (a * Common.a2r));
}
}
}//package mathAttack
Section 71
//Virus (mathAttack.Virus)
package mathAttack {
import flash.display.*;
import flash.events.*;
import ui.*;
public class Virus extends MovChar {
public var body:MovieClip;
public var nums:Word;
public var numsBg:MovieClip;
public function Virus(_arg1:Number, _arg2:Number, _arg3:int, _arg4:String, _arg5:Number){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24);
super(_arg1, _arg2, _arg3, _arg4, _arg5);
Common.randomStop(this);
}
function frame10(){
randomPlay();
}
function frame14(){
randomPlay();
}
function frame18(){
randomPlay();
}
function frame12(){
randomPlay();
}
override public function removed(_arg1:Event=null):void{
super.removed();
trace(this);
}
function frame3(){
randomPlay();
}
function frame7(){
randomPlay();
}
function frame1(){
randomPlay();
}
function frame19(){
randomPlay();
}
function frame6(){
randomPlay();
}
function frame13(){
randomPlay();
}
function frame17(){
randomPlay();
}
function frame4(){
randomPlay();
}
function frame5(){
randomPlay();
}
function frame22(){
randomPlay();
}
function frame8(){
randomPlay();
}
function frame9(){
randomPlay();
}
function frame15(){
randomPlay();
}
function frame23(){
randomPlay();
}
public function randomPlay():void{
Common.randomPlay(body);
}
function frame16(){
randomPlay();
}
function frame21(){
randomPlay();
}
override public function run():void{
super.run();
movRun();
}
function frame11(){
randomPlay();
}
function frame24(){
randomPlay();
}
function frame20(){
randomPlay();
}
function frame2(){
randomPlay();
}
}
}//package mathAttack
Section 72
//all_14 (mathAttack_08182_fla.all_14)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class all_14 extends MovieClip {
public function all_14(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mathAttack_08182_fla
Section 73
//game_bg_131 (mathAttack_08182_fla.game_bg_131)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class game_bg_131 extends MovieClip {
public var organ4:MovieClip;
public var organ5:MovieClip;
public var organ2:MovieClip;
public var organ1:MovieClip;
public var organ3:MovieClip;
}
}//package mathAttack_08182_fla
Section 74
//gameOverMc_163 (mathAttack_08182_fla.gameOverMc_163)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class gameOverMc_163 extends MovieClip {
public var onFinish:Function;
public function gameOverMc_163(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
onFinish();
}
}
}//package mathAttack_08182_fla
Section 75
//loading_logo_loading_2 (mathAttack_08182_fla.loading_logo_loading_2)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class loading_logo_loading_2 extends MovieClip {
public function loading_logo_loading_2(){
addFrameScript(38, frame39);
}
function frame39(){
stop();
}
}
}//package mathAttack_08182_fla
Section 76
//loading_num_4 (mathAttack_08182_fla.loading_num_4)
package mathAttack_08182_fla {
import flash.media.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class loading_num_4 extends MovieClip {
public var num_txt:TextField;
public var li:LoaderInfo;
public var _root;
public function loading_num_4(){
addFrameScript(0, frame1);
}
public function loading(_arg1:Event):void{
var _local2:int;
_local2 = int(((li.bytesLoaded / li.bytesTotal) * 100));
num_txt.text = (_local2 + "%");
if (_local2 >= 100){
removeEventListener(Event.ENTER_FRAME, loading);
if (!(_root._mochiad is MovieClip)){
_root.play();
};
};
}
function frame1(){
_root = stage.getChildAt(0);
li = _root.loaderInfo;
this.addEventListener(Event.ENTER_FRAME, loading);
}
}
}//package mathAttack_08182_fla
Section 77
//loading_protect_text_7 (mathAttack_08182_fla.loading_protect_text_7)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class loading_protect_text_7 extends MovieClip {
public var main;
public function loading_protect_text_7(){
addFrameScript(0, frame1);
}
function frame1(){
this.visible = false;
}
}
}//package mathAttack_08182_fla
Section 78
//logoNew_gra_13 (mathAttack_08182_fla.logoNew_gra_13)
package mathAttack_08182_fla {
import flash.display.*;
import flash.events.*;
public dynamic class logoNew_gra_13 extends MovieClip {
public function logoNew_gra_13(){
addFrameScript(0, frame1);
}
public function press(_arg1:MouseEvent){
Common.getURL("http://www.freeworldgroup.com");
}
function frame1(){
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_DOWN, press, false, 0, true);
}
}
}//package mathAttack_08182_fla
Section 79
//logoNew_intro_8 (mathAttack_08182_fla.logoNew_intro_8)
package mathAttack_08182_fla {
import flash.display.*;
import flash.events.*;
public dynamic class logoNew_intro_8 extends MovieClip {
public function logoNew_intro_8(){
addFrameScript(1, frame2, 164, frame165);
}
function frame165(){
stop();
}
public function press(_arg1:MouseEvent){
Common.getURL("http://www.freeworldgroup.com");
}
function frame2(){
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_DOWN, press, false, 0, true);
}
}
}//package mathAttack_08182_fla
Section 80
//MainTimeline (mathAttack_08182_fla.MainTimeline)
package mathAttack_08182_fla {
import flash.display.*;
import flash.events.*;
import FWG.*;
import flash.net.*;
public dynamic class MainTimeline extends MovieClip {
public var hitRec:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 2, frame3, 181, frame182, 278, frame279);
}
function frame279(){
stop();
}
function frame3(){
if (this.loaderInfo.bytesLoaded < this.loaderInfo.bytesTotal){
gotoAndStop("loading");
};
}
function frame1(){
stage.showDefaultContextMenu = false;
MochiAd.showPreloaderAd({clip:this, id:"7017b097b555cfb2", res:"500x550"});
}
function frame182(){
hitRec.buttonMode = true;
hitRec.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
}
public function mouseDown(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.freeworldgroup.com/"), "_blank");
}
}
}//package mathAttack_08182_fla
Section 81
//mathAttack_145 (mathAttack_08182_fla.mathAttack_145)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class mathAttack_145 extends MovieClip {
public function mathAttack_145(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package mathAttack_08182_fla
Section 82
//mathAttack_216 (mathAttack_08182_fla.mathAttack_216)
package mathAttack_08182_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mathAttack_216 extends MovieClip {
public var diffTxt:TextField;
public var timeTxt:TextField;
public var scoreTxt:TextField;
}
}//package mathAttack_08182_fla
Section 83
//mathAttack_61 (mathAttack_08182_fla.mathAttack_61)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class mathAttack_61 extends MovieClip {
public var body:MovieClip;
}
}//package mathAttack_08182_fla
Section 84
//stageClearMc_162 (mathAttack_08182_fla.stageClearMc_162)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class stageClearMc_162 extends MovieClip {
public var onFinish:Function;
public function stageClearMc_162(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
onFinish();
}
}
}//package mathAttack_08182_fla
Section 85
//timeUpMc_164 (mathAttack_08182_fla.timeUpMc_164)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class timeUpMc_164 extends MovieClip {
public var onFinish:Function;
public function timeUpMc_164(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
onFinish();
}
}
}//package mathAttack_08182_fla
Section 86
//ui_25 (mathAttack_08182_fla.ui_25)
package mathAttack_08182_fla {
import flash.display.*;
import ui.*;
public dynamic class ui_25 extends MovieClip {
public var num0:Letter;
public var num1:Letter;
public var num3:Letter;
public var num6:Letter;
public var num7:Letter;
public var num4:Letter;
public var num5:Letter;
public var num2:Letter;
}
}//package mathAttack_08182_fla
Section 87
//versionWarning_6 (mathAttack_08182_fla.versionWarning_6)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class versionWarning_6 extends MovieClip {
public function versionWarning_6(){
addFrameScript(0, frame1);
}
function frame1(){
this.visible = false;
}
}
}//package mathAttack_08182_fla
Section 88
//virus19_body_62 (mathAttack_08182_fla.virus19_body_62)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class virus19_body_62 extends MovieClip {
public var body:MovieClip;
}
}//package mathAttack_08182_fla
Section 89
//virus19_body_body_63 (mathAttack_08182_fla.virus19_body_body_63)
package mathAttack_08182_fla {
import flash.display.*;
public dynamic class virus19_body_body_63 extends MovieClip {
public var body:MovieClip;
}
}//package mathAttack_08182_fla
Section 90
//MovSnd (media.MovSnd)
package media {
import flash.media.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
public class MovSnd {
private var obj;
private var sndChannel:SoundChannel;
public static const p0:Point = new Point();
public static var soundOn:Boolean = true;
public static var stageWid:Number;
public static var stageHei:Number;
public static var stage:Stage;
public function MovSnd(_arg1:String, _arg2:DisplayObject, _arg3:Boolean=false){
obj = _arg2;
sndChannel = playSound(_arg1, _arg2, _arg3);
if (!_arg3){
sndChannel.addEventListener(Event.SOUND_COMPLETE, remove, false, 0, true);
};
stage.addEventListener(Event.ENTER_FRAME, mov, false, 0, true);
}
private function mov(_arg1:Event):void{
if ((((obj == null)) || ((obj.stage == null)))){
stage.removeEventListener(Event.ENTER_FRAME, mov);
obj = null;
return;
};
setSoundByObj(sndChannel, obj);
}
public function remove(_arg1:Event=null):void{
if (sndChannel != null){
sndChannel.removeEventListener(Event.SOUND_COMPLETE, remove);
sndChannel.stop();
};
stage.removeEventListener(Event.ENTER_FRAME, mov);
obj = null;
sndChannel = null;
}
public static function setSoundByXy(_arg1:SoundChannel, _arg2:Number, _arg3:Number):void{
var _local4:Point;
var _local5:SoundTransform;
_local4 = new Point((_arg2 - (stageWid / 2)), (_arg3 - (stageHei / 2)));
_local5 = _arg1.soundTransform;
_local5.pan = ((_local4.x / (stageWid / 2)) * 0.8);
_local5.volume = (soundOn) ? Math.pow(2, (-(_local4.length) * 0.002)) : 0;
_arg1.soundTransform = _local5;
}
public static function setSoundByObj(_arg1:SoundChannel, _arg2):void{
var _local3:Point;
if (_arg2 == null){
return;
};
if ((_arg2 is Point)){
setSoundByXy(_arg1, _arg2.x, _arg2.y);
} else {
_local3 = _arg2.localToGlobal(p0);
setSoundByXy(_arg1, _local3.x, _local3.y);
};
}
public static function playSound(_arg1:String, _arg2=null, _arg3:Boolean=false):SoundChannel{
var _local4:SoundChannel;
_local4 = new (getDefinitionByName(_arg1)).play(0, (_arg3) ? 10000 : 1);
if (_local4 != null){
setSoundByObj(_local4, _arg2);
};
return (_local4);
}
}
}//package media
Section 91
//AlphaFade (motion.AlphaFade)
package motion {
import flash.display.*;
import flash.events.*;
import basic.*;
public class AlphaFade extends Obj {
public var onHide:Function;
private var mc:MovieClip;
public var onShow:Function;
public function AlphaFade(_arg1:MovieClip){
var _mc = _arg1;
super();
mc = _mc;
onShow = function ():void{
};
onHide = function ():void{
};
}
public function hide():void{
mc.visible = false;
mc.alpha = 0;
}
override public function clear():void{
super.clear();
onShow = null;
onHide = null;
mc = null;
}
private function showRun(_arg1:Event):void{
if ((mc.alpha = (mc.alpha + 0.2)) > 0.9){
mc.stage.removeEventListener(Event.ENTER_FRAME, showRun);
show();
onShow();
};
}
private function hideRun(_arg1:Event):void{
if (mc.alpha <= 0.1){
mc.stage.removeEventListener(Event.ENTER_FRAME, hideRun);
hide();
onHide();
};
mc.alpha = (mc.alpha - 0.2);
}
public function fadeShow():void{
mc.visible = true;
mc.stage.removeEventListener(Event.ENTER_FRAME, showRun);
mc.stage.addEventListener(Event.ENTER_FRAME, showRun, false, 0, true);
}
public function show():void{
mc.visible = true;
mc.alpha = 1;
}
public function fadeHide():void{
mc.stage.removeEventListener(Event.ENTER_FRAME, hideRun);
mc.stage.addEventListener(Event.ENTER_FRAME, hideRun, false, 0, true);
}
}
}//package motion
Section 92
//Alert (ui.Alert)
package ui {
import flash.events.*;
import flash.text.*;
import FWG.*;
import basic.*;
import motion.*;
public class Alert extends Mc {
private var alphaFade:AlphaFade;
public var btnYes:BtnYes;
public var msgTxt:TextField;
public var btnNo:BtnNo;
public var onCallBack:Function;
private var flag:Boolean;
public static var alert:Alert;
public function Alert(){
super();
alert = this;
alphaFade = new AlphaFade(this);
alphaFade.hide();
btnYes.onPress = function ():void{
callBack(true);
};
btnNo.onPress = function ():void{
callBack(false);
};
}
private function show_(_arg1:String, _arg2:Function):void{
this.mouseChildren = true;
alphaFade.fadeShow();
msg = _arg1;
onCallBack = _arg2;
}
public function set msg(_arg1:String):void{
msgTxt.text = _arg1;
trace(msgTxt.text);
}
override public function removed(_arg1:Event=null):void{
super.removed();
if (alert == this){
alert = null;
};
onCallBack = null;
alphaFade = null;
}
public function callBack(_arg1:Boolean):void{
var _flag = _arg1;
this.mouseChildren = false;
flag = _flag;
alphaFade.fadeHide();
alphaFade.onHide = function ():void{
onCallBack(flag);
};
}
public function get msg():String{
return (msgTxt.text);
}
public static function show(_arg1:String, _arg2:Function):void{
if (alert == null){
_arg2(true);
} else {
alert.show_(_arg1, _arg2);
};
}
}
}//package ui
Section 93
//Alt (ui.Alt)
package ui {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import FWG.*;
import basic.*;
import flash.utils.*;
public class Alt extends Mc {
public var msgTxt:TextField;
public var bg:MovieClip;
public static var alt:Alt;
private static var timeoutId:int = -1;
public function Alt(){
Alt.alt = this;
this.visible = false;
this.mouseEnabled = false;
this.mouseChildren = false;
msgTxt.autoSize = "center";
}
private function show_(_arg1:String, _arg2:Number=NaN, _arg3:Number=NaN):void{
var _local4:Rectangle;
this.visible = true;
msg = _arg1;
bg.width = (msgTxt.textWidth + 10);
if (isNaN(_arg2)){
this.x = this.parent.mouseX;
} else {
this.x = _arg2;
};
if (isNaN(_arg3)){
this.y = this.parent.mouseY;
} else {
this.y = _arg3;
};
_local4 = bg.getBounds(root);
if (_local4.x < 0){
this.x = ((_local4.width / 2) + 5);
} else {
if ((_local4.x + _local4.width) > Common.main.stageWid){
this.x = ((Common.main.stageWid - (_local4.width / 2)) - 5);
};
};
if (_local4.y < 0){
this.y = ((_local4.height / 2) + 5);
} else {
if ((_local4.y + _local4.height) > Common.main.stageHei){
this.y = ((Common.main.stageHei - (_local4.height / 2)) - 5);
};
};
}
public function set msg(_arg1:String):void{
msgTxt.text = _arg1;
}
private function hide():void{
this.visible = false;
}
public function get msg():String{
return (msgTxt.text);
}
public static function hideDelay(_arg1:int):void{
clearTimeout(timeoutId);
timeoutId = setTimeout(alt.hide, _arg1);
}
public static function hide():void{
Alt.alt.hide();
}
public static function show(_arg1:String, _arg2:Number=NaN, _arg3:Number=NaN):void{
Alt.alt.show_(_arg1, _arg2, _arg3);
}
}
}//package ui
Section 94
//Clock (ui.Clock)
package ui {
import flash.events.*;
import FWG.*;
import flash.utils.*;
public class Clock extends RunMc {
public var onTimeUp:Function;
private var totalTime:Number;
private var t0:Number;
public var num0:Letter;
public var num1:Letter;
public var num3:Letter;
public var num2:Letter;
private var t:Number;
private var time:Number;
public function Clock(){
super();
onTimeUp = function (){
};
runAble = false;
}
override public function stop():void{
delRun();
}
public function init(_arg1:int):void{
time = (totalTime = _arg1);
update();
}
override public function removed(_arg1:Event=null):void{
super.removed();
onTimeUp = null;
}
public function start():void{
runAble = true;
t0 = getTimer();
addRun();
}
override public function run():void{
var _local1:Number;
t = getTimer();
_local1 = (t - t0);
if (_local1 > 100){
_local1 = 0;
t0 = getTimer();
};
time = (time - (_local1 / 1000));
t0 = t;
update();
if (time <= 0){
onTimeUp();
stop();
};
}
private function numToTime(_arg1:int):String{
var _local2:int;
var _local3:int;
var _local4:String;
_local2 = (_arg1 % 60);
_local3 = ((_arg1 - _local2) / 60);
_local4 = "";
if (_local3 < 10){
_local4 = (_local4 + "0");
};
_local4 = (_local4 + (_local3 + ":"));
if (_local2 < 10){
_local4 = (_local4 + "0");
};
_local4 = (_local4 + _local2);
return (_local4);
}
private function update():void{
var _local1:String;
_local1 = numToTime(time);
num0.text = _local1.charAt(0);
num1.text = _local1.charAt(1);
num2.text = _local1.charAt(3);
num3.text = _local1.charAt(4);
}
}
}//package ui
Section 95
//Letter (ui.Letter)
package ui {
import basic.*;
public class Letter extends Mc {
private var __text;
public function Letter(){
text = 0;
}
public function get text(){
return (__text);
}
public function set text(_arg1):void{
__text = _arg1;
this.gotoAndStop(("f" + __text));
}
}
}//package ui
Section 96
//SBtn (ui.SBtn)
package ui {
import flash.display.*;
import flash.events.*;
import FWG.*;
import basic.*;
import flash.filters.*;
public class SBtn extends Mc {
private var greyFilters:Array;
private var __selectAble:Boolean;
private var filters0:Array;
private var __onErrorPress:Function;
public var onPress:Function;
public var onRollOut:Function;
public var onRollOver:Function;
private static const greyFilter:ColorMatrixFilter = new ColorMatrixFilter([0.15, 0.295, 0.055, 0, 0, 0.15, 0.295, 0.055, 0, 0, 0.15, 0.295, 0.055, 0, 0, 0, 0, 0, 1, 0]);
public function SBtn(){
super();
onRollOver = function ():void{
};
onRollOut = function ():void{
};
onPress = function ():void{
};
this.addEventListener(MouseEvent.MOUSE_OVER, rollOver, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_OUT, rollOut, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_DOWN, press, false, 0, true);
filters0 = this.filters.slice();
greyFilters = this.filters.concat([greyFilter]);
__selectAble = true;
}
public function set selectAble(_arg1:Boolean):void{
__selectAble = _arg1;
if (__selectAble){
this.mouseEnabled = true;
this.mouseChildren = true;
this.filters = filters0;
} else {
if (onErrorPress == null){
this.mouseEnabled = false;
};
this.mouseChildren = false;
this.filters = greyFilters;
};
}
public function press(_arg1:MouseEvent):void{
if (selectAble){
onPress(_arg1);
} else {
if (onErrorPress != null){
onErrorPress();
};
};
}
override public function removed(_arg1:Event=null):void{
this.removeEventListener(MouseEvent.MOUSE_OVER, rollOver);
this.removeEventListener(MouseEvent.MOUSE_OUT, rollOut);
this.removeEventListener(MouseEvent.MOUSE_DOWN, press);
super.removed();
onRollOver = null;
onRollOut = null;
onPress = null;
filters0 = null;
greyFilters = null;
onErrorPress = null;
}
public function get onErrorPress():Function{
return (__onErrorPress);
}
public function get selectAble():Boolean{
return (__selectAble);
}
public function rollOut(_arg1:MouseEvent):void{
if (selectAble){
onRollOut(_arg1);
if (Common.userMouse != null){
Common.userMouse.rollOut();
};
};
}
public function set onErrorPress(_arg1:Function):void{
__onErrorPress = _arg1;
this.mouseEnabled = true;
}
public function rollOver(_arg1:MouseEvent):void{
if (selectAble){
onRollOver(_arg1);
if (Common.userMouse != null){
Common.userMouse.rollOver();
};
};
}
}
}//package ui
Section 97
//Word (ui.Word)
package ui {
import flash.display.*;
import flash.geom.*;
import basic.*;
public class Word extends Mc {
private var __text;
private var __align:String;
private var total:int;
public var body:MovieClip;
private var wid:Number;
public function Word(){
total = body.numChildren;
text = 0;
}
public function get align():String{
return (__align);
}
public function get text(){
return (__text);
}
public function set align(_arg1:String):void{
__align = _arg1;
switch (__align){
case "left":
body.x = 0;
break;
case "right":
body.x = -(wid);
break;
case "center":
body.x = (-(wid) / 2);
break;
};
}
public function set text(_arg1):void{
var _local2:String;
var _local3:int;
var _local4:*;
var _local5:int;
__text = _arg1;
_local2 = String(__text);
_local3 = _local2.length;
_local5 = 0;
while (_local5 < _local3) {
_local4 = body[("num" + _local5)];
_local4.text = _local2.charAt(_local5);
_local4.visible = true;
_local5++;
};
wid = body.num0.getBounds(body).union(_local4.getBounds(body)).width;
align = align;
while (_local5 < total) {
var _temp1 = _local5;
_local5 = (_local5 + 1);
_local4 = body[("num" + _temp1)];
_local4.stop();
_local4.visible = false;
};
}
}
}//package ui
Section 98
//Common (Common)
package {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
public class Common {
public static const a2r:Number = (180 / Math.PI);
public static var main;
public static var game;
public static var pause:Boolean;
public static var userMouse;
public static function disorder(_arg1:Array):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:*;
_local2 = _arg1.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = random(_local2);
_local5 = _arg1[_local3];
_arg1[_local3] = _arg1[_local4];
_arg1[_local4] = _local5;
_local3++;
};
}
public static function random(_arg1:int):int{
return (int((Math.random() * _arg1)));
}
public static function checkDisplayObjects(_arg1:DisplayObjectContainer):void{
var _local2:Array;
var _local3:int;
var _local4:String;
var _local5:*;
_local2 = getVars(_arg1);
_local3 = 0;
for each (_local4 in _local2) {
_local5 = _arg1[_local4];
if ((_local5 is DisplayObject)){
_local3++;
trace(((((_local4 + ",parent=") + _local5.parent) + ",stage=") + _local5.stage));
};
};
trace((("共" + _local3) + "个------------"));
}
public static function collectChildren(_arg1:DisplayObjectContainer, _arg2:Function):Array{
var _local3:int;
var _local4:Array;
var _local5:Array;
var _local6:*;
_local3 = 0;
_local4 = getAllChildren(_arg1);
_local5 = new Array();
for each (_local6 in _local4) {
if (_arg2(_local6, _local3, _local4)){
_local5.push(_local6);
};
};
return (_local5);
}
public static function getAllChildren(_arg1:DisplayObjectContainer):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
_local2 = new Array();
_local3 = _arg1.numChildren;
_local4 = 0;
while (_local4 < _local3) {
_local2.push(_arg1.getChildAt(_local4));
_local4++;
};
return (_local2);
}
public static function setRGB(_arg1:DisplayObject, _arg2:int):void{
var _local3:ColorTransform;
_local3 = _arg1.transform.colorTransform;
_local3.color = _arg2;
_arg1.transform.colorTransform = _local3;
}
public static function getAllChildrenByOrder(_arg1:DisplayObjectContainer, _arg2:String):Array{
var _local3:Array;
_local3 = getAllChildren(_arg1);
_local3.sortOn(_arg2, Array.NUMERIC);
return (_local3);
}
public static function someChild(_arg1:DisplayObjectContainer, _arg2:Function):Boolean{
return (getAllChildren(_arg1).some(_arg2));
}
public static function everyChild(_arg1:DisplayObjectContainer, _arg2:Function):Boolean{
return (getAllChildren(_arg1).every(_arg2));
}
public static function forEachChild(_arg1:DisplayObjectContainer, _arg2:Function):void{
getAllChildren(_arg1).forEach(_arg2);
}
public static function selectTxt(_arg1:TextField):void{
_arg1.stage.focus = _arg1;
_arg1.setSelection(0, _arg1.text.length);
}
public static function getSum(_arg1:Array):Number{
var _local2:Number;
var _local3:Number;
_local2 = 0;
for each (_local3 in _arg1) {
_local2 = (_local2 + _local3);
};
return (_local2);
}
public static function randomLine(_arg1:Sprite, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:Point;
var _local8:Number;
var _local9:Number;
var _local10:Graphics;
var _local11:int;
_local7 = new Point((_arg4 - _arg2), (_arg5 - _arg3));
_local8 = _local7.length;
_local9 = Math.round((_local8 / _arg6));
_local7.x = (_local7.x / _local9);
_local7.y = (_local7.y / _local9);
_local10 = _arg1.graphics;
_local10.moveTo(_arg2, _arg3);
_local11 = 1;
while (_local11 < _local9) {
_local10.lineTo(((_arg2 + (_local7.x * _local11)) + ((Math.random() - 0.5) * _arg6)), ((_arg3 + (_local7.y * _local11)) + ((Math.random() - 0.5) * _arg6)));
_local11++;
};
_local10.lineTo(_arg4, _arg5);
}
public static function cloneObj(_arg1:Object):Object{
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.writeObject(_arg1);
_local2.position = 0;
return (_local2.readObject());
}
public static function fitRect(_arg1:MovieClip, _arg2:Rectangle):void{
var _local3:Rectangle;
_arg1.width = _arg2.width;
_arg1.height = _arg2.height;
_local3 = _arg1.getBounds(_arg1.parent);
_arg1.x = (_arg1.x + (_arg2.x - _local3.x));
_arg1.y = (_arg1.y + (_arg2.y - _local3.y));
}
public static function setFirstLetterUpperCase(_arg1:String):String{
return ((_arg1.charAt(0).toUpperCase() + _arg1.substr(1, _arg1.length)));
}
public static function getContainColor(_arg1:DisplayObject, _arg2:DisplayObject):int{
var _local3:Rectangle;
var _local4:BitmapData;
var _local5:Matrix;
var _local6:Matrix;
var _local7:Matrix;
var _local8:int;
_local3 = _arg2.getBounds(_arg2);
_local4 = new BitmapData(1, 1, true, 0);
_local5 = _arg1.transform.concatenatedMatrix;
_local6 = new Matrix(1, 0, 0, 1, _local3.x, _local3.y);
_local7 = _arg2.transform.concatenatedMatrix;
_local6.concat(new Matrix(_local3.width, 0, 0, _local3.height, _local3.x, _local3.y));
_local6.concat(_local7);
_local6.invert();
_local5.concat(_local6);
_local4.draw(_arg1, _local5);
_local8 = _local4.getPixel(0, 0);
return (_local8);
}
public static function randomPlay(_arg1:MovieClip):void{
var _local2:int;
var _local3:int;
var _local4:*;
_arg1.gotoAndPlay((Common.random(_arg1.totalFrames) + 1));
_local2 = _arg1.numChildren;
_local3 = 0;
while (_local3 < _local2) {
_local4 = _arg1.getChildAt(_local3);
if ((_local4 is MovieClip)){
randomPlay(_local4);
};
_local3++;
};
}
public static function getVars(_arg1):Array{
var instanceInfo:XML;
var properties:XMLList;
var vars:Array;
var propertyInfo:XML;
var obj = _arg1;
instanceInfo = describeType(obj);
properties = (instanceInfo..accessor.(@access != "writeonly") + instanceInfo..variable);
vars = new Array();
for each (propertyInfo in properties) {
vars.push(propertyInfo.@name);
};
return (vars);
}
public static function arrToStr(_arg1):String{
var _local2:String;
var _local3:*;
if ((_arg1 is Array)){
_local2 = "[";
for each (_local3 in _arg1) {
_local2 = (_local2 + (arrToStr(_local3) + ","));
};
return ((_local2.substr(0, (_local2.length - 1)) + "]"));
};
return (_arg1);
}
public static function moveTo(_arg1:DisplayObject, _arg2:DisplayObjectContainer):void{
var _local3:Matrix;
var _local4:Matrix;
_local3 = _arg1.transform.concatenatedMatrix;
_local4 = _arg2.transform.concatenatedMatrix;
_local4.invert();
_local3.concat(_local4);
_arg1.transform.matrix = _local3;
_arg2.addChild(_arg1);
}
public static function getRanArr(_arg1:int, _arg2:Array):Array{
var _local3:Array;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:int;
_local3 = _arg2.slice();
_local4 = (_arg1 / getSum(_local3));
_local5 = _local3.length;
_local6 = 0;
while (_local6 < _local5) {
_local3[_local6] = Math.round((_local3[_local6] * _local4));
_local6++;
};
while (getSum(_local3) > _arg1) {
_local7 = random(_local5);
if (_local3[_local7] > 0){
var _local8 = _local3;
var _local9 = _local7;
var _local10 = (_local8[_local9] - 1);
_local8[_local9] = _local10;
};
};
while (getSum(_local3) < _arg1) {
_local8 = _local3;
_local9 = random(_local5);
_local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
};
return (_local3);
}
public static function getURL(_arg1:String):void{
navigateToURL(new URLRequest(_arg1), "_blank");
}
public static function getContainBmd(_arg1:DisplayObject, _arg2:DisplayObject):BitmapData{
return (getRectContainBmd(_arg1, _arg2, _arg2.getBounds(_arg2)));
}
public static function randomStop(_arg1:MovieClip, _arg2:int=0):void{
if (_arg2 <= 0){
_arg2 = _arg1.totalFrames;
};
_arg1.gotoAndStop((Common.random(_arg2) + 1));
}
public static function setRGBOffset(_arg1:DisplayObject, _arg2:int, _arg3:int=1):void{
var _local4:ColorTransform;
_local4 = _arg1.transform.colorTransform;
_local4.redOffset = (((_arg2 >> 16) & 0xFF) - (0xFF * _arg3));
_local4.greenOffset = (((_arg2 >> 8) & 0xFF) - (0xFF * _arg3));
_local4.blueOffset = ((_arg2 & 0xFF) - (0xFF * _arg3));
_arg1.transform.colorTransform = _local4;
}
public static function getRectContainBmd(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Rectangle):BitmapData{
var _local4:BitmapData;
var _local5:Matrix;
var _local6:Matrix;
var _local7:Matrix;
_local4 = new BitmapData(_arg3.width, _arg3.height, true, 0);
_local5 = _arg1.transform.concatenatedMatrix;
_local6 = new Matrix(1, 0, 0, 1, _arg3.x, _arg3.y);
_local7 = _arg2.transform.concatenatedMatrix;
_local6.concat(_local7);
_local6.invert();
_local5.concat(_local6);
_local4.draw(_arg1, _local5);
return (_local4);
}
}
}//package
Section 99
//SndBg (SndBg)
package {
import flash.media.*;
public dynamic class SndBg extends Sound {
}
}//package
Section 100
//SndPress (SndPress)
package {
import flash.media.*;
public dynamic class SndPress extends Sound {
}
}//package
Section 101
//SndRollOver (SndRollOver)
package {
import flash.media.*;
public dynamic class SndRollOver extends Sound {
}
}//package