home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 161 / MOBICLIC161.ISO / pc / DATA / ANI161 / ANI161_00 / ANI161_00.swf / scripts / ani_00 / Console.as < prev    next >
Text File  |  2014-01-15  |  43KB  |  1,199 lines

  1. package ani_00
  2. {
  3.    import com.milanpresse.engine.Engine;
  4.    import com.milanpresse.engine.initmovieclip.InteractiveMovie;
  5.    import com.milanpresse.engine.managers.TimelineManager;
  6.    import com.milanpresse.engine.timelines.TimelineLinear;
  7.    import com.milanpresse.engine.typeargument.NoiseObject;
  8.    import com.milanpresse.tools.GlobalesFunctions;
  9.    import flash.display.MovieClip;
  10.    
  11.    public class Console
  12.    {
  13.        
  14.       
  15.       private var mainTimeline:MovieClip;
  16.       
  17.       private var _engine:Engine;
  18.       
  19.       private var _levelFunction;
  20.       
  21.       private var _timelineManager:TimelineManager;
  22.       
  23.       private var _timeline_:TimelineLinear;
  24.       
  25.       public var gOutil:String = "";
  26.       
  27.       public function Console(mainClip:MovieClip, _e:Engine, levelFunction:*, timelineManager:TimelineManager, timeline:TimelineLinear)
  28.       {
  29.          var myMc:InteractiveMovie = null;
  30.          super();
  31.          var myListOutils:Array = ["03","04","05"];
  32.          this.mainTimeline = mainClip;
  33.          this._engine = _e;
  34.          this._levelFunction = levelFunction;
  35.          this._timelineManager = timelineManager;
  36.          this._timeline_ = timeline;
  37.          for(var i:int = 1; i <= 10; i++)
  38.          {
  39.             if(myListOutils.indexOf(GlobalesFunctions.gimme2digits(i)) == -1)
  40.             {
  41.                myMc = new InteractiveMovie(this.mainTimeline["OUTIL_" + GlobalesFunctions.gimme2digits(i)],this._timelineManager);
  42.                myMc.gotoAndStop("E1");
  43.             }
  44.          }
  45.       }
  46.       
  47.       private function initOutil01() : void
  48.       {
  49.          var pOutil:String = "01";
  50.          var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
  51.          myMc.gotoAndStop("E1");
  52.          myMc.mc.pNum = pOutil;
  53.          myMc.mc.mcI = myMc;
  54.          myMc.mc.onRollOver = function(p:Object):void
  55.          {
  56.             if(_levelFunction.gDrag == null)
  57.             {
  58.                _engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  59.                _engine.showIB({
  60.                   "id":"IB" + this.pNum,
  61.                   "reference":this,
  62.                   "position":6
  63.                });
  64.                this.mcI.gotoAndPlayUntil({
  65.                   "labelplay":"E2",
  66.                   "beforeLabelStop":"E3"
  67.                });
  68.             }
  69.          };
  70.          myMc.mc.onRollOut = function(p:Object):void
  71.          {
  72.             if(_levelFunction.gDrag == null)
  73.             {
  74.                _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  75.                _engine.hideIB();
  76.                this.mcI.gotoAndStop("E1");
  77.             }
  78.          };
  79.          myMc.mc.onPress = function(p:Object):void
  80.          {
  81.             initAllOutils(this.pNum);
  82.             _engine.hideIB();
  83.             this.kill();
  84.             this.mcI.gotoAndStop("E3");
  85.             _engine.playNoise(new NoiseObject({"code":"B_DIODE"}));
  86.             var pLabel:String = "PLAY_" + this.pNum + "_DEBUT";
  87.             var pos:int = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
  88.             _timeline_.GotoAndPlayUntil({
  89.                "labelPlay":pLabel,
  90.                "labelStop":mainTimeline.currentLabels[pos].frame - 1,
  91.                "callback":_timeline_.nextLabel
  92.             });
  93.          };
  94.          myMc.activeMC();
  95.       }
  96.       
  97.       private function initOutil02() : void
  98.       {
  99.          var pOutil:String = "02";
  100.          var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
  101.          myMc.gotoAndStop("E1");
  102.          myMc.mc.pNum = pOutil;
  103.          myMc.mc.mcI = myMc;
  104.          myMc.mc.onRollOver = function(p:Object):void
  105.          {
  106.             if(_levelFunction.gDrag == null)
  107.             {
  108.                _engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  109.                _engine.showIB({
  110.                   "id":"IB" + this.pNum,
  111.                   "reference":this,
  112.                   "position":6
  113.                });
  114.                _engine.changeCursor("mainO");
  115.                this.mcI.gotoAndPlayUntil({
  116.                   "labelplay":"E2",
  117.                   "beforeLabelStop":"E3"
  118.                });
  119.             }
  120.          };
  121.          myMc.mc.onRollOut = function(p:Object):void
  122.          {
  123.             if(_levelFunction.gDrag == null)
  124.             {
  125.                _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  126.                _engine.hideIB();
  127.                _engine.changeCursor("auto");
  128.                this.mcI.gotoAndStop("E1");
  129.             }
  130.          };
  131.          myMc.mc.onMouseDown = function(p:Object):void
  132.          {
  133.             _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  134.             _engine.hideIB();
  135.             this.pY = this.stage.mouseY;
  136.             _levelFunction.gDrag = this;
  137.             this.pOk = 0;
  138.             _engine.changeCursor("mainF");
  139.             if(_engine.pad !== null)
  140.             {
  141.                _engine.pad.activated = false;
  142.             }
  143.          };
  144.          myMc.mc.onMouseUp = function(p:Object):void
  145.          {
  146.             var pLabel:String = null;
  147.             var pos:int = 0;
  148.             _levelFunction.gDrag = null;
  149.             if(this.pOk == 1)
  150.             {
  151.                initAllOutils(this.pNum);
  152.                this.kill();
  153.                _engine.changeCursor("auto");
  154.                this.mcI.gotoAndStop("E4");
  155.                pLabel = "PLAY_" + this.pNum + "_DEBUT";
  156.                pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
  157.                _timeline_.GotoAndPlayUntil({
  158.                   "labelPlay":pLabel,
  159.                   "labelStop":mainTimeline.currentLabels[pos].frame - 1,
  160.                   "callback":_timeline_.nextLabel
  161.                });
  162.             }
  163.             else if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
  164.             {
  165.                this.onRollOver(p);
  166.             }
  167.             else
  168.             {
  169.                this.onRollOut(p);
  170.             }
  171.             if(_engine.pad !== null)
  172.             {
  173.                _engine.pad.activated = true;
  174.             }
  175.          };
  176.          myMc.mc.onEnterFrame = function(p:Object):void
  177.          {
  178.             if(this.stage.mouseY - this.pY > 10)
  179.             {
  180.                if(this.pOk != 1)
  181.                {
  182.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  183.                }
  184.                this.pOk = 1;
  185.                this.mcI.gotoAndStop("E3");
  186.             }
  187.             else
  188.             {
  189.                if(this.pOk != 0)
  190.                {
  191.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  192.                }
  193.                this.pOk = 0;
  194.                this.mcI.gotoAndStop("E2_1");
  195.             }
  196.          };
  197.          myMc.activeDragAndDropMC({
  198.             "changeDepth":false,
  199.             "changePos":false
  200.          });
  201.       }
  202.       
  203.       private function initOutil03() : void
  204.       {
  205.          var pOutil:String = "03";
  206.          var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
  207.          myMc.mc.pNum = pOutil;
  208.          myMc.mc.mcI = myMc;
  209.          myMc.mc.rollOverFrame = "E" + myMc.mc.pNbCran;
  210.          myMc.mc.rollOutFrame = "E" + myMc.mc.pNbCran;
  211.          myMc.gotoAndStop("E" + myMc.mc.pNbCran);
  212.          myMc.mc.onRollOver = function(p:Object):void
  213.          {
  214.             if(_levelFunction.gDrag == null)
  215.             {
  216.                _engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  217.                _engine.showIB({
  218.                   "id":"IB" + this.pNum,
  219.                   "reference":this,
  220.                   "position":6
  221.                });
  222.                _engine.changeCursor("mainO");
  223.             }
  224.          };
  225.          myMc.mc.onRollOut = function(p:Object):void
  226.          {
  227.             if(_levelFunction.gDrag == null)
  228.             {
  229.                _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  230.                _engine.hideIB();
  231.                _engine.changeCursor("auto");
  232.             }
  233.          };
  234.          myMc.mc.onMouseDown = function(p:Object):void
  235.          {
  236.             _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  237.             _engine.hideIB();
  238.             this.pY = this.stage.mouseY;
  239.             _levelFunction.gDrag = this;
  240.             this.pOk = 0;
  241.             _engine.changeCursor("mainF");
  242.             if(_engine.pad !== null)
  243.             {
  244.                _engine.pad.activated = false;
  245.             }
  246.          };
  247.          myMc.mc.onMouseUp = function(p:Object):void
  248.          {
  249.             var pLabel:String = null;
  250.             var pos:int = 0;
  251.             _engine.changeCursor("auto");
  252.             _levelFunction.gDrag = null;
  253.             switch(this.pOk)
  254.             {
  255.                case 0:
  256.                   if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
  257.                   {
  258.                      this.onRollOver(p);
  259.                   }
  260.                   else
  261.                   {
  262.                      this.onRollOut(p);
  263.                   }
  264.                   break;
  265.                default:
  266.                   initAllOutils(this.pNum);
  267.                   this.kill();
  268.                   this.mcI.gotoAndStop("E" + this.pNbCran + "_" + this.pOk);
  269.                   pLabel = "PLAY_" + this.pNum + "_" + GlobalesFunctions.gimme2digits(this.pOk) + "_DEBUT";
  270.                   pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
  271.                   _timeline_.GotoAndPlayUntil({
  272.                      "labelPlay":pLabel,
  273.                      "labelStop":mainTimeline.currentLabels[pos].frame - 1,
  274.                      "callback":_timeline_.nextLabel
  275.                   });
  276.             }
  277.             if(_engine.pad !== null)
  278.             {
  279.                _engine.pad.activated = true;
  280.             }
  281.          };
  282.          myMc.mc.onEnterFrame = function(p:Object):void
  283.          {
  284.             if(this.stage.mouseY - this.pY >= 30)
  285.             {
  286.                switch(this.pNbCran)
  287.                {
  288.                   case 3:
  289.                      if(this.pOk != 3)
  290.                      {
  291.                         _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  292.                      }
  293.                      this.pOk = 3;
  294.                      this.mcI.gotoAndStop("E" + this.pNbCran + "_3");
  295.                      break;
  296.                   case 2:
  297.                      if(this.pOk != 2)
  298.                      {
  299.                         _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  300.                      }
  301.                      this.pOk = 2;
  302.                      this.mcI.gotoAndStop("E" + this.pNbCran + "_2");
  303.                      break;
  304.                   case 1:
  305.                      if(this.pOk != 1)
  306.                      {
  307.                         _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  308.                      }
  309.                      this.pOk = 1;
  310.                      this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
  311.                }
  312.             }
  313.             else if(this.stage.mouseY - this.pY >= 20)
  314.             {
  315.                switch(this.pNbCran)
  316.                {
  317.                   case 3:
  318.                   case 2:
  319.                      if(this.pOk != 2)
  320.                      {
  321.                         _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  322.                      }
  323.                      this.pOk = 2;
  324.                      this.mcI.gotoAndStop("E" + this.pNbCran + "_2");
  325.                      break;
  326.                   case 1:
  327.                      if(this.pOk != 1)
  328.                      {
  329.                         _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  330.                      }
  331.                      this.pOk = 1;
  332.                      this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
  333.                }
  334.             }
  335.             else if(this.stage.mouseY - this.pY >= 10)
  336.             {
  337.                if(this.pOk != 1)
  338.                {
  339.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  340.                }
  341.                this.pOk = 1;
  342.                this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
  343.             }
  344.             else
  345.             {
  346.                if(this.pOk != 0)
  347.                {
  348.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  349.                }
  350.                this.pOk = 0;
  351.                this.mcI.gotoAndStop("E" + this.pNbCran);
  352.             }
  353.          };
  354.          myMc.activeDragAndDropMC({
  355.             "changeDepth":false,
  356.             "changePos":false
  357.          });
  358.       }
  359.       
  360.       private function initOutil04() : void
  361.       {
  362.          var pOutil:String = "04";
  363.          var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
  364.          myMc.mc.pNum = pOutil;
  365.          myMc.mc.mcI = myMc;
  366.          if(myMc.mc.pNbCran == 1 && myMc.mc.etatActif == 2)
  367.          {
  368.             myMc.mc.rollOverFrame = "E" + Number(myMc.mc.pNbCran) + "_1_1-0";
  369.             myMc.mc.rollOutFrame = "E" + Number(myMc.mc.pNbCran) + "_1_1-0";
  370.          }
  371.          else
  372.          {
  373.             myMc.mc.rollOverFrame = "E" + myMc.mc.pNbCran;
  374.             myMc.mc.rollOutFrame = "E" + myMc.mc.pNbCran;
  375.          }
  376.          myMc.gotoAndStop(myMc.mc.rollOverFrame);
  377.          myMc.mc.onRollOver = function(p:Object):void
  378.          {
  379.             if(_levelFunction.gDrag == null)
  380.             {
  381.                _engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  382.                _engine.showIB({
  383.                   "id":"IB" + this.pNum,
  384.                   "reference":this,
  385.                   "position":6
  386.                });
  387.                _engine.changeCursor("mainO");
  388.             }
  389.          };
  390.          myMc.mc.onRollOut = function(p:Object):void
  391.          {
  392.             if(_levelFunction.gDrag == null)
  393.             {
  394.                _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  395.                _engine.hideIB();
  396.                _engine.changeCursor("auto");
  397.             }
  398.          };
  399.          myMc.mc.onMouseDown = function(p:Object):void
  400.          {
  401.             _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  402.             _engine.hideIB();
  403.             this.pX = this.stage.mouseX;
  404.             _levelFunction.gDrag = this;
  405.             this.pOk = 0;
  406.             _engine.changeCursor("mainF");
  407.             if(_engine.pad !== null)
  408.             {
  409.                _engine.pad.activated = false;
  410.             }
  411.          };
  412.          myMc.mc.onMouseUp = function(p:Object):void
  413.          {
  414.             var pLabel:String = null;
  415.             var pos:int = 0;
  416.             _engine.changeCursor("auto");
  417.             _levelFunction.gDrag = null;
  418.             switch(this.pOk)
  419.             {
  420.                case 0:
  421.                   if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
  422.                   {
  423.                      this.onRollOver(p);
  424.                   }
  425.                   else
  426.                   {
  427.                      this.onRollOut(p);
  428.                   }
  429.                   break;
  430.                default:
  431.                   initAllOutils(this.pNum);
  432.                   this.kill();
  433.                   this.mcI.gotoAndStop("E" + this.pNbCran + "_" + this.pOk);
  434.                   pLabel = "PLAY_" + this.pNum + "_" + GlobalesFunctions.gimme2digits(this.pOk) + "_DEBUT";
  435.                   pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
  436.                   _timeline_.GotoAndPlayUntil({
  437.                      "labelPlay":pLabel,
  438.                      "labelStop":mainTimeline.currentLabels[pos].frame - 1,
  439.                      "callback":_timeline_.nextLabel
  440.                   });
  441.             }
  442.             if(_engine.pad !== null)
  443.             {
  444.                _engine.pad.activated = true;
  445.             }
  446.          };
  447.          myMc.mc.onEnterFrame = function(p:Object):void
  448.          {
  449.             if(this.stage.mouseX - this.pX >= 30)
  450.             {
  451.                switch(this.pNbCran)
  452.                {
  453.                   case 2:
  454.                      if(this.pOk != 2)
  455.                      {
  456.                         _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  457.                      }
  458.                      this.pOk = 2;
  459.                      this.mcI.gotoAndStop("E" + this.pNbCran + "_2");
  460.                      break;
  461.                   case 1:
  462.                      if(this.etatActif == 2)
  463.                      {
  464.                         if(this.pOk != 2)
  465.                         {
  466.                            _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  467.                         }
  468.                         this.mcI.gotoAndStop("E" + this.pNbCran + "_2_1-0");
  469.                         this.pOk = 2;
  470.                      }
  471.                      else
  472.                      {
  473.                         if(this.pOk != 1)
  474.                         {
  475.                            _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  476.                         }
  477.                         this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
  478.                         this.pOk = 1;
  479.                      }
  480.                }
  481.             }
  482.             else if(this.stage.mouseX - this.pX >= 10)
  483.             {
  484.                switch(this.pNbCran)
  485.                {
  486.                   case 2:
  487.                      if(this.pOk != 1)
  488.                      {
  489.                         _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  490.                      }
  491.                      this.pOk = 1;
  492.                      this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
  493.                      break;
  494.                   case 1:
  495.                      if(this.etatActif == 1)
  496.                      {
  497.                         if(this.pOk != 1)
  498.                         {
  499.                            _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  500.                         }
  501.                         this.pOk = 1;
  502.                         this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
  503.                      }
  504.                }
  505.             }
  506.             else
  507.             {
  508.                if(this.pOk != 0)
  509.                {
  510.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  511.                }
  512.                this.pOk = 0;
  513.                if(this.pNbCran == 1 && this.etatActif == 2)
  514.                {
  515.                   this.mcI.gotoAndStop("E" + this.pNbCran + "_1_1-0");
  516.                }
  517.                else
  518.                {
  519.                   this.mcI.gotoAndStop("E" + this.pNbCran);
  520.                }
  521.             }
  522.          };
  523.          myMc.activeDragAndDropMC({
  524.             "changeDepth":false,
  525.             "changePos":false
  526.          });
  527.       }
  528.       
  529.       private function initOutil05() : void
  530.       {
  531.          var pOutil:String = "05";
  532.          var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
  533.          myMc.mc.pNum = pOutil;
  534.          myMc.mc.mcI = myMc;
  535.          if(myMc.mc.pNbCran == 1 && myMc.mc.etatActif == 2)
  536.          {
  537.             myMc.mc.rollOverFrame = "E" + Number(myMc.mc.pNbCran) + "_1_1-0";
  538.             myMc.mc.rollOutFrame = "E" + Number(myMc.mc.pNbCran) + "_1_1-0";
  539.          }
  540.          else
  541.          {
  542.             myMc.mc.rollOverFrame = "E" + myMc.mc.pNbCran;
  543.             myMc.mc.rollOutFrame = "E" + myMc.mc.pNbCran;
  544.          }
  545.          myMc.gotoAndStop(myMc.mc.rollOverFrame);
  546.          myMc.mc.onRollOver = function(p:Object):void
  547.          {
  548.             if(_levelFunction.gDrag == null)
  549.             {
  550.                _engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  551.                _engine.showIB({
  552.                   "id":"IB" + this.pNum,
  553.                   "reference":this,
  554.                   "position":6
  555.                });
  556.                _engine.changeCursor("mainO");
  557.             }
  558.          };
  559.          myMc.mc.onRollOut = function(p:Object):void
  560.          {
  561.             if(_levelFunction.gDrag == null)
  562.             {
  563.                _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  564.                _engine.hideIB();
  565.                _engine.changeCursor("auto");
  566.             }
  567.          };
  568.          myMc.mc.onMouseDown = function(p:Object):void
  569.          {
  570.             _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  571.             _engine.hideIB();
  572.             this.pX = this.stage.mouseX;
  573.             _levelFunction.gDrag = this;
  574.             this.pOk = 0;
  575.             _engine.changeCursor("mainF");
  576.             if(_engine.pad !== null)
  577.             {
  578.                _engine.pad.activated = false;
  579.             }
  580.          };
  581.          myMc.mc.onMouseUp = function(p:Object):void
  582.          {
  583.             var pLabel:String = null;
  584.             var pos:int = 0;
  585.             _engine.changeCursor("auto");
  586.             _levelFunction.gDrag = null;
  587.             switch(this.pOk)
  588.             {
  589.                case 0:
  590.                   if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
  591.                   {
  592.                      this.onRollOver(p);
  593.                   }
  594.                   else
  595.                   {
  596.                      this.onRollOut(p);
  597.                   }
  598.                   break;
  599.                default:
  600.                   initAllOutils(this.pNum);
  601.                   this.kill();
  602.                   this.mcI.gotoAndStop("E" + this.pNbCran + "_" + this.pOk);
  603.                   pLabel = "PLAY_" + this.pNum + "_" + GlobalesFunctions.gimme2digits(this.pOk) + "_DEBUT";
  604.                   pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
  605.                   _timeline_.GotoAndPlayUntil({
  606.                      "labelPlay":pLabel,
  607.                      "labelStop":mainTimeline.currentLabels[pos].frame - 1,
  608.                      "callback":_timeline_.nextLabel
  609.                   });
  610.             }
  611.             if(_engine.pad !== null)
  612.             {
  613.                _engine.pad.activated = true;
  614.             }
  615.          };
  616.          myMc.mc.onEnterFrame = function(p:Object):void
  617.          {
  618.             if(this.stage.mouseX - this.pX >= 30)
  619.             {
  620.                switch(this.pNbCran)
  621.                {
  622.                   case 2:
  623.                      if(this.pOk != 2)
  624.                      {
  625.                         _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  626.                      }
  627.                      this.pOk = 2;
  628.                      this.mcI.gotoAndStop("E" + this.pNbCran + "_2");
  629.                      break;
  630.                   case 1:
  631.                      if(this.etatActif == 2)
  632.                      {
  633.                         if(this.pOk != 2)
  634.                         {
  635.                            _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  636.                         }
  637.                         this.mcI.gotoAndStop("E" + this.pNbCran + "_2_1-0");
  638.                         this.pOk = 2;
  639.                      }
  640.                      else
  641.                      {
  642.                         if(this.pOk != 1)
  643.                         {
  644.                            _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  645.                         }
  646.                         this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
  647.                         this.pOk = 1;
  648.                      }
  649.                }
  650.             }
  651.             else if(this.stage.mouseX - this.pX >= 10)
  652.             {
  653.                switch(this.pNbCran)
  654.                {
  655.                   case 2:
  656.                      if(this.pOk != 1)
  657.                      {
  658.                         _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  659.                      }
  660.                      this.pOk = 1;
  661.                      this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
  662.                      break;
  663.                   case 1:
  664.                      if(this.etatActif == 1)
  665.                      {
  666.                         if(this.pOk != 1)
  667.                         {
  668.                            _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  669.                         }
  670.                         this.pOk = 1;
  671.                         this.mcI.gotoAndStop("E" + this.pNbCran + "_1");
  672.                      }
  673.                }
  674.             }
  675.             else
  676.             {
  677.                if(this.pOk != 0)
  678.                {
  679.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  680.                }
  681.                this.pOk = 0;
  682.                if(this.pNbCran == 1 && this.etatActif == 2)
  683.                {
  684.                   this.mcI.gotoAndStop("E" + this.pNbCran + "_1_1-0");
  685.                }
  686.                else
  687.                {
  688.                   this.mcI.gotoAndStop("E" + this.pNbCran);
  689.                }
  690.             }
  691.          };
  692.          myMc.activeDragAndDropMC({
  693.             "changeDepth":false,
  694.             "changePos":false
  695.          });
  696.       }
  697.       
  698.       private function initOutil06() : void
  699.       {
  700.          var pOutil:String = "06";
  701.          var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
  702.          myMc.gotoAndStop("E1");
  703.          myMc.mc.pNum = pOutil;
  704.          myMc.mc.mcI = myMc;
  705.          myMc.mc.onRollOver = function(p:Object):void
  706.          {
  707.             if(_levelFunction.gDrag == null)
  708.             {
  709.                _engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  710.                _engine.showIB({
  711.                   "id":"IB" + this.pNum,
  712.                   "reference":this,
  713.                   "position":6
  714.                });
  715.             }
  716.             else
  717.             {
  718.                this.mcI.gotoAndStop("E1");
  719.             }
  720.          };
  721.          myMc.mc.onRollOut = function(p:Object):void
  722.          {
  723.             if(_levelFunction.gDrag == null)
  724.             {
  725.                _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  726.                _engine.hideIB();
  727.             }
  728.          };
  729.          myMc.mc.onPress = function(p:Object):void
  730.          {
  731.             initAllOutils(this.pNum);
  732.             _engine.hideIB();
  733.             this.kill();
  734.             this.mcI.gotoAndStop("E2");
  735.             _engine.playNoise(new NoiseObject({"code":"B_DIODE"}));
  736.             var pLabel:String = "PLAY_" + this.pNum + "_DEBUT";
  737.             var pos:int = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
  738.             _timeline_.GotoAndPlayUntil({
  739.                "labelPlay":pLabel,
  740.                "labelStop":mainTimeline.currentLabels[pos].frame - 1,
  741.                "callback":_timeline_.nextLabel
  742.             });
  743.          };
  744.          myMc.activeMC();
  745.       }
  746.       
  747.       private function initOutil07() : void
  748.       {
  749.          var pOutil:String = "07";
  750.          var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
  751.          myMc.gotoAndStop("E1");
  752.          myMc.mc.pNum = pOutil;
  753.          myMc.mc.mcI = myMc;
  754.          myMc.mc.onRollOver = function(p:Object):void
  755.          {
  756.             if(_levelFunction.gDrag == null)
  757.             {
  758.                _engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  759.                _engine.showIB({
  760.                   "id":"IB" + this.pNum,
  761.                   "reference":this,
  762.                   "position":6
  763.                });
  764.                _engine.changeCursor("mainO");
  765.                this.mcI.gotoAndPlayUntil({
  766.                   "labelplay":"E2",
  767.                   "beforeLabelStop":"E3"
  768.                });
  769.             }
  770.          };
  771.          myMc.mc.onRollOut = function(p:Object):void
  772.          {
  773.             if(_levelFunction.gDrag == null)
  774.             {
  775.                _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  776.                _engine.hideIB();
  777.                _engine.changeCursor("auto");
  778.                this.mcI.gotoAndStop("E1");
  779.             }
  780.          };
  781.          myMc.mc.onMouseDown = function(p:Object):void
  782.          {
  783.             _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  784.             _engine.hideIB();
  785.             this.pY = this.stage.mouseY;
  786.             _levelFunction.gDrag = this;
  787.             this.pOk = 0;
  788.             _engine.changeCursor("mainF");
  789.             if(_engine.pad !== null)
  790.             {
  791.                _engine.pad.activated = false;
  792.             }
  793.          };
  794.          myMc.mc.onMouseUp = function(p:Object):void
  795.          {
  796.             var pLabel:String = null;
  797.             var pos:int = 0;
  798.             _levelFunction.gDrag = null;
  799.             if(this.pOk == 1)
  800.             {
  801.                initAllOutils(this.pNum);
  802.                this.kill();
  803.                _engine.changeCursor("auto");
  804.                this.mcI.gotoAndStop("E4");
  805.                pLabel = "PLAY_" + this.pNum + "_DEBUT";
  806.                pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
  807.                _timeline_.GotoAndPlayUntil({
  808.                   "labelPlay":pLabel,
  809.                   "labelStop":mainTimeline.currentLabels[pos].frame - 1,
  810.                   "callback":_timeline_.nextLabel
  811.                });
  812.             }
  813.             else if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
  814.             {
  815.                this.onRollOver(p);
  816.             }
  817.             else
  818.             {
  819.                this.onRollOut(p);
  820.             }
  821.             if(_engine.pad !== null)
  822.             {
  823.                _engine.pad.activated = true;
  824.             }
  825.          };
  826.          myMc.mc.onEnterFrame = function(p:Object):void
  827.          {
  828.             if(this.stage.mouseY - this.pY > 30)
  829.             {
  830.                if(this.pOk != 1)
  831.                {
  832.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  833.                }
  834.                this.pOk = 1;
  835.                this.mcI.gotoAndStop("E3");
  836.             }
  837.             else
  838.             {
  839.                if(this.pOk != 0)
  840.                {
  841.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  842.                }
  843.                this.pOk = 0;
  844.                this.mcI.gotoAndStop("E2_1");
  845.             }
  846.          };
  847.          myMc.activeDragAndDropMC({
  848.             "changeDepth":false,
  849.             "changePos":false
  850.          });
  851.       }
  852.       
  853.       private function initOutil08() : void
  854.       {
  855.          var pOutil:String = "08";
  856.          var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
  857.          myMc.gotoAndStop("E1");
  858.          myMc.mc.pNum = pOutil;
  859.          myMc.mc.mcI = myMc;
  860.          myMc.mc.onRollOver = function(p:Object):void
  861.          {
  862.             if(_levelFunction.gDrag == null)
  863.             {
  864.                _engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  865.                _engine.showIB({
  866.                   "id":"IB" + this.pNum,
  867.                   "reference":this,
  868.                   "position":6
  869.                });
  870.                _engine.changeCursor("mainO");
  871.                this.mcI.gotoAndPlayUntil({
  872.                   "labelplay":"E2",
  873.                   "beforeLabelStop":"E3"
  874.                });
  875.             }
  876.          };
  877.          myMc.mc.onRollOut = function(p:Object):void
  878.          {
  879.             if(_levelFunction.gDrag == null)
  880.             {
  881.                _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  882.                _engine.hideIB();
  883.                _engine.changeCursor("auto");
  884.                this.mcI.gotoAndStop("E1");
  885.             }
  886.          };
  887.          myMc.mc.onMouseDown = function(p:Object):void
  888.          {
  889.             _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  890.             _engine.hideIB();
  891.             this.pY = this.stage.mouseY;
  892.             _levelFunction.gDrag = this;
  893.             this.pOk = 0;
  894.             _engine.changeCursor("mainF");
  895.             if(_engine.pad !== null)
  896.             {
  897.                _engine.pad.activated = false;
  898.             }
  899.          };
  900.          myMc.mc.onMouseUp = function(p:Object):void
  901.          {
  902.             var pLabel:String = null;
  903.             var pos:int = 0;
  904.             _levelFunction.gDrag = null;
  905.             if(this.pOk == 1)
  906.             {
  907.                initAllOutils(this.pNum);
  908.                this.kill();
  909.                _engine.changeCursor("auto");
  910.                this.mcI.gotoAndStop("E4");
  911.                pLabel = "PLAY_" + this.pNum + "_DEBUT";
  912.                pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
  913.                _timeline_.GotoAndPlayUntil({
  914.                   "labelPlay":pLabel,
  915.                   "labelStop":mainTimeline.currentLabels[pos].frame - 1,
  916.                   "callback":_timeline_.nextLabel
  917.                });
  918.             }
  919.             else if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
  920.             {
  921.                this.onRollOver(p);
  922.             }
  923.             else
  924.             {
  925.                this.onRollOut(p);
  926.             }
  927.             if(_engine.pad !== null)
  928.             {
  929.                _engine.pad.activated = true;
  930.             }
  931.          };
  932.          myMc.mc.onEnterFrame = function(p:Object):void
  933.          {
  934.             if(this.stage.mouseY - this.pY > 30)
  935.             {
  936.                if(this.pOk != 1)
  937.                {
  938.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  939.                }
  940.                this.pOk = 1;
  941.                this.mcI.gotoAndStop("E3");
  942.             }
  943.             else
  944.             {
  945.                if(this.pOk != 0)
  946.                {
  947.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  948.                }
  949.                this.pOk = 0;
  950.                this.mcI.gotoAndStop("E2_1");
  951.             }
  952.          };
  953.          myMc.activeDragAndDropMC({
  954.             "changeDepth":false,
  955.             "changePos":false
  956.          });
  957.       }
  958.       
  959.       private function initOutil09() : void
  960.       {
  961.          var pOutil:String = "09";
  962.          var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
  963.          myMc.mc.pNum = pOutil;
  964.          myMc.mc.mcI = myMc;
  965.          myMc.gotoAndStop("E1");
  966.          myMc.mc.rollOverFrame = "E1";
  967.          myMc.mc.onRollOver = function(p:Object):void
  968.          {
  969.             if(_levelFunction.gDrag == null)
  970.             {
  971.                _engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  972.                _engine.showIB({
  973.                   "id":"IB" + this.pNum,
  974.                   "reference":this,
  975.                   "position":6
  976.                });
  977.                _engine.changeCursor("mainO");
  978.             }
  979.          };
  980.          myMc.mc.onRollOut = function(p:Object):void
  981.          {
  982.             if(_levelFunction.gDrag == null)
  983.             {
  984.                _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  985.                _engine.hideIB();
  986.                _engine.changeCursor("auto");
  987.             }
  988.          };
  989.          myMc.mc.onMouseDown = function(p:Object):void
  990.          {
  991.             _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  992.             _engine.hideIB();
  993.             this.pY = this.stage.mouseY;
  994.             _levelFunction.gDrag = this;
  995.             this.pOk = 0;
  996.             _engine.changeCursor("mainF");
  997.             if(_engine.pad !== null)
  998.             {
  999.                _engine.pad.activated = false;
  1000.             }
  1001.          };
  1002.          myMc.mc.onMouseUp = function(p:Object):void
  1003.          {
  1004.             var pLabel:String = null;
  1005.             var pos:int = 0;
  1006.             _engine.changeCursor("auto");
  1007.             _levelFunction.gDrag = null;
  1008.             switch(this.pOk)
  1009.             {
  1010.                case 0:
  1011.                   if(this.hitTestPoint(this.stage.mouseX,this.stage.mouseY,true))
  1012.                   {
  1013.                      this.onRollOver(p);
  1014.                   }
  1015.                   else
  1016.                   {
  1017.                      this.onRollOut(p);
  1018.                   }
  1019.                   break;
  1020.                default:
  1021.                   initAllOutils(this.pNum);
  1022.                   this.kill();
  1023.                   pLabel = "PLAY_" + this.pNum + "_" + GlobalesFunctions.gimme2digits(this.pOk) + "_DEBUT";
  1024.                   pos = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
  1025.                   _timeline_.GotoAndPlayUntil({
  1026.                      "labelPlay":pLabel,
  1027.                      "labelStop":mainTimeline.currentLabels[pos].frame - 1,
  1028.                      "callback":_timeline_.nextLabel
  1029.                   });
  1030.             }
  1031.             if(_engine.pad !== null)
  1032.             {
  1033.                _engine.pad.activated = true;
  1034.             }
  1035.          };
  1036.          myMc.mc.onEnterFrame = function(p:Object):void
  1037.          {
  1038.             if(this.stage.mouseY - this.pY >= 20)
  1039.             {
  1040.                if(this.pOk != 2)
  1041.                {
  1042.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  1043.                }
  1044.                this.pOk = 2;
  1045.                this.mcI.gotoAndStop("E3");
  1046.             }
  1047.             else if(this.stage.mouseY - this.pY >= 10)
  1048.             {
  1049.                if(this.pOk != 1)
  1050.                {
  1051.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  1052.                }
  1053.                this.pOk = 1;
  1054.                this.mcI.gotoAndStop("E2");
  1055.             }
  1056.             else
  1057.             {
  1058.                if(this.pOk != 0)
  1059.                {
  1060.                   _engine.playNoise(new NoiseObject({"code":"B_CRAN"}));
  1061.                }
  1062.                this.pOk = 0;
  1063.                this.mcI.gotoAndStop("E1");
  1064.             }
  1065.          };
  1066.          myMc.activeDragAndDropMC({
  1067.             "changeDepth":false,
  1068.             "changePos":false
  1069.          });
  1070.       }
  1071.       
  1072.       private function initOutil10() : void
  1073.       {
  1074.          var pOutil:String = "10";
  1075.          var myMc:InteractiveMovie = new InteractiveMovie(this.mainTimeline["OUTIL_" + pOutil],this._timelineManager);
  1076.          myMc.gotoAndStop("E1");
  1077.          myMc.mc.pNum = pOutil;
  1078.          myMc.mc.mcI = myMc;
  1079.          myMc.mc.onRollOver = function(p:Object):void
  1080.          {
  1081.             if(_levelFunction.gDrag == null)
  1082.             {
  1083.                _engine.playNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  1084.                _engine.showIB({
  1085.                   "id":"IB" + this.pNum,
  1086.                   "reference":this,
  1087.                   "position":6
  1088.                });
  1089.                this.mcI.gotoAndPlayUntil({
  1090.                   "labelplay":"E2",
  1091.                   "beforeLabelStop":"E3"
  1092.                });
  1093.             }
  1094.          };
  1095.          myMc.mc.onRollOut = function(p:Object):void
  1096.          {
  1097.             if(_levelFunction.gDrag == null)
  1098.             {
  1099.                _engine.stopNoise(new NoiseObject({"code":"B_OUTIL" + this.pNum + "_E1"}));
  1100.                _engine.hideIB();
  1101.                this.mcI.gotoAndStop("E1");
  1102.             }
  1103.          };
  1104.          myMc.mc.onPress = function(p:Object):void
  1105.          {
  1106.             initAllOutils(this.pNum);
  1107.             _engine.hideIB();
  1108.             this.kill();
  1109.             this.mcI.gotoAndStop("E3");
  1110.             _engine.playNoise(new NoiseObject({"code":"B_DIODE"}));
  1111.             var pLabel:String = "PLAY_" + this.pNum + "_DEBUT";
  1112.             var pos:int = _timeline_.getPosFrameLabelByName(mainTimeline,pLabel) + 1;
  1113.             _timeline_.GotoAndPlayUntil({
  1114.                "labelPlay":pLabel,
  1115.                "labelStop":mainTimeline.currentLabels[pos].frame - 1,
  1116.                "callback":_timeline_.nextLabel
  1117.             });
  1118.          };
  1119.          myMc.activeMC();
  1120.       }
  1121.       
  1122.       public function initOutils() : void
  1123.       {
  1124.          var pNum:int = 0;
  1125.          if(this._levelFunction.gDrag !== null)
  1126.          {
  1127.             pNum = Number(this._levelFunction.gDrag.pNum);
  1128.          }
  1129.          for(var i:int = 1; i < 11; i++)
  1130.          {
  1131.             if(pNum !== i)
  1132.             {
  1133.                this["initOutil" + GlobalesFunctions.gimme2digits(i)]();
  1134.             }
  1135.             else
  1136.             {
  1137.                trace("l\'outil " + pNum + "ne doit pas ├¬tre initialis├⌐");
  1138.             }
  1139.          }
  1140.       }
  1141.       
  1142.       public function initAllOutils(myNum:String) : void
  1143.       {
  1144.          var myMc:InteractiveMovie = null;
  1145.          this._engine.stopComment();
  1146.          if(this._levelFunction.videoPlaying !== null)
  1147.          {
  1148.             this._levelFunction.videoPlaying.close();
  1149.             this._levelFunction.videoPlaying = null;
  1150.          }
  1151.          if(this._levelFunction.gTimerOn == true)
  1152.          {
  1153.             this._levelFunction.OUTIL_10.timerBloc.stop();
  1154.          }
  1155.          trace("┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º┬º " + this.gOutil);
  1156.          if(this.gOutil !== "")
  1157.          {
  1158.             this["initOutil" + this.gOutil]();
  1159.          }
  1160.          for(var i:int = 1; i < 11; i++)
  1161.          {
  1162.             if(GlobalesFunctions.gimme2digits(i) != myNum)
  1163.             {
  1164.                myMc = new InteractiveMovie(this.mainTimeline["OUTIL_" + GlobalesFunctions.gimme2digits(i)],this._timelineManager);
  1165.                switch(i)
  1166.                {
  1167.                   case 1:
  1168.                   case 2:
  1169.                   case 6:
  1170.                   case 7:
  1171.                   case 8:
  1172.                   case 9:
  1173.                   case 10:
  1174.                      myMc.gotoAndStop("E1");
  1175.                      break;
  1176.                   case 3:
  1177.                      myMc.gotoAndStop("E" + myMc.mc.pNbCran);
  1178.                      break;
  1179.                   case 4:
  1180.                   case 5:
  1181.                      if(myMc.mc.pNbCran == 1 && myMc.mc.etatActif == 2)
  1182.                      {
  1183.                         myMc.gotoAndStop("E" + myMc.mc.pNbCran + "_1_1-0");
  1184.                      }
  1185.                      else
  1186.                      {
  1187.                         myMc.gotoAndStop("E" + myMc.mc.pNbCran);
  1188.                      }
  1189.                }
  1190.             }
  1191.             else
  1192.             {
  1193.                this.gOutil = GlobalesFunctions.gimme2digits(i);
  1194.             }
  1195.          }
  1196.       }
  1197.    }
  1198. }
  1199.