home *** CD-ROM | disk | FTP | other *** search
Text File | 2008-09-05 | 58.7 KB | 1,618 lines |
- package Gamefile
- {
- import fl.transitions.Tween;
- import fl.transitions.TweenEvent;
- import fl.transitions.easing.*;
- import flash.display.Bitmap;
- import flash.display.MovieClip;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.events.*;
- import flash.geom.Rectangle;
- import flash.utils.Timer;
-
- public class Main
- {
-
-
- private var _soleLayer_:MovieClip;
-
- private var _bg_:MovieClip;
-
- private var pencilFlag:Boolean;
-
- private var actionAnimalScaleYTween:Tween;
-
- public var helpAutoEnd:Boolean;
-
- private var printHeight:int;
-
- private var _toner_:MovieClip;
-
- private var helprepealAllMovie:MovieClip;
-
- private var pencilTool:PencilTool;
-
- private var helpSoundFunction:Function;
-
- private var BG:Background;
-
- private var moving:Move;
-
- private var delScaleYTween:Tween;
-
- private var mouseTweenX:Tween;
-
- private var mouseTweenY:Tween;
-
- private var helpFlag:Boolean;
-
- private var helpBGNum:int;
-
- private var curveLineDelCount:int;
-
- private var _backBtn_:SimpleButton;
-
- private var helpYTrackArr:Array;
-
- private var delYTween1:Tween;
-
- private var delYTween4:Tween;
-
- private var _printLayer_:MovieClip;
-
- private var delYTween3:Tween;
-
- private var helpSprayCount:int;
-
- private var _hotArea_:SimpleButton;
-
- private var helpLoopSum:int;
-
- private var logoMC:MovieClip;
-
- private var _sprayLayer_:MovieClip;
-
- private var helpLoopCount:int;
-
- private var helpAnimal:SimpleButton;
-
- private var helpTimerFunction:Function;
-
- private var PARENT:MovieClip;
-
- private var spray:Spray;
-
- private var yTrackArr:Array;
-
- private var moveSum:Number;
-
- private var bmpTool:BmpTool;
-
- private var _main_:MovieClip;
-
- private var _helpShowLayer_:MovieClip;
-
- private var sole:Sole;
-
- private var rectSole:Rectangle;
-
- private var movingFlag:Boolean;
-
- private var operateType:int;
-
- private var _pushpin_:MovieClip;
-
- private var loopCount:int;
-
- private var mouseControl:MouseControl;
-
- private var chooseAnimal:SimpleButton;
-
- private var drawTool:DrawTool;
-
- private var helpActionAnimalYTween:Tween;
-
- private var helpActionAnimalScaleXTween:Tween;
-
- private var printWidth:int;
-
- private var _paintBarrel_:MovieClip;
-
- private var delAlphaTween3:Tween;
-
- private var delAlphaTween4:Tween;
-
- private var helpTrackFlag:Boolean;
-
- private var sound:String;
-
- private var actionAnimalAlphaTween:Tween;
-
- private var delAlphaTween1:Tween;
-
- private var delAlphaTween2:Tween;
-
- private var _mainBG_:MovieClip;
-
- private var loopSum:int;
-
- private var helpRepealCount:int;
-
- private var help:Help;
-
- private var timer:Timer;
-
- private var _paintBarrelColorLayer_:MovieClip;
-
- private var animalType:int;
-
- private var trackFlag:Boolean;
-
- private var helpBackFlag:Boolean;
-
- private var curveLineType:int;
-
- private var color:uint;
-
- private var helpXTrackArr:Array;
-
- private var soundTimer:Timer;
-
- private var _mouse_:MovieClip;
-
- private var helprepealMovie:MovieClip;
-
- private var trackTool:TrackTool;
-
- private var sprayType:int;
-
- private var actionAnimalScaleXTween:Tween;
-
- private var sprayDelCount:int;
-
- private var repeal:Repeal;
-
- private var printBmp:Bitmap;
-
- private var colorTool:ColorTool;
-
- private var mouseTimer:Timer;
-
- private var previousCurveLineStartX:int;
-
- private var previousCurveLineStartY:int;
-
- private var helpActionAnimalScaleYTween:Tween;
-
- private var xTrackArr:Array;
-
- private var helpTweenFunction:Function;
-
- private var helpActionAnimal:MovieClip;
-
- private var soleDelCount:int;
-
- private var helpActionAnimalAlphaTween:Tween;
-
- private var delScaleXTween:Tween;
-
- private var printSprite:Sprite;
-
- private var _operateLayer_:MovieClip;
-
- private var actionAnimal:MovieClip;
-
- private var actionAnimalYTween:Tween;
-
- private var printTool:PrintTool;
-
- private var pencilType:int;
-
- private var helpMovingFunction:Function;
-
- private var pencilDelCount:int;
-
- private var currentlyBGNum:int;
-
- private var animal:Animal;
-
- public function Main(param1:MovieClip)
- {
- super();
- initMain(param1);
- }
-
- private function mouseIsDown(param1:MouseEvent) : *
- {
- if(movingFlag == false && trackFlag == false && animalType == 1)
- {
- if(actionAnimal.visible == false)
- {
- actionAnimal.visible = true;
- }
- moving.getCoord(actionAnimal,_operateLayer_.mouseX,_operateLayer_.mouseY);
- actionAnimal.alpha = 0;
- actionAnimal.scaleX = 2;
- actionAnimal.scaleY = 2;
- actionAnimal.stop();
- actionAnimalAlphaTween = new Tween(actionAnimal,"alpha",Regular.easeOut,actionAnimal.alpha,1,0.2,true);
- actionAnimalScaleXTween = new Tween(actionAnimal,"scaleX",Regular.easeOut,actionAnimal.scaleX,1,0.2,true);
- actionAnimalScaleYTween = new Tween(actionAnimal,"scaleY",Regular.easeOut,actionAnimal.scaleY,1,0.2,true);
- actionAnimalYTween = new Tween(actionAnimal,"y",Regular.easeOut,actionAnimal.y - 50,actionAnimal.y,0.2,true);
- startGetTrack();
- }
- else if(movingFlag == false && trackFlag == false && (animalType == 2 || animalType == 3))
- {
- if(animalType == 2)
- {
- SoundsManager.playSound("_Whale_S_");
- spray.drawSpray(_soleLayer_,_sprayLayer_,_operateLayer_.mouseX,_operateLayer_.mouseY,sprayType,color,helpFlag);
- }
- else if(animalType == 3)
- {
- spray.drawSingleSpray(_soleLayer_,_operateLayer_.mouseX,_operateLayer_.mouseY,sprayType);
- }
- operateType = spray.operateType;
- repeal.noteInformation(operateType);
- drawBmp();
- }
- else if(movingFlag == false && trackFlag == false && (animalType == 4 || animalType == 5))
- {
- if(actionAnimal.visible == false)
- {
- actionAnimal.visible = true;
- }
- moving.getCoord(actionAnimal,_operateLayer_.mouseX,_operateLayer_.mouseY);
- actionAnimal.alpha = 0;
- actionAnimal.scaleX = 2;
- actionAnimal.scaleY = 2;
- actionAnimal.stop();
- actionAnimalAlphaTween = new Tween(actionAnimal,"alpha",Regular.easeOut,actionAnimal.alpha,1,0.2,true);
- actionAnimalScaleXTween = new Tween(actionAnimal,"scaleX",Regular.easeOut,actionAnimal.scaleX,1,0.2,true);
- actionAnimalScaleYTween = new Tween(actionAnimal,"scaleY",Regular.easeOut,actionAnimal.scaleY,1,0.2,true);
- actionAnimalYTween = new Tween(actionAnimal,"y",Regular.easeOut,actionAnimal.y - 50,actionAnimal.y,0.2,true);
- startGetTrack();
- }
- else if(movingFlag == false && trackFlag == false && (pencilType == 1 || pencilType == 2))
- {
- startPencil();
- }
- else if(movingFlag == true)
- {
- mouseControl._mouse_.gotoAndStop(4);
- _operateLayer_.stage.addEventListener(MouseEvent.MOUSE_UP,mouseIsUp);
- }
- }
-
- private function helpPencilSound(param1:TimerEvent) : *
- {
- soundTimer.removeEventListener(TimerEvent.TIMER,helpPencilSound);
- soundTimer = null;
- SoundsManager.playSound("_GameMouseDown_");
- }
-
- private function repealAllMain() : *
- {
- delAlphaTween1 = null;
- delYTween1 = null;
- delAlphaTween2 = null;
- delScaleXTween = null;
- delScaleYTween = null;
- soleDelCount = 0;
- sprayDelCount = 0;
- pencilDelCount = 0;
- curveLineDelCount = 0;
- if(movingFlag == true && animalType == 1)
- {
- endMove();
- }
- else if((animalType == 4 || animalType == 5) && movingFlag == true)
- {
- endMove();
- }
- sole.soleArr = repeal.repealAllObj(sole.soleArr);
- spray.sprayArr = repeal.repealAllObj(spray.sprayArr);
- pencilTool.pencilArr = repeal.repealAllObj(pencilTool.pencilArr);
- drawTool.curveLineArr = repeal.repealAllObj(drawTool.curveLineArr);
- bmpTool.delBmp(_soleLayer_);
- repeal.repealArr = [];
- }
-
- private function choosePencil(param1:Event) : *
- {
- if(movingFlag == false && trackFlag == false)
- {
- animalType = 0;
- animal.animalType = 0;
- pencilType = pencilTool.pencilType;
- animal.clearBtnFilters();
- mouseControl._mouse_.gotoAndStop(2);
- }
- }
-
- private function startPencil() : *
- {
- if(pencilFlag == false)
- {
- _operateLayer_.addEventListener(MouseEvent.MOUSE_MOVE,pencilDrawing);
- _operateLayer_.stage.addEventListener(MouseEvent.MOUSE_UP,endPencil);
- pencilTool.createPencilMC(_soleLayer_,_operateLayer_.mouseX,_operateLayer_.mouseY,color);
- }
- }
-
- private function printing(param1:Event) : *
- {
- _pushpin_.visible = false;
- bmpTool.hideBmp(_soleLayer_);
- drawTool.showCurveLine();
- pencilTool.showPencilArr();
- sole.showSoleArr();
- spray.showSpray();
- rectSole = new Rectangle(0,0,printWidth,printHeight);
- printTool.createMask(_mainBG_,_printLayer_,_printLayer_.x,_printLayer_.y);
- printTool.printOpus(_printLayer_,rectSole);
- printTool.delMask(_printLayer_);
- _pushpin_.visible = true;
- bmpTool.showBmp(_soleLayer_);
- drawTool.hideCurveLine();
- pencilTool.hidePencilArr();
- sole.hideSoleArr();
- spray.hideSpray();
- }
-
- private function startGetTrack() : *
- {
- _operateLayer_.stage.addEventListener(MouseEvent.MOUSE_UP,endGetTrack);
- _operateLayer_.addEventListener(MouseEvent.MOUSE_MOVE,getTrack);
- trackFlag = true;
- trackTool.startGetTrack(_operateLayer_.mouseX,_operateLayer_.mouseY);
- drawTool.startDrawLine(_operateLayer_.mouseX,_operateLayer_.mouseY);
- mouseControl._mouse_.gotoAndStop(1);
- }
-
- private function clearTrackArray() : *
- {
- trackTool.clearArray();
- xTrackArr = [];
- yTrackArr = [];
- }
-
- private function mouseIsOut(param1:Event) : *
- {
- if((animalType == 1 || (animalType == 4 || animalType == 5)) && movingFlag == true)
- {
- mouseControl._mouse_.gotoAndStop(1);
- }
- else if((animalType == 1 || (animalType == 4 || animalType == 5)) && trackFlag == true)
- {
- mouseControl._mouse_.gotoAndStop(1);
- }
- else if(animalType == 1 || (animalType == 4 || animalType == 5))
- {
- mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
- }
- else
- {
- mouseControl._mouse_.gotoAndStop(1);
- }
- }
-
- private function helpDelMC(param1:TweenEvent) : *
- {
- _helpShowLayer_.removeChildAt(_helpShowLayer_.numChildren - 1);
- }
-
- private function mouseIsOver(param1:Event) : *
- {
- if((animalType == 1 || (animalType == 4 || animalType == 5)) && movingFlag == true)
- {
- mouseControl._mouse_.gotoAndStop(2);
- }
- else if((animalType == 1 || (animalType == 4 || animalType == 5)) && trackFlag == true)
- {
- mouseControl._mouse_.gotoAndStop(1);
- }
- else if(animalType == 1 || (animalType == 4 || animalType == 5))
- {
- mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
- }
- else
- {
- mouseControl._mouse_.gotoAndStop(2);
- }
- }
-
- private function helpAnimalTweenEnd(param1:TweenEvent) : *
- {
- mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpAnimalTweenEnd);
- mouseTweenX = null;
- mouseTweenY = null;
- SoundsManager.playSound("_GameMouseOver_");
- SoundsManager.playSound("_Cat_S_");
- animal.showHelpAnimalMovie(help.animalMovieX,help.animalMovieY,help.animalMovieScale);
- animal.animalGlowFilter(animal.helpMovie);
- _mouse_.gotoAndStop(8);
- timer = new Timer(1000,0);
- timer.addEventListener(TimerEvent.TIMER,startHelpTrack);
- helpTimerFunction = startHelpTrack;
- timer.start();
- }
-
- private function helpRepealAllSound(param1:TimerEvent) : *
- {
- timer.removeEventListener(TimerEvent.TIMER,helpRepealAllSound);
- timer = null;
- repeal.showRepealMC(_operateLayer_);
- helpRepealAll();
- }
-
- private function startHelpTrack(param1:TimerEvent) : *
- {
- _mouse_.gotoAndStop(8);
- timer.removeEventListener(TimerEvent.TIMER,startHelpTrack);
- timer = null;
- mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,helpXTrackArr[0] + 99,1,true);
- mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,helpYTrackArr[0] + 23.6,1,true);
- mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpTrack);
- animal.delHelpMovie();
- animal.animalGlowFilter(helpAnimal);
- helpTweenFunction = helpTrack;
- }
-
- private function chooseTheAnimalMain() : *
- {
- animalType = animal.animalType;
- chooseAnimal = animal.returnChooseAnimal();
- actionAnimal = animal.returnActionAnimal();
- showActionAnimal();
- mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
- }
-
- private function helpRepealOBJ(param1:TimerEvent) : *
- {
- var _loc2_:* = undefined;
- var _loc3_:* = undefined;
- var _loc4_:* = undefined;
- var _loc5_:* = undefined;
- var _loc6_:* = undefined;
- _mouse_.gotoAndStop(2);
- SoundsManager.playSound("_Squirrel_S_");
- if(helpRepealCount == 1)
- {
- _loc2_ = new Tween(_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1),"alpha",Regular.easeOut,_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1).alpha,0,0.2,true);
- _loc3_ = new Tween(_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1),"y",Regular.easeOut,_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1).y,_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1).y + 20,0.2,true);
- _loc2_.addEventListener(TweenEvent.MOTION_FINISH,helpDelMC);
- helpTweenFunction = helpDelMC;
- }
- else
- {
- _loc4_ = new Tween(_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1),"alpha",Regular.easeOut,_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1).alpha,0,0.2,true);
- _loc5_ = new Tween(_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1),"scaleX",Regular.easeOut,_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1).scaleX,1.5,0.2,true);
- _loc6_ = new Tween(_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1),"scaleY",Regular.easeOut,_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1).scaleY,1.5,0.2,true);
- _loc4_.addEventListener(TweenEvent.MOTION_FINISH,helpDelMC);
- helpTweenFunction = helpDelMC;
- }
- ++helpRepealCount;
- if(helpRepealCount == 4)
- {
- helprepealMovie.parent.removeChild(helprepealMovie);
- helprepealMovie = null;
- repeal._repealBtn_.visible = true;
- helpRepealCount = 1;
- timer.removeEventListener(TimerEvent.TIMER,helpRepealOBJ);
- timer = null;
- timer = new Timer(500,0);
- timer.addEventListener(TimerEvent.TIMER,startHelpRepealAll);
- helpTimerFunction = startHelpRepealAll;
- timer.start();
- }
- }
-
- private function pencilDrawing(param1:MouseEvent) : *
- {
- if(pencilTool.drawFlag == false)
- {
- pencilTool.drawFlag = true;
- }
- pencilFlag = true;
- pencilTool.Pencildrawing(_operateLayer_.mouseX,_operateLayer_.mouseY);
- }
-
- public function delMain() : *
- {
- mouseControl.delMouseControl();
- animal.delEvent();
- BG.delEvent();
- colorTool.delEvent();
- help.delEvent();
- pencilTool.delEvent();
- printTool.delEvent();
- repeal.delEvent();
- spray.delEvent();
- delEvent();
- repealAllMain();
- PARENT.removeChild(_main_);
- }
-
- private function showMain() : *
- {
- animal = new Animal(_main_);
- moving = new Move();
- sole = new Sole();
- trackTool = new TrackTool();
- colorTool = new ColorTool(_main_);
- drawTool = new DrawTool(_operateLayer_);
- bmpTool = new BmpTool();
- repeal = new Repeal(_main_);
- spray = new Spray(_main_);
- pencilTool = new PencilTool(_main_);
- BG = new Background(_bg_,_main_);
- printTool = new PrintTool(_main_);
- help = new Help(_main_);
- mouseControl = new MouseControl(PARENT);
- _main_.addEventListener("chooseTheAnimal",chooseTheAnimal);
- _main_.addEventListener("changeColor",changeColor);
- _main_.addEventListener("repealOperate",fadeOutSole);
- _main_.addEventListener("choosePencil",choosePencil);
- _main_.addEventListener("repealAll",repealAll);
- _main_.addEventListener("printing",printing);
- _main_.addEventListener("startHelp",startHelp);
- _main_.addEventListener("mouseIsOver",mouseIsOver);
- _main_.addEventListener("mouseIsOut",mouseIsOut);
- _main_.addEventListener("mouseIsNotEnabled",mouseIsNotEnabled);
- _main_.addEventListener("changeSprayType",changeSprayType);
- }
-
- private function helpPencilTweenEnd(param1:TweenEvent) : *
- {
- SoundsManager.playSound("_GameMouseOver_");
- soundTimer = new Timer(400,0);
- soundTimer.addEventListener(TimerEvent.TIMER,helpPencilSound);
- soundTimer.start();
- helpSoundFunction = helpPencilSound;
- mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpPencilTweenEnd);
- mouseTweenX = null;
- mouseTweenY = null;
- helpSprayCount = 0;
- animal.clearBtnFilters();
- animal.showHelpPencilMovie(help.pencilMovieX,help.pencilMovieY,help.pencilMovieScale);
- animal.animalGlowFilter(animal.helpMovie);
- _mouse_.gotoAndStop(2);
- timer = new Timer(1000,0);
- timer.addEventListener(TimerEvent.TIMER,startHelpPencil);
- helpTimerFunction = startHelpPencil;
- timer.start();
- }
-
- private function helpRepealAllTweenEnd(param1:TweenEvent) : *
- {
- SoundsManager.playSound("_GameMouseOver_");
- helpTimerFunction = helpRepealAllSound;
- repeal._repealAllBtn_.visible = false;
- helprepealAllMovie = new _RepealAllMovie_();
- animal._animalBtnMC_.addChild(helprepealAllMovie);
- helprepealAllMovie.x = help.repealMovieX + 45;
- helprepealAllMovie.y = help.repealMovieY - 25;
- helprepealAllMovie.scaleX = 0.8;
- helprepealAllMovie.scaleY = 0.8;
- mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpRepealAllTweenEnd);
- mouseTweenX = null;
- mouseTweenY = null;
- _mouse_.gotoAndStop(2);
- animal.showHelpRepealAllMovie(help.repealAllMovieX,help.repealAllMovieY,help.repealAllMovieScale);
- helpAutoEnd = true;
- timer = new Timer(400,0);
- timer.addEventListener(TimerEvent.TIMER,helpRepealAllSound);
- timer.start();
- }
-
- private function repealOperate(param1:TweenEvent) : *
- {
- SoundsManager.stopMusic();
- if(movingFlag == true && animalType == 1)
- {
- endMove();
- }
- else if((animalType == 4 || animalType == 5) && movingFlag == true)
- {
- endMove();
- }
- switch(repeal.repealOperateType())
- {
- case 1:
- delAlphaTween1 = null;
- delYTween1 = null;
- soleDelCount = 0;
- sole.soleArr = repeal.repealObj(sole.soleArr);
- drawBmp();
- break;
- case 2:
- delAlphaTween2 = null;
- delScaleXTween = null;
- delScaleYTween = null;
- sprayDelCount = 0;
- spray.sprayArr = repeal.repealObj(spray.sprayArr);
- drawBmp();
- break;
- case 3:
- delAlphaTween3 = null;
- delYTween3 = null;
- pencilDelCount = 0;
- pencilTool.pencilArr = repeal.repealObj(pencilTool.pencilArr);
- drawBmp();
- break;
- case 4 || 5:
- delAlphaTween4 = null;
- delYTween4 = null;
- curveLineDelCount = 0;
- drawTool.curveLineArr = repeal.repealObj(drawTool.curveLineArr);
- drawBmp();
- }
- repeal.delInformation();
- }
-
- private function helpAnimalStartMoving() : *
- {
- helpActionAnimalAlphaTween = null;
- helpActionAnimalScaleXTween = null;
- helpActionAnimalScaleYTween = null;
- helpActionAnimalYTween = null;
- SoundsManager.playMusic("_WalkLoop_");
- _main_.addEventListener(Event.ENTER_FRAME,helpAnimalMoving);
- helpMovingFunction = helpAnimalMoving;
- _main_.addEventListener("getSpeed",getSpeed);
- }
-
- private function helpSpraySound(param1:TimerEvent) : *
- {
- soundTimer.removeEventListener(TimerEvent.TIMER,helpSpraySound);
- soundTimer = null;
- SoundsManager.playSound("_Whale_S_");
- }
-
- private function endHelpMain() : *
- {
- SoundsManager.stopMusic();
- PARENT.stage.removeEventListener(MouseEvent.MOUSE_UP,stageClick);
- if(timer != null)
- {
- timer.removeEventListener(TimerEvent.TIMER,helpTimerFunction);
- timer = null;
- }
- if(mouseTweenX != null)
- {
- mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpTweenFunction);
- mouseTweenX = null;
- mouseTweenY = null;
- }
- if(soundTimer != null)
- {
- soundTimer.removeEventListener(TweenEvent.MOTION_FINISH,helpSoundFunction);
- soundTimer = null;
- }
- if(helpMovingFunction != null)
- {
- _main_.removeEventListener(Event.ENTER_FRAME,helpMovingFunction);
- _main_.removeEventListener("getSpeed",getSpeed);
- helpMovingFunction = null;
- }
- if(helpActionAnimalAlphaTween != null)
- {
- helpActionAnimalAlphaTween.removeEventListener(TweenEvent.MOTION_FINISH,helpAnimalStartMoving);
- helpActionAnimalAlphaTween = null;
- helpActionAnimalScaleXTween = null;
- helpActionAnimalScaleYTween = null;
- helpActionAnimalYTween = null;
- }
- _operateLayer_.graphics.clear();
- _mouse_.parent.removeChild(_mouse_);
- _mouse_ = null;
- if(helpAutoEnd == false)
- {
- repeal.delRepealMCEvent();
- helpRepealAll();
- }
- sole.pushEndFlag(helpFlag);
- BG._bg_.gotoAndStop(currentlyBGNum);
- BG._bgBtn_.gotoAndStop(currentlyBGNum);
- BG.getBgNum(currentlyBGNum);
- animal.delHelpMovie();
- animal.clearBtnFilters();
- pencilTool.clearBtnFilters();
- helpFlag = false;
- helpLoopCount = 1;
- mouseControl.initMouseControl(PARENT);
- mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
- bmpTool.showBmp(_soleLayer_);
- animal.clearBtnFilters();
- helpRepealCount = 1;
- helpSprayCount = 0;
- helpBGNum = 1;
- if(helprepealMovie != null)
- {
- helprepealMovie.parent.removeChild(helprepealMovie);
- helprepealMovie = null;
- }
- repeal._repealBtn_.visible = true;
- if(helprepealAllMovie != null)
- {
- helprepealAllMovie.parent.removeChild(helprepealAllMovie);
- helprepealAllMovie = null;
- }
- repeal._repealAllBtn_.visible = true;
- if(animalType > 0)
- {
- animal.animalGlowFilter(chooseAnimal);
- }
- else if(pencilType > 0)
- {
- pencilTool.pencilGlowFilter();
- }
- _main_.mouseChildren = true;
- getHelpInformation();
- back();
- trace("helpEnd");
- }
-
- private function getSpeed(param1:Event) : *
- {
- if(helpFlag == false)
- {
- moving.getSpeed(xTrackArr[loopCount - 1],yTrackArr[loopCount - 1],xTrackArr[loopCount],yTrackArr[loopCount]);
- ++loopCount;
- }
- else if(helpFlag == true)
- {
- moving.getSpeed(helpXTrackArr[helpLoopCount - 1],helpYTrackArr[helpLoopCount - 1],helpXTrackArr[helpLoopCount],helpYTrackArr[helpLoopCount]);
- if(helpTrackFlag == true)
- {
- drawTool.drawLine(helpXTrackArr[helpLoopCount - 1],helpYTrackArr[helpLoopCount - 1]);
- }
- ++helpLoopCount;
- }
- }
-
- private function helpBGTweenStart(param1:TimerEvent) : *
- {
- helpActionAnimalAlphaTween = null;
- helpActionAnimal.parent.removeChild(helpActionAnimal);
- timer.removeEventListener(TimerEvent.TIMER,helpBGTweenStart);
- timer = null;
- _mouse_.parent.removeChild(_mouse_);
- _mouse_ = null;
- _mouse_ = new _Mouse_();
- PARENT.addChild(_mouse_);
- _mouse_.gotoAndStop(8);
- _mouse_.x = helpXTrackArr[helpXTrackArr.length - 1];
- _mouse_.y = helpYTrackArr[helpYTrackArr.length - 1] + 23.6;
- mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.BGX,1,true);
- mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.BGY,1,true);
- mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpBGTweenEnd);
- helpTweenFunction = helpBGTweenEnd;
- }
-
- private function helpTrack(param1:TweenEvent) : *
- {
- mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpTrack);
- mouseTweenX = null;
- mouseTweenY = null;
- _mouse_.parent.removeChild(_mouse_);
- _mouse_ = null;
- _mouse_ = new _Mouse_();
- _operateLayer_.addChild(_mouse_);
- helpTrackFlag = true;
- moving.getCoord(_mouse_,helpXTrackArr[0],helpYTrackArr[0]);
- drawTool.startDrawLine(helpXTrackArr[0],helpYTrackArr[0]);
- helpLoopSum = helpXTrackArr.length;
- moving.getSpeed(helpXTrackArr[helpLoopCount - 1],helpYTrackArr[helpLoopCount - 1],helpXTrackArr[helpLoopCount],helpYTrackArr[helpLoopCount]);
- ++helpLoopCount;
- _main_.addEventListener(Event.ENTER_FRAME,helpTracking);
- helpMovingFunction = helpTracking;
- _main_.addEventListener("getSpeed",getSpeed);
- _operateLayer_.addChild(helpActionAnimal);
- helpActionAnimal.alpha = 0;
- moving.getCoord(helpActionAnimal,helpXTrackArr[0],helpYTrackArr[0]);
- helpActionAnimal.scaleX = 2;
- helpActionAnimal.scaleY = 2;
- helpActionAnimalAlphaTween = new Tween(helpActionAnimal,"alpha",Regular.easeOut,helpActionAnimal.alpha,1,0.2,true);
- helpActionAnimalScaleXTween = new Tween(helpActionAnimal,"scaleX",Regular.easeOut,helpActionAnimal.scaleX,1,0.2,true);
- helpActionAnimalScaleYTween = new Tween(helpActionAnimal,"scaleY",Regular.easeOut,helpActionAnimal.scaleY,1,0.2,true);
- helpActionAnimalYTween = new Tween(helpActionAnimal,"y",Regular.easeOut,helpActionAnimal.y - 50,helpActionAnimal.y,0.2,true);
- }
-
- private function endHelp(param1:TimerEvent) : *
- {
- helprepealAllMovie.parent.removeChild(helprepealAllMovie);
- helprepealAllMovie = null;
- repeal._repealAllBtn_.visible = true;
- _mouse_.gotoAndStop(animal.animalDownFrame);
- endHelpMain();
- }
-
- private function helpSprayTweenEnd(param1:TweenEvent) : *
- {
- SoundsManager.playSound("_GameMouseOver_");
- soundTimer = new Timer(300,0);
- soundTimer.addEventListener(TimerEvent.TIMER,helpSpraySound);
- soundTimer.start();
- helpSoundFunction = helpSpraySound;
- mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpSprayTweenEnd);
- mouseTweenX = null;
- mouseTweenY = null;
- animal.clearBtnFilters();
- helpAnimal = animal.outputHelpSprayAnimal();
- animal.showHelpSprayMovie(help.sprayMovieX,help.sprayMovieY,help.sprayMovieScale);
- animal.animalGlowFilter(animal.helpMovie);
- _mouse_.gotoAndStop(2);
- timer = new Timer(1300,0);
- timer.addEventListener(TimerEvent.TIMER,startHelpSpray);
- helpTimerFunction = startHelpSpray;
- timer.start();
- }
-
- private function startHelp(param1:Event) : *
- {
- if(movingFlag == false)
- {
- startHelpMain(false);
- }
- }
-
- private function helpRepealTweenEnd(param1:TweenEvent) : *
- {
- SoundsManager.playSound("_GameMouseOver_");
- repeal._repealBtn_.visible = false;
- helprepealMovie = new _RepealMovie_();
- animal._animalBtnMC_.addChild(helprepealMovie);
- helprepealMovie.x = help.repealMovieX - 20;
- helprepealMovie.y = help.repealMovieY - 24;
- helprepealMovie.scaleX = 0.8;
- helprepealMovie.scaleY = 0.8;
- mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpRepealTweenEnd);
- mouseTweenX = null;
- mouseTweenY = null;
- timer = new Timer(1000,0);
- timer.addEventListener(TimerEvent.TIMER,helpRepealOBJ);
- helpTimerFunction = helpRepealOBJ;
- timer.start();
- }
-
- private function helpRepealAll() : *
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- if(helpAutoEnd == true)
- {
- SoundsManager.playSound("_Elephant_S_");
- }
- _loc1_ = _helpShowLayer_.numChildren;
- _loc2_ = 0;
- while(_loc2_ < _loc1_ - 1)
- {
- _helpShowLayer_.removeChildAt(_helpShowLayer_.numChildren - 1);
- _loc2_++;
- }
- _loc1_ = _operateLayer_.numChildren;
- _loc3_ = 0;
- while(_loc3_ < _loc1_ - 2)
- {
- if(helpAutoEnd == false)
- {
- _operateLayer_.removeChildAt(_operateLayer_.numChildren - 1);
- }
- _loc3_++;
- }
- if(helpAutoEnd == true)
- {
- timer = new Timer(2500,0);
- timer.addEventListener(TimerEvent.TIMER,endHelp);
- helpTimerFunction = endHelp;
- timer.start();
- }
- }
-
- private function back() : *
- {
- if(helpBackFlag == true)
- {
- PARENT.dispatchEvent(new Event("delMain",true));
- }
- }
-
- private function initMain(param1:MovieClip) : *
- {
- PARENT = param1;
- initElement();
- initEvent();
- initProperty();
- getHelpInformation();
- chooseTheAnimalMain();
- }
-
- private function startHelpRepealObj(param1:TimerEvent) : *
- {
- _mouse_.parent.removeChild(_mouse_);
- _mouse_ = null;
- _mouse_ = new _Mouse_();
- PARENT.addChild(_mouse_);
- _mouse_.gotoAndStop(1);
- _mouse_.x = helpXTrackArr[helpXTrackArr.length - 1] + 99;
- _mouse_.y = helpYTrackArr[helpYTrackArr.length - 1] + 23.6;
- timer.removeEventListener(TimerEvent.TIMER,startHelpRepealObj);
- timer = null;
- mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.repealX,1,true);
- mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.repealY,1,true);
- mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpRepealTweenEnd);
- helpTweenFunction = helpRepealTweenEnd;
- }
-
- private function fadeOutSprayMain(param1:MovieClip) : *
- {
- if(delAlphaTween2 == null)
- {
- delAlphaTween2 = new Tween(param1,"alpha",Regular.easeOut,param1.alpha,0,0.2,true);
- delScaleXTween = new Tween(param1,"scaleX",Regular.easeOut,param1.scaleX,1.5,0.2,true);
- delScaleYTween = new Tween(param1,"scaleY",Regular.easeOut,param1.scaleY,1.5,0.2,true);
- delAlphaTween2.addEventListener(TweenEvent.MOTION_FINISH,repealOperate);
- }
- }
-
- private function getHelpInformation() : *
- {
- helpAnimal = animal.outputHelpAnimal();
- helpActionAnimal = animal.outputHelpActionAnimal();
- helpXTrackArr = help.animalXArr;
- helpYTrackArr = help.animalYArr;
- }
-
- private function mouseIsNotEnabled(param1:Event) : *
- {
- mouseControl._mouse_.gotoAndStop(3);
- }
-
- private function endMoving(param1:TweenEvent) : *
- {
- endMove();
- }
-
- private function drawObj() : *
- {
- rectSole = new Rectangle(0,0,_bg_.width,_bg_.height);
- bmpTool.cutoutBmp(_soleLayer_,_soleLayer_,rectSole);
- rectSole = null;
- }
-
- private function repealAll(param1:Event) : *
- {
- SoundsManager.stopMusic();
- repeal.showRepealMC(_operateLayer_);
- repealAllMain();
- }
-
- private function helpTracking(param1:Event) : *
- {
- moving.moving(_mouse_,false);
- _mouse_.gotoAndStop(1);
- if(helpLoopCount == helpLoopSum)
- {
- _main_.removeEventListener(Event.ENTER_FRAME,helpTracking);
- _main_.removeEventListener("getSpeed",getSpeed);
- helpTrackFlag = false;
- _mouse_.gotoAndStop(1);
- helpLoopCount = 1;
- _operateLayer_.graphics.clear();
- moving.getSpeed(helpXTrackArr[helpLoopCount - 1],helpYTrackArr[helpLoopCount - 1],helpXTrackArr[helpLoopCount],helpYTrackArr[helpLoopCount]);
- ++helpLoopCount;
- helpAnimalStartMoving();
- }
- }
-
- public function startHelpMain(param1:Boolean) : *
- {
- trace("help");
- helpBackFlag = param1;
- mouseControl.delEvent();
- mouseControl.delMouse();
- helpFlag = true;
- _main_.mouseChildren = false;
- bmpTool.hideBmp(_soleLayer_);
- animal.clearBtnFilters();
- pencilTool.clearBtnFilters();
- currentlyBGNum = BG.intoBgNum();
- trace("currentlyBGNum === " + currentlyBGNum);
- help.getAnimalBtnY(animal.outPutBtnMCY());
- _mouse_ = new _Mouse_();
- PARENT.addChild(_mouse_);
- _mouse_.gotoAndStop(1);
- _mouse_.x = 640 / 2;
- _mouse_.y = 480 / 2;
- mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.animalX,1,true);
- mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.animalY,1,true);
- mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpAnimalTweenEnd);
- helpTweenFunction = helpAnimalTweenEnd;
- PARENT.stage.addEventListener(MouseEvent.MOUSE_UP,stageClick);
- }
-
- private function initProperty() : *
- {
- showMain();
- animalType = 0;
- trackFlag = false;
- movingFlag = false;
- loopCount = 1;
- loopSum = 0;
- moveSum = 36;
- color = 16663877;
- operateType = 0;
- sprayType = 1;
- pencilType = 0;
- pencilFlag = false;
- printWidth = 516;
- printHeight = 349;
- helpFlag = false;
- helpTrackFlag = false;
- helpLoopCount = 1;
- helpLoopSum = 0;
- helpBGNum = 1;
- helpSprayCount = 0;
- helpRepealCount = 1;
- helpBackFlag = false;
- helpAutoEnd = true;
- soleDelCount = 0;
- sprayDelCount = 0;
- curveLineDelCount = 0;
- pencilDelCount = 0;
- logoMC.gotoAndStop(Language.frame_logo);
- }
-
- private function stageClick(param1:MouseEvent) : *
- {
- helpAutoEnd = false;
- endHelpMain();
- }
-
- private function fadeOutSole(param1:Event) : *
- {
- if(movingFlag == true && animalType == 1)
- {
- endMove();
- }
- else if((animalType == 4 || animalType == 5) && movingFlag == true)
- {
- endMove();
- }
- drawTool.showCurveLine();
- pencilTool.showPencilArr();
- sole.showSoleArr();
- spray.showSpray();
- delBmp();
- switch(repeal.repealOperateType())
- {
- case 1:
- if(movingFlag == true)
- {
- soleDelCount += 1;
- }
- else
- {
- soleDelCount += 2;
- }
- fadeOutSoleMain(sole.soleArr[sole.soleArr.length - soleDelCount]);
- break;
- case 2:
- sprayDelCount += 2;
- fadeOutSprayMain(spray.sprayArr[spray.sprayArr.length - sprayDelCount]);
- break;
- case 3:
- pencilDelCount += 2;
- fadeOutPencilMain(pencilTool.pencilArr[pencilTool.pencilArr.length - pencilDelCount]);
- break;
- case 4 || 5:
- if(movingFlag == true)
- {
- curveLineDelCount += 1;
- }
- else
- {
- curveLineDelCount += 2;
- }
- fadeOutCurveLineMain(drawTool.curveLineArr[drawTool.curveLineArr.length - curveLineDelCount]);
- }
- }
-
- private function helpPencilTweenStart(param1:TimerEvent) : *
- {
- timer.removeEventListener(TimerEvent.TIMER,helpPencilTweenStart);
- timer = null;
- mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.pencilX,1,true);
- mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.pencilY,1,true);
- mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpPencilTweenEnd);
- helpTweenFunction = helpPencilTweenEnd;
- }
-
- private function fadeOutPencilMain(param1:MovieClip) : *
- {
- if(delAlphaTween3 == null)
- {
- delAlphaTween3 = new Tween(param1,"alpha",Regular.easeOut,param1.alpha,0,0.2,true);
- delYTween3 = new Tween(param1,"y",Regular.easeOut,param1.y,param1.y + 20,0.2,true);
- delAlphaTween3.addEventListener(TweenEvent.MOTION_FINISH,repealOperate);
- }
- }
-
- private function helpBG(param1:TimerEvent) : *
- {
- ++helpBGNum;
- if(helpBGNum <= 6)
- {
- BG.chooseBGMian();
- }
- if(helpBGNum > 6)
- {
- BG.delBgBtnFilters();
- timer.removeEventListener(TimerEvent.TIMER,helpBG);
- timer = null;
- helpBGNum = 1;
- helpLoopSum = helpXTrackArr.length;
- _mouse_.gotoAndStop(8);
- mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.sprayX,1,true);
- mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.sprayY,1,true);
- mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpSprayTweenEnd);
- helpTweenFunction = helpSprayTweenEnd;
- }
- }
-
- private function delEvent() : *
- {
- _main_.removeEventListener("chooseTheAnimal",chooseTheAnimal);
- _main_.removeEventListener("changeColor",changeColor);
- _main_.removeEventListener("repealOperate",repealOperate);
- _main_.removeEventListener("choosePencil",choosePencil);
- _main_.removeEventListener("repealAll",repealAll);
- _main_.removeEventListener("printing",printing);
- _main_.removeEventListener("startHelp",startHelp);
- _main_.removeEventListener("mouseIsOver",mouseIsOver);
- _main_.removeEventListener("mouseIsOut",mouseIsOut);
- _main_.removeEventListener("mouseIsNotEnabled",mouseIsNotEnabled);
- _main_.removeEventListener("changeSprayType",changeSprayType);
- _operateLayer_.removeEventListener(MouseEvent.MOUSE_DOWN,mouseIsDown);
- _operateLayer_.removeEventListener("startMove",startMove);
- }
-
- private function startMoving() : *
- {
- _main_.mouseChildren = true;
- if(animalType == 1)
- {
- moving.moveSum = 0;
- sole.showSole(_soleLayer_,chooseAnimal.name,actionAnimal.x,actionAnimal.y,moving.outPutAngle(),color,helpFlag);
- }
- _operateLayer_.addEventListener(Event.ENTER_FRAME,animalMoving);
- _operateLayer_.addEventListener("getSpeed",getSpeed);
- SoundsManager.playMusic("_WalkLoop_");
- sound = animal.sound;
- }
-
- private function startMove(param1:Event) : *
- {
- movingFlag = true;
- if(actionAnimal.visible == false)
- {
- actionAnimal.visible = true;
- }
- animal.getMovingFlag(movingFlag);
- pencilTool.getMovingFlag(movingFlag);
- help.getMovingFlag(movingFlag);
- moving.getCoord(actionAnimal,xTrackArr[0],yTrackArr[0]);
- loopSum = xTrackArr.length;
- moving.getSpeed(xTrackArr[loopCount - 1],yTrackArr[loopCount - 1],xTrackArr[loopCount],yTrackArr[loopCount]);
- if(animalType == 4 || animalType == 5)
- {
- drawTool.startDrawCurveLine(_soleLayer_,xTrackArr[loopCount - 1],yTrackArr[loopCount - 1],color);
- curveLineType = moving.curveLineType;
- previousCurveLineStartX = xTrackArr[loopCount - 1];
- previousCurveLineStartY = yTrackArr[loopCount - 1];
- }
- ++loopCount;
- startMoving();
- }
-
- private function animalMovingMian() : *
- {
- moving.moving(actionAnimal,true);
- if(moveSum <= moving.moveSum && animalType == 1)
- {
- moving.moveSum = 0;
- sole.showSole(_soleLayer_,chooseAnimal.name,actionAnimal.x,actionAnimal.y,moving.outPutAngle(),color,helpFlag);
- }
- else if((animalType == 4 || animalType == 5) && moving.moveSum >= moveSum * 2)
- {
- moving.moveSum = 0;
- if(xTrackArr[loopCount - 1] != "end")
- {
- if(previousCurveLineStartX != actionAnimal.x || previousCurveLineStartY != actionAnimal.y)
- {
- moving.getAnchor(previousCurveLineStartX,previousCurveLineStartY,actionAnimal.x,actionAnimal.y,curveLineType);
- previousCurveLineStartX = actionAnimal.x;
- previousCurveLineStartY = actionAnimal.y;
- drawTool.drawCurveLine(moving.anchorX,moving.anchorY,actionAnimal.x,actionAnimal.y);
- curveLineType = moving.curveLineType;
- }
- }
- }
- if(loopCount >= loopSum || (actionAnimal.x < 0 || actionAnimal.y > _operateLayer_.height || actionAnimal.x > _operateLayer_.width || actionAnimal.y < 0) && loopCount >= loopSum)
- {
- SoundsManager.stopMusic();
- _operateLayer_.removeEventListener(Event.ENTER_FRAME,animalMoving);
- _operateLayer_.removeEventListener("getSpeed",getSpeed);
- actionAnimalAlphaTween = new Tween(actionAnimal,"alpha",Regular.easeOut,actionAnimal.alpha,0,0.4,true);
- actionAnimalAlphaTween.addEventListener(TweenEvent.MOTION_FINISH,endMoving);
- SoundsManager.playSound(sound);
- }
- }
-
- private function initEvent() : *
- {
- _operateLayer_.addEventListener(MouseEvent.MOUSE_DOWN,mouseIsDown);
- _operateLayer_.addEventListener("startMove",startMove);
- _hotArea_.addEventListener(MouseEvent.CLICK,clickLink);
- }
-
- private function endMove() : *
- {
- actionAnimalAlphaTween.removeEventListener(TweenEvent.MOTION_FINISH,endMoving);
- actionAnimalAlphaTween = null;
- actionAnimal.alpha = 100;
- SoundsManager.stopMusic();
- _operateLayer_.removeEventListener(Event.ENTER_FRAME,animalMoving);
- _operateLayer_.removeEventListener("getSpeed",getSpeed);
- animal.hideActionAnimal(actionAnimal);
- clearTrackArray();
- mouseControl._mouse_.gotoAndStop(1);
- if(sole.soleMC != null)
- {
- repeal.noteInformation(operateType);
- }
- else if(drawTool.curveMC != null)
- {
- repeal.noteInformation(operateType);
- }
- revertProperty();
- animal.getMovingFlag(movingFlag);
- pencilTool.getMovingFlag(movingFlag);
- help.getMovingFlag(movingFlag);
- if(animalType == 1)
- {
- sole.pushEndFlag(helpFlag);
- mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
- }
- else if(animalType == 4 || animalType == 5)
- {
- drawTool.pushEndFlag(helpFlag);
- mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
- }
- drawBmp();
- }
-
- private function showActionAnimal() : *
- {
- pencilType = 0;
- animal.showActionAnimal(_operateLayer_,actionAnimal,-200,0);
- animalType = animal.animalType;
- pencilTool.clearBtnFilters();
- }
-
- private function animalMoving(param1:Event) : *
- {
- animalMovingMian();
- }
-
- private function helpAnimalMoving(param1:Event) : *
- {
- moving.moving(helpActionAnimal,true);
- if(moveSum <= moving.moveSum && helpFlag == true)
- {
- moving.moveSum = 0;
- sole.showSole(_helpShowLayer_,"CatBtn",helpActionAnimal.x,helpActionAnimal.y,moving.outPutAngle(),color,helpFlag);
- }
- if(helpLoopCount == helpLoopSum)
- {
- SoundsManager.stopMusic();
- sole.pushEndFlag(helpFlag);
- _main_.removeEventListener(Event.ENTER_FRAME,helpAnimalMoving);
- _main_.removeEventListener("getSpeed",getSpeed);
- helpLoopCount = 1;
- _mouse_.gotoAndStop(8);
- helpActionAnimalAlphaTween = new Tween(helpActionAnimal,"alpha",Regular.easeOut,helpActionAnimal.alpha,0,0.4,true);
- SoundsManager.playSound("_Cat_S_");
- timer = new Timer(1300,0);
- timer.addEventListener(TimerEvent.TIMER,helpBGTweenStart);
- helpTimerFunction = helpBGTweenStart;
- timer.start();
- }
- }
-
- private function chooseTheAnimal(param1:Event) : *
- {
- chooseTheAnimalMain();
- }
-
- private function delBmp() : *
- {
- bmpTool.delBmp(_soleLayer_);
- }
-
- private function fadeOutSoleMain(param1:MovieClip) : *
- {
- if(delAlphaTween1 == null && param1 != null)
- {
- delAlphaTween1 = new Tween(param1,"alpha",Regular.easeOut,param1.alpha,0,0.2,true);
- delYTween1 = new Tween(param1,"y",Regular.easeOut,param1.y,param1.y + 20,0.2,true);
- delAlphaTween1.addEventListener(TweenEvent.MOTION_FINISH,repealOperate);
- }
- }
-
- private function endGetTrack(param1:MouseEvent) : *
- {
- if(movingFlag == false && trackFlag == true)
- {
- _operateLayer_.removeEventListener(MouseEvent.MOUSE_MOVE,getTrack);
- _operateLayer_.stage.removeEventListener(MouseEvent.MOUSE_UP,endGetTrack);
- trackFlag = false;
- trackTool.endGetTrack();
- drawTool.clearDraw();
- getTrackArray();
- if(xTrackArr.length > 1 && actionAnimal != null)
- {
- trackTool.startMove(_operateLayer_);
- if(animalType == 1)
- {
- operateType = sole.operateType;
- }
- else if(animalType == 4 || animalType == 5)
- {
- operateType = drawTool.operateType;
- }
- }
- else
- {
- actionAnimal.visible = false;
- actionAnimal.alpha = 0;
- clearTrackArray();
- mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
- }
- }
- }
-
- private function startHelpRepealAll(param1:TimerEvent) : *
- {
- _mouse_.gotoAndStop(1);
- timer.removeEventListener(TimerEvent.TIMER,startHelpRepealAll);
- timer = null;
- mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.repealAllX,1,true);
- mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.repealAllY,1,true);
- mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpRepealAllTweenEnd);
- helpTweenFunction = helpRepealAllTweenEnd;
- }
-
- private function getTrack(param1:MouseEvent) : *
- {
- if(trackFlag == true)
- {
- mouseControl._mouse_.gotoAndStop(1);
- trackTool.getTrack(_operateLayer_.mouseX,_operateLayer_.mouseY);
- drawTool.drawLine(_operateLayer_.mouseX,_operateLayer_.mouseY);
- }
- }
-
- private function changeColor(param1:Event) : *
- {
- color = colorTool.getColor();
- if(animalType == 4 || animalType == 5)
- {
- drawTool.setCurveLineColor(color);
- }
- else if(pencilType == 1 || pencilType == 2)
- {
- pencilTool.setPencilColor(color);
- }
- }
-
- private function helpPencilMoving(param1:Event) : *
- {
- moving.moving(_mouse_,false);
- pencilTool.Pencildrawing(_mouse_.x,_mouse_.y);
- if(helpLoopCount == helpLoopSum)
- {
- helpLoopCount = 1;
- _main_.removeEventListener(Event.ENTER_FRAME,helpPencilMoving);
- _main_.removeEventListener("getSpeed",getSpeed);
- _mouse_.gotoAndStop(1);
- timer = new Timer(1300,0);
- timer.addEventListener(TimerEvent.TIMER,startHelpRepealObj);
- helpTimerFunction = startHelpRepealObj;
- timer.start();
- }
- }
-
- private function helpMouseUp(param1:TimerEvent) : *
- {
- mouseTimer.removeEventListener(TimerEvent.TIMER,helpMouseUp);
- mouseTimer = null;
- if(_mouse_ != null)
- {
- _mouse_.gotoAndStop(1);
- }
- }
-
- private function drawBmp() : *
- {
- drawTool.showCurveLine();
- pencilTool.showPencilArr();
- sole.showSoleArr();
- spray.showSpray();
- delBmp();
- drawObj();
- drawTool.hideCurveLine();
- pencilTool.hidePencilArr();
- sole.hideSoleArr();
- spray.hideSpray();
- }
-
- private function startHelpPencil(param1:TimerEvent) : *
- {
- animal.delHelpMovie();
- animal.clearBtnFilters();
- pencilTool.pencilGlowFilter();
- _mouse_.gotoAndStop(1);
- timer.removeEventListener(TimerEvent.TIMER,startHelpPencil);
- timer = null;
- helpXTrackArr = help.pencilXArr;
- helpYTrackArr = help.pencilYArr;
- mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,helpXTrackArr[0] + 99,1,true);
- mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,helpYTrackArr[0] + 23.6,1,true);
- mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpPencil);
- helpTweenFunction = helpPencil;
- }
-
- private function helpPencil(param1:TweenEvent) : *
- {
- mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpPencil);
- mouseTweenX = null;
- mouseTweenY = null;
- helpLoopSum = helpXTrackArr.length;
- _mouse_.parent.removeChild(_mouse_);
- _mouse_ = null;
- _mouse_ = new _Mouse_();
- _operateLayer_.addChild(_mouse_);
- _mouse_.gotoAndStop(1);
- moving.getCoord(_mouse_,helpXTrackArr[0],helpYTrackArr[0]);
- pencilTool.createPencilMC(_helpShowLayer_,_mouse_.x,_mouse_.y,color);
- moving.getSpeed(helpXTrackArr[helpLoopCount - 1],helpYTrackArr[helpLoopCount - 1],helpXTrackArr[helpLoopCount],helpYTrackArr[helpLoopCount]);
- ++helpLoopCount;
- _main_.addEventListener(Event.ENTER_FRAME,helpPencilMoving);
- helpMovingFunction = helpPencilMoving;
- _main_.addEventListener("getSpeed",getSpeed);
- }
-
- private function changeSprayType(param1:Event) : *
- {
- sprayType = spray.changeSprayType();
- }
-
- private function clickLink(param1:MouseEvent) : *
- {
- Language.onCLick1();
- }
-
- private function mouseIsUp(param1:MouseEvent) : *
- {
- mouseControl._mouse_.gotoAndStop(1);
- _operateLayer_.stage.removeEventListener(MouseEvent.MOUSE_UP,mouseIsUp);
- }
-
- private function getTrackArray() : *
- {
- xTrackArr = trackTool.xTrackArr;
- yTrackArr = trackTool.yTrackArr;
- }
-
- private function initElement() : *
- {
- _main_ = new _Main_();
- PARENT.addChild(_main_);
- _mainBG_ = _main_.getChildByName("MainBG") as MovieClip;
- _operateLayer_ = _mainBG_.getChildByName("OperateLayer") as MovieClip;
- _helpShowLayer_ = _mainBG_.getChildByName("HelpShowLayer") as MovieClip;
- _printLayer_ = _mainBG_.getChildByName("PrintLayer") as MovieClip;
- _soleLayer_ = _printLayer_.getChildByName("SoleLayer") as MovieClip;
- _sprayLayer_ = _mainBG_.getChildByName("SprayLayer") as MovieClip;
- _bg_ = _printLayer_.getChildByName("Background") as MovieClip;
- _pushpin_ = _bg_.getChildByName("Pushpin") as MovieClip;
- _toner_ = _main_.getChildByName("Toner") as MovieClip;
- logoMC = _main_.getChildByName("LogoMC") as MovieClip;
- _hotArea_ = logoMC.getChildByName("hitarea_url1") as SimpleButton;
- }
-
- private function endPencil(param1:MouseEvent) : *
- {
- _operateLayer_.stage.removeEventListener(MouseEvent.MOUSE_UP,endPencil);
- _operateLayer_.removeEventListener(MouseEvent.MOUSE_MOVE,pencilDrawing);
- pencilFlag = false;
- operateType = pencilTool.operateType;
- repeal.noteInformation(operateType);
- pencilTool.endPencilDraw(_soleLayer_,helpFlag);
- drawBmp();
- }
-
- private function fadeOutCurveLineMain(param1:MovieClip) : *
- {
- if(delAlphaTween4 == null)
- {
- delAlphaTween4 = new Tween(param1,"alpha",Regular.easeOut,param1.alpha,0,0.2,true);
- delYTween4 = new Tween(param1,"y",Regular.easeOut,param1.y,param1.y + 20,0.2,true);
- delAlphaTween4.addEventListener(TweenEvent.MOTION_FINISH,repealOperate);
- }
- }
-
- private function helpBGTweenEnd(param1:TweenEvent) : *
- {
- SoundsManager.playSound("_GameMouseOver_");
- BG.showBgBtnFilters();
- mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpBGTweenEnd);
- mouseTweenX = null;
- mouseTweenY = null;
- _mouse_.gotoAndStop(8);
- timer = new Timer(1000,0);
- timer.addEventListener(TimerEvent.TIMER,helpBG);
- helpTimerFunction = helpBG;
- timer.start();
- }
-
- private function startHelpSpray(param1:TimerEvent) : *
- {
- _mouse_.gotoAndStop(1);
- if(helpSprayCount == 0)
- {
- animal.delHelpMovie();
- animal.animalGlowFilter(helpAnimal);
- }
- mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.sprayXArr[helpSprayCount],1,true);
- mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.sprayYArr[helpSprayCount],1,true);
- mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpSpray);
- helpTweenFunction = helpSpray;
- ++helpSprayCount;
- }
-
- private function revertProperty() : *
- {
- moving.moveSum = 0;
- movingFlag = false;
- loopCount = 1;
- operateType = 0;
- }
-
- private function helpSpray(param1:TweenEvent) : *
- {
- _mouse_.gotoAndStop(1);
- SoundsManager.playSound("_Whale_S_");
- spray.drawSpray(_helpShowLayer_,_sprayLayer_,help.sprayXArr[helpSprayCount - 1] - 99,help.sprayYArr[helpSprayCount - 1] - 23.6,sprayType,color,helpFlag);
- if(helpSprayCount == 5)
- {
- helpSprayCount = 0;
- timer.removeEventListener(TimerEvent.TIMER,startHelpSpray);
- timer = null;
- mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpSpray);
- mouseTweenX = null;
- mouseTweenY = null;
- timer = new Timer(1300,0);
- timer.addEventListener(TimerEvent.TIMER,helpPencilTweenStart);
- helpTimerFunction = helpPencilTweenStart;
- timer.start();
- }
- }
- }
- }
-