home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 145 / MOBICLIC145.ISO / pc / DATA / DSS145 / DSS145_05 / DSS145_05.swf / scripts / dss145_05 / CapsuleAlgo.as < prev    next >
Text File  |  2012-07-18  |  25KB  |  675 lines

  1. package dss145_05
  2. {
  3.    import com.milanpresse.engine.Engine;
  4.    import com.milanpresse.engine.managers.PauseManager;
  5.    import com.milanpresse.engine.managers.TimelineManager;
  6.    import com.milanpresse.engine.medias.MediaSwf;
  7.    import com.milanpresse.engine.timelines.Timeline;
  8.    import com.milanpresse.engine.timelines.TimelineLinear;
  9.    import com.milanpresse.engineaddons.facades.EngineExt;
  10.    import com.milanpresse.engineaddons.initdisplayobject.ExtendedClip;
  11.    import com.milanpresse.tools.GlobalesFunctions;
  12.    import flash.display.Bitmap;
  13.    import flash.display.BitmapData;
  14.    import flash.display.MovieClip;
  15.    import flash.display.Sprite;
  16.    import flash.events.Event;
  17.    import flash.events.MouseEvent;
  18.    import flash.events.TimerEvent;
  19.    import flash.geom.Matrix;
  20.    import flash.geom.Rectangle;
  21.    import flash.net.SharedObject;
  22.    import flash.ui.Mouse;
  23.    import flash.utils.Timer;
  24.    import flash.utils.getTimer;
  25.    import org.computus.model.Timekeeper;
  26.    import org.computus.model.TimekeeperEvent;
  27.    
  28.    public class CapsuleAlgo
  29.    {
  30.        
  31.       
  32.       private var _e:EngineExt;
  33.       
  34.       private var menu:MediaSwf;
  35.       
  36.       private var menuTimeline:MovieClip;
  37.       
  38.       private var menuTL:Timeline;
  39.       
  40.       private var mainClip:MediaSwf;
  41.       
  42.       private var mainTimeline:MovieClip;
  43.       
  44.       private var _engine:Engine;
  45.       
  46.       private var labelList:Array;
  47.       
  48.       private var _timeline_:TimelineLinear;
  49.       
  50.       private var _timelineManager:TimelineManager;
  51.       
  52.       private var _pauseManager:PauseManager;
  53.       
  54.       private var labelsCallback:Object;
  55.       
  56.       private var firstLabel:String;
  57.       
  58.       private var so:SharedObject;
  59.       
  60.       private var gListDone:Array;
  61.       
  62.       private var gListeObjet:Array;
  63.       
  64.       private var gListeCibles:Array;
  65.       
  66.       private var gListeCurrentCibles:Array;
  67.       
  68.       private var gDoneDepart:Boolean;
  69.       
  70.       private var BT_RETOUR:BtRetour;
  71.       
  72.       private var PANO_AIDE:MovieClip;
  73.       
  74.       public var _bitmap:Bitmap = null;
  75.       
  76.       public var _sprite:Sprite;
  77.       
  78.       private var attenteJeu:AttenteJeu = null;
  79.       
  80.       private var _timerCursor:Timer;
  81.       
  82.       private var ANIM_TIR:ExtendedClip;
  83.       
  84.       public var timekeeper:Timekeeper;
  85.       
  86.       private var _fondDuration:Number = 20;
  87.       
  88.       private var nbOiseauxToLaunch:int = 2;
  89.       
  90.       private var BT_REJOUER:ExtendedClip;
  91.       
  92.       private var keeperTimeIsRunning:Boolean = false;
  93.       
  94.       private var _attackTimeLast:Number = 0;
  95.       
  96.       private var _attackInterval:int = 5000;
  97.       
  98.       private var _attackIntervalMinimum:Number = 12000;
  99.       
  100.       private var _attackIntervalMaximum:Number = 13000;
  101.       
  102.       private var _limitLayer;
  103.       
  104.       private var lastTimeOiseau:int = 0;
  105.       
  106.       private var _levelIndex:int = -1;
  107.       
  108.       private var _totalTimes:Array;
  109.       
  110.       private var _oiseauxSpeedsDuration:Array;
  111.       
  112.       protected var oiseauIndex:int = 0;
  113.       
  114.       protected var ind:int = 2;
  115.       
  116.       protected var delaiActuelTimer:Number = 0;
  117.       
  118.       protected var _spriteMobile:Boolean;
  119.       
  120.       private var Oiseautouche:Boolean = false;
  121.       
  122.       protected var numOiseauxToKill:int = 5;
  123.       
  124.       private var actualTime:int = 0;
  125.       
  126.       public var startTime:int = 0;
  127.       
  128.       private var lastTime:int = 0;
  129.       
  130.       public function CapsuleAlgo(param1:Engine)
  131.       {
  132.          var engine:Engine = param1;
  133.          this.labelsCallback = {"_11":"prioAnim"};
  134.          this._timerCursor = new Timer(1);
  135.          this._limitLayer = new Sprite();
  136.          this._totalTimes = [25555000,35000,35000,35000,35000];
  137.          this._oiseauxSpeedsDuration = [60,60,60,60,60];
  138.          super();
  139.          this._engine = engine;
  140.          this._engine.playMusic({"code":"MU"});
  141.          this._engine.setSubtitles(this._engine.host.subtitlesOn);
  142.          this._engine.setFrameRate(12);
  143.          this.mainClip = this._engine.showSwf({
  144.             "code":"A_" + this._engine.config.moduleName,
  145.             "parent":this._engine.config.layers["content"]
  146.          });
  147.          this.mainTimeline = this.mainClip.swfContent;
  148.          this._timelineManager = new TimelineManager();
  149.          this._timeline_ = new TimelineLinear(this.mainTimeline,this._engine,this,this._timelineManager,this.labelsCallback);
  150.          this._engine.levelCZ = this._engine.config.layers["content"];
  151.          this._e = new EngineExt(this._engine,this._timelineManager);
  152.          this.firstLabel = this.mainTimeline.currentLabels[0].name;
  153.          this._timeline_.GotoAndPlayUntil({"labelStop":this.firstLabel});
  154.          this.so = SharedObject.getLocal(this._engine.config.rubriqueName,"/");
  155.          this.gListDone = this.so.data.listDone;
  156.          this.gDoneDepart = this.gListDone[this._engine.config.moduleNum - 1] == 1;
  157.          this.BT_RETOUR = new BtRetour(this._engine,this._timelineManager,this.so);
  158.          this.BT_RETOUR.setFunctionHideCursorSpecial(function():void
  159.          {
  160.          });
  161.          this.BT_RETOUR.setFunctionShowCursorSpecial(function():void
  162.          {
  163.          });
  164.       }
  165.       
  166.       public function labelATTENTE_JEU() : void
  167.       {
  168.          this._totalTimes = [];
  169.          this._oiseauxSpeedsDuration = [];
  170.          var j:int = 1;
  171.          while(j <= 5)
  172.          {
  173.             var _loc3_:int = 0;
  174.             var _loc4_:* = ┬º┬ºcheckfilter(this._e.config.XmlConfig.Module.Config.Params.Param);
  175.             var _loc2_:* = new XMLList("");
  176.             ┬º┬ºpush(┬º┬ºfindproperty(Number));
  177.             this._e.config.XmlConfig.Module.Config.Params.Param.(@nom == "N" + j + "_TotalTime");
  178.             ┬º┬ºpop().push(this._totalTimes.Number(_loc2_[0].@valeur) * 1000);
  179.             _loc3_ = 0;
  180.             _loc4_ = ┬º┬ºcheckfilter(this._e.config.XmlConfig.Module.Config.Params.Param);
  181.             _loc2_ = new XMLList("");
  182.             ┬º┬ºpush(┬º┬ºfindproperty(Number));
  183.             this._e.config.XmlConfig.Module.Config.Params.Param.(@nom == "N" + j + "_OiseauVitesse");
  184.             ┬º┬ºpop().push(this._oiseauxSpeedsDuration.Number(_loc2_[0].@valeur));
  185.             j++;
  186.          }
  187.          _loc3_ = 0;
  188.          _loc4_ = ┬º┬ºcheckfilter(this._e.config.XmlConfig.Module.Config.Params.Param);
  189.          _loc2_ = new XMLList("");
  190.          ┬º┬ºpush(┬º┬ºfindproperty(Number));
  191.          this._e.config.XmlConfig.Module.Config.Params.Param.(@nom == "FondVitesse");
  192.          ┬º┬ºpop()._fondDuration = this.Number(_loc2_[0].@valeur);
  193.          _loc3_ = 0;
  194.          _loc4_ = ┬º┬ºcheckfilter(this._e.config.XmlConfig.Module.Config.Params.Param);
  195.          _loc2_ = new XMLList("");
  196.          ┬º┬ºpush(┬º┬ºfindproperty(Number));
  197.          this._e.config.XmlConfig.Module.Config.Params.Param.(@nom == "OiseauxSimultanes");
  198.          ┬º┬ºpop().nbOiseauxToLaunch = this.Number(_loc2_[0].@valeur);
  199.          if(this._fondDuration != -1)
  200.          {
  201.             if(this._fondDuration != 0)
  202.             {
  203.                this._fondDuration = 1000 / this._fondDuration;
  204.             }
  205.          }
  206.          this.attenteJeu = new AttenteJeu(this._e,this.labelATTENTE_JEU_CALLBACK,this);
  207.          this.attenteJeu.config.CONTAINER = this.mainTimeline;
  208.          var anim_oiseaux:MovieClip = this.mainTimeline.getChildByName("ANIM_OISEAU_FOND") as MovieClip;
  209.          anim_oiseaux.gotoAndStop(1);
  210.          this.mainTimeline.removeChild(this.mainTimeline.getChildByName("CIBLE"));
  211.          this._sprite = new Sprite();
  212.          this._bitmap = this.buildCacheFromClip(anim_oiseaux);
  213.          this._sprite.addChild(this._bitmap);
  214.          this._bitmap.x = -this._bitmap.width / 2;
  215.          this._bitmap.y = -this._bitmap.height / 2;
  216.          this._bitmap.smoothing = true;
  217.          this._sprite.cacheAsBitmap = true;
  218.          this.mainTimeline.removeChild(anim_oiseaux);
  219.          if(this._fondDuration != -1)
  220.          {
  221.             this.mainTimeline.addChild(this._sprite);
  222.          }
  223.          this.mainTimeline.addChild(this._limitLayer);
  224.          this.timekeeper = new Timekeeper();
  225.          this.timekeeper.setRealTimeValue();
  226.          this.timekeeper.setRealTimeTick();
  227.          this.timekeeper.setTickFrequency(1);
  228.          this.timekeeper.setTickDuration(1);
  229.          this.timekeeper.startTicking();
  230.          this.BT_REJOUER_Init();
  231.          this.attenteJeu.config.BT_AIDE = this.mainTimeline.getChildByName("BT_AIDE");
  232.          this.attenteJeu.config.BT_REJOUER = this.mainTimeline.getChildByName("BT_REJOUER");
  233.          this.mainTimeline.getChildByName("CLIP_AIDE").visible = false;
  234.          this.attenteJeu.config.TIMER = this.mainTimeline.getChildByName("TIMER");
  235.          var i:int = 1;
  236.          while(i <= 5)
  237.          {
  238.             this.attenteJeu.config.OISEAUX.push(this.mainTimeline.getChildByName("OISEAU_0" + i));
  239.             this.attenteJeu.config.OISEAUX_FRONT.push(this.mainTimeline.getChildByName("OISEAU_FRONT_0" + i));
  240.             i++;
  241.          }
  242.          this.mainTimeline.getChildByName("CIBLE");
  243.          this.attenteJeu.config.CLIP_AIDE = this.mainTimeline.getChildByName("CLIP_AIDE");
  244.          this.ANIM_TIR = new ExtendedClip(this.mainTimeline.getChildByName("ANIM_TIR") as MovieClip,this._e);
  245.          this.ANIM_TIR.visible = false;
  246.          this.ANIM_TIR.init();
  247.          this.attenteJeu.init();
  248.          this.gameReset();
  249.          this.levelLaunch();
  250.       }
  251.       
  252.       private function BT_REJOUER_Init() : void
  253.       {
  254.          var clip:ExtendedClip = this.BT_REJOUER = new ExtendedClip(this.mainTimeline.getChildByName("BT_REJOUER") as MovieClip,this._e);
  255.          clip.onPressState = {"label":"E1"};
  256.          clip.onRollOverState = {
  257.             "label":"E2",
  258.             "noiseCode":"B_REJ"
  259.          };
  260.          clip.onRollOutState = {"label":"E1"};
  261.          clip.onPress = function():void
  262.          {
  263.             levelLaunch();
  264.          };
  265.          clip.enabled = false;
  266.          clip.visible = false;
  267.          clip.init();
  268.       }
  269.       
  270.       private function cursorTimerHandler(param1:TimerEvent) : void
  271.       {
  272.       }
  273.       
  274.       protected function gameReset() : void
  275.       {
  276.          this._levelIndex = -1;
  277.          this.levelReset();
  278.       }
  279.       
  280.       protected function levelReset() : void
  281.       {
  282.          this.numOiseauxToKill = 5;
  283.          this.ind = 1;
  284.          this.attenteJeu.TIMER.gotoAndStop("E1");
  285.          this.attenteJeu.TIMER.movie.TIMER_E1.gotoAndStop(1);
  286.          var _loc1_:int = 0;
  287.          while(_loc1_ < 5)
  288.          {
  289.             this.attenteJeu.OISEAUX[_loc1_].gotoAndStop(1);
  290.             this.attenteJeu.OISEAUX[_loc1_].movie.CLIP.gotoAndStop("E1");
  291.             this.attenteJeu.OISEAUX[_loc1_].visible = false;
  292.             this.attenteJeu.OISEAUX[_loc1_].attack = false;
  293.             this.attenteJeu.OISEAUX[_loc1_].killed = false;
  294.             this.attenteJeu.OISEAUX[_loc1_].depthIndex = this.attenteJeu.CONTAINER.getChildIndex(this._limitLayer);
  295.             this.attenteJeu.OISEAUX_FRONT[_loc1_].enabled = false;
  296.             this.attenteJeu.OISEAUX_FRONT[_loc1_].movie.CLIP.gotoAndStop("E1");
  297.             this.attenteJeu.OISEAUX_FRONT[_loc1_].gotoAndStop(1);
  298.             this.attenteJeu.OISEAUX_FRONT[_loc1_].killed = false;
  299.             this.attenteJeu.OISEAUX_FRONT[_loc1_].visible = false;
  300.             _loc1_++;
  301.          }
  302.       }
  303.       
  304.       protected function levelLaunch() : void
  305.       {
  306.          this.BT_REJOUER.visible = false;
  307.          ++this._levelIndex;
  308.          if(this._levelIndex >= 3)
  309.          {
  310.             this.gameFinished();
  311.          }
  312.          else
  313.          {
  314.             this._e.noisePlay({"code":"B_MANCHE"});
  315.             this.mainTimeline.stage.addEventListener(MouseEvent.MOUSE_DOWN,this.stageMouseClicHandler);
  316.             this.startTime = this.lastTime = this.lastTimeOiseau = this._attackTimeLast = getTimer();
  317.             this.timekeeper.addEventListener(TimekeeperEvent.CHANGE,this.onTick);
  318.             this.keeperTimeIsRunning = true;
  319.             this.launchOiseaux();
  320.          }
  321.       }
  322.       
  323.       protected function timeFinished() : void
  324.       {
  325.          this.mainTimeline.stage.removeEventListener(MouseEvent.MOUSE_DOWN,this.stageMouseClicHandler);
  326.          this.timekeeper.removeEventListener(TimekeeperEvent.CHANGE,this.onTick);
  327.          this.keeperTimeIsRunning = false;
  328.          this.attenteJeu.TIMER.gotoAndStop("E2");
  329.          Mouse.show();
  330.          this._e.noisePlay({
  331.             "code":"B_TIME",
  332.             "callback":function():void
  333.             {
  334.                levelReset();
  335.                _e.commentPlay({
  336.                   "code":"PERDU",
  337.                   "callback":function():void
  338.                   {
  339.                      BT_REJOUER.enabled = true;
  340.                      BT_REJOUER.visible = true;
  341.                   }
  342.                });
  343.             }
  344.          });
  345.       }
  346.       
  347.       protected function levelFinished() : void
  348.       {
  349.          this.mainTimeline.stage.removeEventListener(MouseEvent.MOUSE_DOWN,this.stageMouseClicHandler);
  350.          this.timekeeper.removeEventListener(TimekeeperEvent.CHANGE,this.onTick);
  351.          this.keeperTimeIsRunning = false;
  352.          Mouse.show();
  353.          this.levelReset();
  354.          if(this._levelIndex >= 2)
  355.          {
  356.             this.gameFinished();
  357.          }
  358.          else
  359.          {
  360.             this._e.commentPlay({
  361.                "code":"BRAVO_0" + int(this._levelIndex + 1),
  362.                "callback":function():void
  363.                {
  364.                   levelLaunch();
  365.                }
  366.             });
  367.          }
  368.       }
  369.       
  370.       protected function gameFinished() : void
  371.       {
  372.          this.save();
  373.          this.attenteJeu.BT_AIDE.visible = false;
  374.          this.attenteJeu.TIMER.visible = false;
  375.          this.mainTimeline.stage.removeEventListener(MouseEvent.MOUSE_DOWN,this.stageMouseClicHandler);
  376.          this.mainTimeline.removeChild(this._sprite);
  377.          this._timeline_.GotoAndPlayUntil({"labelStop":"_10"});
  378.       }
  379.       
  380.       protected function launchOiseaux() : void
  381.       {
  382.          if(this.numOiseauxToKill <= 0)
  383.          {
  384.             return;
  385.          }
  386.          var _loc1_:int = 0;
  387.          while(_loc1_ < 5)
  388.          {
  389.             if(this.attenteJeu.OISEAUX[_loc1_].attack == false)
  390.             {
  391.                this.attenteJeu.OISEAUX[_loc1_].depthIndex = this.attenteJeu.CONTAINER.getChildIndex(this._limitLayer);
  392.                this.attenteJeu.OISEAUX[_loc1_].gotoAndPlay(1,this.launchEndHandler);
  393.                this.attenteJeu.OISEAUX[_loc1_].visible = true;
  394.                this.attenteJeu.OISEAUX[_loc1_].attack = true;
  395.                if(_loc1_ + 1 >= this.nbOiseauxToLaunch)
  396.                {
  397.                   return;
  398.                }
  399.             }
  400.             _loc1_++;
  401.          }
  402.       }
  403.       
  404.       private function launchEndHandler(param1:* = null) : void
  405.       {
  406.          param1.target.visible = false;
  407.          param1.target.gotoAndStop(1);
  408.          var _loc2_:ExtendedClip = this.attenteJeu.OISEAUX_FRONT[param1.target.no - 1];
  409.          _loc2_.depthIndex = this.attenteJeu.CONTAINER.getChildIndex(this._limitLayer);
  410.          _loc2_.gotoAndStop(1);
  411.          _loc2_.movie.CLIP.gotoAndStop("E1");
  412.          _loc2_.visible = true;
  413.          _loc2_.movie.enabled = false;
  414.          _loc2_.movie.mouseEnabled = false;
  415.          _loc2_.movie.mouseChildren = true;
  416.          _loc2_.movie.CLIP.mouseEnabled = false;
  417.          _loc2_.movie.CLIP.enabled = false;
  418.          _loc2_.movie.CLIP.mouseEnabled = true;
  419.          _loc2_.movie.CLIP.STATE.mouseEnabled = false;
  420.          _loc2_.movie.CLIP.STATE.enabled = false;
  421.          _loc2_.movie.CLIP.STATE.mouseEnabled = true;
  422.          _loc2_.movie.CLIP.STATE.ZONE.indexOiseau = param1.target.no - 1;
  423.          _loc2_.movie.CLIP.STATE.ZONE.buttonMode = true;
  424.          _loc2_.movie.CLIP.STATE.ZONE.enabled = true;
  425.          _loc2_.movie.CLIP.STATE.ZONE.mouseEnabled = true;
  426.          _loc2_.movie.CLIP.STATE.ZONE.useHandCursor = true;
  427.       }
  428.       
  429.       public function resetTimers() : void
  430.       {
  431.          this.startTime = getTimer() - this.delaiActuelTimer;
  432.          this.delaiActuelTimer = 0;
  433.       }
  434.       
  435.       public function stopTimer() : void
  436.       {
  437.          this.delaiActuelTimer = this.actualTime - this.startTime;
  438.       }
  439.       
  440.       protected function onTick(param1:TimekeeperEvent) : void
  441.       {
  442.          var _loc2_:int = 0;
  443.          this.actualTime = getTimer();
  444.          if(this.delaiActuelTimer == 0)
  445.          {
  446.             if(this.actualTime - this.startTime >= this._totalTimes[this._levelIndex])
  447.             {
  448.                this.timeFinished();
  449.                return;
  450.             }
  451.             this.attenteJeu.TIMER.movie.TIMER_E1.gotoAndStop(Math.floor(100 * (this.actualTime - this.startTime) / this._totalTimes[this._levelIndex]));
  452.          }
  453.          if(this._fondDuration > 0 && this.actualTime - this.lastTime > this._fondDuration)
  454.          {
  455.             this._sprite.rotation += 5;
  456.             this.lastTime = this.actualTime;
  457.          }
  458.          if(this.actualTime - this.lastTimeOiseau > this._oiseauxSpeedsDuration[this._levelIndex])
  459.          {
  460.             _loc2_ = 0;
  461.             while(_loc2_ < 5)
  462.             {
  463.                this.lastTimeOiseau = this.actualTime;
  464.                if(this.attenteJeu.OISEAUX_FRONT[_loc2_].currentFrame >= this.attenteJeu.OISEAUX_FRONT[_loc2_].totalFrames)
  465.                {
  466.                   this.attenteJeu.OISEAUX_FRONT[_loc2_].gotoAndStop(1);
  467.                }
  468.                else
  469.                {
  470.                   this.attenteJeu.OISEAUX_FRONT[_loc2_].gotoAndStop(this.attenteJeu.OISEAUX_FRONT[_loc2_].currentFrame + 1);
  471.                }
  472.                _loc2_++;
  473.             }
  474.          }
  475.          _loc2_ = 0;
  476.          while(_loc2_ < 5)
  477.          {
  478.             if(this.attenteJeu.OISEAUX_FRONT[_loc2_].movie.CLIP.STATE != null && this.attenteJeu.OISEAUX_FRONT[_loc2_].movie.CLIP.STATE.ZONE.hitTestPoint(this.mainTimeline.stage.mouseX,this.mainTimeline.stage.mouseY,true))
  479.             {
  480.                this.Oiseautouche = true;
  481.                break;
  482.             }
  483.             this.Oiseautouche = false;
  484.             _loc2_++;
  485.          }
  486.       }
  487.       
  488.       private function oiseauReset(param1:ExtendedClip) : void
  489.       {
  490.          param1.attack = false;
  491.          param1.killed = false;
  492.          param1.visible = false;
  493.          param1.movie.CLIP.gotoAndStop("E1");
  494.          param1.gotoAndStop(1);
  495.          param1.depthIndex = this.attenteJeu.CONTAINER.getChildIndex(this._limitLayer);
  496.          param1.movie.CLIP.STATE.ZONE.removeEventListener(MouseEvent.MOUSE_DOWN,this.zoneClicHandler);
  497.       }
  498.       
  499.       private function stageMouseClicHandler(param1:MouseEvent) : void
  500.       {
  501.          var oiseau:ExtendedClip = null;
  502.          var event:MouseEvent = param1;
  503.          if(event.target.hasOwnProperty("indexOiseau"))
  504.          {
  505.             oiseau = this.attenteJeu.OISEAUX_FRONT[event.target.indexOiseau];
  506.             if(oiseau.killed)
  507.             {
  508.                return;
  509.             }
  510.             oiseau.killed = true;
  511.             --this.numOiseauxToKill;
  512.             oiseau.stop();
  513.             oiseau.last = this.numOiseauxToKill == 0 ? true : false;
  514.             if(this.numOiseauxToKill <= 0)
  515.             {
  516.                this.timekeeper.removeEventListener(TimekeeperEvent.CHANGE,this.onTick);
  517.                this.keeperTimeIsRunning = false;
  518.             }
  519.             this.ANIM_TIR.x = this.attenteJeu.CONTAINER.mouseX;
  520.             this.ANIM_TIR.y = this.attenteJeu.CONTAINER.mouseY;
  521.             this.ANIM_TIR.depthIndex = this.attenteJeu.CONTAINER.numChildren - 1;
  522.             this.ANIM_TIR.gotoAndPlay(1,function():void
  523.             {
  524.                ANIM_TIR.visible = false;
  525.                (oiseau.getChildByName("CLIP") as MovieClip).gotoAndStop("E2");
  526.                _e.noisePlay({
  527.                   "code":"B_CRI",
  528.                   "callback":function():void
  529.                   {
  530.                      (oiseau.getChildByName("CLIP") as MovieClip).gotoAndStop("E3");
  531.                      if(oiseau.last == false)
  532.                      {
  533.                         launchOiseaux();
  534.                      }
  535.                      _e.noisePlay({
  536.                         "code":"B_CENDRE",
  537.                         "callback":function():void
  538.                         {
  539.                            oiseau.gotoAndStop(1);
  540.                            oiseau.visible = false;
  541.                            oiseau.attack = false;
  542.                            oiseau.killed = false;
  543.                            if(oiseau.last)
  544.                            {
  545.                               levelFinished();
  546.                            }
  547.                         }
  548.                      });
  549.                   }
  550.                });
  551.             });
  552.             this.ANIM_TIR.visible = true;
  553.             this._e.noisePlay({"code":"B_TIR"});
  554.          }
  555.          else
  556.          {
  557.             this._e.noisePlay({"code":"B_RATE"});
  558.          }
  559.       }
  560.       
  561.       private function zoneClicHandler(param1:MouseEvent) : void
  562.       {
  563.       }
  564.       
  565.       public function enterFrameHandler(param1:Event) : void
  566.       {
  567.          this.actualTime = getTimer();
  568.          this.lastTime = this.actualTime;
  569.          this._sprite.rotation += 2;
  570.       }
  571.       
  572.       public function buildCacheFromClip(param1:MovieClip) : Bitmap
  573.       {
  574.          var _loc4_:BitmapData = null;
  575.          var _loc5_:Matrix = null;
  576.          var _loc2_:Bitmap = new Bitmap(null,"auto",true);
  577.          param1.gotoAndStop(1);
  578.          var _loc3_:Rectangle = param1.getRect(param1);
  579.          _loc2_.x = _loc3_.x * param1.scaleX;
  580.          _loc2_.y = _loc3_.y * param1.scaleY;
  581.          _loc4_ = new BitmapData(_loc3_.width,_loc3_.height,true,0);
  582.          (_loc5_ = new Matrix()).translate(-_loc3_.x,-_loc3_.y);
  583.          _loc5_.scale(param1.scaleX,param1.scaleY);
  584.          _loc4_.draw(param1,_loc5_);
  585.          _loc2_.bitmapData = _loc4_;
  586.          return _loc2_;
  587.       }
  588.       
  589.       public function labelATTENTE_JEU_CALLBACK() : void
  590.       {
  591.          this._timeline_.GotoAndPlayUntil({"labelStop":"_10"});
  592.       }
  593.       
  594.       public function G2D(param1:int) : String
  595.       {
  596.          return GlobalesFunctions.gimme2digits(param1);
  597.       }
  598.       
  599.       public function save() : void
  600.       {
  601.          this.BT_RETOUR._gameWon = true;
  602.          this.gListDone[this._engine.config.moduleNum - 1] = 1;
  603.          if(this.gDoneDepart)
  604.          {
  605.             this.so.data.lastDone = 2;
  606.          }
  607.          else
  608.          {
  609.             this.so.data.lastDone = 1;
  610.          }
  611.          this.so.data.listDone = this.gListDone;
  612.          this.so.flush();
  613.       }
  614.       
  615.       public function endMODULE() : void
  616.       {
  617.          this._engine.host.changeModule({"numMod":0});
  618.       }
  619.       
  620.       public function sleep() : void
  621.       {
  622.          if(this.keeperTimeIsRunning)
  623.          {
  624.             this.stopTimer();
  625.          }
  626.          else
  627.          {
  628.             this._pauseManager = new PauseManager(this._engine,this._timelineManager);
  629.             this._pauseManager.sleepMovie(this.mainTimeline);
  630.          }
  631.       }
  632.       
  633.       public function wake() : void
  634.       {
  635.          if(this.keeperTimeIsRunning)
  636.          {
  637.             this.resetTimers();
  638.          }
  639.          else
  640.          {
  641.             this._pauseManager.wakeMovie(this.mainTimeline);
  642.          }
  643.       }
  644.       
  645.       public function destroy() : void
  646.       {
  647.          this._timeline_.kilListeners();
  648.          this._e.destroy();
  649.          this.mainTimeline.stage.removeEventListener(MouseEvent.MOUSE_DOWN,this.stageMouseClicHandler);
  650.          if(this.keeperTimeIsRunning)
  651.          {
  652.             this.timekeeper.stopTicking();
  653.          }
  654.          this.timekeeper.removeEventListener(TimekeeperEvent.CHANGE,this.onTick);
  655.          if(this._bitmap != null && this._bitmap.bitmapData != null)
  656.          {
  657.             this._bitmap.bitmapData.dispose();
  658.          }
  659.          if(this.attenteJeu != null)
  660.          {
  661.             this.attenteJeu.destroy();
  662.          }
  663.          this.timekeeper = null;
  664.          this.attenteJeu = null;
  665.          this._bitmap = null;
  666.       }
  667.       
  668.       public function destroy2() : void
  669.       {
  670.          this._timeline_.kilListeners();
  671.          this._e.destroy();
  672.       }
  673.    }
  674. }
  675.