home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / animal_artist.swf / scripts / Gamefile / Main.as < prev    next >
Encoding:
Text File  |  2008-09-05  |  58.7 KB  |  1,618 lines

  1. package Gamefile
  2. {
  3.    import fl.transitions.Tween;
  4.    import fl.transitions.TweenEvent;
  5.    import fl.transitions.easing.*;
  6.    import flash.display.Bitmap;
  7.    import flash.display.MovieClip;
  8.    import flash.display.SimpleButton;
  9.    import flash.display.Sprite;
  10.    import flash.events.*;
  11.    import flash.geom.Rectangle;
  12.    import flash.utils.Timer;
  13.    
  14.    public class Main
  15.    {
  16.        
  17.       
  18.       private var _soleLayer_:MovieClip;
  19.       
  20.       private var _bg_:MovieClip;
  21.       
  22.       private var pencilFlag:Boolean;
  23.       
  24.       private var actionAnimalScaleYTween:Tween;
  25.       
  26.       public var helpAutoEnd:Boolean;
  27.       
  28.       private var printHeight:int;
  29.       
  30.       private var _toner_:MovieClip;
  31.       
  32.       private var helprepealAllMovie:MovieClip;
  33.       
  34.       private var pencilTool:PencilTool;
  35.       
  36.       private var helpSoundFunction:Function;
  37.       
  38.       private var BG:Background;
  39.       
  40.       private var moving:Move;
  41.       
  42.       private var delScaleYTween:Tween;
  43.       
  44.       private var mouseTweenX:Tween;
  45.       
  46.       private var mouseTweenY:Tween;
  47.       
  48.       private var helpFlag:Boolean;
  49.       
  50.       private var helpBGNum:int;
  51.       
  52.       private var curveLineDelCount:int;
  53.       
  54.       private var _backBtn_:SimpleButton;
  55.       
  56.       private var helpYTrackArr:Array;
  57.       
  58.       private var delYTween1:Tween;
  59.       
  60.       private var delYTween4:Tween;
  61.       
  62.       private var _printLayer_:MovieClip;
  63.       
  64.       private var delYTween3:Tween;
  65.       
  66.       private var helpSprayCount:int;
  67.       
  68.       private var _hotArea_:SimpleButton;
  69.       
  70.       private var helpLoopSum:int;
  71.       
  72.       private var logoMC:MovieClip;
  73.       
  74.       private var _sprayLayer_:MovieClip;
  75.       
  76.       private var helpLoopCount:int;
  77.       
  78.       private var helpAnimal:SimpleButton;
  79.       
  80.       private var helpTimerFunction:Function;
  81.       
  82.       private var PARENT:MovieClip;
  83.       
  84.       private var spray:Spray;
  85.       
  86.       private var yTrackArr:Array;
  87.       
  88.       private var moveSum:Number;
  89.       
  90.       private var bmpTool:BmpTool;
  91.       
  92.       private var _main_:MovieClip;
  93.       
  94.       private var _helpShowLayer_:MovieClip;
  95.       
  96.       private var sole:Sole;
  97.       
  98.       private var rectSole:Rectangle;
  99.       
  100.       private var movingFlag:Boolean;
  101.       
  102.       private var operateType:int;
  103.       
  104.       private var _pushpin_:MovieClip;
  105.       
  106.       private var loopCount:int;
  107.       
  108.       private var mouseControl:MouseControl;
  109.       
  110.       private var chooseAnimal:SimpleButton;
  111.       
  112.       private var drawTool:DrawTool;
  113.       
  114.       private var helpActionAnimalYTween:Tween;
  115.       
  116.       private var helpActionAnimalScaleXTween:Tween;
  117.       
  118.       private var printWidth:int;
  119.       
  120.       private var _paintBarrel_:MovieClip;
  121.       
  122.       private var delAlphaTween3:Tween;
  123.       
  124.       private var delAlphaTween4:Tween;
  125.       
  126.       private var helpTrackFlag:Boolean;
  127.       
  128.       private var sound:String;
  129.       
  130.       private var actionAnimalAlphaTween:Tween;
  131.       
  132.       private var delAlphaTween1:Tween;
  133.       
  134.       private var delAlphaTween2:Tween;
  135.       
  136.       private var _mainBG_:MovieClip;
  137.       
  138.       private var loopSum:int;
  139.       
  140.       private var helpRepealCount:int;
  141.       
  142.       private var help:Help;
  143.       
  144.       private var timer:Timer;
  145.       
  146.       private var _paintBarrelColorLayer_:MovieClip;
  147.       
  148.       private var animalType:int;
  149.       
  150.       private var trackFlag:Boolean;
  151.       
  152.       private var helpBackFlag:Boolean;
  153.       
  154.       private var curveLineType:int;
  155.       
  156.       private var color:uint;
  157.       
  158.       private var helpXTrackArr:Array;
  159.       
  160.       private var soundTimer:Timer;
  161.       
  162.       private var _mouse_:MovieClip;
  163.       
  164.       private var helprepealMovie:MovieClip;
  165.       
  166.       private var trackTool:TrackTool;
  167.       
  168.       private var sprayType:int;
  169.       
  170.       private var actionAnimalScaleXTween:Tween;
  171.       
  172.       private var sprayDelCount:int;
  173.       
  174.       private var repeal:Repeal;
  175.       
  176.       private var printBmp:Bitmap;
  177.       
  178.       private var colorTool:ColorTool;
  179.       
  180.       private var mouseTimer:Timer;
  181.       
  182.       private var previousCurveLineStartX:int;
  183.       
  184.       private var previousCurveLineStartY:int;
  185.       
  186.       private var helpActionAnimalScaleYTween:Tween;
  187.       
  188.       private var xTrackArr:Array;
  189.       
  190.       private var helpTweenFunction:Function;
  191.       
  192.       private var helpActionAnimal:MovieClip;
  193.       
  194.       private var soleDelCount:int;
  195.       
  196.       private var helpActionAnimalAlphaTween:Tween;
  197.       
  198.       private var delScaleXTween:Tween;
  199.       
  200.       private var printSprite:Sprite;
  201.       
  202.       private var _operateLayer_:MovieClip;
  203.       
  204.       private var actionAnimal:MovieClip;
  205.       
  206.       private var actionAnimalYTween:Tween;
  207.       
  208.       private var printTool:PrintTool;
  209.       
  210.       private var pencilType:int;
  211.       
  212.       private var helpMovingFunction:Function;
  213.       
  214.       private var pencilDelCount:int;
  215.       
  216.       private var currentlyBGNum:int;
  217.       
  218.       private var animal:Animal;
  219.       
  220.       public function Main(param1:MovieClip)
  221.       {
  222.          super();
  223.          initMain(param1);
  224.       }
  225.       
  226.       private function mouseIsDown(param1:MouseEvent) : *
  227.       {
  228.          if(movingFlag == false && trackFlag == false && animalType == 1)
  229.          {
  230.             if(actionAnimal.visible == false)
  231.             {
  232.                actionAnimal.visible = true;
  233.             }
  234.             moving.getCoord(actionAnimal,_operateLayer_.mouseX,_operateLayer_.mouseY);
  235.             actionAnimal.alpha = 0;
  236.             actionAnimal.scaleX = 2;
  237.             actionAnimal.scaleY = 2;
  238.             actionAnimal.stop();
  239.             actionAnimalAlphaTween = new Tween(actionAnimal,"alpha",Regular.easeOut,actionAnimal.alpha,1,0.2,true);
  240.             actionAnimalScaleXTween = new Tween(actionAnimal,"scaleX",Regular.easeOut,actionAnimal.scaleX,1,0.2,true);
  241.             actionAnimalScaleYTween = new Tween(actionAnimal,"scaleY",Regular.easeOut,actionAnimal.scaleY,1,0.2,true);
  242.             actionAnimalYTween = new Tween(actionAnimal,"y",Regular.easeOut,actionAnimal.y - 50,actionAnimal.y,0.2,true);
  243.             startGetTrack();
  244.          }
  245.          else if(movingFlag == false && trackFlag == false && (animalType == 2 || animalType == 3))
  246.          {
  247.             if(animalType == 2)
  248.             {
  249.                SoundsManager.playSound("_Whale_S_");
  250.                spray.drawSpray(_soleLayer_,_sprayLayer_,_operateLayer_.mouseX,_operateLayer_.mouseY,sprayType,color,helpFlag);
  251.             }
  252.             else if(animalType == 3)
  253.             {
  254.                spray.drawSingleSpray(_soleLayer_,_operateLayer_.mouseX,_operateLayer_.mouseY,sprayType);
  255.             }
  256.             operateType = spray.operateType;
  257.             repeal.noteInformation(operateType);
  258.             drawBmp();
  259.          }
  260.          else if(movingFlag == false && trackFlag == false && (animalType == 4 || animalType == 5))
  261.          {
  262.             if(actionAnimal.visible == false)
  263.             {
  264.                actionAnimal.visible = true;
  265.             }
  266.             moving.getCoord(actionAnimal,_operateLayer_.mouseX,_operateLayer_.mouseY);
  267.             actionAnimal.alpha = 0;
  268.             actionAnimal.scaleX = 2;
  269.             actionAnimal.scaleY = 2;
  270.             actionAnimal.stop();
  271.             actionAnimalAlphaTween = new Tween(actionAnimal,"alpha",Regular.easeOut,actionAnimal.alpha,1,0.2,true);
  272.             actionAnimalScaleXTween = new Tween(actionAnimal,"scaleX",Regular.easeOut,actionAnimal.scaleX,1,0.2,true);
  273.             actionAnimalScaleYTween = new Tween(actionAnimal,"scaleY",Regular.easeOut,actionAnimal.scaleY,1,0.2,true);
  274.             actionAnimalYTween = new Tween(actionAnimal,"y",Regular.easeOut,actionAnimal.y - 50,actionAnimal.y,0.2,true);
  275.             startGetTrack();
  276.          }
  277.          else if(movingFlag == false && trackFlag == false && (pencilType == 1 || pencilType == 2))
  278.          {
  279.             startPencil();
  280.          }
  281.          else if(movingFlag == true)
  282.          {
  283.             mouseControl._mouse_.gotoAndStop(4);
  284.             _operateLayer_.stage.addEventListener(MouseEvent.MOUSE_UP,mouseIsUp);
  285.          }
  286.       }
  287.       
  288.       private function helpPencilSound(param1:TimerEvent) : *
  289.       {
  290.          soundTimer.removeEventListener(TimerEvent.TIMER,helpPencilSound);
  291.          soundTimer = null;
  292.          SoundsManager.playSound("_GameMouseDown_");
  293.       }
  294.       
  295.       private function repealAllMain() : *
  296.       {
  297.          delAlphaTween1 = null;
  298.          delYTween1 = null;
  299.          delAlphaTween2 = null;
  300.          delScaleXTween = null;
  301.          delScaleYTween = null;
  302.          soleDelCount = 0;
  303.          sprayDelCount = 0;
  304.          pencilDelCount = 0;
  305.          curveLineDelCount = 0;
  306.          if(movingFlag == true && animalType == 1)
  307.          {
  308.             endMove();
  309.          }
  310.          else if((animalType == 4 || animalType == 5) && movingFlag == true)
  311.          {
  312.             endMove();
  313.          }
  314.          sole.soleArr = repeal.repealAllObj(sole.soleArr);
  315.          spray.sprayArr = repeal.repealAllObj(spray.sprayArr);
  316.          pencilTool.pencilArr = repeal.repealAllObj(pencilTool.pencilArr);
  317.          drawTool.curveLineArr = repeal.repealAllObj(drawTool.curveLineArr);
  318.          bmpTool.delBmp(_soleLayer_);
  319.          repeal.repealArr = [];
  320.       }
  321.       
  322.       private function choosePencil(param1:Event) : *
  323.       {
  324.          if(movingFlag == false && trackFlag == false)
  325.          {
  326.             animalType = 0;
  327.             animal.animalType = 0;
  328.             pencilType = pencilTool.pencilType;
  329.             animal.clearBtnFilters();
  330.             mouseControl._mouse_.gotoAndStop(2);
  331.          }
  332.       }
  333.       
  334.       private function startPencil() : *
  335.       {
  336.          if(pencilFlag == false)
  337.          {
  338.             _operateLayer_.addEventListener(MouseEvent.MOUSE_MOVE,pencilDrawing);
  339.             _operateLayer_.stage.addEventListener(MouseEvent.MOUSE_UP,endPencil);
  340.             pencilTool.createPencilMC(_soleLayer_,_operateLayer_.mouseX,_operateLayer_.mouseY,color);
  341.          }
  342.       }
  343.       
  344.       private function printing(param1:Event) : *
  345.       {
  346.          _pushpin_.visible = false;
  347.          bmpTool.hideBmp(_soleLayer_);
  348.          drawTool.showCurveLine();
  349.          pencilTool.showPencilArr();
  350.          sole.showSoleArr();
  351.          spray.showSpray();
  352.          rectSole = new Rectangle(0,0,printWidth,printHeight);
  353.          printTool.createMask(_mainBG_,_printLayer_,_printLayer_.x,_printLayer_.y);
  354.          printTool.printOpus(_printLayer_,rectSole);
  355.          printTool.delMask(_printLayer_);
  356.          _pushpin_.visible = true;
  357.          bmpTool.showBmp(_soleLayer_);
  358.          drawTool.hideCurveLine();
  359.          pencilTool.hidePencilArr();
  360.          sole.hideSoleArr();
  361.          spray.hideSpray();
  362.       }
  363.       
  364.       private function startGetTrack() : *
  365.       {
  366.          _operateLayer_.stage.addEventListener(MouseEvent.MOUSE_UP,endGetTrack);
  367.          _operateLayer_.addEventListener(MouseEvent.MOUSE_MOVE,getTrack);
  368.          trackFlag = true;
  369.          trackTool.startGetTrack(_operateLayer_.mouseX,_operateLayer_.mouseY);
  370.          drawTool.startDrawLine(_operateLayer_.mouseX,_operateLayer_.mouseY);
  371.          mouseControl._mouse_.gotoAndStop(1);
  372.       }
  373.       
  374.       private function clearTrackArray() : *
  375.       {
  376.          trackTool.clearArray();
  377.          xTrackArr = [];
  378.          yTrackArr = [];
  379.       }
  380.       
  381.       private function mouseIsOut(param1:Event) : *
  382.       {
  383.          if((animalType == 1 || (animalType == 4 || animalType == 5)) && movingFlag == true)
  384.          {
  385.             mouseControl._mouse_.gotoAndStop(1);
  386.          }
  387.          else if((animalType == 1 || (animalType == 4 || animalType == 5)) && trackFlag == true)
  388.          {
  389.             mouseControl._mouse_.gotoAndStop(1);
  390.          }
  391.          else if(animalType == 1 || (animalType == 4 || animalType == 5))
  392.          {
  393.             mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
  394.          }
  395.          else
  396.          {
  397.             mouseControl._mouse_.gotoAndStop(1);
  398.          }
  399.       }
  400.       
  401.       private function helpDelMC(param1:TweenEvent) : *
  402.       {
  403.          _helpShowLayer_.removeChildAt(_helpShowLayer_.numChildren - 1);
  404.       }
  405.       
  406.       private function mouseIsOver(param1:Event) : *
  407.       {
  408.          if((animalType == 1 || (animalType == 4 || animalType == 5)) && movingFlag == true)
  409.          {
  410.             mouseControl._mouse_.gotoAndStop(2);
  411.          }
  412.          else if((animalType == 1 || (animalType == 4 || animalType == 5)) && trackFlag == true)
  413.          {
  414.             mouseControl._mouse_.gotoAndStop(1);
  415.          }
  416.          else if(animalType == 1 || (animalType == 4 || animalType == 5))
  417.          {
  418.             mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
  419.          }
  420.          else
  421.          {
  422.             mouseControl._mouse_.gotoAndStop(2);
  423.          }
  424.       }
  425.       
  426.       private function helpAnimalTweenEnd(param1:TweenEvent) : *
  427.       {
  428.          mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpAnimalTweenEnd);
  429.          mouseTweenX = null;
  430.          mouseTweenY = null;
  431.          SoundsManager.playSound("_GameMouseOver_");
  432.          SoundsManager.playSound("_Cat_S_");
  433.          animal.showHelpAnimalMovie(help.animalMovieX,help.animalMovieY,help.animalMovieScale);
  434.          animal.animalGlowFilter(animal.helpMovie);
  435.          _mouse_.gotoAndStop(8);
  436.          timer = new Timer(1000,0);
  437.          timer.addEventListener(TimerEvent.TIMER,startHelpTrack);
  438.          helpTimerFunction = startHelpTrack;
  439.          timer.start();
  440.       }
  441.       
  442.       private function helpRepealAllSound(param1:TimerEvent) : *
  443.       {
  444.          timer.removeEventListener(TimerEvent.TIMER,helpRepealAllSound);
  445.          timer = null;
  446.          repeal.showRepealMC(_operateLayer_);
  447.          helpRepealAll();
  448.       }
  449.       
  450.       private function startHelpTrack(param1:TimerEvent) : *
  451.       {
  452.          _mouse_.gotoAndStop(8);
  453.          timer.removeEventListener(TimerEvent.TIMER,startHelpTrack);
  454.          timer = null;
  455.          mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,helpXTrackArr[0] + 99,1,true);
  456.          mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,helpYTrackArr[0] + 23.6,1,true);
  457.          mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpTrack);
  458.          animal.delHelpMovie();
  459.          animal.animalGlowFilter(helpAnimal);
  460.          helpTweenFunction = helpTrack;
  461.       }
  462.       
  463.       private function chooseTheAnimalMain() : *
  464.       {
  465.          animalType = animal.animalType;
  466.          chooseAnimal = animal.returnChooseAnimal();
  467.          actionAnimal = animal.returnActionAnimal();
  468.          showActionAnimal();
  469.          mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
  470.       }
  471.       
  472.       private function helpRepealOBJ(param1:TimerEvent) : *
  473.       {
  474.          var _loc2_:* = undefined;
  475.          var _loc3_:* = undefined;
  476.          var _loc4_:* = undefined;
  477.          var _loc5_:* = undefined;
  478.          var _loc6_:* = undefined;
  479.          _mouse_.gotoAndStop(2);
  480.          SoundsManager.playSound("_Squirrel_S_");
  481.          if(helpRepealCount == 1)
  482.          {
  483.             _loc2_ = new Tween(_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1),"alpha",Regular.easeOut,_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1).alpha,0,0.2,true);
  484.             _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);
  485.             _loc2_.addEventListener(TweenEvent.MOTION_FINISH,helpDelMC);
  486.             helpTweenFunction = helpDelMC;
  487.          }
  488.          else
  489.          {
  490.             _loc4_ = new Tween(_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1),"alpha",Regular.easeOut,_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1).alpha,0,0.2,true);
  491.             _loc5_ = new Tween(_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1),"scaleX",Regular.easeOut,_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1).scaleX,1.5,0.2,true);
  492.             _loc6_ = new Tween(_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1),"scaleY",Regular.easeOut,_helpShowLayer_.getChildAt(_helpShowLayer_.numChildren - 1).scaleY,1.5,0.2,true);
  493.             _loc4_.addEventListener(TweenEvent.MOTION_FINISH,helpDelMC);
  494.             helpTweenFunction = helpDelMC;
  495.          }
  496.          ++helpRepealCount;
  497.          if(helpRepealCount == 4)
  498.          {
  499.             helprepealMovie.parent.removeChild(helprepealMovie);
  500.             helprepealMovie = null;
  501.             repeal._repealBtn_.visible = true;
  502.             helpRepealCount = 1;
  503.             timer.removeEventListener(TimerEvent.TIMER,helpRepealOBJ);
  504.             timer = null;
  505.             timer = new Timer(500,0);
  506.             timer.addEventListener(TimerEvent.TIMER,startHelpRepealAll);
  507.             helpTimerFunction = startHelpRepealAll;
  508.             timer.start();
  509.          }
  510.       }
  511.       
  512.       private function pencilDrawing(param1:MouseEvent) : *
  513.       {
  514.          if(pencilTool.drawFlag == false)
  515.          {
  516.             pencilTool.drawFlag = true;
  517.          }
  518.          pencilFlag = true;
  519.          pencilTool.Pencildrawing(_operateLayer_.mouseX,_operateLayer_.mouseY);
  520.       }
  521.       
  522.       public function delMain() : *
  523.       {
  524.          mouseControl.delMouseControl();
  525.          animal.delEvent();
  526.          BG.delEvent();
  527.          colorTool.delEvent();
  528.          help.delEvent();
  529.          pencilTool.delEvent();
  530.          printTool.delEvent();
  531.          repeal.delEvent();
  532.          spray.delEvent();
  533.          delEvent();
  534.          repealAllMain();
  535.          PARENT.removeChild(_main_);
  536.       }
  537.       
  538.       private function showMain() : *
  539.       {
  540.          animal = new Animal(_main_);
  541.          moving = new Move();
  542.          sole = new Sole();
  543.          trackTool = new TrackTool();
  544.          colorTool = new ColorTool(_main_);
  545.          drawTool = new DrawTool(_operateLayer_);
  546.          bmpTool = new BmpTool();
  547.          repeal = new Repeal(_main_);
  548.          spray = new Spray(_main_);
  549.          pencilTool = new PencilTool(_main_);
  550.          BG = new Background(_bg_,_main_);
  551.          printTool = new PrintTool(_main_);
  552.          help = new Help(_main_);
  553.          mouseControl = new MouseControl(PARENT);
  554.          _main_.addEventListener("chooseTheAnimal",chooseTheAnimal);
  555.          _main_.addEventListener("changeColor",changeColor);
  556.          _main_.addEventListener("repealOperate",fadeOutSole);
  557.          _main_.addEventListener("choosePencil",choosePencil);
  558.          _main_.addEventListener("repealAll",repealAll);
  559.          _main_.addEventListener("printing",printing);
  560.          _main_.addEventListener("startHelp",startHelp);
  561.          _main_.addEventListener("mouseIsOver",mouseIsOver);
  562.          _main_.addEventListener("mouseIsOut",mouseIsOut);
  563.          _main_.addEventListener("mouseIsNotEnabled",mouseIsNotEnabled);
  564.          _main_.addEventListener("changeSprayType",changeSprayType);
  565.       }
  566.       
  567.       private function helpPencilTweenEnd(param1:TweenEvent) : *
  568.       {
  569.          SoundsManager.playSound("_GameMouseOver_");
  570.          soundTimer = new Timer(400,0);
  571.          soundTimer.addEventListener(TimerEvent.TIMER,helpPencilSound);
  572.          soundTimer.start();
  573.          helpSoundFunction = helpPencilSound;
  574.          mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpPencilTweenEnd);
  575.          mouseTweenX = null;
  576.          mouseTweenY = null;
  577.          helpSprayCount = 0;
  578.          animal.clearBtnFilters();
  579.          animal.showHelpPencilMovie(help.pencilMovieX,help.pencilMovieY,help.pencilMovieScale);
  580.          animal.animalGlowFilter(animal.helpMovie);
  581.          _mouse_.gotoAndStop(2);
  582.          timer = new Timer(1000,0);
  583.          timer.addEventListener(TimerEvent.TIMER,startHelpPencil);
  584.          helpTimerFunction = startHelpPencil;
  585.          timer.start();
  586.       }
  587.       
  588.       private function helpRepealAllTweenEnd(param1:TweenEvent) : *
  589.       {
  590.          SoundsManager.playSound("_GameMouseOver_");
  591.          helpTimerFunction = helpRepealAllSound;
  592.          repeal._repealAllBtn_.visible = false;
  593.          helprepealAllMovie = new _RepealAllMovie_();
  594.          animal._animalBtnMC_.addChild(helprepealAllMovie);
  595.          helprepealAllMovie.x = help.repealMovieX + 45;
  596.          helprepealAllMovie.y = help.repealMovieY - 25;
  597.          helprepealAllMovie.scaleX = 0.8;
  598.          helprepealAllMovie.scaleY = 0.8;
  599.          mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpRepealAllTweenEnd);
  600.          mouseTweenX = null;
  601.          mouseTweenY = null;
  602.          _mouse_.gotoAndStop(2);
  603.          animal.showHelpRepealAllMovie(help.repealAllMovieX,help.repealAllMovieY,help.repealAllMovieScale);
  604.          helpAutoEnd = true;
  605.          timer = new Timer(400,0);
  606.          timer.addEventListener(TimerEvent.TIMER,helpRepealAllSound);
  607.          timer.start();
  608.       }
  609.       
  610.       private function repealOperate(param1:TweenEvent) : *
  611.       {
  612.          SoundsManager.stopMusic();
  613.          if(movingFlag == true && animalType == 1)
  614.          {
  615.             endMove();
  616.          }
  617.          else if((animalType == 4 || animalType == 5) && movingFlag == true)
  618.          {
  619.             endMove();
  620.          }
  621.          switch(repeal.repealOperateType())
  622.          {
  623.             case 1:
  624.                delAlphaTween1 = null;
  625.                delYTween1 = null;
  626.                soleDelCount = 0;
  627.                sole.soleArr = repeal.repealObj(sole.soleArr);
  628.                drawBmp();
  629.                break;
  630.             case 2:
  631.                delAlphaTween2 = null;
  632.                delScaleXTween = null;
  633.                delScaleYTween = null;
  634.                sprayDelCount = 0;
  635.                spray.sprayArr = repeal.repealObj(spray.sprayArr);
  636.                drawBmp();
  637.                break;
  638.             case 3:
  639.                delAlphaTween3 = null;
  640.                delYTween3 = null;
  641.                pencilDelCount = 0;
  642.                pencilTool.pencilArr = repeal.repealObj(pencilTool.pencilArr);
  643.                drawBmp();
  644.                break;
  645.             case 4 || 5:
  646.                delAlphaTween4 = null;
  647.                delYTween4 = null;
  648.                curveLineDelCount = 0;
  649.                drawTool.curveLineArr = repeal.repealObj(drawTool.curveLineArr);
  650.                drawBmp();
  651.          }
  652.          repeal.delInformation();
  653.       }
  654.       
  655.       private function helpAnimalStartMoving() : *
  656.       {
  657.          helpActionAnimalAlphaTween = null;
  658.          helpActionAnimalScaleXTween = null;
  659.          helpActionAnimalScaleYTween = null;
  660.          helpActionAnimalYTween = null;
  661.          SoundsManager.playMusic("_WalkLoop_");
  662.          _main_.addEventListener(Event.ENTER_FRAME,helpAnimalMoving);
  663.          helpMovingFunction = helpAnimalMoving;
  664.          _main_.addEventListener("getSpeed",getSpeed);
  665.       }
  666.       
  667.       private function helpSpraySound(param1:TimerEvent) : *
  668.       {
  669.          soundTimer.removeEventListener(TimerEvent.TIMER,helpSpraySound);
  670.          soundTimer = null;
  671.          SoundsManager.playSound("_Whale_S_");
  672.       }
  673.       
  674.       private function endHelpMain() : *
  675.       {
  676.          SoundsManager.stopMusic();
  677.          PARENT.stage.removeEventListener(MouseEvent.MOUSE_UP,stageClick);
  678.          if(timer != null)
  679.          {
  680.             timer.removeEventListener(TimerEvent.TIMER,helpTimerFunction);
  681.             timer = null;
  682.          }
  683.          if(mouseTweenX != null)
  684.          {
  685.             mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpTweenFunction);
  686.             mouseTweenX = null;
  687.             mouseTweenY = null;
  688.          }
  689.          if(soundTimer != null)
  690.          {
  691.             soundTimer.removeEventListener(TweenEvent.MOTION_FINISH,helpSoundFunction);
  692.             soundTimer = null;
  693.          }
  694.          if(helpMovingFunction != null)
  695.          {
  696.             _main_.removeEventListener(Event.ENTER_FRAME,helpMovingFunction);
  697.             _main_.removeEventListener("getSpeed",getSpeed);
  698.             helpMovingFunction = null;
  699.          }
  700.          if(helpActionAnimalAlphaTween != null)
  701.          {
  702.             helpActionAnimalAlphaTween.removeEventListener(TweenEvent.MOTION_FINISH,helpAnimalStartMoving);
  703.             helpActionAnimalAlphaTween = null;
  704.             helpActionAnimalScaleXTween = null;
  705.             helpActionAnimalScaleYTween = null;
  706.             helpActionAnimalYTween = null;
  707.          }
  708.          _operateLayer_.graphics.clear();
  709.          _mouse_.parent.removeChild(_mouse_);
  710.          _mouse_ = null;
  711.          if(helpAutoEnd == false)
  712.          {
  713.             repeal.delRepealMCEvent();
  714.             helpRepealAll();
  715.          }
  716.          sole.pushEndFlag(helpFlag);
  717.          BG._bg_.gotoAndStop(currentlyBGNum);
  718.          BG._bgBtn_.gotoAndStop(currentlyBGNum);
  719.          BG.getBgNum(currentlyBGNum);
  720.          animal.delHelpMovie();
  721.          animal.clearBtnFilters();
  722.          pencilTool.clearBtnFilters();
  723.          helpFlag = false;
  724.          helpLoopCount = 1;
  725.          mouseControl.initMouseControl(PARENT);
  726.          mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
  727.          bmpTool.showBmp(_soleLayer_);
  728.          animal.clearBtnFilters();
  729.          helpRepealCount = 1;
  730.          helpSprayCount = 0;
  731.          helpBGNum = 1;
  732.          if(helprepealMovie != null)
  733.          {
  734.             helprepealMovie.parent.removeChild(helprepealMovie);
  735.             helprepealMovie = null;
  736.          }
  737.          repeal._repealBtn_.visible = true;
  738.          if(helprepealAllMovie != null)
  739.          {
  740.             helprepealAllMovie.parent.removeChild(helprepealAllMovie);
  741.             helprepealAllMovie = null;
  742.          }
  743.          repeal._repealAllBtn_.visible = true;
  744.          if(animalType > 0)
  745.          {
  746.             animal.animalGlowFilter(chooseAnimal);
  747.          }
  748.          else if(pencilType > 0)
  749.          {
  750.             pencilTool.pencilGlowFilter();
  751.          }
  752.          _main_.mouseChildren = true;
  753.          getHelpInformation();
  754.          back();
  755.          trace("helpEnd");
  756.       }
  757.       
  758.       private function getSpeed(param1:Event) : *
  759.       {
  760.          if(helpFlag == false)
  761.          {
  762.             moving.getSpeed(xTrackArr[loopCount - 1],yTrackArr[loopCount - 1],xTrackArr[loopCount],yTrackArr[loopCount]);
  763.             ++loopCount;
  764.          }
  765.          else if(helpFlag == true)
  766.          {
  767.             moving.getSpeed(helpXTrackArr[helpLoopCount - 1],helpYTrackArr[helpLoopCount - 1],helpXTrackArr[helpLoopCount],helpYTrackArr[helpLoopCount]);
  768.             if(helpTrackFlag == true)
  769.             {
  770.                drawTool.drawLine(helpXTrackArr[helpLoopCount - 1],helpYTrackArr[helpLoopCount - 1]);
  771.             }
  772.             ++helpLoopCount;
  773.          }
  774.       }
  775.       
  776.       private function helpBGTweenStart(param1:TimerEvent) : *
  777.       {
  778.          helpActionAnimalAlphaTween = null;
  779.          helpActionAnimal.parent.removeChild(helpActionAnimal);
  780.          timer.removeEventListener(TimerEvent.TIMER,helpBGTweenStart);
  781.          timer = null;
  782.          _mouse_.parent.removeChild(_mouse_);
  783.          _mouse_ = null;
  784.          _mouse_ = new _Mouse_();
  785.          PARENT.addChild(_mouse_);
  786.          _mouse_.gotoAndStop(8);
  787.          _mouse_.x = helpXTrackArr[helpXTrackArr.length - 1];
  788.          _mouse_.y = helpYTrackArr[helpYTrackArr.length - 1] + 23.6;
  789.          mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.BGX,1,true);
  790.          mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.BGY,1,true);
  791.          mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpBGTweenEnd);
  792.          helpTweenFunction = helpBGTweenEnd;
  793.       }
  794.       
  795.       private function helpTrack(param1:TweenEvent) : *
  796.       {
  797.          mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpTrack);
  798.          mouseTweenX = null;
  799.          mouseTweenY = null;
  800.          _mouse_.parent.removeChild(_mouse_);
  801.          _mouse_ = null;
  802.          _mouse_ = new _Mouse_();
  803.          _operateLayer_.addChild(_mouse_);
  804.          helpTrackFlag = true;
  805.          moving.getCoord(_mouse_,helpXTrackArr[0],helpYTrackArr[0]);
  806.          drawTool.startDrawLine(helpXTrackArr[0],helpYTrackArr[0]);
  807.          helpLoopSum = helpXTrackArr.length;
  808.          moving.getSpeed(helpXTrackArr[helpLoopCount - 1],helpYTrackArr[helpLoopCount - 1],helpXTrackArr[helpLoopCount],helpYTrackArr[helpLoopCount]);
  809.          ++helpLoopCount;
  810.          _main_.addEventListener(Event.ENTER_FRAME,helpTracking);
  811.          helpMovingFunction = helpTracking;
  812.          _main_.addEventListener("getSpeed",getSpeed);
  813.          _operateLayer_.addChild(helpActionAnimal);
  814.          helpActionAnimal.alpha = 0;
  815.          moving.getCoord(helpActionAnimal,helpXTrackArr[0],helpYTrackArr[0]);
  816.          helpActionAnimal.scaleX = 2;
  817.          helpActionAnimal.scaleY = 2;
  818.          helpActionAnimalAlphaTween = new Tween(helpActionAnimal,"alpha",Regular.easeOut,helpActionAnimal.alpha,1,0.2,true);
  819.          helpActionAnimalScaleXTween = new Tween(helpActionAnimal,"scaleX",Regular.easeOut,helpActionAnimal.scaleX,1,0.2,true);
  820.          helpActionAnimalScaleYTween = new Tween(helpActionAnimal,"scaleY",Regular.easeOut,helpActionAnimal.scaleY,1,0.2,true);
  821.          helpActionAnimalYTween = new Tween(helpActionAnimal,"y",Regular.easeOut,helpActionAnimal.y - 50,helpActionAnimal.y,0.2,true);
  822.       }
  823.       
  824.       private function endHelp(param1:TimerEvent) : *
  825.       {
  826.          helprepealAllMovie.parent.removeChild(helprepealAllMovie);
  827.          helprepealAllMovie = null;
  828.          repeal._repealAllBtn_.visible = true;
  829.          _mouse_.gotoAndStop(animal.animalDownFrame);
  830.          endHelpMain();
  831.       }
  832.       
  833.       private function helpSprayTweenEnd(param1:TweenEvent) : *
  834.       {
  835.          SoundsManager.playSound("_GameMouseOver_");
  836.          soundTimer = new Timer(300,0);
  837.          soundTimer.addEventListener(TimerEvent.TIMER,helpSpraySound);
  838.          soundTimer.start();
  839.          helpSoundFunction = helpSpraySound;
  840.          mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpSprayTweenEnd);
  841.          mouseTweenX = null;
  842.          mouseTweenY = null;
  843.          animal.clearBtnFilters();
  844.          helpAnimal = animal.outputHelpSprayAnimal();
  845.          animal.showHelpSprayMovie(help.sprayMovieX,help.sprayMovieY,help.sprayMovieScale);
  846.          animal.animalGlowFilter(animal.helpMovie);
  847.          _mouse_.gotoAndStop(2);
  848.          timer = new Timer(1300,0);
  849.          timer.addEventListener(TimerEvent.TIMER,startHelpSpray);
  850.          helpTimerFunction = startHelpSpray;
  851.          timer.start();
  852.       }
  853.       
  854.       private function startHelp(param1:Event) : *
  855.       {
  856.          if(movingFlag == false)
  857.          {
  858.             startHelpMain(false);
  859.          }
  860.       }
  861.       
  862.       private function helpRepealTweenEnd(param1:TweenEvent) : *
  863.       {
  864.          SoundsManager.playSound("_GameMouseOver_");
  865.          repeal._repealBtn_.visible = false;
  866.          helprepealMovie = new _RepealMovie_();
  867.          animal._animalBtnMC_.addChild(helprepealMovie);
  868.          helprepealMovie.x = help.repealMovieX - 20;
  869.          helprepealMovie.y = help.repealMovieY - 24;
  870.          helprepealMovie.scaleX = 0.8;
  871.          helprepealMovie.scaleY = 0.8;
  872.          mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpRepealTweenEnd);
  873.          mouseTweenX = null;
  874.          mouseTweenY = null;
  875.          timer = new Timer(1000,0);
  876.          timer.addEventListener(TimerEvent.TIMER,helpRepealOBJ);
  877.          helpTimerFunction = helpRepealOBJ;
  878.          timer.start();
  879.       }
  880.       
  881.       private function helpRepealAll() : *
  882.       {
  883.          var _loc1_:int = 0;
  884.          var _loc2_:int = 0;
  885.          var _loc3_:int = 0;
  886.          if(helpAutoEnd == true)
  887.          {
  888.             SoundsManager.playSound("_Elephant_S_");
  889.          }
  890.          _loc1_ = _helpShowLayer_.numChildren;
  891.          _loc2_ = 0;
  892.          while(_loc2_ < _loc1_ - 1)
  893.          {
  894.             _helpShowLayer_.removeChildAt(_helpShowLayer_.numChildren - 1);
  895.             _loc2_++;
  896.          }
  897.          _loc1_ = _operateLayer_.numChildren;
  898.          _loc3_ = 0;
  899.          while(_loc3_ < _loc1_ - 2)
  900.          {
  901.             if(helpAutoEnd == false)
  902.             {
  903.                _operateLayer_.removeChildAt(_operateLayer_.numChildren - 1);
  904.             }
  905.             _loc3_++;
  906.          }
  907.          if(helpAutoEnd == true)
  908.          {
  909.             timer = new Timer(2500,0);
  910.             timer.addEventListener(TimerEvent.TIMER,endHelp);
  911.             helpTimerFunction = endHelp;
  912.             timer.start();
  913.          }
  914.       }
  915.       
  916.       private function back() : *
  917.       {
  918.          if(helpBackFlag == true)
  919.          {
  920.             PARENT.dispatchEvent(new Event("delMain",true));
  921.          }
  922.       }
  923.       
  924.       private function initMain(param1:MovieClip) : *
  925.       {
  926.          PARENT = param1;
  927.          initElement();
  928.          initEvent();
  929.          initProperty();
  930.          getHelpInformation();
  931.          chooseTheAnimalMain();
  932.       }
  933.       
  934.       private function startHelpRepealObj(param1:TimerEvent) : *
  935.       {
  936.          _mouse_.parent.removeChild(_mouse_);
  937.          _mouse_ = null;
  938.          _mouse_ = new _Mouse_();
  939.          PARENT.addChild(_mouse_);
  940.          _mouse_.gotoAndStop(1);
  941.          _mouse_.x = helpXTrackArr[helpXTrackArr.length - 1] + 99;
  942.          _mouse_.y = helpYTrackArr[helpYTrackArr.length - 1] + 23.6;
  943.          timer.removeEventListener(TimerEvent.TIMER,startHelpRepealObj);
  944.          timer = null;
  945.          mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.repealX,1,true);
  946.          mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.repealY,1,true);
  947.          mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpRepealTweenEnd);
  948.          helpTweenFunction = helpRepealTweenEnd;
  949.       }
  950.       
  951.       private function fadeOutSprayMain(param1:MovieClip) : *
  952.       {
  953.          if(delAlphaTween2 == null)
  954.          {
  955.             delAlphaTween2 = new Tween(param1,"alpha",Regular.easeOut,param1.alpha,0,0.2,true);
  956.             delScaleXTween = new Tween(param1,"scaleX",Regular.easeOut,param1.scaleX,1.5,0.2,true);
  957.             delScaleYTween = new Tween(param1,"scaleY",Regular.easeOut,param1.scaleY,1.5,0.2,true);
  958.             delAlphaTween2.addEventListener(TweenEvent.MOTION_FINISH,repealOperate);
  959.          }
  960.       }
  961.       
  962.       private function getHelpInformation() : *
  963.       {
  964.          helpAnimal = animal.outputHelpAnimal();
  965.          helpActionAnimal = animal.outputHelpActionAnimal();
  966.          helpXTrackArr = help.animalXArr;
  967.          helpYTrackArr = help.animalYArr;
  968.       }
  969.       
  970.       private function mouseIsNotEnabled(param1:Event) : *
  971.       {
  972.          mouseControl._mouse_.gotoAndStop(3);
  973.       }
  974.       
  975.       private function endMoving(param1:TweenEvent) : *
  976.       {
  977.          endMove();
  978.       }
  979.       
  980.       private function drawObj() : *
  981.       {
  982.          rectSole = new Rectangle(0,0,_bg_.width,_bg_.height);
  983.          bmpTool.cutoutBmp(_soleLayer_,_soleLayer_,rectSole);
  984.          rectSole = null;
  985.       }
  986.       
  987.       private function repealAll(param1:Event) : *
  988.       {
  989.          SoundsManager.stopMusic();
  990.          repeal.showRepealMC(_operateLayer_);
  991.          repealAllMain();
  992.       }
  993.       
  994.       private function helpTracking(param1:Event) : *
  995.       {
  996.          moving.moving(_mouse_,false);
  997.          _mouse_.gotoAndStop(1);
  998.          if(helpLoopCount == helpLoopSum)
  999.          {
  1000.             _main_.removeEventListener(Event.ENTER_FRAME,helpTracking);
  1001.             _main_.removeEventListener("getSpeed",getSpeed);
  1002.             helpTrackFlag = false;
  1003.             _mouse_.gotoAndStop(1);
  1004.             helpLoopCount = 1;
  1005.             _operateLayer_.graphics.clear();
  1006.             moving.getSpeed(helpXTrackArr[helpLoopCount - 1],helpYTrackArr[helpLoopCount - 1],helpXTrackArr[helpLoopCount],helpYTrackArr[helpLoopCount]);
  1007.             ++helpLoopCount;
  1008.             helpAnimalStartMoving();
  1009.          }
  1010.       }
  1011.       
  1012.       public function startHelpMain(param1:Boolean) : *
  1013.       {
  1014.          trace("help");
  1015.          helpBackFlag = param1;
  1016.          mouseControl.delEvent();
  1017.          mouseControl.delMouse();
  1018.          helpFlag = true;
  1019.          _main_.mouseChildren = false;
  1020.          bmpTool.hideBmp(_soleLayer_);
  1021.          animal.clearBtnFilters();
  1022.          pencilTool.clearBtnFilters();
  1023.          currentlyBGNum = BG.intoBgNum();
  1024.          trace("currentlyBGNum === " + currentlyBGNum);
  1025.          help.getAnimalBtnY(animal.outPutBtnMCY());
  1026.          _mouse_ = new _Mouse_();
  1027.          PARENT.addChild(_mouse_);
  1028.          _mouse_.gotoAndStop(1);
  1029.          _mouse_.x = 640 / 2;
  1030.          _mouse_.y = 480 / 2;
  1031.          mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.animalX,1,true);
  1032.          mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.animalY,1,true);
  1033.          mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpAnimalTweenEnd);
  1034.          helpTweenFunction = helpAnimalTweenEnd;
  1035.          PARENT.stage.addEventListener(MouseEvent.MOUSE_UP,stageClick);
  1036.       }
  1037.       
  1038.       private function initProperty() : *
  1039.       {
  1040.          showMain();
  1041.          animalType = 0;
  1042.          trackFlag = false;
  1043.          movingFlag = false;
  1044.          loopCount = 1;
  1045.          loopSum = 0;
  1046.          moveSum = 36;
  1047.          color = 16663877;
  1048.          operateType = 0;
  1049.          sprayType = 1;
  1050.          pencilType = 0;
  1051.          pencilFlag = false;
  1052.          printWidth = 516;
  1053.          printHeight = 349;
  1054.          helpFlag = false;
  1055.          helpTrackFlag = false;
  1056.          helpLoopCount = 1;
  1057.          helpLoopSum = 0;
  1058.          helpBGNum = 1;
  1059.          helpSprayCount = 0;
  1060.          helpRepealCount = 1;
  1061.          helpBackFlag = false;
  1062.          helpAutoEnd = true;
  1063.          soleDelCount = 0;
  1064.          sprayDelCount = 0;
  1065.          curveLineDelCount = 0;
  1066.          pencilDelCount = 0;
  1067.          logoMC.gotoAndStop(Language.frame_logo);
  1068.       }
  1069.       
  1070.       private function stageClick(param1:MouseEvent) : *
  1071.       {
  1072.          helpAutoEnd = false;
  1073.          endHelpMain();
  1074.       }
  1075.       
  1076.       private function fadeOutSole(param1:Event) : *
  1077.       {
  1078.          if(movingFlag == true && animalType == 1)
  1079.          {
  1080.             endMove();
  1081.          }
  1082.          else if((animalType == 4 || animalType == 5) && movingFlag == true)
  1083.          {
  1084.             endMove();
  1085.          }
  1086.          drawTool.showCurveLine();
  1087.          pencilTool.showPencilArr();
  1088.          sole.showSoleArr();
  1089.          spray.showSpray();
  1090.          delBmp();
  1091.          switch(repeal.repealOperateType())
  1092.          {
  1093.             case 1:
  1094.                if(movingFlag == true)
  1095.                {
  1096.                   soleDelCount += 1;
  1097.                }
  1098.                else
  1099.                {
  1100.                   soleDelCount += 2;
  1101.                }
  1102.                fadeOutSoleMain(sole.soleArr[sole.soleArr.length - soleDelCount]);
  1103.                break;
  1104.             case 2:
  1105.                sprayDelCount += 2;
  1106.                fadeOutSprayMain(spray.sprayArr[spray.sprayArr.length - sprayDelCount]);
  1107.                break;
  1108.             case 3:
  1109.                pencilDelCount += 2;
  1110.                fadeOutPencilMain(pencilTool.pencilArr[pencilTool.pencilArr.length - pencilDelCount]);
  1111.                break;
  1112.             case 4 || 5:
  1113.                if(movingFlag == true)
  1114.                {
  1115.                   curveLineDelCount += 1;
  1116.                }
  1117.                else
  1118.                {
  1119.                   curveLineDelCount += 2;
  1120.                }
  1121.                fadeOutCurveLineMain(drawTool.curveLineArr[drawTool.curveLineArr.length - curveLineDelCount]);
  1122.          }
  1123.       }
  1124.       
  1125.       private function helpPencilTweenStart(param1:TimerEvent) : *
  1126.       {
  1127.          timer.removeEventListener(TimerEvent.TIMER,helpPencilTweenStart);
  1128.          timer = null;
  1129.          mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.pencilX,1,true);
  1130.          mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.pencilY,1,true);
  1131.          mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpPencilTweenEnd);
  1132.          helpTweenFunction = helpPencilTweenEnd;
  1133.       }
  1134.       
  1135.       private function fadeOutPencilMain(param1:MovieClip) : *
  1136.       {
  1137.          if(delAlphaTween3 == null)
  1138.          {
  1139.             delAlphaTween3 = new Tween(param1,"alpha",Regular.easeOut,param1.alpha,0,0.2,true);
  1140.             delYTween3 = new Tween(param1,"y",Regular.easeOut,param1.y,param1.y + 20,0.2,true);
  1141.             delAlphaTween3.addEventListener(TweenEvent.MOTION_FINISH,repealOperate);
  1142.          }
  1143.       }
  1144.       
  1145.       private function helpBG(param1:TimerEvent) : *
  1146.       {
  1147.          ++helpBGNum;
  1148.          if(helpBGNum <= 6)
  1149.          {
  1150.             BG.chooseBGMian();
  1151.          }
  1152.          if(helpBGNum > 6)
  1153.          {
  1154.             BG.delBgBtnFilters();
  1155.             timer.removeEventListener(TimerEvent.TIMER,helpBG);
  1156.             timer = null;
  1157.             helpBGNum = 1;
  1158.             helpLoopSum = helpXTrackArr.length;
  1159.             _mouse_.gotoAndStop(8);
  1160.             mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.sprayX,1,true);
  1161.             mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.sprayY,1,true);
  1162.             mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpSprayTweenEnd);
  1163.             helpTweenFunction = helpSprayTweenEnd;
  1164.          }
  1165.       }
  1166.       
  1167.       private function delEvent() : *
  1168.       {
  1169.          _main_.removeEventListener("chooseTheAnimal",chooseTheAnimal);
  1170.          _main_.removeEventListener("changeColor",changeColor);
  1171.          _main_.removeEventListener("repealOperate",repealOperate);
  1172.          _main_.removeEventListener("choosePencil",choosePencil);
  1173.          _main_.removeEventListener("repealAll",repealAll);
  1174.          _main_.removeEventListener("printing",printing);
  1175.          _main_.removeEventListener("startHelp",startHelp);
  1176.          _main_.removeEventListener("mouseIsOver",mouseIsOver);
  1177.          _main_.removeEventListener("mouseIsOut",mouseIsOut);
  1178.          _main_.removeEventListener("mouseIsNotEnabled",mouseIsNotEnabled);
  1179.          _main_.removeEventListener("changeSprayType",changeSprayType);
  1180.          _operateLayer_.removeEventListener(MouseEvent.MOUSE_DOWN,mouseIsDown);
  1181.          _operateLayer_.removeEventListener("startMove",startMove);
  1182.       }
  1183.       
  1184.       private function startMoving() : *
  1185.       {
  1186.          _main_.mouseChildren = true;
  1187.          if(animalType == 1)
  1188.          {
  1189.             moving.moveSum = 0;
  1190.             sole.showSole(_soleLayer_,chooseAnimal.name,actionAnimal.x,actionAnimal.y,moving.outPutAngle(),color,helpFlag);
  1191.          }
  1192.          _operateLayer_.addEventListener(Event.ENTER_FRAME,animalMoving);
  1193.          _operateLayer_.addEventListener("getSpeed",getSpeed);
  1194.          SoundsManager.playMusic("_WalkLoop_");
  1195.          sound = animal.sound;
  1196.       }
  1197.       
  1198.       private function startMove(param1:Event) : *
  1199.       {
  1200.          movingFlag = true;
  1201.          if(actionAnimal.visible == false)
  1202.          {
  1203.             actionAnimal.visible = true;
  1204.          }
  1205.          animal.getMovingFlag(movingFlag);
  1206.          pencilTool.getMovingFlag(movingFlag);
  1207.          help.getMovingFlag(movingFlag);
  1208.          moving.getCoord(actionAnimal,xTrackArr[0],yTrackArr[0]);
  1209.          loopSum = xTrackArr.length;
  1210.          moving.getSpeed(xTrackArr[loopCount - 1],yTrackArr[loopCount - 1],xTrackArr[loopCount],yTrackArr[loopCount]);
  1211.          if(animalType == 4 || animalType == 5)
  1212.          {
  1213.             drawTool.startDrawCurveLine(_soleLayer_,xTrackArr[loopCount - 1],yTrackArr[loopCount - 1],color);
  1214.             curveLineType = moving.curveLineType;
  1215.             previousCurveLineStartX = xTrackArr[loopCount - 1];
  1216.             previousCurveLineStartY = yTrackArr[loopCount - 1];
  1217.          }
  1218.          ++loopCount;
  1219.          startMoving();
  1220.       }
  1221.       
  1222.       private function animalMovingMian() : *
  1223.       {
  1224.          moving.moving(actionAnimal,true);
  1225.          if(moveSum <= moving.moveSum && animalType == 1)
  1226.          {
  1227.             moving.moveSum = 0;
  1228.             sole.showSole(_soleLayer_,chooseAnimal.name,actionAnimal.x,actionAnimal.y,moving.outPutAngle(),color,helpFlag);
  1229.          }
  1230.          else if((animalType == 4 || animalType == 5) && moving.moveSum >= moveSum * 2)
  1231.          {
  1232.             moving.moveSum = 0;
  1233.             if(xTrackArr[loopCount - 1] != "end")
  1234.             {
  1235.                if(previousCurveLineStartX != actionAnimal.x || previousCurveLineStartY != actionAnimal.y)
  1236.                {
  1237.                   moving.getAnchor(previousCurveLineStartX,previousCurveLineStartY,actionAnimal.x,actionAnimal.y,curveLineType);
  1238.                   previousCurveLineStartX = actionAnimal.x;
  1239.                   previousCurveLineStartY = actionAnimal.y;
  1240.                   drawTool.drawCurveLine(moving.anchorX,moving.anchorY,actionAnimal.x,actionAnimal.y);
  1241.                   curveLineType = moving.curveLineType;
  1242.                }
  1243.             }
  1244.          }
  1245.          if(loopCount >= loopSum || (actionAnimal.x < 0 || actionAnimal.y > _operateLayer_.height || actionAnimal.x > _operateLayer_.width || actionAnimal.y < 0) && loopCount >= loopSum)
  1246.          {
  1247.             SoundsManager.stopMusic();
  1248.             _operateLayer_.removeEventListener(Event.ENTER_FRAME,animalMoving);
  1249.             _operateLayer_.removeEventListener("getSpeed",getSpeed);
  1250.             actionAnimalAlphaTween = new Tween(actionAnimal,"alpha",Regular.easeOut,actionAnimal.alpha,0,0.4,true);
  1251.             actionAnimalAlphaTween.addEventListener(TweenEvent.MOTION_FINISH,endMoving);
  1252.             SoundsManager.playSound(sound);
  1253.          }
  1254.       }
  1255.       
  1256.       private function initEvent() : *
  1257.       {
  1258.          _operateLayer_.addEventListener(MouseEvent.MOUSE_DOWN,mouseIsDown);
  1259.          _operateLayer_.addEventListener("startMove",startMove);
  1260.          _hotArea_.addEventListener(MouseEvent.CLICK,clickLink);
  1261.       }
  1262.       
  1263.       private function endMove() : *
  1264.       {
  1265.          actionAnimalAlphaTween.removeEventListener(TweenEvent.MOTION_FINISH,endMoving);
  1266.          actionAnimalAlphaTween = null;
  1267.          actionAnimal.alpha = 100;
  1268.          SoundsManager.stopMusic();
  1269.          _operateLayer_.removeEventListener(Event.ENTER_FRAME,animalMoving);
  1270.          _operateLayer_.removeEventListener("getSpeed",getSpeed);
  1271.          animal.hideActionAnimal(actionAnimal);
  1272.          clearTrackArray();
  1273.          mouseControl._mouse_.gotoAndStop(1);
  1274.          if(sole.soleMC != null)
  1275.          {
  1276.             repeal.noteInformation(operateType);
  1277.          }
  1278.          else if(drawTool.curveMC != null)
  1279.          {
  1280.             repeal.noteInformation(operateType);
  1281.          }
  1282.          revertProperty();
  1283.          animal.getMovingFlag(movingFlag);
  1284.          pencilTool.getMovingFlag(movingFlag);
  1285.          help.getMovingFlag(movingFlag);
  1286.          if(animalType == 1)
  1287.          {
  1288.             sole.pushEndFlag(helpFlag);
  1289.             mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
  1290.          }
  1291.          else if(animalType == 4 || animalType == 5)
  1292.          {
  1293.             drawTool.pushEndFlag(helpFlag);
  1294.             mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
  1295.          }
  1296.          drawBmp();
  1297.       }
  1298.       
  1299.       private function showActionAnimal() : *
  1300.       {
  1301.          pencilType = 0;
  1302.          animal.showActionAnimal(_operateLayer_,actionAnimal,-200,0);
  1303.          animalType = animal.animalType;
  1304.          pencilTool.clearBtnFilters();
  1305.       }
  1306.       
  1307.       private function animalMoving(param1:Event) : *
  1308.       {
  1309.          animalMovingMian();
  1310.       }
  1311.       
  1312.       private function helpAnimalMoving(param1:Event) : *
  1313.       {
  1314.          moving.moving(helpActionAnimal,true);
  1315.          if(moveSum <= moving.moveSum && helpFlag == true)
  1316.          {
  1317.             moving.moveSum = 0;
  1318.             sole.showSole(_helpShowLayer_,"CatBtn",helpActionAnimal.x,helpActionAnimal.y,moving.outPutAngle(),color,helpFlag);
  1319.          }
  1320.          if(helpLoopCount == helpLoopSum)
  1321.          {
  1322.             SoundsManager.stopMusic();
  1323.             sole.pushEndFlag(helpFlag);
  1324.             _main_.removeEventListener(Event.ENTER_FRAME,helpAnimalMoving);
  1325.             _main_.removeEventListener("getSpeed",getSpeed);
  1326.             helpLoopCount = 1;
  1327.             _mouse_.gotoAndStop(8);
  1328.             helpActionAnimalAlphaTween = new Tween(helpActionAnimal,"alpha",Regular.easeOut,helpActionAnimal.alpha,0,0.4,true);
  1329.             SoundsManager.playSound("_Cat_S_");
  1330.             timer = new Timer(1300,0);
  1331.             timer.addEventListener(TimerEvent.TIMER,helpBGTweenStart);
  1332.             helpTimerFunction = helpBGTweenStart;
  1333.             timer.start();
  1334.          }
  1335.       }
  1336.       
  1337.       private function chooseTheAnimal(param1:Event) : *
  1338.       {
  1339.          chooseTheAnimalMain();
  1340.       }
  1341.       
  1342.       private function delBmp() : *
  1343.       {
  1344.          bmpTool.delBmp(_soleLayer_);
  1345.       }
  1346.       
  1347.       private function fadeOutSoleMain(param1:MovieClip) : *
  1348.       {
  1349.          if(delAlphaTween1 == null && param1 != null)
  1350.          {
  1351.             delAlphaTween1 = new Tween(param1,"alpha",Regular.easeOut,param1.alpha,0,0.2,true);
  1352.             delYTween1 = new Tween(param1,"y",Regular.easeOut,param1.y,param1.y + 20,0.2,true);
  1353.             delAlphaTween1.addEventListener(TweenEvent.MOTION_FINISH,repealOperate);
  1354.          }
  1355.       }
  1356.       
  1357.       private function endGetTrack(param1:MouseEvent) : *
  1358.       {
  1359.          if(movingFlag == false && trackFlag == true)
  1360.          {
  1361.             _operateLayer_.removeEventListener(MouseEvent.MOUSE_MOVE,getTrack);
  1362.             _operateLayer_.stage.removeEventListener(MouseEvent.MOUSE_UP,endGetTrack);
  1363.             trackFlag = false;
  1364.             trackTool.endGetTrack();
  1365.             drawTool.clearDraw();
  1366.             getTrackArray();
  1367.             if(xTrackArr.length > 1 && actionAnimal != null)
  1368.             {
  1369.                trackTool.startMove(_operateLayer_);
  1370.                if(animalType == 1)
  1371.                {
  1372.                   operateType = sole.operateType;
  1373.                }
  1374.                else if(animalType == 4 || animalType == 5)
  1375.                {
  1376.                   operateType = drawTool.operateType;
  1377.                }
  1378.             }
  1379.             else
  1380.             {
  1381.                actionAnimal.visible = false;
  1382.                actionAnimal.alpha = 0;
  1383.                clearTrackArray();
  1384.                mouseControl._mouse_.gotoAndStop(animal.animalDownFrame);
  1385.             }
  1386.          }
  1387.       }
  1388.       
  1389.       private function startHelpRepealAll(param1:TimerEvent) : *
  1390.       {
  1391.          _mouse_.gotoAndStop(1);
  1392.          timer.removeEventListener(TimerEvent.TIMER,startHelpRepealAll);
  1393.          timer = null;
  1394.          mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.repealAllX,1,true);
  1395.          mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.repealAllY,1,true);
  1396.          mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpRepealAllTweenEnd);
  1397.          helpTweenFunction = helpRepealAllTweenEnd;
  1398.       }
  1399.       
  1400.       private function getTrack(param1:MouseEvent) : *
  1401.       {
  1402.          if(trackFlag == true)
  1403.          {
  1404.             mouseControl._mouse_.gotoAndStop(1);
  1405.             trackTool.getTrack(_operateLayer_.mouseX,_operateLayer_.mouseY);
  1406.             drawTool.drawLine(_operateLayer_.mouseX,_operateLayer_.mouseY);
  1407.          }
  1408.       }
  1409.       
  1410.       private function changeColor(param1:Event) : *
  1411.       {
  1412.          color = colorTool.getColor();
  1413.          if(animalType == 4 || animalType == 5)
  1414.          {
  1415.             drawTool.setCurveLineColor(color);
  1416.          }
  1417.          else if(pencilType == 1 || pencilType == 2)
  1418.          {
  1419.             pencilTool.setPencilColor(color);
  1420.          }
  1421.       }
  1422.       
  1423.       private function helpPencilMoving(param1:Event) : *
  1424.       {
  1425.          moving.moving(_mouse_,false);
  1426.          pencilTool.Pencildrawing(_mouse_.x,_mouse_.y);
  1427.          if(helpLoopCount == helpLoopSum)
  1428.          {
  1429.             helpLoopCount = 1;
  1430.             _main_.removeEventListener(Event.ENTER_FRAME,helpPencilMoving);
  1431.             _main_.removeEventListener("getSpeed",getSpeed);
  1432.             _mouse_.gotoAndStop(1);
  1433.             timer = new Timer(1300,0);
  1434.             timer.addEventListener(TimerEvent.TIMER,startHelpRepealObj);
  1435.             helpTimerFunction = startHelpRepealObj;
  1436.             timer.start();
  1437.          }
  1438.       }
  1439.       
  1440.       private function helpMouseUp(param1:TimerEvent) : *
  1441.       {
  1442.          mouseTimer.removeEventListener(TimerEvent.TIMER,helpMouseUp);
  1443.          mouseTimer = null;
  1444.          if(_mouse_ != null)
  1445.          {
  1446.             _mouse_.gotoAndStop(1);
  1447.          }
  1448.       }
  1449.       
  1450.       private function drawBmp() : *
  1451.       {
  1452.          drawTool.showCurveLine();
  1453.          pencilTool.showPencilArr();
  1454.          sole.showSoleArr();
  1455.          spray.showSpray();
  1456.          delBmp();
  1457.          drawObj();
  1458.          drawTool.hideCurveLine();
  1459.          pencilTool.hidePencilArr();
  1460.          sole.hideSoleArr();
  1461.          spray.hideSpray();
  1462.       }
  1463.       
  1464.       private function startHelpPencil(param1:TimerEvent) : *
  1465.       {
  1466.          animal.delHelpMovie();
  1467.          animal.clearBtnFilters();
  1468.          pencilTool.pencilGlowFilter();
  1469.          _mouse_.gotoAndStop(1);
  1470.          timer.removeEventListener(TimerEvent.TIMER,startHelpPencil);
  1471.          timer = null;
  1472.          helpXTrackArr = help.pencilXArr;
  1473.          helpYTrackArr = help.pencilYArr;
  1474.          mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,helpXTrackArr[0] + 99,1,true);
  1475.          mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,helpYTrackArr[0] + 23.6,1,true);
  1476.          mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpPencil);
  1477.          helpTweenFunction = helpPencil;
  1478.       }
  1479.       
  1480.       private function helpPencil(param1:TweenEvent) : *
  1481.       {
  1482.          mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpPencil);
  1483.          mouseTweenX = null;
  1484.          mouseTweenY = null;
  1485.          helpLoopSum = helpXTrackArr.length;
  1486.          _mouse_.parent.removeChild(_mouse_);
  1487.          _mouse_ = null;
  1488.          _mouse_ = new _Mouse_();
  1489.          _operateLayer_.addChild(_mouse_);
  1490.          _mouse_.gotoAndStop(1);
  1491.          moving.getCoord(_mouse_,helpXTrackArr[0],helpYTrackArr[0]);
  1492.          pencilTool.createPencilMC(_helpShowLayer_,_mouse_.x,_mouse_.y,color);
  1493.          moving.getSpeed(helpXTrackArr[helpLoopCount - 1],helpYTrackArr[helpLoopCount - 1],helpXTrackArr[helpLoopCount],helpYTrackArr[helpLoopCount]);
  1494.          ++helpLoopCount;
  1495.          _main_.addEventListener(Event.ENTER_FRAME,helpPencilMoving);
  1496.          helpMovingFunction = helpPencilMoving;
  1497.          _main_.addEventListener("getSpeed",getSpeed);
  1498.       }
  1499.       
  1500.       private function changeSprayType(param1:Event) : *
  1501.       {
  1502.          sprayType = spray.changeSprayType();
  1503.       }
  1504.       
  1505.       private function clickLink(param1:MouseEvent) : *
  1506.       {
  1507.          Language.onCLick1();
  1508.       }
  1509.       
  1510.       private function mouseIsUp(param1:MouseEvent) : *
  1511.       {
  1512.          mouseControl._mouse_.gotoAndStop(1);
  1513.          _operateLayer_.stage.removeEventListener(MouseEvent.MOUSE_UP,mouseIsUp);
  1514.       }
  1515.       
  1516.       private function getTrackArray() : *
  1517.       {
  1518.          xTrackArr = trackTool.xTrackArr;
  1519.          yTrackArr = trackTool.yTrackArr;
  1520.       }
  1521.       
  1522.       private function initElement() : *
  1523.       {
  1524.          _main_ = new _Main_();
  1525.          PARENT.addChild(_main_);
  1526.          _mainBG_ = _main_.getChildByName("MainBG") as MovieClip;
  1527.          _operateLayer_ = _mainBG_.getChildByName("OperateLayer") as MovieClip;
  1528.          _helpShowLayer_ = _mainBG_.getChildByName("HelpShowLayer") as MovieClip;
  1529.          _printLayer_ = _mainBG_.getChildByName("PrintLayer") as MovieClip;
  1530.          _soleLayer_ = _printLayer_.getChildByName("SoleLayer") as MovieClip;
  1531.          _sprayLayer_ = _mainBG_.getChildByName("SprayLayer") as MovieClip;
  1532.          _bg_ = _printLayer_.getChildByName("Background") as MovieClip;
  1533.          _pushpin_ = _bg_.getChildByName("Pushpin") as MovieClip;
  1534.          _toner_ = _main_.getChildByName("Toner") as MovieClip;
  1535.          logoMC = _main_.getChildByName("LogoMC") as MovieClip;
  1536.          _hotArea_ = logoMC.getChildByName("hitarea_url1") as SimpleButton;
  1537.       }
  1538.       
  1539.       private function endPencil(param1:MouseEvent) : *
  1540.       {
  1541.          _operateLayer_.stage.removeEventListener(MouseEvent.MOUSE_UP,endPencil);
  1542.          _operateLayer_.removeEventListener(MouseEvent.MOUSE_MOVE,pencilDrawing);
  1543.          pencilFlag = false;
  1544.          operateType = pencilTool.operateType;
  1545.          repeal.noteInformation(operateType);
  1546.          pencilTool.endPencilDraw(_soleLayer_,helpFlag);
  1547.          drawBmp();
  1548.       }
  1549.       
  1550.       private function fadeOutCurveLineMain(param1:MovieClip) : *
  1551.       {
  1552.          if(delAlphaTween4 == null)
  1553.          {
  1554.             delAlphaTween4 = new Tween(param1,"alpha",Regular.easeOut,param1.alpha,0,0.2,true);
  1555.             delYTween4 = new Tween(param1,"y",Regular.easeOut,param1.y,param1.y + 20,0.2,true);
  1556.             delAlphaTween4.addEventListener(TweenEvent.MOTION_FINISH,repealOperate);
  1557.          }
  1558.       }
  1559.       
  1560.       private function helpBGTweenEnd(param1:TweenEvent) : *
  1561.       {
  1562.          SoundsManager.playSound("_GameMouseOver_");
  1563.          BG.showBgBtnFilters();
  1564.          mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpBGTweenEnd);
  1565.          mouseTweenX = null;
  1566.          mouseTweenY = null;
  1567.          _mouse_.gotoAndStop(8);
  1568.          timer = new Timer(1000,0);
  1569.          timer.addEventListener(TimerEvent.TIMER,helpBG);
  1570.          helpTimerFunction = helpBG;
  1571.          timer.start();
  1572.       }
  1573.       
  1574.       private function startHelpSpray(param1:TimerEvent) : *
  1575.       {
  1576.          _mouse_.gotoAndStop(1);
  1577.          if(helpSprayCount == 0)
  1578.          {
  1579.             animal.delHelpMovie();
  1580.             animal.animalGlowFilter(helpAnimal);
  1581.          }
  1582.          mouseTweenX = new Tween(_mouse_,"x",Regular.easeOut,_mouse_.x,help.sprayXArr[helpSprayCount],1,true);
  1583.          mouseTweenY = new Tween(_mouse_,"y",Regular.easeOut,_mouse_.y,help.sprayYArr[helpSprayCount],1,true);
  1584.          mouseTweenX.addEventListener(TweenEvent.MOTION_FINISH,helpSpray);
  1585.          helpTweenFunction = helpSpray;
  1586.          ++helpSprayCount;
  1587.       }
  1588.       
  1589.       private function revertProperty() : *
  1590.       {
  1591.          moving.moveSum = 0;
  1592.          movingFlag = false;
  1593.          loopCount = 1;
  1594.          operateType = 0;
  1595.       }
  1596.       
  1597.       private function helpSpray(param1:TweenEvent) : *
  1598.       {
  1599.          _mouse_.gotoAndStop(1);
  1600.          SoundsManager.playSound("_Whale_S_");
  1601.          spray.drawSpray(_helpShowLayer_,_sprayLayer_,help.sprayXArr[helpSprayCount - 1] - 99,help.sprayYArr[helpSprayCount - 1] - 23.6,sprayType,color,helpFlag);
  1602.          if(helpSprayCount == 5)
  1603.          {
  1604.             helpSprayCount = 0;
  1605.             timer.removeEventListener(TimerEvent.TIMER,startHelpSpray);
  1606.             timer = null;
  1607.             mouseTweenX.removeEventListener(TweenEvent.MOTION_FINISH,helpSpray);
  1608.             mouseTweenX = null;
  1609.             mouseTweenY = null;
  1610.             timer = new Timer(1300,0);
  1611.             timer.addEventListener(TimerEvent.TIMER,helpPencilTweenStart);
  1612.             helpTimerFunction = helpPencilTweenStart;
  1613.             timer.start();
  1614.          }
  1615.       }
  1616.    }
  1617. }
  1618.