home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 136 / MOBICLIC136.ISO / pc / DATA / DSS136 / DSS136_03 / DSS136_03.swf / scripts / frame_2 / DoAction.as
Text File  |  2011-07-20  |  48KB  |  1,688 lines

  1. function InitMC(p)
  2. {
  3.    trace("InitMC() " + p.mc);
  4.    var mc = typeof p != "movieclip" ? p.mc : p;
  5.    if(p.level != undefined)
  6.    {
  7.       var ceMC_name_old = mc._name + "_old";
  8.       var ceMC_name = mc._name;
  9.       mc._name = ceMC_name_old;
  10.       mc.duplicateMovieClip(ceMC_name,p.level);
  11.       mc._visible = false;
  12.       mc = this[ceMC_name];
  13.    }
  14.    if(mc.OriginalMC == undefined)
  15.    {
  16.       mc.OriginalMC = {};
  17.       mc.OriginalMC._x = mc._x;
  18.       mc.OriginalMC._y = mc._y;
  19.       mc.OriginalMC._xscale = mc._xscale;
  20.       mc.OriginalMC._yscale = mc._yscale;
  21.       mc.OriginalMC._width = mc._width;
  22.    }
  23.    var fonction = p.fonction != undefined ? eval("InitMC_" + p.fonction) : InitMC_standart;
  24.    mc.InitMC = fonction;
  25.    InitMC_reccurent(mc);
  26.    mc.InitMC(p);
  27. }
  28. function InitMC_reccurent(mc)
  29. {
  30.    mc.oriX = mc._x;
  31.    mc.oriY = mc._y;
  32.    mc.oriW = mc._width;
  33.    mc.oriH = mc._height;
  34.    mc.BackToInitialPos = function()
  35.    {
  36.       this._x = this.oriX;
  37.       this._y = this.oriY;
  38.    };
  39.    mc.BackToInitialSize = function()
  40.    {
  41.       this._width = this.oriW;
  42.       this._height = this.oriH;
  43.    };
  44. }
  45. function ResetMC(p)
  46. {
  47.    var _loc1_ = p.mc;
  48.    delete _loc1_.onPress;
  49.    delete _loc1_.onRollOver;
  50.    delete _loc1_.onRollOut;
  51.    delete _loc1_.onRelease;
  52.    delete _loc1_.onReleaseOutside;
  53.    delete _loc1_.BTN.onPress;
  54.    delete _loc1_.BTN.onRollOver;
  55.    delete _loc1_.BTN.onRollOut;
  56.    delete _loc1_.BTN.onRelease;
  57.    delete _loc1_.BTN.onReleaseOutside;
  58. }
  59. function InitMC_standart(p)
  60. {
  61.    trace("InitMC_standart : " + InitMC_standart);
  62.    this.p = p;
  63.    for(var _loc3_ in p)
  64.    {
  65.       this[_loc3_] = p[_loc3_];
  66.    }
  67.    if(this.IB != undefined)
  68.    {
  69.       if(typeof this.IBrep == "movieclip")
  70.       {
  71.          var IBrepere = this.IBrep;
  72.       }
  73.       else if(typeof _MOD_["IBrep_" + this.IB] == "movieclip" && this.IBrep != false)
  74.       {
  75.          var IBrepere = _MOD_["IBrep_" + this.IB];
  76.       }
  77.       else
  78.       {
  79.          var IBrepere = p.mc;
  80.       }
  81.       this.afficheIB = function()
  82.       {
  83.          _root.gereTextes.afficheIB({codeIB:this.IB,mc:IBrepere});
  84.       };
  85.       this.masqueIB = function()
  86.       {
  87.          _root.IB.removeMovieClip();
  88.       };
  89.    }
  90.    if(this.UseLabels != false)
  91.    {
  92.       if(this.reposFrame == undefined)
  93.       {
  94.          this.reposFrame = "E1";
  95.       }
  96.       if(this.pressFrame == undefined)
  97.       {
  98.          this.pressFrame = "E2";
  99.       }
  100.       if(this.overFrame == undefined)
  101.       {
  102.          this.overFrame = "E2";
  103.       }
  104.       if(this.outFrame == undefined)
  105.       {
  106.          this.outFrame = "E1";
  107.       }
  108.       if(this.releaseFrame == undefined)
  109.       {
  110.          this.releaseFrame = "E1";
  111.       }
  112.       if(this.releaseOutFrame == undefined)
  113.       {
  114.          this.releaseOutFrame = "E1";
  115.       }
  116.       if(this.activeFrame == undefined)
  117.       {
  118.          this.activeFrame = undefined;
  119.       }
  120.       if(this.desactiveFrame == undefined)
  121.       {
  122.          this.desactiveFrame = undefined;
  123.       }
  124.    }
  125.    this.gotoAndStop(p.reposFrame);
  126.    ┬º┬ºpush(this);
  127.    ┬º┬ºpush("joueson");
  128.    if(this.son == undefined)
  129.    {
  130.       ┬º┬ºpush(undefined);
  131.    }
  132.    ┬º┬ºpop()[┬º┬ºenumeration()] = ┬º┬ºpop();
  133.    ┬º┬ºpush(this);
  134.    ┬º┬ºpush("stopson");
  135.    if(this.nostop != undefined)
  136.    {
  137.       ┬º┬ºpush(undefined);
  138.    }
  139.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  140.    if(this.sonOnPress != undefined)
  141.    {
  142.       if(this.sonOnPress_offset == undefined)
  143.       {
  144.          this.sonOnPress_offset = 0;
  145.       }
  146.       if(this.sonOnPress_loopSon == undefined)
  147.       {
  148.          this.sonOnPress_loopSon = 0;
  149.       }
  150.       this.jouesonOnPress = function()
  151.       {
  152.          joueBruitage({nomSon:this.sonOnPress,offset:this.sonOnPress_offset,loopSon:this.sonOnPress_loopSon});
  153.       };
  154.       this.stopsonOnPress = function()
  155.       {
  156.          stopBruitage({nomSon:this.sonOnPress});
  157.       };
  158.    }
  159.    else
  160.    {
  161.       this.jouesonOnMove = undefined;
  162.       this.stopsonOnMove = undefined;
  163.    }
  164.    if(this.UseHandCursor == undefined)
  165.    {
  166.       this.UseHandCursor = true;
  167.    }
  168.    if(this.UseCurseur != false)
  169.    {
  170.       this.curseur_after_press = this.goto != undefined ? "fleche" : "doigt";
  171.       if(this.curseur_on_roll == undefined)
  172.       {
  173.          this.curseur_on_roll = "doigt";
  174.       }
  175.       if(this.curseur_onRollOut == undefined)
  176.       {
  177.          this.curseur_onRollOut = "fleche";
  178.       }
  179.       if(this.curseur_after_press == undefined)
  180.       {
  181.          this.curseur_after_press = "doigt";
  182.       }
  183.       if(this.curseur_onRelease == undefined)
  184.       {
  185.          this.curseur_onRelease = "doigt";
  186.       }
  187.       if(this.curseur_onReleaseOutside == undefined)
  188.       {
  189.          this.curseur_onReleaseOutside = "fleche";
  190.       }
  191.    }
  192.    this.Activer = function()
  193.    {
  194.       if(this.Actif == true)
  195.       {
  196.          return undefined;
  197.       }
  198.       this.enabled = true;
  199.       this.BTN.enabled = true;
  200.       this.Actif = true;
  201.       this.gotoAndStop(this.activeFrame);
  202.    };
  203.    this.Desactiver = function()
  204.    {
  205.       if(this.Actif == false)
  206.       {
  207.          return undefined;
  208.       }
  209.       this.enabled = false;
  210.       this.BTN.enabled = false;
  211.       this.Actif = false;
  212.       this.stopsonOnPress();
  213.       this.masqueIB();
  214.       this.gotoAndStop(this.desactiveFrame);
  215.    };
  216.    this.SetUseHandCursor = function(flag)
  217.    {
  218.       this.UseHandCursor = flag;
  219.       this.useHandCursor = this.UseHandCursor;
  220.       this.BTN.useHandCursor = this.UseHandCursor;
  221.    };
  222.    this.Activer();
  223.    this.GS = this.gotoAndStop;
  224.    this.MConPress = function()
  225.    {
  226.       if(this.p.blockOnPress == true)
  227.       {
  228.          this.enabled = false;
  229.          this.BTN.enabled = false;
  230.       }
  231.       this.stopson();
  232.       this.jouesonOnPress();
  233.       this.masqueIB();
  234.       this.gotoAndStop(this.pressFrame);
  235.       gereCursor(this.curseur_after_press);
  236.       _root.gotoAndStop(this.goto);
  237.       var p = this.OnPress();
  238.    };
  239.    this.MConRollOver = function()
  240.    {
  241.       this.joueson();
  242.       this.afficheIB();
  243.       this.gotoAndStop(this.overFrame);
  244.       gereCursor(this.curseur_on_roll);
  245.       var _loc2_ = this.OnRollOver();
  246.    };
  247.    this.MConRollOut = function()
  248.    {
  249.       trace("MConRollOut : " + this.masqueIB);
  250.       this.stopson();
  251.       this.masqueIB();
  252.       this.gotoAndStop(this.outFrame);
  253.       gereCursor(this.curseur_onRollOut);
  254.       var _loc2_ = this.OnRollOut();
  255.    };
  256.    this.MConRelease = function()
  257.    {
  258.       this.gotoAndStop(this.releaseFrame);
  259.       gereCursor(this.curseur_onRelease);
  260.       var _loc2_ = this.OnRelease();
  261.    };
  262.    this.MConReleaseOutside = function()
  263.    {
  264.       this.gotoAndStop(this.releaseOutFrame);
  265.       gereCursor(this.curseur_onReleaseOutside);
  266.       var _loc2_ = this.OnReleaseOutside();
  267.    };
  268.    if(this.BTN == undefined || this.BTN == false)
  269.    {
  270.       this.useHandCursor = this.UseHandCursor;
  271.       this.onPress = this.MConPress;
  272.       this.onRollOver = this.MConRollOver;
  273.       this.onRollOut = this.MConRollOut;
  274.       this.onRelease = this.MConRelease;
  275.       this.onReleaseOutside = this.MConReleaseOutside;
  276.    }
  277.    else
  278.    {
  279.       this.BTN.useHandCursor = this.UseHandCursor;
  280.       this.BTN.onPress = function()
  281.       {
  282.          this._parent.MConPress();
  283.       };
  284.       this.BTN.onRollOver = function()
  285.       {
  286.          this._parent.MConRollOver();
  287.       };
  288.       this.BTN.onRollOut = function()
  289.       {
  290.          this._parent.MConRollOut();
  291.       };
  292.       this.BTN.onRelease = function()
  293.       {
  294.          this._parent.MConRelease();
  295.       };
  296.       this.BTN.onReleaseOutside = function()
  297.       {
  298.          this._parent.MConReleaseOutside();
  299.       };
  300.    }
  301.    this.Refresh();
  302. }
  303. function InitMC_BTN(p)
  304. {
  305.    if(p.IB != undefined)
  306.    {
  307.       if(p.IBrep == true)
  308.       {
  309.          var IBrepere = _MOD_["IBrep_" + p.IB];
  310.       }
  311.       else
  312.       {
  313.          var IBrepere = p.mc;
  314.       }
  315.       this.afficheIB = function()
  316.       {
  317.          gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  318.       };
  319.       this.masqueIB = function()
  320.       {
  321.          gereTextes.masqueIB();
  322.       };
  323.    }
  324.    this.enabled = true;
  325.    ┬º┬ºpush(this);
  326.    ┬º┬ºpush("joueson");
  327.    if(p.son == undefined)
  328.    {
  329.       ┬º┬ºpush(undefined);
  330.    }
  331.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  332.    ┬º┬ºpush(this);
  333.    ┬º┬ºpush("stopson");
  334.    if(p.nostop != undefined)
  335.    {
  336.       ┬º┬ºpush(undefined);
  337.    }
  338.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  339.    var curseur_after_press = p.goto != undefined ? "fleche" : "doigt";
  340.    this.goto = p.goto;
  341.    this.BTN.onPress = function()
  342.    {
  343.       this._parent.stopson();
  344.       this._parent.masqueIB();
  345.       this._parent.gotoAndStop("E3");
  346.       gereCursor(curseur_after_press);
  347.       _root.gotoAndStop(this.goto);
  348.       var _loc3_ = this._parent.OnPress();
  349.    };
  350.    this.BTN.onRollOver = function()
  351.    {
  352.       this._parent.joueson();
  353.       this._parent.afficheIB();
  354.       this._parent.gotoAndStop("E2");
  355.       gereCursor("doigt");
  356.       var _loc2_ = this._parent.OnRollOver();
  357.    };
  358.    this.BTN.onRollOut = function()
  359.    {
  360.       this._parent.stopson();
  361.       this._parent.masqueIB();
  362.       this._parent.gotoAndStop("E1");
  363.       gereCursor("fleche");
  364.       var _loc2_ = this._parent.OnRollOut();
  365.    };
  366.    this.BTN.onRelease = function()
  367.    {
  368.       this._parent.gotoAndStop("E2");
  369.       gereCursor("doigt");
  370.       var _loc2_ = this._parent.OnRelease();
  371.    };
  372.    this.BTN.onReleaseOutside = function()
  373.    {
  374.       this._parent.gotoAndStop("E1");
  375.       gereCursor("fleche");
  376.       var _loc2_ = this._parent.OnReleaseOutside();
  377.    };
  378. }
  379. function InitMC_dragdrop(p)
  380. {
  381.    trace("InitMC_dragdrop_z");
  382.    if(p.IB != undefined)
  383.    {
  384.       if(p.IBrep == true)
  385.       {
  386.          var IBrepere = _MOD_["IBrep_" + p.IB];
  387.       }
  388.       else
  389.       {
  390.          var IBrepere = p.mc;
  391.       }
  392.       this.afficheIB = function()
  393.       {
  394.          _root.gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  395.       };
  396.       this.masqueIB = function()
  397.       {
  398.          _root.gereTextes.masqueIB();
  399.       };
  400.    }
  401.    this.pDepth = this.getDepth();
  402.    this.UseHandCursor = p.useHandCursor != undefined ? p.useHandCursor : true;
  403.    this.PressLevel = p.PressLevel != undefined ? p.PressLevel : 15832;
  404.    this.pressFrame = p.pressFrame != undefined ? p.pressFrame : "E3";
  405.    this.overFrame = p.overFrame != undefined ? p.overFrame : "E2";
  406.    this.CibleOverFrame = p.CibleOverFrame != undefined ? p.CibleOverFrame : "E3";
  407.    this.CibleOutFrame = p.CibleOutFrame != undefined ? p.CibleOutFrame : "E1";
  408.    this.outFrame = p.outFrame != undefined ? p.outFrame : "E1";
  409.    this.releaseFrame = p.releaseFrame != undefined ? p.releaseFrame : "E1";
  410.    ┬º┬ºpush(this);
  411.    ┬º┬ºpush("joueson");
  412.    if(p.son == undefined)
  413.    {
  414.       ┬º┬ºpush(undefined);
  415.    }
  416.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  417.    ┬º┬ºpush(this);
  418.    ┬º┬ºpush("stopson");
  419.    if(p.son == undefined)
  420.    {
  421.       ┬º┬ºpush(undefined);
  422.    }
  423.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  424.    ┬º┬ºpush(this);
  425.    ┬º┬ºpush("jouesonOnPress");
  426.    if(p.sonOnPress == undefined)
  427.    {
  428.       ┬º┬ºpush(undefined);
  429.    }
  430.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  431.    ┬º┬ºpush(this);
  432.    ┬º┬ºpush("stopsonOnPress");
  433.    if(p.sonOnPress == undefined)
  434.    {
  435.       ┬º┬ºpush(undefined);
  436.    }
  437.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  438.    ┬º┬ºpush(this);
  439.    ┬º┬ºpush("jouesonOnOverCible");
  440.    if(p.sonOnOverCible == undefined)
  441.    {
  442.       ┬º┬ºpush(undefined);
  443.    }
  444.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  445.    ┬º┬ºpush(this);
  446.    ┬º┬ºpush("stopsonOnOverCible");
  447.    if(p.sonOnOverCible == undefined)
  448.    {
  449.       ┬º┬ºpush(undefined);
  450.    }
  451.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  452.    var _loc19_ = p.goto != undefined ? "fleche" : "doigt";
  453.    this.goto = p.goto;
  454.    this.ModeDrag = p.ModeDrag != undefined ? p.ModeDrag : "lache_au_rollout";
  455.    this.CentrerOnStartDrag = p.CentrerOnStartDrag != undefined ? p.CentrerOnStartDrag : false;
  456.    this.ModeHitTest = p.ModeHitTest != undefined ? p.ModeHitTest : "bounds";
  457.    this.DistanceTouche = p.DistanceTouche != undefined ? p.DistanceTouche : 50;
  458.    this.DistanceToucheRatio = p.DistanceToucheRatio != undefined ? p.DistanceToucheRatio : 1;
  459.    this.ZoneDragLimites = p.ZoneDragLimites != undefined ? p.ZoneDragLimites : {x:0,y:0,w:800,h:600};
  460.    this.MethodeDetecteDrag = "DetectDrag_" + this.ModeHitTest;
  461.    trace("this[\"DetectDrag_\" + this.ModeHitTest] : " + this["DetectDrag_" + this.ModeHitTest]);
  462.    this.DragEnCours = false;
  463.    this.DetectDrag_bounds = function()
  464.    {
  465.       this._x = _xmouse - this.ecart_mousex;
  466.       this._y = _ymouse - this.ecart_mousey;
  467.       if(this._x < this.ZoneDragLimites.x)
  468.       {
  469.          this._x = this.ZoneDragLimites.x;
  470.       }
  471.       if(this._x > this.ZoneDragLimites.x + this.ZoneDragLimites.w)
  472.       {
  473.          this._x = this.ZoneDragLimites.x + this.ZoneDragLimites.w;
  474.       }
  475.       if(this._y < this.ZoneDragLimites.y)
  476.       {
  477.          this._y = this.ZoneDragLimites.y;
  478.       }
  479.       if(this._y > this.ZoneDragLimites.y + this.ZoneDragLimites.h)
  480.       {
  481.          this._y = this.ZoneDragLimites.y + this.ZoneDragLimites.h;
  482.       }
  483.       this.CiblesTouchees = [];
  484.       var _loc3_ = this.CibleLaPlusProche();
  485.       var _loc2_ = 0;
  486.       while(_loc2_ < this.CiblesDrag.length)
  487.       {
  488.          if(this.hitTest(this.CiblesDrag[_loc2_]))
  489.          {
  490.             this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOverFrame);
  491.             this.CiblesTouchees.push(this.CiblesDrag[_loc2_]);
  492.             this.touche = this.touche + 1;
  493.          }
  494.          else
  495.          {
  496.             this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOutFrame);
  497.          }
  498.          _loc2_ = _loc2_ + 1;
  499.       }
  500.       if(this.touche == 1)
  501.       {
  502.          this.jouesonOnOverCible();
  503.       }
  504.       if(this.CiblesTouchees.length <= 0)
  505.       {
  506.          this.touche = 0;
  507.          this.stopsonOnOverCible();
  508.       }
  509.       this.PendantDrag();
  510.       updateAfterEvent();
  511.    };
  512.    this.DetectDrag_mouse = function()
  513.    {
  514.       this._x = _xmouse - this.ecart_mousex;
  515.       this._y = _ymouse - this.ecart_mousey;
  516.       if(this._x < this.ZoneDragLimites.x)
  517.       {
  518.          this._x = this.ZoneDragLimites.x;
  519.       }
  520.       if(this._x > this.ZoneDragLimites.x + this.ZoneDragLimites.w)
  521.       {
  522.          this._x = this.ZoneDragLimites.x + this.ZoneDragLimites.w;
  523.       }
  524.       if(this._y < this.ZoneDragLimites.y)
  525.       {
  526.          this._y = this.ZoneDragLimites.y;
  527.       }
  528.       if(this._y > this.ZoneDragLimites.y + this.ZoneDragLimites.h)
  529.       {
  530.          this._y = this.ZoneDragLimites.y + this.ZoneDragLimites.h;
  531.       }
  532.       this.CiblesTouchees = [];
  533.       var _loc2_ = 0;
  534.       while(_loc2_ < this.CiblesDrag.length)
  535.       {
  536.          if(this.CiblesDrag[_loc2_].hitTest(_xmouse,_ymouse,true))
  537.          {
  538.             this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOverFrame);
  539.             this.CiblesTouchees.push(this.CiblesDrag[_loc2_]);
  540.             this.touche = this.touche + 1;
  541.          }
  542.          else
  543.          {
  544.             this.CiblesDrag[_loc2_].gotoAndStop(this.CibleOutFrame);
  545.          }
  546.          _loc2_ = _loc2_ + 1;
  547.       }
  548.       if(this.touche == 1)
  549.       {
  550.          this.jouesonOnOverCible();
  551.       }
  552.       if(this.CiblesTouchees.length <= 0)
  553.       {
  554.          this.touche = 0;
  555.          this.stopsonOnOverCible();
  556.       }
  557.       this.PendantDrag();
  558.       updateAfterEvent();
  559.    };
  560.    this.DetectDrag_distance = function()
  561.    {
  562.       this._x = _xmouse - this.ecart_mousex;
  563.       this._y = _ymouse - this.ecart_mousey;
  564.       if(this._x < this.ZoneDragLimites.x)
  565.       {
  566.          this._x = this.ZoneDragLimites.x;
  567.       }
  568.       if(this._x > this.ZoneDragLimites.x + this.ZoneDragLimites.w)
  569.       {
  570.          this._x = this.ZoneDragLimites.x + this.ZoneDragLimites.w;
  571.       }
  572.       if(this._y < this.ZoneDragLimites.y)
  573.       {
  574.          this._y = this.ZoneDragLimites.y;
  575.       }
  576.       if(this._y > this.ZoneDragLimites.y + this.ZoneDragLimites.h)
  577.       {
  578.          this._y = this.ZoneDragLimites.y + this.ZoneDragLimites.h;
  579.       }
  580.       _global.CURSEUR._x = this._x;
  581.       _global.CURSEUR._y = this._y;
  582.       Mouse.hide();
  583.       gereCursor("mainF");
  584.       var _loc4_ = this.CibleLaPlusProche({mode:"toutes"});
  585.       var _loc5_ = Math.sqrt(Math.pow(_loc4_._x - this._x,2) + Math.pow(_loc4_._y - this._y,2));
  586.       var _loc6_ = (_loc4_._width / 2 + this._width / 2) * this.DistanceToucheRatio;
  587.       if(_loc5_ > _loc6_)
  588.       {
  589.          _loc4_ = undefined;
  590.       }
  591.       this.CiblesTouchees = [];
  592.       var _loc3_ = 0;
  593.       while(_loc3_ < this.CiblesDrag.length)
  594.       {
  595.          if(this.CiblesDrag[_loc3_] == _loc4_)
  596.          {
  597.             this.CiblesDrag[_loc3_].gotoAndStop(this.CibleOverFrame);
  598.             this.CiblesTouchees.push(this.CiblesDrag[_loc3_]);
  599.             this.touche = this.touche + 1;
  600.          }
  601.          else
  602.          {
  603.             this.CiblesDrag[_loc3_].gotoAndStop(this.CibleOutFrame);
  604.          }
  605.          _loc3_ = _loc3_ + 1;
  606.       }
  607.       if(this.touche == 1)
  608.       {
  609.          this.jouesonOnOverCible();
  610.       }
  611.       if(this.CiblesTouchees.length <= 0)
  612.       {
  613.          this.touche = 0;
  614.          this.stopsonOnOverCible();
  615.       }
  616.       this.PendantDrag();
  617.       updateAfterEvent();
  618.    };
  619.    this.StartDrag = function()
  620.    {
  621.       trace("StartDrag : " + StartDrag);
  622.       if(this.CentrerOnStartDrag != true)
  623.       {
  624.          this.ecart_mousex = _xmouse - this._x;
  625.          this.ecart_mousey = _ymouse - this._y;
  626.       }
  627.       else
  628.       {
  629.          this._x = _xmouse;
  630.          this._y = _ymouse;
  631.          this.ecart_mousex = _xmouse - this._x;
  632.          this.ecart_mousey = _ymouse - this._y;
  633.       }
  634.       _global.CURSEUR.Verrouiller();
  635.       this.IntervalId = _global.SetInterval({mcRef:this,methode:this.MethodeDetecteDrag,interval:10});
  636.       trace("this.MethodeDetecteDrag : " + this.MethodeDetecteDrag);
  637.       this.swapDepths(this.PressLevel);
  638.       this.DragEnCours = true;
  639.       if(this.ModeDrag == "lache_au_clic")
  640.       {
  641.          var me = this;
  642.          _root.onMouseDown = function()
  643.          {
  644.             me.FirstPress = false;
  645.             me.DragEnCours = false;
  646.             gereCursor("mainO");
  647.             me.stopsonOnPress();
  648.             me.gotoAndStop("E2");
  649.             _global.ClearInterval(me.IntervalId);
  650.             _global.CURSEUR.Deverrouiller();
  651.             me.swapDepths(me.pDepth);
  652.             me.ApresDrag();
  653.             delete _root.onMouseDown;
  654.          };
  655.       }
  656.    };
  657.    this.ContinueDrag = function()
  658.    {
  659.       this.gotoAndStop(this.pressFrame);
  660.       gereCursor("mainF");
  661.       this.ecart_mousex = _xmouse - this._x;
  662.       this.ecart_mousey = _ymouse - this._y;
  663.       if(this.IntervalId != undefined)
  664.       {
  665.          _global.ClearInterval(this.IntervalId);
  666.       }
  667.       this.IntervalId = _global.SetInterval({mcRef:this,methode:this.MethodeDetecteDrag,interval:10});
  668.       this.swapDepths(this.PressLevel);
  669.       this.DragEnCours = true;
  670.    };
  671.    this.StopDrag = function()
  672.    {
  673.       _global.ClearInterval(this.IntervalId);
  674.       this.swapDepths(this.pDepth);
  675.       this.DragEnCours = false;
  676.       _global.CURSEUR.Deverrouiller();
  677.    };
  678.    this.ComeBack = function()
  679.    {
  680.       this._x = this.xOri;
  681.       this._y = this.yOri;
  682.       this.gotoAndStop("E1");
  683.       this.DragEnCours = false;
  684.    };
  685.    this.Activer = function()
  686.    {
  687.       trace("Activer : " + this);
  688.       this.enabled = true;
  689.       this.BTN.enabled = true;
  690.       this.useHandCursor = this.UseHandCursor;
  691.       this.BTN.useHandCursor = this.UseHandCursor;
  692.    };
  693.    this.Desactiver = function()
  694.    {
  695.       trace("Desactiver : " + this);
  696.       this.enabled = false;
  697.       this.BTN.enabled = false;
  698.       this.useHandCursor = false;
  699.       this.BTN.useHandCursor = false;
  700.    };
  701.    this.CibleLaPlusProche = function(p)
  702.    {
  703.       var _loc3_ = p.mode != "toutes" ? this.CiblesTouchees : this.CiblesDrag;
  704.       if(_loc3_.length == 0)
  705.       {
  706.          return null;
  707.       }
  708.       var _loc4_ = undefined;
  709.       var _loc10_ = null;
  710.       var _loc9_ = undefined;
  711.       var _loc7_ = undefined;
  712.       if(p.mcRef == undefined)
  713.       {
  714.          _loc9_ = _xmouse;
  715.          _loc7_ = _ymouse;
  716.       }
  717.       else if(p.mcRef == "center")
  718.       {
  719.          _loc9_ = this._x + this._width / 2;
  720.          _loc7_ = this._y + this._height / 2;
  721.       }
  722.       else
  723.       {
  724.          var _loc12_ = new flash.geom.Point(p.mcRef._x,p.mcRef._y);
  725.          mcRef.localToGlobal(_loc12_);
  726.          _loc9_ = _loc12_.x;
  727.          _loc7_ = _loc12_.y;
  728.       }
  729.       var _loc5_ = 100000;
  730.       var _loc2_ = 0;
  731.       while(_loc2_ < _loc3_.length)
  732.       {
  733.          if(_loc3_[_loc2_] !== this)
  734.          {
  735.             _loc4_ = DistancePoints({x1:_loc9_,y1:_loc7_,x2:_loc3_[_loc2_]._x,y2:_loc3_[_loc2_]._y});
  736.             if(_loc4_ < _loc5_)
  737.             {
  738.                _loc5_ = _loc4_;
  739.                _loc10_ = _loc3_[_loc2_];
  740.             }
  741.          }
  742.          _loc2_ = _loc2_ + 1;
  743.       }
  744.       return _loc10_;
  745.    };
  746.    this.MConPress = function()
  747.    {
  748.       if(!(this.ModeDrag == "lache_au_clic" && this.DragEnCours == true))
  749.       {
  750.          this.FirstPress = true;
  751.          this.jouesonOnPress();
  752.          this.xOri = this._x;
  753.          this.yOri = this._y;
  754.          this.masqueIB();
  755.          this.gotoAndStop(this.pressFrame);
  756.          gereCursor("mainF");
  757.          this.StartDrag();
  758.          var _loc2_ = this.OnPress();
  759.       }
  760.    };
  761.    this.MConRollOver = function()
  762.    {
  763.       trace("MConRollOver : " + this);
  764.       if(this.DragEnCours == true)
  765.       {
  766.          return undefined;
  767.       }
  768.       this.joueson();
  769.       this.afficheIB();
  770.       this.gotoAndStop(this.overFrame);
  771.       gereCursor("mainO");
  772.       var _loc2_ = this.OnRollOver();
  773.    };
  774.    this.MConRollOut = function()
  775.    {
  776.       if(this.DragEnCours == true)
  777.       {
  778.          return undefined;
  779.       }
  780.       this.stopson();
  781.       this.gotoAndStop(this.outFrame);
  782.       this.masqueIB();
  783.       gereCursor("fleche");
  784.       var _loc2_ = this.OnRollOut();
  785.    };
  786.    this.MConRelease = function()
  787.    {
  788.       if(this.ModeDrag != "lache_au_rollout")
  789.       {
  790.          return undefined;
  791.       }
  792.       this.DragEnCours = false;
  793.       _global.CURSEUR.Deverrouiller();
  794.       gereCursor("mainO");
  795.       this.stopsonOnPress();
  796.       this.gotoAndStop(this.releaseFrame);
  797.       _global.ClearInterval(this.IntervalId);
  798.       this.swapDepths(this.pDepth);
  799.       this.ApresDrag();
  800.       var _loc3_ = this.OnRelease();
  801.    };
  802.    this.MConReleaseOutside = this.MConRelease;
  803.    if(this.BTN == undefined || p.BTN == false)
  804.    {
  805.       this.onPress = this.MConPress;
  806.       this.onRollOver = this.MConRollOver;
  807.       this.onRollOut = this.MConRollOut;
  808.       this.onRelease = this.MConRelease;
  809.       this.onReleaseOutside = this.MConReleaseOutside;
  810.    }
  811.    else
  812.    {
  813.       this.BTN.onPress = function()
  814.       {
  815.          this._parent.MConPress();
  816.       };
  817.       this.BTN.onRollOver = function()
  818.       {
  819.          this._parent.MConRollOver();
  820.       };
  821.       this.BTN.onRollOut = function()
  822.       {
  823.          this._parent.MConRollOut();
  824.       };
  825.       this.BTN.onRelease = function()
  826.       {
  827.          this._parent.MConRelease();
  828.       };
  829.       this.BTN.onReleaseOutside = function()
  830.       {
  831.          this._parent.MConReleaseOutside();
  832.       };
  833.    }
  834. }
  835. function InitMC_slider(p)
  836. {
  837.    if(p.IB != undefined)
  838.    {
  839.       if(typeof p.IBrep == "movieclip")
  840.       {
  841.          var IBrepere = p.IBrep;
  842.       }
  843.       else if(typeof _MOD_["IBrep_" + p.IB] == "movieclip" && p.IBrep != false)
  844.       {
  845.          var IBrepere = _MOD_["IBrep_" + p.IB];
  846.       }
  847.       else
  848.       {
  849.          var IBrepere = p.mc;
  850.       }
  851.       this.afficheIB = function()
  852.       {
  853.          _root.gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  854.       };
  855.       this.masqueIB = function()
  856.       {
  857.          _root.IB.removeMovieClip();
  858.       };
  859.    }
  860.    ┬º┬ºpush(this);
  861.    ┬º┬ºpush("joueson");
  862.    if(p.son == undefined)
  863.    {
  864.       ┬º┬ºpush(undefined);
  865.    }
  866.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  867.    ┬º┬ºpush(this);
  868.    ┬º┬ºpush("stopson");
  869.    if(p.son == undefined)
  870.    {
  871.       ┬º┬ºpush(undefined);
  872.    }
  873.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  874.    var _loc7_ = p.goto != undefined ? "fleche" : "doigt";
  875.    this.goto = p.goto;
  876.    this.EnMouvement = false;
  877.    if(p.sonOnMove != undefined)
  878.    {
  879.       this.sonOnMove = p.sonOnMove;
  880.       this.sonOnMove_offset = p.sonOnMove_offset != undefined ? Number(p.sonOnMove_offset) : 0;
  881.       this.sonOnMove_loopSon = p.sonOnMove_loopSon != undefined ? Number(p.sonOnMove_loopSon) : 0;
  882.       this.jouesonOnMove = function()
  883.       {
  884.          joueBruitage({nomSon:this.sonOnMove,offset:this.sonOnMove_offset,loopSon:this.sonOnMove_loopSon});
  885.       };
  886.       this.stopsonOnMove = function()
  887.       {
  888.          stopBruitage({nomSon:this.sonOnMove});
  889.       };
  890.    }
  891.    else
  892.    {
  893.       this.jouesonOnMove = undefined;
  894.       this.stopsonOnMove = undefined;
  895.    }
  896.    if(p.sonOnPress != undefined)
  897.    {
  898.       this.sonOnPress = p.sonOnPress;
  899.       this.sonOnPress_offset = p.sonOnPress_offset != undefined ? Number(p.sonOnPress_offset) : 0;
  900.       this.sonOnPress_loopSon = p.sonOnPress_loopSon != undefined ? Number(p.sonOnPress_loopSon) : 0;
  901.       this.jouesonOnPress = function()
  902.       {
  903.          joueBruitage({nomSon:this.sonOnPress,offset:this.sonOnPress_offset,loopSon:this.sonOnPress_loopSon});
  904.       };
  905.       this.stopsonOnPress = function()
  906.       {
  907.          stopBruitage({nomSon:this.sonOnPress});
  908.       };
  909.    }
  910.    else
  911.    {
  912.       this.jouesonOnPress = undefined;
  913.       this.stopsonOnPress = undefined;
  914.    }
  915.    this.DragZoneLargeur = p.DragZoneLargeur != undefined ? p.DragZoneLargeur : 0;
  916.    this.DragZoneHauteur = p.DragZoneHauteur != undefined ? p.DragZoneHauteur : 0;
  917.    this.DragZoneLargeur_pourcent = p.DragZoneLargeur / 100;
  918.    this.DragZoneHauteur_pourcent = p.DragZoneHauteur / 100;
  919.    this.DragZone = {left:this._x,right:this._x + this.DragZoneLargeur,top:this._y,bottom:this._y + this.DragZoneHauteur};
  920.    this.Activer = function()
  921.    {
  922.       this.enabled = true;
  923.    };
  924.    this.Desactiver = function()
  925.    {
  926.       this.enabled = false;
  927.    };
  928.    this.SetPosition = this.SetPositionX = function(pourcent)
  929.    {
  930.       this._x = this.DragZone.left + this.DragZoneLargeur_pourcent * pourcent;
  931.    };
  932.    this.SetPositionY = function(pourcent)
  933.    {
  934.       this._y = this.DragZone.top + this.DragZoneHauteur_pourcent * pourcent;
  935.    };
  936.    this.GetPosition = this.GetPositionX = function()
  937.    {
  938.       return (this._x - this.DragZone.left) / this.DragZoneLargeur_pourcent;
  939.    };
  940.    this.GetPositionY = function()
  941.    {
  942.       return (this._y - this.DragZone.top) / this.DragZoneHauteur_pourcent;
  943.    };
  944.    this.DetectDrag = function()
  945.    {
  946.       this._x = _root._xmouse - this.ecart_mousex;
  947.       this._y = _root._ymouse - this.ecart_mousey;
  948.       if(this._x <= this.DragZone.left)
  949.       {
  950.          this._x = this.DragZone.left;
  951.       }
  952.       if(this._y < this.DragZone.top)
  953.       {
  954.          this._y = this.DragZone.top;
  955.       }
  956.       if(this._x >= this.DragZone.right)
  957.       {
  958.          this._x = this.DragZone.right;
  959.       }
  960.       if(this._y > this.DragZone.bottom)
  961.       {
  962.          this._y = this.DragZone.bottom;
  963.       }
  964.       updateAfterEvent();
  965.       if(this._x == this.lastx && this._y == this.lasty)
  966.       {
  967.          if(this.EnMouvement == true)
  968.          {
  969.             this.EnMouvement = false;
  970.             this.stopsonOnMove();
  971.          }
  972.       }
  973.       else if(this.EnMouvement == false)
  974.       {
  975.          this.EnMouvement = true;
  976.          this.jouesonOnMove();
  977.       }
  978.       this.lastx = this._x;
  979.       this.lasty = this._y;
  980.       this.PendantSlide();
  981.    };
  982.    this.StartDrag = function()
  983.    {
  984.       this.ecart_mousex = _root._xmouse - this._x;
  985.       this.ecart_mousey = _root._ymouse - this._y;
  986.       this.lastx = this._x;
  987.       this.lasty = this._y;
  988.       this.IntervalId = _global.SetInterval({mcRef:this,methode:"DetectDrag",interval:1});
  989.    };
  990.    this.onPress = function()
  991.    {
  992.       this.jouesonOnPress();
  993.       this.masqueIB();
  994.       this.gotoAndStop("E3");
  995.       gereCursor("mainF");
  996.       this.StartDrag();
  997.       var _loc2_ = this.OnPress();
  998.    };
  999.    this.onRollOver = function()
  1000.    {
  1001.       this.joueson();
  1002.       this.afficheIB();
  1003.       this.gotoAndStop("E2");
  1004.       gereCursor("mainO");
  1005.       var _loc2_ = this.OnRollOver();
  1006.    };
  1007.    this.onRollOut = function()
  1008.    {
  1009.       this.stopson();
  1010.       this.stopsonOnPress();
  1011.       this.stopsonOnMove();
  1012.       this.gotoAndStop("E1");
  1013.       this.masqueIB();
  1014.       gereCursor("fleche");
  1015.       var _loc2_ = this.OnRollOut();
  1016.    };
  1017.    this.onRelease = function()
  1018.    {
  1019.       this.gotoAndStop("E2");
  1020.       _global.ClearInterval(this.IntervalId);
  1021.       this.stopson();
  1022.       this.stopsonOnPress();
  1023.       this.stopsonOnMove();
  1024.       gereCursor("mainO");
  1025.       var _loc3_ = this.OnRelease();
  1026.    };
  1027.    this.onReleaseOutside = function()
  1028.    {
  1029.       this.onRelease();
  1030.       gereCursor("fleche");
  1031.       var _loc2_ = this.OnReleaseOutside();
  1032.    };
  1033. }
  1034. function InitMC_titre(p)
  1035. {
  1036.    this.LMaVider = [];
  1037.    this.offsetx = p.offsetx != undefined ? Number(p.offsetx) : 0;
  1038.    this.offsety = p.offsety != undefined ? Number(p.offsety) : 0;
  1039.    this.ChangeTexte = function(p)
  1040.    {
  1041.       this.viderLM();
  1042.       _root.gereTextes.afficheLM({codeLM:p.codeLM,X:this._x + this.offsetx,Y:this._y + this.offsety,width:this._width,height:this._height});
  1043.       this.LMaVider.push(p);
  1044.    };
  1045.    this.viderLM = function()
  1046.    {
  1047.       var _loc3_ = 0;
  1048.       while(_loc3_ < this.LMaVider.length)
  1049.       {
  1050.          _root.gereTextes.masqueLM(this.LMaVider[_loc3_]);
  1051.          _loc3_ = _loc3_ + 1;
  1052.       }
  1053.    };
  1054. }
  1055. function InitMC_texte(p)
  1056. {
  1057.    trace("InitMC_titre()");
  1058.    xlisteObj(p);
  1059.    this.LMaVider = [];
  1060.    this.pere = p.pere != undefined ? Number(p.pere) : _root;
  1061.    this.offsetx = p.offsetx != undefined ? Number(p.offsetx) : 0;
  1062.    this.offsety = p.offsety != undefined ? Number(p.offsety) : 0;
  1063.    this.level = p.level != undefined ? Number(p.level) : this.pere.getNextHighestDepth();
  1064.    this.texte = p.texte != undefined ? p.texte : "";
  1065.    this.MC = p.mc;
  1066.    this.MC._visible = false;
  1067.    if(p.style == undefined)
  1068.    {
  1069.       this.Style = {};
  1070.    }
  1071.    else
  1072.    {
  1073.       this.Style = p.style;
  1074.    }
  1075.    this.Style.multiline = this.Style.multiline != undefined ? this.Style.multiline : true;
  1076.    this.Style.wordWrap = this.Style.wordWrap != undefined ? this.Style.wordWrap : true;
  1077.    this.Style.border = this.Style.border != undefined ? this.Style.border : false;
  1078.    this.Style.color = this.Style.color != undefined ? this.Style.color : 16711680;
  1079.    this.Style.size = this.Style.size != undefined ? this.Style.size : 12;
  1080.    this.Style.font = this.Style.font != undefined ? this.Style.font : "Comic Sans MS";
  1081.    this.Style.align = this.Style.align != undefined ? this.Style.align : "center";
  1082.    this.Style.underline = this.Style.underline != undefined ? this.Style.underline : false;
  1083.    this.Style.selectable = this.Style.selectable != undefined ? this.Style.selectable : false;
  1084.    var _loc4_ = this.pere.createTextField(this.MC._name + "_txt",this.level,this.MC._x,this.MC._y,this.MC._width,this.MC._height);
  1085.    _loc4_.multiline = this.Style.multiline;
  1086.    _loc4_.wordWrap = this.Style.wordWrap;
  1087.    _loc4_.border = this.Style.border;
  1088.    _loc4_.selectable = this.Style.selectable;
  1089.    _loc4_.embedFonts = true;
  1090.    var my_fmt = new TextFormat();
  1091.    my_fmt.font = this.Style.font;
  1092.    my_fmt.size = this.Style.size;
  1093.    my_fmt.color = this.Style.color;
  1094.    my_fmt.align = this.Style.align;
  1095.    my_fmt.underline = this.Style.underline;
  1096.    _loc4_.text = this.texte;
  1097.    _loc4_.setTextFormat(my_fmt);
  1098.    this.TexteMC = _loc4_;
  1099.    this.ChangeTexte = function(p)
  1100.    {
  1101.       this.texte = p.texte;
  1102.       this.TexteMC.text = p.texte;
  1103.       this.TexteMC.setTextFormat(my_fmt);
  1104.    };
  1105. }
  1106. function DistancePoints(p)
  1107. {
  1108.    return Math.sqrt(Math.pow(p.x2 - p.x1,2) + Math.pow(p.y2 - p.y1,2));
  1109. }
  1110. function getLMById(codeLM)
  1111. {
  1112.    var _loc3_ = _root.moduleInfo.returnNodeByPath("Module." + _root.gLangue + ".LegendesMedias");
  1113.    myLM = this.recusivegetLMById(_loc3_,"id",codeLM);
  1114.    if(myLM == undefined)
  1115.    {
  1116.       myLM(attributeValue + " n\'existe pas dans XML");
  1117.    }
  1118.    return myLM;
  1119. }
  1120. function recusivegetLMById(node, attribute, attributeValue)
  1121. {
  1122.    var _loc1_ = 0;
  1123.    while(_loc1_ < node.childNodes.length)
  1124.    {
  1125.       if(node.childNodes[_loc1_].attributes[attribute] == attributeValue)
  1126.       {
  1127.          myText = node.childNodes[_loc1_].firstChild.nodeValue;
  1128.          var _loc7_ = [];
  1129.          for(var _loc5_ in node.childNodes[_loc1_].attributes)
  1130.          {
  1131.             _loc7_[_loc5_] = node.childNodes[_loc1_].attributes[_loc5_];
  1132.          }
  1133.          break;
  1134.       }
  1135.       if(node.childNodes[_loc1_].hasChildNodes())
  1136.       {
  1137.          recusivegetLMById(node.childNodes[_loc1_],attribute,attributeValue);
  1138.       }
  1139.       _loc1_ = _loc1_ + 1;
  1140.    }
  1141.    return {texte:myText,attributs:_loc7_};
  1142. }
  1143. function getStyleLM(codeLM)
  1144. {
  1145.    var _loc8_ = "LM";
  1146.    var _loc12_ = _root.moduleInfo.returnNodeByPath("Module." + _root.gLangue + ".LegendesMedias");
  1147.    var _loc10_ = getLMById(codeLM);
  1148.    var _loc11_ = _loc10_.texte;
  1149.    myStyle = _loc10_.attributs.style;
  1150.    var _loc3_ = _root.moduleInfo.returnNodeByPath("Module.StylesTextes.StylesLM");
  1151.    var _loc6_ = {};
  1152.    var _loc14_ = 0;
  1153.    var _loc7_ = new TextFormat();
  1154.    var _loc5_ = new XML();
  1155.    var _loc13_ = "00";
  1156.    var _loc2_ = 0;
  1157.    while(_loc2_ < _loc3_.childNodes.length)
  1158.    {
  1159.       if(_loc3_.childNodes[_loc2_].attributes.id == _loc8_)
  1160.       {
  1161.          var _loc4_ = 0;
  1162.          while(_loc4_ < _loc3_.childNodes[_loc2_].childNodes.length)
  1163.          {
  1164.             _loc6_[_loc3_.childNodes[_loc2_].childNodes[_loc4_].nodeName] = _loc3_.childNodes[_loc2_].childNodes[_loc4_].firstChild.nodeValue;
  1165.             _loc4_ = _loc4_ + 1;
  1166.          }
  1167.       }
  1168.       else
  1169.       {
  1170.          if(_loc3_.childNodes[_loc2_].attributes.id == codeLM)
  1171.          {
  1172.             _loc5_ = _loc3_.childNodes[_loc2_];
  1173.             break;
  1174.          }
  1175.          if(_loc3_.childNodes[_loc2_].attributes.id == myStyle)
  1176.          {
  1177.             _loc5_ = _loc3_.childNodes[_loc2_];
  1178.             break;
  1179.          }
  1180.       }
  1181.       _loc2_ = _loc2_ + 1;
  1182.    }
  1183.    if(_loc5_.childNodes.length !== 0)
  1184.    {
  1185.       _loc4_ = 0;
  1186.       while(_loc4_ < _loc5_.childNodes.length)
  1187.       {
  1188.          _loc6_[_loc5_.childNodes[_loc4_].nodeName] = _loc5_.childNodes[_loc4_].firstChild.nodeValue;
  1189.          _loc4_ = _loc4_ + 1;
  1190.       }
  1191.    }
  1192.    _loc7_.font = _loc6_.police;
  1193.    _loc7_.size = Number(_loc6_.corps);
  1194.    _loc7_.bold = _loc6_.bold != "0" ? true : false;
  1195.    _loc7_.italic = _loc6_.italic != "0" ? true : false;
  1196.    _loc7_.underline = _loc6_.underline != "0" ? true : false;
  1197.    _loc7_.color = Number(_loc6_.couleurT);
  1198.    _loc7_.align = _loc6_.justify;
  1199.    _loc6_.textFormat = _loc7_;
  1200.    return _loc6_;
  1201. }
  1202. function GetLmTextField(lm)
  1203. {
  1204.    return lm.LM.texte;
  1205. }
  1206. function IncString(str, seuil)
  1207. {
  1208.    var _loc2_ = str.split("_");
  1209.    var _loc1_ = _loc2_.length - 1;
  1210.    var _loc3_ = Number(_loc2_[_loc1_]) + 1;
  1211.    while(_loc3_ > seuil)
  1212.    {
  1213.       _loc2_[_loc1_] = gimme2digits(0);
  1214.       _loc1_ = _loc1_ - 1;
  1215.       _loc3_ = Number(_loc2_[_loc1_]) + 1;
  1216.    }
  1217.    _loc2_[_loc1_] = gimme2digits(_loc3_);
  1218.    return _loc2_.join("_");
  1219. }
  1220. function DecString(str)
  1221. {
  1222.    var _loc1_ = str.split("_");
  1223.    trace(_loc1_);
  1224.    var _loc2_ = _loc1_.length - 1;
  1225.    trace(Number(_loc1_[_loc2_]));
  1226.    _loc1_[_loc2_] = gimme2digits(Number(_loc1_[_loc2_]) - 1);
  1227.    return _loc1_.join("_");
  1228. }
  1229. function RetourneLettreAlphabet(no)
  1230. {
  1231.    var _loc1_ = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
  1232.    trace("RetourneLettreAlphabet() : lettre no " + no + " :" + _loc1_[no - 1]);
  1233.    return _loc1_[no - 1];
  1234. }
  1235. function xGetConfig()
  1236. {
  1237.    trace("xGetConfig()");
  1238.    _root.xConfig = {};
  1239.    _root.xConfig.Params = {};
  1240.    _root.xConfig.Set = function(p)
  1241.    {
  1242.       if(this[p.nom] == undefined)
  1243.       {
  1244.          if(p.defaut == "OBLIGATOIRE")
  1245.          {
  1246.             trace({mess:"/!\\ERROR /!\\Param├¿tre du xml obligatoire manquant dans la balise Config: " + p.nom,group:"error"});
  1247.          }
  1248.          else
  1249.          {
  1250.             this[p.nom] = p.defaut;
  1251.             if(p.type == "number")
  1252.             {
  1253.                this[p.nom] = Number(this[p.nom]);
  1254.             }
  1255.             if(p.type == "boolean")
  1256.             {
  1257.                this[p.nom] = !(this[p.nom] == "true" || this[p.nom] == true) ? false : true;
  1258.             }
  1259.          }
  1260.       }
  1261.       else
  1262.       {
  1263.          if(p.type == "number")
  1264.          {
  1265.             this[p.nom] = Number(this[p.nom]);
  1266.          }
  1267.          if(p.type == "boolean")
  1268.          {
  1269.             this[p.nom] = !(this[p.nom] == "true" || this[p.nom] == true) ? false : true;
  1270.          }
  1271.       }
  1272.       this.Params[p.nom] = {nom:p.nom,type:p.type,desc:p.desc,valeur:this[p.nom]};
  1273.    };
  1274.    _root.xConfig.ToXml = function()
  1275.    {
  1276.       var _loc2_ = "";
  1277.       trace("");
  1278.       trace("");
  1279.       trace("");
  1280.       trace("(!)_____ xConfig en XML _______");
  1281.       trace("<Params>");
  1282.       for(var _loc3_ in this.Params)
  1283.       {
  1284.          this.Params[_loc3_].desc = this.Params[_loc3_].desc != undefined ? this.Params[_loc3_].desc : "";
  1285.          _loc2_ = "<Param nom=\"" + _loc3_ + "\" valeur=\"" + this.Params[_loc3_].valeur + "\"  desc=\"" + this.Params[_loc3_].desc + "\" /> <!-- " + this.Params[_loc3_].desc + " -->\r" + _loc2_;
  1286.       }
  1287.       trace(_loc2_);
  1288.       trace("</Params>");
  1289.       trace("(!)_____ xConfig en XML- FIN _______");
  1290.       trace("");
  1291.       trace("");
  1292.       trace("");
  1293.    };
  1294.    _root.xConfig._name = "xConfig";
  1295.    var _loc3_ = _root.moduleInfo.returnNodeByPath("Module.Config.Params").childNodes;
  1296.    for(props in _loc3_)
  1297.    {
  1298.       _root.xConfig[_loc3_[props].attributes.nom] = _loc3_[props].attributes.valeur;
  1299.    }
  1300. }
  1301. function GetFilePath(fichier)
  1302. {
  1303.    var _loc2_ = AntiSlashToSlash(fichier);
  1304.    var _loc1_ = _loc2_.split("/");
  1305.    _loc1_.pop();
  1306.    return _loc1_.join("/");
  1307. }
  1308. function AntiSlashToSlash(chaine)
  1309. {
  1310.    return str_replace(chaine,"\\","/");
  1311. }
  1312. function DistancePoints(p)
  1313. {
  1314.    return Math.sqrt(Math.pow(p.x2 - p.x1,2) + Math.pow(p.y2 - p.y1,2));
  1315. }
  1316. function SetInterval(p)
  1317. {
  1318.    if(_root.INTERVAL_IDS == undefined)
  1319.    {
  1320.       _root.INTERVAL_IDS = [];
  1321.    }
  1322.    if(p.mcRef == undefined)
  1323.    {
  1324.       p.mcRef = _root;
  1325.    }
  1326.    if(p.methode == undefined)
  1327.    {
  1328.       return false;
  1329.    }
  1330.    if(p.interval == undefined)
  1331.    {
  1332.       return false;
  1333.    }
  1334.    if(p.params == undefined)
  1335.    {
  1336.       p.params = {};
  1337.    }
  1338.    var _loc3_ = setInterval(p.mcRef,p.methode,p.interval,p.params);
  1339.    _root.INTERVAL_IDS.push(_loc3_);
  1340.    return _loc3_;
  1341. }
  1342. function ClearInterval(id)
  1343. {
  1344.    clearInterval(id);
  1345.    var _loc2_ = 0;
  1346.    while(_loc2_ < _root.INTERVAL_IDS.length)
  1347.    {
  1348.       if(_root.INTERVAL_IDS[_loc2_] == id)
  1349.       {
  1350.          _root.INTERVAL_IDS.splice(_loc2_,1);
  1351.          return undefined;
  1352.       }
  1353.       _loc2_ = _loc2_ + 1;
  1354.    }
  1355. }
  1356. function ClearAllIntervals()
  1357. {
  1358.    var _loc2_ = 0;
  1359.    while(_loc2_ < _root.INTERVAL_IDS.length)
  1360.    {
  1361.       clearInterval(_root.INTERVAL_IDS[_loc2_]);
  1362.       _loc2_ = _loc2_ + 1;
  1363.    }
  1364.    _root.INTERVAL_IDS = [];
  1365. }
  1366. function ExecuterApresDelai(p)
  1367. {
  1368.    var tdep = getTimer();
  1369.    var tfin;
  1370.    var _loc3_ = "ExecuterApresDelai" + Number(++_root.ExecuterApresDelaiNo);
  1371.    var id;
  1372.    var delai = p.delai * 1000;
  1373.    var _loc4_ = p.mcRef[p.methode];
  1374.    var mcRef = p.mcRef;
  1375.    var methode = p.methode;
  1376.    var params = p.params;
  1377.    _root[_loc3_] = function()
  1378.    {
  1379.       tfin = getTimer();
  1380.       if(tfin - tdep >= delai)
  1381.       {
  1382.          ClearInterval(id);
  1383.          mcRef[methode](params);
  1384.       }
  1385.    };
  1386.    id = SetInterval({methode:_loc3_,interval:p.delai});
  1387.    return id;
  1388. }
  1389. function str_replace(str, search, replace)
  1390. {
  1391.    return str.split(search).join(replace);
  1392. }
  1393. function JoindreObjets(objects)
  1394. {
  1395.    var _loc2_ = new Object();
  1396.    var _loc1_ = 0;
  1397.    while(_loc1_ < objects.length)
  1398.    {
  1399.       p1 = objects[_loc1_];
  1400.       for(props in p1)
  1401.       {
  1402.          _loc2_[props] = p1[props];
  1403.       }
  1404.       _loc1_ = _loc1_ + 1;
  1405.    }
  1406.    return _loc2_;
  1407. }
  1408. function GetOriginalSize(mc)
  1409. {
  1410.    var _loc2_ = mc._rotation;
  1411.    mc._rotation = 0;
  1412.    var _loc3_ = {w:mc._width * mc._xscale / 100,h:mc._height * mc._yscale / 100};
  1413.    mc._rotation = _loc2_;
  1414.    return _loc3_;
  1415. }
  1416. function GetOriginalWidth(mc)
  1417. {
  1418.    var _loc2_ = mc._rotation;
  1419.    mc._rotation = 0;
  1420.    var _loc3_ = mc._width * mc._xscale / 100;
  1421.    var _loc4_ = mc._height * mc._yscale / 100;
  1422.    mc._rotation = _loc2_;
  1423.    return _loc3_;
  1424. }
  1425. function GetOriginalHeight(mc)
  1426. {
  1427.    var _loc2_ = mc._rotation;
  1428.    mc._rotation = 0;
  1429.    var _loc4_ = mc._width * mc._xscale / 100;
  1430.    var _loc3_ = mc._height * mc._yscale / 100;
  1431.    mc._rotation = _loc2_;
  1432.    return _loc3_;
  1433. }
  1434. function CreerCache(p)
  1435. {
  1436.    var _loc4_ = p.level != undefined ? p.level : _global.Levels.cache;
  1437.    var _loc2_ = p.mc.createEmptyMovieClip("CACHE",_loc4_);
  1438.    _loc2_.beginFill(65280,50);
  1439.    _loc2_.moveTo(0,0);
  1440.    _loc2_.lineTo(p.width,0);
  1441.    _loc2_.lineTo(p.width,p.height);
  1442.    _loc2_.lineTo(0,p.height);
  1443.    _loc2_.lineTo(0,0);
  1444.    _loc2_.endFill();
  1445.    p.mc.setMask(_loc2_);
  1446. }
  1447. function ConvertCoord(mc_src, mc_dest)
  1448. {
  1449.    var _loc1_ = {x:0,y:0};
  1450.    mc_src.localToGlobal(_loc1_);
  1451.    mc_dest.globalToLocal(_loc1_);
  1452.    return _loc1_;
  1453. }
  1454. function getGlobalCoord(xc, yc, mc)
  1455. {
  1456.    var _loc1_ = {x:xc * 100 / mc._xscale,y:yc * 100 / mc._yscale};
  1457.    mc.localToGlobal(_loc1_);
  1458.    return _loc1_;
  1459. }
  1460. function getLocalCoord(xc, yc, mc)
  1461. {
  1462.    var _loc1_ = new Object({x:xc,y:yc});
  1463.    mc.globalToLocal(_loc1_);
  1464.    _loc1_.x = _loc1_.x / 100 * mc._xscale;
  1465.    _loc1_.y = _loc1_.y / 100 * mc._yscale;
  1466.    return _loc1_;
  1467. }
  1468. function length_ass(arr)
  1469. {
  1470.    var _loc1_ = 0;
  1471.    for(prop in arr)
  1472.    {
  1473.       _loc1_ = _loc1_ + 1;
  1474.    }
  1475.    return _loc1_;
  1476. }
  1477. function ExplodeString(chaine)
  1478. {
  1479.    var _loc3_ = new Array();
  1480.    var _loc1_ = 0;
  1481.    while(_loc1_ < chaine.length)
  1482.    {
  1483.       _loc3_.push(chaine.charAt(_loc1_));
  1484.       _loc1_ = _loc1_ + 1;
  1485.    }
  1486.    return _loc3_;
  1487. }
  1488. function TrimString(chaine)
  1489. {
  1490.    var _loc3_ = "";
  1491.    var _loc5_ = "";
  1492.    var _loc2_ = false;
  1493.    var _loc1_ = 0;
  1494.    while(_loc1_ < chaine.length)
  1495.    {
  1496.       if(chaine.charAt(_loc1_) != " ")
  1497.       {
  1498.          _loc2_ = true;
  1499.       }
  1500.       if(_loc2_ == true)
  1501.       {
  1502.          _loc3_ += chaine.charAt(_loc1_);
  1503.       }
  1504.       _loc1_ = _loc1_ + 1;
  1505.    }
  1506.    _loc2_ = false;
  1507.    _loc1_ = _loc3_.length - 1;
  1508.    while(_loc1_ >= 0)
  1509.    {
  1510.       if(_loc3_.charAt(_loc1_) != " ")
  1511.       {
  1512.          _loc2_ = true;
  1513.       }
  1514.       if(_loc2_ == true)
  1515.       {
  1516.          _loc5_ = _loc3_.charAt(_loc1_) + _loc5_;
  1517.       }
  1518.       _loc1_ = _loc1_ - 1;
  1519.    }
  1520.    return _loc5_;
  1521. }
  1522. function BloquerActives()
  1523. {
  1524.    if(_global.ClipBloquant == undefined)
  1525.    {
  1526.       var _loc0_ = null;
  1527.       var _loc3_ = _global.ClipBloquant = _root.createEmptyMovieClip("ClipBloquant",12123);
  1528.       _loc3_.attachMovie("ClipInvisible","ClipInvisible",2);
  1529.       _loc3_._width = Stage.width;
  1530.       _loc3_._height = Stage.height;
  1531.       _loc3_._x = 0;
  1532.       _loc3_._y = 0;
  1533.       _loc3_.useHandCursor = false;
  1534.       _loc3_.onPress = function()
  1535.       {
  1536.       };
  1537.    }
  1538. }
  1539. function DebloquerActives()
  1540. {
  1541.    if(_global.ClipBloquant != undefined)
  1542.    {
  1543.       _global.ClipBloquant.removeMovieClip();
  1544.       _global.ClipBloquant = undefined;
  1545.    }
  1546. }
  1547. function afficheLM_x2(p)
  1548. {
  1549.    viderLM_x2();
  1550.    _root.gereTextes.afficheLM({codeLM:p.codeLM,X:p.LMrep._x,Y:p.LMrep._y,width:p.LMrep._width,height:p.LMrep._height});
  1551.    LMaVider2.push(p);
  1552. }
  1553. function viderLM_x2()
  1554. {
  1555.    var _loc3_ = 0;
  1556.    while(_loc3_ < _global.LMaVider2.length)
  1557.    {
  1558.       _root.gereTextes.masqueLM(_global.LMaVider2[_loc3_]);
  1559.       _loc3_ = _loc3_ + 1;
  1560.    }
  1561. }
  1562. function afficheLM_x(p)
  1563. {
  1564.    _root.gereTextes.afficheLM({codeLM:p.codeLM,X:p.LMrep._x - p.width / 2,Y:p.LMrep._y - p.height / 2,width:p.width,height:p.height});
  1565.    _global.LMaVider.push(p);
  1566. }
  1567. function viderLM_x()
  1568. {
  1569.    var _loc3_ = 0;
  1570.    while(_loc3_ < _global.LMaVider.length)
  1571.    {
  1572.       _root.gereTextes.masqueLM(_global.LMaVider[_loc3_]);
  1573.       _loc3_ = _loc3_ + 1;
  1574.    }
  1575. }
  1576. function ConvertMcToArray(p)
  1577. {
  1578.    xtrace("Convertion du bitmap en tableau de nombres");
  1579.    var _loc3_ = p.mc;
  1580.    var _loc5_ = _loc3_._rotation;
  1581.    _loc3_._rotation = 0;
  1582.    var _loc1_ = _loc3_._width * 100 / _loc3_._xscale;
  1583.    var _loc4_ = _loc3_._height * 100 / _loc3_._yscale;
  1584.    _loc3_._rotation = _loc5_;
  1585.    _loc3_.MCwidth = _loc1_;
  1586.    _loc3_.MCheight = _loc4_;
  1587.    xtrace("WH " + _loc1_ + " " + _loc4_);
  1588.    var _loc2_ = new flash.display.BitmapData(_loc1_,_loc4_,true,0);
  1589.    _loc2_.draw(_loc3_);
  1590.    var _loc6_ = new Array();
  1591.    lv = new LoadVars();
  1592.    lv.tab = new Array();
  1593.    i = 0;
  1594.    while(i < _loc4_)
  1595.    {
  1596.       j = 0;
  1597.       while(j < _loc1_)
  1598.       {
  1599.          lv.tab.push(_loc2_.getPixel(j,i));
  1600.          j++;
  1601.       }
  1602.       i++;
  1603.    }
  1604.    return lv.tab;
  1605. }
  1606. function ConvertMcToBitmap(p)
  1607. {
  1608.    var _loc1_ = p.mc;
  1609.    var _loc2_ = new flash.display.BitmapData(_loc1_._width,_loc1_._height,true,16777215);
  1610.    _loc2_.draw(_loc1_,_loc1_.transform.matrix);
  1611.    _loc1_._parent.createEmptyMovieClip(_loc1_._name,_loc1_.getDepth());
  1612.    _loc1_.attachBitmap(_loc2_,2,"always",true);
  1613. }
  1614. function CloneMcToBitmap(p)
  1615. {
  1616.    var _loc1_ = p.mc;
  1617.    var _loc9_ = p.pere;
  1618.    var _loc8_ = p.nom;
  1619.    var _loc5_ = p.level;
  1620.    trace("-*-*-* " + _loc1_._width + " " + _loc1_._height);
  1621.    var _loc7_ = _loc1_._x;
  1622.    var _loc6_ = _loc1_._y;
  1623.    _loc1_._x = 0;
  1624.    _loc1_._y = 0;
  1625.    var _loc4_ = new flash.display.BitmapData(_loc1_._width,_loc1_._height,true,16755370);
  1626.    trace(_loc1_.transform.matrix.toString());
  1627.    var _loc2_ = _loc9_.createEmptyMovieClip(_loc8_,_loc5_);
  1628.    _loc2_._visible = false;
  1629.    _loc2_.attachBitmap(_loc4_,2,"auto",true);
  1630.    _loc4_.draw(_loc1_,_loc1_.transform.matrix);
  1631.    _loc1_._x = _loc7_;
  1632.    _loc1_._y = _loc6_;
  1633.    trace("CloneMcToBitmap" + _loc2_);
  1634.    return _loc2_;
  1635. }
  1636. function trace_obj(obj)
  1637. {
  1638.    trace("\r________________" + obj + "________________");
  1639.    for(var _loc2_ in obj)
  1640.    {
  1641.       trace(_loc2_ + " = " + obj[_loc2_]);
  1642.    }
  1643.    trace("\r_______________________________________");
  1644. }
  1645. function xtrace_mc(obj)
  1646. {
  1647.    trace("\r________________" + obj + "________________");
  1648.    trace("_x : " + obj._x);
  1649.    trace("_y : " + obj._y);
  1650.    trace("_width : " + obj._width);
  1651.    trace("_height : " + obj._height);
  1652.    trace("_level : " + obj.getDepth());
  1653.    for(var _loc2_ in obj)
  1654.    {
  1655.       trace(_loc2_ + " = " + obj[_loc2_]);
  1656.    }
  1657.    trace("\r_______________________________________");
  1658. }
  1659. stop();
  1660. _global.InitMC = InitMC;
  1661. _global.InitMC_reccurent = InitMC_reccurent;
  1662. _global.ResetMC = ResetMC;
  1663. _global.InitMC_standart = InitMC_standart;
  1664. _global.InitMC_BTN = InitMC_BTN;
  1665. _global.InitMC_dragdrop = InitMC_dragdrop;
  1666. _global.InitMC_slider = InitMC_slider;
  1667. _global.InitMC_titre = InitMC_titre;
  1668. _global.InitMC_texte = InitMC_texte;
  1669. _global.DistancePoints = DistancePoints;
  1670. _global.DistancePoints = DistancePoints;
  1671. _global.SetInterval = SetInterval;
  1672. _global.ClearInterval = ClearInterval;
  1673. _global.ClearAllIntervals = ClearAllIntervals;
  1674. _root.ExecuterApresDelaiNo = 0;
  1675. _global.ExecuterApresDelai = ExecuterApresDelai;
  1676. _global.BloquerActives = BloquerActives;
  1677. _global.DebloquerActives = DebloquerActives;
  1678. _global.LMaVider = new Array();
  1679. _global.LMaVider2 = new Array();
  1680. _global.trace_obj = trace_obj;
  1681. _global.xtrace_mc = xtrace_mc;
  1682. gMode = 1;
  1683. gGameOn = undefined;
  1684. gResultat = undefined;
  1685. _commun_.INIT();
  1686. MEMO = _commun_.MEMO;
  1687. InitOk();
  1688.