home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 148 / MOBICLIC148.ISO / mac / DATA / QZZ148 / QZZ148_00 / QZZ148_00.swf / scripts / frame_295 / DoAction.as < prev   
Text File  |  2012-10-16  |  34KB  |  1,048 lines

  1. function clearAllInterval(lFrom)
  2. {
  3.    trace("clearAllInterval M3 from : " + lFrom);
  4.    clearInterval(IntervalRemplisBarre);
  5.    clearInterval(IntervalLanceBruitageChrono);
  6.    clearInterval(IntervalVIRTUEL);
  7.    clearInterval(IntervalIndice);
  8. }
  9. function testeReponseM3(lClip)
  10. {
  11.    trace("testeReponseM3");
  12.    trace("lCLip = " + lCLip);
  13.    desactiveTOUT();
  14.    gRemplisBarreOK = undefined;
  15.    clearAllInterval("testeReponseM3");
  16.    trace("lClip.texte_REPONSE = " + lClip.texte_REPONSE);
  17.    gResult = lClip.texte_REPONSE.text.toLowerCase();
  18.    gResult = videEspaces(gResult);
  19.    trace("________REPONSE__________________ " + gResult);
  20.    gQuestionNum = gQuestionNumLM.split("_")[0];
  21.    var _loc2_ = [];
  22.    XmlLM = moduleInfo.returnNodeByPath("Module." + gLangue + ".LegendesMedias");
  23.    gReponseOK = gereTextes.getTextById(XmlLM,"LM_R" + gimme2digits(gQuestionNum) + "A");
  24.    _loc2_.push(videEspaces(gReponseOK.toLowerCase()));
  25.    var _loc4_ = gereTextes.getTextById(XmlLM,"LM_E" + gimme2digits(gQuestionNum));
  26.    _loc4_ = _loc4_.split(",");
  27.    var _loc1_ = 0;
  28.    while(_loc1_ < _loc4_.length)
  29.    {
  30.       var _loc3_ = videEspaces(_loc4_[_loc1_].toLowerCase());
  31.       _loc2_.push(_loc3_);
  32.       _loc1_ = _loc1_ + 1;
  33.    }
  34.    var _loc5_ = false;
  35.    _loc1_ = 0;
  36.    while(_loc1_ < _loc2_.length)
  37.    {
  38.       if(gResult.indexOf(_loc2_[_loc1_]) !== -1)
  39.       {
  40.          _loc5_ = true;
  41.          break;
  42.       }
  43.       _loc1_ = _loc1_ + 1;
  44.    }
  45.    if(getPos(_loc2_,gResult) !== -1 || _loc5_ == true)
  46.    {
  47.       trace("bonne reponse");
  48.       gBonneRep = true;
  49.       gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push("A");
  50.    }
  51.    else
  52.    {
  53.       trace("mauvaise reponse");
  54.       gBonneRep = false;
  55.       gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push("B");
  56.    }
  57.    joueBruitage({nomSon:"B_LETTRE",actionFin:"testeReponseDone"});
  58. }
  59. function initManche()
  60. {
  61.    var _loc2_ = 0;
  62.    while(_loc2_ < gNbJoueurs_M[gManche - 1])
  63.    {
  64.       trace("initManche");
  65.       trace("i = " + _loc2_);
  66.       trace("gListeJoueurMixed[i].Avatar = " + gListeJoueurMixed[_loc2_].Avatar);
  67.       this["JOUEUR_" + (_loc2_ + 1)].gotoAndPlay("A" + gListeJoueurMixed[_loc2_].Avatar);
  68.       this["BORNE_" + (_loc2_ + 1)].texte_PSEUDO.text = gListeJoueurMixed[_loc2_].Pseudo;
  69.       this["BORNE_" + (_loc2_ + 1)].LETTRE.texte_LETTRE.text = "";
  70.       this["BORNE_" + (_loc2_ + 1)].SCORE.texte_SCORE.text = String(gListeJoueurMixed[_loc2_].Score);
  71.       if(gListeJoueurMixed[_loc2_].Type == "REEL")
  72.       {
  73.          this["BORNE_" + (_loc2_ + 1)].BARIL.PICTO_ORDI._visible = false;
  74.       }
  75.       _loc2_ = _loc2_ + 1;
  76.    }
  77.    gJoueur = 1;
  78.    gNoQuestion = 1;
  79. }
  80. function lanceQuestion()
  81. {
  82.    gClipReponse = undefined;
  83.    gValuePoint = 4;
  84.    if(gNoQuestion == 1 && gJoueur == 1)
  85.    {
  86.       gotoAndPlay("JEU_M" + gManche + "_C" + gTypePartie);
  87.    }
  88.    if(gNoQuestion == 1 && gListeJoueurMixed[gJoueur - 1].Type == "REEL")
  89.    {
  90.       gTimerJoueur = getTimer();
  91.    }
  92.    eteintJoueurs();
  93.    allumeJoueur();
  94.    var _loc11_ = this["BORNE_" + gJoueur].LETTRE;
  95.    _loc11_.gotoAndPlay("E1");
  96.    var _loc6_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
  97.    _loc6_.text = "";
  98.    if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
  99.    {
  100.       coupeBruitPerso();
  101.    }
  102.    this["JOUEUR_" + gJoueur].AVATAR.gotoAndPlay("E2");
  103.    gereTextes.videLM();
  104.    var _loc5_ = this["TABLEAU_M" + gManche];
  105.    _loc5_._visible = true;
  106.    var _loc13_ = _loc5_.ZAP;
  107.    if(gListeJoueurMixed[gJoueur - 1].Type == "VIRTUEL")
  108.    {
  109.       _loc5_.texte_REPONSE.type = "dynamic";
  110.       _loc5_.texte_REPONSE.selectable = false;
  111.       _loc13_._visible = true;
  112.       _loc13_.pIB = "IB_ZAP";
  113.       _loc13_.onRollOver = function()
  114.       {
  115.          gereCursor(2);
  116.          this.gotoAndPlay("E2");
  117.          gereTextes.afficheIB({codeIB:this.pIB,X:740,Y:300});
  118.       };
  119.       _loc13_.onRollOut = function()
  120.       {
  121.          gereCursor(1);
  122.          this.gotoAndPlay("E1");
  123.          gereTextes.masqueIB();
  124.       };
  125.       _loc13_.onPress = function()
  126.       {
  127.          gRemplisBarreOK = undefined;
  128.          desactiveTOUT();
  129.          clearAllInterval("CLIC ZAP");
  130.          gereTextes.masqueIB();
  131.          gereCursor(1);
  132.          this.gotoAndPlay("E1");
  133.          var _loc9_ = gListeReponse.length;
  134.          var _loc6_ = gNoQuestion;
  135.          var _loc4_ = gNoQuestion;
  136.          while(_loc4_ <= gListeNbQ_M[gManche - 1])
  137.          {
  138.             if(randomValue(0,100) < 95)
  139.             {
  140.                if(randomValue(0,100) < 90)
  141.                {
  142.                   var _loc3_ = getPos(gListeReponse,"A");
  143.                }
  144.                else
  145.                {
  146.                   _loc3_ = getPos(gListeReponse,"B");
  147.                }
  148.             }
  149.             else
  150.             {
  151.                _loc3_ = undefined;
  152.             }
  153.             trace("gNoQuestion = " + gNoQuestion);
  154.             if(_loc3_ !== undefined)
  155.             {
  156.                trace("________REPONSE__________________ " + gListeReponse[_loc3_]);
  157.                trace("_________POS_________________ " + _loc3_);
  158.                gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push(gListeReponse[_loc3_]);
  159.                gListeJoueurMixed[gJoueur - 1].gListePosReponseManche.push(_loc3_);
  160.             }
  161.             else
  162.             {
  163.                gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push(0);
  164.                gListeJoueurMixed[gJoueur - 1].gListePosReponseManche.push(-1);
  165.             }
  166.             if(gListeReponse[_loc3_] == "A")
  167.             {
  168.                if(_loc4_ == _loc6_)
  169.                {
  170.                   gListeJoueurMixed[gJoueur - 1].Score += gValuePoint;
  171.                }
  172.                else
  173.                {
  174.                   gListeJoueurMixed[gJoueur - 1].Score += randomValue(1,4);
  175.                }
  176.                var _loc5_ = _root["BORNE_" + gJoueur].SCORE.texte_SCORE;
  177.                _loc5_.text = String(gListeJoueurMixed[gJoueur - 1].Score);
  178.             }
  179.             gNoQuestion += 1;
  180.             gListeReponse = randomiseList(gList_ABC);
  181.             gListeJoueurMixed[gJoueur - 1].gListeTirageReponseManche.push(gListeReponse);
  182.             trace("gListeReponse = " + gListeReponse);
  183.             _loc4_ = _loc4_ + 1;
  184.          }
  185.          joueBruitage({nomSon:"B_ZAP",actionFin:"suiteReponse"});
  186.       };
  187.    }
  188.    else
  189.    {
  190.       _loc5_.texte_REPONSE.type = "input";
  191.       _loc5_.texte_REPONSE.editable = true;
  192.       _loc5_.texte_REPONSE.selectable = true;
  193.       _loc13_._visible = false;
  194.    }
  195.    trace("gListePartieQ[gManche-1] = " + gListePartieQ[gManche - 1]);
  196.    trace("gListePartieQ[gManche-1][gJoueur-1] = " + gListePartieQ[gManche - 1][gJoueur - 1]);
  197.    trace("gNoQuestion = " + gNoQuestion);
  198.    gQuestionNum = gimme2digits(gListePartieQ[gManche - 1][gJoueur - 1][gNoQuestion - 1]);
  199.    gQuestionNumLM = gQuestionNum + "_3";
  200.    trace("gQuestionNumLM = " + gQuestionNumLM);
  201.    gereTextes.afficheLM({mc:_loc5_,codeLM:"LM_Q" + gQuestionNumLM});
  202.    var _loc10_ = _loc5_["LM_Q" + gQuestionNumLM];
  203.    var _loc12_ = 30;
  204.    if(_loc10_.LM.texte._height < _loc12_)
  205.    {
  206.       _loc10_._y += _loc10_.LM.texte._height / 2;
  207.    }
  208.    CAPITAINE.gotoAndPlay("E1");
  209.    _loc13_ = _loc5_.POINT.texte_POINT;
  210.    if(gManche < 3)
  211.    {
  212.       _loc13_.text = String(gManche);
  213.    }
  214.    else
  215.    {
  216.       _loc13_.text = String(gValuePoint);
  217.    }
  218.    _loc5_.texte_REPONSE.text = "";
  219.    _loc5_.texte_REPONSE.textColor = "0x000000";
  220.    if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
  221.    {
  222.       _loc5_.texte_REPONSE.onChanged = function()
  223.       {
  224.          joueBruitage({nomSon:"B_TAPE"});
  225.          if(this.text !== "")
  226.          {
  227.             if(gBT_OKactif == undefined)
  228.             {
  229.                initBT_OK();
  230.             }
  231.          }
  232.          else if(gBT_OKactif == true)
  233.          {
  234.             desinitBT_OK();
  235.          }
  236.       };
  237.    }
  238.    _loc13_ = _loc5_["ROND_" + (gNoQuestion - 1)];
  239.    _loc13_.gotoAndPlay("E3");
  240.    _loc13_ = _loc5_["ROND_" + gNoQuestion];
  241.    _loc13_.gotoAndPlay("E2");
  242.    gList_ABC = ["A","B","C"];
  243.    var _loc4_ = 1;
  244.    while(_loc4_ < 4)
  245.    {
  246.       var _loc8_ = _loc5_["INDICE_" + gimme2digits(_loc4_)];
  247.       _loc6_ = _loc5_["texte_LMI" + gimme2digits(_loc4_)];
  248.       _loc8_._visible = false;
  249.       _loc6_._visible = false;
  250.       _loc4_ = _loc4_ + 1;
  251.    }
  252.    gIndice = 0;
  253.    gDone = 0;
  254.    desinitBT_OK();
  255.    XmlLM = this.moduleInfo.returnNodeByPath("Module." + gLangue + ".LegendesMedias");
  256.    gReponseOK = gereTextes.getTextById(XmlLM,"LM_R" + gimme2digits(Number(gQuestionNumLM.split("_")[0])) + "A");
  257.    clearAllInterval("lanceQuestion");
  258.    if(gListeJoueurMixed[gJoueur - 1].Type == "VIRTUEL")
  259.    {
  260.       IntervalVIRTUEL = setInterval(this,"reponseVirtuelle",randomValue(50,gListeTimerM[gManche - 1] * 1000 - 100));
  261.    }
  262.    gBT_OKactif = undefined;
  263.    _loc5_.COMPTEUR_T.masque._y = -132;
  264.    gTimer = getTimer();
  265.    gRemplisBarreOK = true;
  266.    trace("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% M3 creation Intervals");
  267.    IntervalIndice = setInterval(this,"remplisIndice",gListeTimerM[gManche - 1] * 1000 / 4);
  268.    IntervalRemplisBarre = setInterval(this,"remplisBarre",100);
  269.    IntervalLanceBruitageChrono = setInterval(this,"lanceB_CHRONO",gListeTimerM[gManche - 1] * 1000 - 2191);
  270. }
  271. function lanceB_CHRONO()
  272. {
  273.    if(gRemplisBarreOK == true)
  274.    {
  275.       trace("AV M3 IntervalLanceBruitageChrono = " + IntervalLanceBruitageChrono);
  276.       clearInterval(IntervalLanceBruitageChrono);
  277.       trace("AP M3 IntervalLanceBruitageChrono = " + IntervalLanceBruitageChrono);
  278.       joueBruitage({nomSon:"B_CHRONO"});
  279.    }
  280. }
  281. function remplisBarre()
  282. {
  283.    if(gRemplisBarreOK == true)
  284.    {
  285.       gTemps = getTimer() - gTimer;
  286.       var _loc6_ = gTemps * 100 / (gListeTimerM[gManche - 1] * 1000);
  287.       var _loc4_ = this["TABLEAU_M" + gManche];
  288.       var _loc5_ = _loc4_.COMPTEUR_T.masque;
  289.       _loc5_._y = -132 + 69 * _loc6_ / 100;
  290.       if(_loc5_._y >= -63)
  291.       {
  292.          desactiveTOUT();
  293.          var _loc2_ = 0;
  294.          while(_loc2_ < gListeReponse.length)
  295.          {
  296.             var _loc3_ = _loc4_["REPONSE_" + gList_ABC[_loc2_]];
  297.             _loc3_.gotoAndPlay("E1");
  298.             _loc2_ = _loc2_ + 1;
  299.          }
  300.          trace("fin descente ");
  301.          trace("combien = " + (getTimer() - gTimer));
  302.          _loc5_._y = -63;
  303.          clearAllInterval("fin remplisBarre");
  304.          gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push(0);
  305.          testeReponseDone();
  306.       }
  307.    }
  308.    else
  309.    {
  310.       trace("M3 BUG DEJOUE remplisBarre !!!!!!!!");
  311.       clearAllInterval("BUG DEJOUE remplisBarre");
  312.    }
  313. }
  314. function reponseVirtuelle()
  315. {
  316.    if(gRemplisBarreOK == true)
  317.    {
  318.       if(gListeJoueurMixed[gJoueur - 1].Type == "VIRTUEL")
  319.       {
  320.          var _loc3_ = this["TABLEAU_M" + gManche];
  321.          trace("reponseVirtuelle");
  322.          trace("myClip0 = " + _loc3_);
  323.          trace("AV M3 IntervalVIRTUEL = " + IntervalVIRTUEL);
  324.          clearInterval(IntervalVIRTUEL);
  325.          trace("AP M3 IntervalVIRTUEL = " + IntervalVIRTUEL);
  326.          gBonneRep = false;
  327.          if(randomValue(0,100) < 95)
  328.          {
  329.             gRemplisBarreOK = undefined;
  330.             desactiveTOUT();
  331.             clearAllInterval("reponseVirtuelle");
  332.             if(randomValue(0,100) < 90)
  333.             {
  334.                var _loc4_ = gReponseOK.length;
  335.                gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push("A");
  336.                gBonneRep = true;
  337.                trace("reponseVirtuelle : bonne r├⌐ponse");
  338.             }
  339.             else
  340.             {
  341.                _loc4_ = randomValue(4,8);
  342.                gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push("B");
  343.                trace("reponseVirtuelle : mauvaise r├⌐ponse");
  344.             }
  345.             var _loc2_ = 1;
  346.             while(_loc2_ <= _loc4_)
  347.             {
  348.                _loc3_.texte_REPONSE.text += "*";
  349.                _loc2_ = _loc2_ + 1;
  350.             }
  351.             clearInterval(IntervalApresReponseVirtuelle);
  352.             gClicVirtuelOK = true;
  353.             trace("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% M3 creation Interval clicOkVirtuel");
  354.             IntervalApresReponseVirtuelle = setInterval(this,"clicOkVirtuel",1000);
  355.          }
  356.          else
  357.          {
  358.             trace("reponseVirtuelle : ne repondra pas");
  359.          }
  360.       }
  361.       else
  362.       {
  363.          trace("M3 REPONSEVIRTUELLE DETECTEE ALORS QUE JOUEUR REEL !!!!!!!!");
  364.          trace("AV M3 IntervalVIRTUEL = " + IntervalVIRTUEL);
  365.          clearInterval(IntervalVIRTUEL);
  366.          trace("AP M3 IntervalVIRTUEL = " + IntervalVIRTUEL);
  367.       }
  368.    }
  369.    else
  370.    {
  371.       trace("M3 BUG DEJOUE reponseVirtuelle !!!!!!!!");
  372.       clearAllInterval("reponseVirtuelle");
  373.    }
  374. }
  375. function clicOkVirtuel()
  376. {
  377.    if(gClicVirtuelOK == true)
  378.    {
  379.       gClicVirtuelOK = undefined;
  380.       trace("clicOkVirtuel M3");
  381.       trace("AV M3 IntervalApresReponseVirtuelle = " + IntervalApresReponseVirtuelle);
  382.       clearInterval(IntervalApresReponseVirtuelle);
  383.       trace("AP M3 IntervalApresReponseVirtuelle = " + IntervalApresReponseVirtuelle);
  384.       var _loc2_ = this["TABLEAU_M" + gManche];
  385.       var _loc4_ = _loc2_.BT_OK;
  386.       _loc4_.gotoAndPlay("E2");
  387.       joueBruitage({nomSon:"B_ROLL_OK"});
  388.       var _loc3_ = _loc2_.ZAP;
  389.       _loc3_.gotoAndPlay("E1");
  390.       gereTextes.masqueIB();
  391.       joueBruitage({nomSon:"B_LETTRE",actionFin:"testeReponseDone"});
  392.    }
  393.    else
  394.    {
  395.       trace("M3 BUG DEJOUE clicOkVirtuel !!!!!!!!");
  396.       clearInterval(IntervalApresReponseVirtuelle);
  397.    }
  398. }
  399. function initBT_OK()
  400. {
  401.    gKeyDown = undefined;
  402.    Key.addListener(KeyListener);
  403.    gBT_OKactif = true;
  404.    var myClip0 = this["TABLEAU_M" + gManche];
  405.    var _loc2_ = myClip0.BT_OK;
  406.    _loc2_._alpha = 100;
  407.    trace("myClip = " + _loc2_);
  408.    _loc2_.mc = myClip0;
  409.    _loc2_.onRollOver = function()
  410.    {
  411.       if(gDone == 0)
  412.       {
  413.          gereCursor(2);
  414.          this.gotoAndPlay("E2");
  415.          joueBruitage({nomSon:"B_ROLL_OK"});
  416.       }
  417.    };
  418.    _loc2_.onRollOut = function()
  419.    {
  420.       if(gDone == 0)
  421.       {
  422.          gereCursor(1);
  423.          this.gotoAndPlay("E1");
  424.          stopBruitage({nomSon:"B_ROLL_OK"});
  425.       }
  426.    };
  427.    _loc2_.onPress = function()
  428.    {
  429.       if(gDone == 0)
  430.       {
  431.          trace("REPONSE CLIC");
  432.          this.gotoAndPlay("E1");
  433.          trace("myClip0 = " + myClip0);
  434.          this.mc.texte_REPONSE.type = "dynamic";
  435.          this.mc.texte_REPONSE.editable = false;
  436.          gRemplisBarreOK = undefined;
  437.          clearAllInterval("CLIC BT_OK");
  438.          gereCursor(1);
  439.          stopBruitage({nomSon:"B_ROLL_OK"});
  440.          gDone = 1;
  441.          testeReponseM3(this.mc);
  442.       }
  443.    };
  444. }
  445. function testeReponseDone()
  446. {
  447.    var _loc2_ = this["TABLEAU_M" + gManche];
  448.    _loc2_.texte_REPONSE.text = gReponseOK;
  449.    if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
  450.    {
  451.       gListeJoueurMixed[gJoueur - 1].TempsReponse = getTimer() - gTimerJoueur;
  452.    }
  453.    var _loc4_ = this["JOUEUR_" + gJoueur].AVATAR;
  454.    var _loc3_ = this["BORNE_" + gJoueur].LETTRE;
  455.    var _loc6_ = this["BORNE_" + gJoueur].SCORE.texte_SCORE;
  456.    var _loc7_ = gListeJoueurMixed[gJoueur - 1].gListeReponseManche[gNoQuestion - 1];
  457.    trace("myClip0.texte_REPONSE.textColor = " + _loc2_.texte_REPONSE.textColor);
  458.    switch(_loc7_)
  459.    {
  460.       case 0:
  461.          _loc3_.gotoAndPlay("E2");
  462.          _loc4_.gotoAndPlay("E4");
  463.          joueBruitage({nomSon:"B_REPONSE_E",actionFin:"suiteReponse"});
  464.          break;
  465.       case "A":
  466.          _loc2_.texte_REPONSE.textColor = "0x0000FF";
  467.          gListeJoueurMixed[gJoueur - 1].Score += gValuePoint;
  468.          _loc6_.text = String(gListeJoueurMixed[gJoueur - 1].Score);
  469.          _loc3_.gotoAndPlay("E3");
  470.          var _loc5_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
  471.          _loc5_.text = "";
  472.          _loc4_.gotoAndPlay("E3");
  473.          joueBruitage({nomSon:"B_REPONSE_S",actionFin:"suiteReponse"});
  474.          break;
  475.       default:
  476.          _loc2_.texte_REPONSE.textColor = "0xFF0000";
  477.          _loc3_.gotoAndPlay("E4");
  478.          _loc5_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
  479.          _loc5_.text = "";
  480.          _loc4_.gotoAndPlay("E4");
  481.          joueBruitage({nomSon:"B_REPONSE_E",actionFin:"suiteReponse"});
  482.    }
  483. }
  484. function suiteReponse()
  485. {
  486.    var _loc4_ = this["TABLEAU_M" + gManche];
  487.    gRemplisBarreOK = undefined;
  488.    clearAllInterval("suiteReponse");
  489.    if(gNoQuestion < gListeNbQ_M[gManche - 1])
  490.    {
  491.       gNoQuestion += 1;
  492.       CAPITAINE.gotoAndPlay("E2");
  493.       joueSon({nomSon:"M" + gManche + "_Q" + gNoQuestion,actionFin:"lanceQuestion"});
  494.    }
  495.    else
  496.    {
  497.       trace("gJoueur = " + gJoueur);
  498.       trace("gListeJoueurMixed[gJoueur-1].gListeReponseManche = " + gListeJoueurMixed[gJoueur - 1].gListeReponseManche);
  499.       var _loc6_ = this["BORNE_" + gJoueur].BARIL;
  500.       _loc6_.gotoAndPlay("E1");
  501.       if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
  502.       {
  503.          this["BORNE_" + gJoueur].BARIL.PICTO_ORDI._visible = false;
  504.       }
  505.       _loc4_._visible = false;
  506.       var _loc3_ = this["BORNE_" + gJoueur].LETTRE;
  507.       _loc3_.gotoAndPlay("E1");
  508.       var _loc2_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
  509.       trace("myClip2 = " + _loc2_);
  510.       _loc2_.text = "";
  511.       if(gJoueur < gNbJoueurs_M[gManche - 1])
  512.       {
  513.          gJoueur += 1;
  514.          eteintJoueurs();
  515.          allumeJoueur();
  516.          _loc6_ = this["BORNE_" + gJoueur].BARIL;
  517.          _loc6_.gotoAndPlay("E2");
  518.          if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
  519.          {
  520.             this["BORNE_" + gJoueur].BARIL.PICTO_ORDI._visible = false;
  521.          }
  522.          _loc3_ = this["BORNE_" + gJoueur].LETTRE;
  523.          _loc3_.gotoAndPlay("E1");
  524.          _loc2_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
  525.          _loc2_.text = "";
  526.          gNoQuestion = 1;
  527.          CAPITAINE.gotoAndPlay("E2");
  528.          if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
  529.          {
  530.             var _loc5_ = "M" + gManche + "_01";
  531.          }
  532.          else
  533.          {
  534.             _loc5_ = "M" + gManche + "_01" + "_V";
  535.          }
  536.          joueSon({nomSon:_loc5_,actionFin:"initLanceManche"});
  537.       }
  538.       else
  539.       {
  540.          trace("fin manche");
  541.          _loc3_ = this["BORNE_" + gJoueur].LETTRE;
  542.          _loc3_.gotoAndPlay("E1");
  543.          _loc2_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
  544.          _loc2_.text = "";
  545.          classeJoueurs();
  546.       }
  547.    }
  548. }
  549. function classeJoueurs()
  550. {
  551.    var _loc27_ = undefined;
  552.    var _loc7_ = [];
  553.    var _loc16_ = 50;
  554.    var _loc6_ = [];
  555.    var _loc2_ = [];
  556.    var _loc17_ = 0;
  557.    var _loc24_ = [];
  558.    var _loc23_ = [];
  559.    var _loc11_ = 0;
  560.    while(_loc11_ < gNbJoueurs_M[gManche - 1])
  561.    {
  562.       if(gListeJoueurMixed[_loc11_].Score < _loc16_)
  563.       {
  564.          _loc7_ = [];
  565.          _loc7_.push(_loc11_);
  566.          _loc16_ = gListeJoueurMixed[_loc11_].Score;
  567.       }
  568.       else if(gListeJoueurMixed[_loc11_].Score == _loc16_)
  569.       {
  570.          _loc7_.push(_loc11_);
  571.       }
  572.       if(gListeJoueurMixed[_loc11_].Score > _loc17_)
  573.       {
  574.          _loc6_ = [];
  575.          _loc6_.push(_loc11_);
  576.          _loc17_ = gListeJoueurMixed[_loc11_].Score;
  577.       }
  578.       else if(gListeJoueurMixed[_loc11_].Score == _loc17_)
  579.       {
  580.          _loc6_.push(_loc11_);
  581.       }
  582.       trace("gListeJoueurMixed Joueur " + _loc11_ + " Score = " + gListeJoueurMixed[_loc11_].Score);
  583.       if(gListeJoueurMixed[_loc11_].Type == "REEL")
  584.       {
  585.          _loc24_.push(_loc11_);
  586.       }
  587.       else
  588.       {
  589.          _loc23_.push(_loc11_);
  590.       }
  591.       trace("gListeJoueurMixed Joueur " + _loc11_ + " Type = " + gListeJoueurMixed[_loc11_].Type);
  592.       _loc11_ = _loc11_ + 1;
  593.    }
  594.    trace("pScoreMin = " + _loc16_);
  595.    trace("pListePosMin = " + _loc7_);
  596.    trace("pListePosMax = " + _loc6_);
  597.    trace("pListeREEL = " + _loc24_);
  598.    trace("pListeVIRTUEL = " + _loc23_);
  599.    var _loc4_ = [];
  600.    var _loc15_ = [];
  601.    if(_loc6_.length > 1)
  602.    {
  603.       _loc11_ = 0;
  604.       while(_loc11_ < _loc6_.length)
  605.       {
  606.          if(gListeJoueurMixed[_loc6_[_loc11_]].Type == "REEL")
  607.          {
  608.             _loc4_.push(_loc6_[_loc11_]);
  609.          }
  610.          else
  611.          {
  612.             _loc15_.push(_loc6_[_loc11_]);
  613.          }
  614.          trace("gListeJoueurMixed MAX joueur " + [_loc6_[_loc11_]] + " Type = " + gListeJoueurMixed[_loc6_[_loc11_]].Type);
  615.          _loc11_ = _loc11_ + 1;
  616.       }
  617.       trace("pListePosMax _______________________ ");
  618.       trace("pListeREEL_MAX = " + _loc4_);
  619.       trace("pListeVIRTUEL_MAX = " + _loc15_);
  620.       if(_loc4_.length == 1)
  621.       {
  622.          gFirst = _loc4_[0];
  623.          _loc2_.push(_loc4_[0]);
  624.          trace("--- pListeOrdre MAX 1 = " + _loc2_);
  625.          var _loc12_ = _loc15_.length;
  626.          if(_loc12_ > 0)
  627.          {
  628.             var _loc9_ = 0;
  629.             while(_loc9_ < _loc12_)
  630.             {
  631.                _loc2_.push(_loc15_[_loc9_]);
  632.                trace("--- pListeOrdre MAX AJOUT VIRTUEL(S) 1 = " + _loc2_);
  633.                _loc9_ = _loc9_ + 1;
  634.             }
  635.          }
  636.       }
  637.       else
  638.       {
  639.          trace("test chrono");
  640.          var _loc21_ = 0;
  641.          var _loc22_ = 0;
  642.          _loc11_ = 0;
  643.          while(_loc11_ < _loc4_.length)
  644.          {
  645.             trace("pListeREEL[i] = " + _loc4_[_loc11_]);
  646.             trace("gListeJoueurMixed[pListeREEL_MAX[i]].TempsReponse = " + gListeJoueurMixed[_loc4_[_loc11_]].TempsReponse);
  647.             if(_loc21_ == 0)
  648.             {
  649.                _loc22_ = gListeJoueurMixed[_loc4_[_loc11_]].TempsReponse;
  650.                gFirst = _loc4_[_loc11_];
  651.                _loc2_.push(_loc4_[_loc11_]);
  652.                trace("--- pListeOrdre MAX 2= " + _loc2_);
  653.                _loc21_ = 1;
  654.             }
  655.             else if(gListeJoueurMixed[_loc4_[_loc11_]].TempsReponse < _loc22_)
  656.             {
  657.                gFirst = _loc4_[_loc11_];
  658.                _loc2_.splice(0,0,_loc4_[_loc11_]);
  659.                trace("--- pListeOrdre MAX 3 = " + _loc2_);
  660.             }
  661.             else
  662.             {
  663.                trace("getPos(pListeOrdre,gFirst)+1 = " + (getPos(_loc2_,gFirst) + 1));
  664.                _loc2_.push(_loc4_[_loc11_]);
  665.                trace("___ pListeOrdre MAX 5 = " + _loc2_);
  666.             }
  667.             _loc11_ = _loc11_ + 1;
  668.          }
  669.          _loc12_ = _loc15_.length;
  670.          if(_loc12_ > 0)
  671.          {
  672.             _loc9_ = 0;
  673.             while(_loc9_ < _loc12_)
  674.             {
  675.                _loc2_.push(_loc15_[_loc9_]);
  676.                trace("--- pListeOrdre MAX AJOUT VIRTUEL(S) 2 = " + _loc2_);
  677.                _loc9_ = _loc9_ + 1;
  678.             }
  679.          }
  680.       }
  681.    }
  682.    else
  683.    {
  684.       gFirst = _loc6_[0];
  685.       _loc2_.push(_loc6_[0]);
  686.       trace("--- pListeOrdre MAX 4 = " + _loc2_);
  687.    }
  688.    if(_loc2_.length < gNbJoueurs_M[gManche - 1])
  689.    {
  690.       var _loc5_ = [];
  691.       var _loc8_ = [];
  692.       if(_loc7_.length > 1)
  693.       {
  694.          _loc11_ = 0;
  695.          while(_loc11_ < _loc7_.length)
  696.          {
  697.             if(gListeJoueurMixed[_loc7_[_loc11_]].Type == "REEL")
  698.             {
  699.                _loc5_.push(_loc7_[_loc11_]);
  700.             }
  701.             else
  702.             {
  703.                _loc8_.push(_loc7_[_loc11_]);
  704.             }
  705.             trace("gListeJoueurMixed MIN joueur " + [_loc7_[_loc11_]] + " Type = " + gListeJoueurMixed[_loc7_[_loc11_]].Type);
  706.             _loc11_ = _loc11_ + 1;
  707.          }
  708.          trace("pListeREEL_MIN = " + _loc5_);
  709.          trace("pListeVIRTUEL_MIN = " + _loc8_);
  710.          if(_loc5_.length > 0)
  711.          {
  712.             trace("test chrono");
  713.             _loc21_ = 0;
  714.             _loc22_ = 0;
  715.             _loc11_ = 0;
  716.             while(_loc11_ < _loc5_.length)
  717.             {
  718.                trace("pListeREEL_MIN[i] = " + _loc5_[_loc11_]);
  719.                trace("gListeJoueurMixed[pListeREEL_MIN[i]].TempsReponse = " + gListeJoueurMixed[_loc5_[_loc11_]].TempsReponse);
  720.                if(_loc21_ == 0)
  721.                {
  722.                   _loc22_ = gListeJoueurMixed[_loc5_[_loc11_]].TempsReponse;
  723.                   gDer = _loc5_[_loc11_];
  724.                   _loc2_.push(_loc5_[_loc11_]);
  725.                   trace("___ pListeOrdre MIN 2 = " + _loc2_);
  726.                   _loc21_ = 1;
  727.                }
  728.                else if(gListeJoueurMixed[_loc5_[_loc11_]].TempsReponse > _loc22_)
  729.                {
  730.                   _loc2_.push(_loc5_[_loc11_]);
  731.                   trace("___ pListeOrdre MIN 3 = " + _loc2_);
  732.                   gDer = _loc5_[_loc11_];
  733.                }
  734.                else
  735.                {
  736.                   _loc2_.splice(getPos(_loc2_,gDer),0,_loc5_[_loc11_]);
  737.                   trace("___ pListeOrdre MIN 5 = " + _loc2_);
  738.                }
  739.                _loc11_ = _loc11_ + 1;
  740.             }
  741.             _loc27_ = true;
  742.             _loc12_ = _loc8_.length;
  743.             if(_loc12_ > 0)
  744.             {
  745.                _loc9_ = 0;
  746.                while(_loc9_ < _loc12_)
  747.                {
  748.                   _loc2_.push(_loc8_[_loc9_]);
  749.                   gDer = _loc8_[_loc9_];
  750.                   trace("--- pListeOrdre MIN AJOUT VIRTUEL(S) 2 = " + _loc2_);
  751.                   _loc9_ = _loc9_ + 1;
  752.                }
  753.             }
  754.          }
  755.          else if(_loc8_.length > 0)
  756.          {
  757.             var _loc10_ = 0;
  758.             while(_loc10_ < _loc8_.length)
  759.             {
  760.                gDer = _loc8_[_loc10_];
  761.                _loc2_.push(_loc8_[_loc10_]);
  762.                trace("___ pListeOrdre MIN 1 = " + _loc2_);
  763.                _loc10_ = _loc10_ + 1;
  764.             }
  765.          }
  766.       }
  767.       else
  768.       {
  769.          gDer = _loc7_[0];
  770.          _loc2_.push(_loc7_[0]);
  771.          trace("___ pListeOrdre MIN 4 = " + _loc2_);
  772.       }
  773.    }
  774.    else
  775.    {
  776.       gDer = _loc2_[_loc2_.length - 1];
  777.       _loc27_ = true;
  778.    }
  779.    trace("gDer = " + gDer);
  780.    trace("gListeJoueurMixed[gDer].Score = " + gListeJoueurMixed[gDer].Score);
  781.    trace("AJOUT ");
  782.    _loc11_ = 0;
  783.    while(_loc11_ < gNbJoueurs_M[gManche - 1])
  784.    {
  785.       var _loc13_ = getPos(_loc2_,_loc11_);
  786.       trace("pListeOrdre = " + _loc2_);
  787.       trace("i = " + _loc11_);
  788.       trace("pPos = " + _loc13_);
  789.       if(_loc13_ == -1)
  790.       {
  791.          _loc12_ = _loc2_.length;
  792.          trace("pLength = " + _loc12_);
  793.          var _loc3_ = 0;
  794.          while(_loc3_ < _loc12_)
  795.          {
  796.             trace("gListeJoueurMixed[i].Score = " + gListeJoueurMixed[_loc11_].Score);
  797.             trace("j = " + _loc3_);
  798.             trace("pListeOrdre[j] = " + _loc2_[_loc3_]);
  799.             trace("gListeJoueurMixed[pListeOrdre[j]].Score = " + gListeJoueurMixed[_loc2_[_loc3_]].Score);
  800.             if(gListeJoueurMixed[_loc11_].Score >= gListeJoueurMixed[_loc2_[_loc3_]].Score)
  801.             {
  802.                _loc2_.splice(_loc3_,0,_loc11_);
  803.                trace("___ pListeOrdre AJOUT = " + _loc2_);
  804.                break;
  805.             }
  806.             _loc3_ = _loc3_ + 1;
  807.          }
  808.       }
  809.       _loc11_ = _loc11_ + 1;
  810.    }
  811.    trace("pListePosMin = " + _loc7_);
  812.    trace("pListePosMax = " + _loc6_);
  813.    trace("+++ pListeOrdre = " + _loc2_);
  814.    trace("gDer = " + gDer);
  815.    trace("gFirst = " + gFirst);
  816.    _loc11_ = 0;
  817.    while(_loc11_ < gNbJoueurs_M[gManche - 1])
  818.    {
  819.       var _loc14_ = this["JOUEUR_" + (_loc11_ + 1)].AVATAR;
  820.       var _loc19_ = this["BORNE_" + (_loc11_ + 1)].LETTRE;
  821.       _loc19_.gotoAndPlay("E1");
  822.       var _loc18_ = this["BORNE_" + (_loc11_ + 1)].LETTRE.texte_LETTRE;
  823.       var _loc20_ = this["BORNE_" + (_loc11_ + 1)].BARIL;
  824.       _loc18_.text = "";
  825.       if(_loc11_ !== gDer)
  826.       {
  827.          _loc14_.gotoAndPlay("E5");
  828.          _loc20_.gotoAndPlay("E3");
  829.       }
  830.       else
  831.       {
  832.          _loc14_.gotoAndPlay("E6");
  833.       }
  834.       if(gListeJoueurMixed[_loc11_].Type == "REEL")
  835.       {
  836.          this["BORNE_" + (_loc11_ + 1)].BARIL.PICTO_ORDI._visible = false;
  837.       }
  838.       _loc11_ = _loc11_ + 1;
  839.    }
  840.    eteintJoueurs();
  841.    var _loc26_ = 0;
  842.    var _loc25_ = 0;
  843.    _loc11_ = 0;
  844.    while(_loc11_ < gNbJoueurs_M[gManche - 1])
  845.    {
  846.       trace("gListeJoueurMixed[i].Type = " + gListeJoueurMixed[_loc11_].Type);
  847.       if(gListeJoueurMixed[_loc11_].Type == "VIRTUEL")
  848.       {
  849.          _loc26_ += 1;
  850.       }
  851.       else
  852.       {
  853.          _loc25_ += 1;
  854.       }
  855.       _loc11_ = _loc11_ + 1;
  856.    }
  857.    if(_loc25_ == 2)
  858.    {
  859.       if(_loc27_ == true)
  860.       {
  861.          var _loc28_ = "M" + gManche + "_C2_S3";
  862.       }
  863.       else
  864.       {
  865.          _loc28_ = "M" + gManche + "_C2_S2";
  866.       }
  867.       CAPITAINE.gotoAndPlay("E3");
  868.       joueSon({nomSon:_loc28_,actionFin:"finManche"});
  869.    }
  870.    else
  871.    {
  872.       if(gListeJoueurMixed[gFirst].Type == "VIRTUEL")
  873.       {
  874.          _loc28_ = "M" + gManche + "_C1_E";
  875.          CAPITAINE.gotoAndPlay("E4");
  876.       }
  877.       else
  878.       {
  879.          _loc28_ = "M" + gManche + "_C1_S1";
  880.          CAPITAINE.gotoAndPlay("E3");
  881.       }
  882.       joueSon({nomSon:_loc28_,actionFin:"finManche"});
  883.    }
  884. }
  885. function finManche()
  886. {
  887.    if(gTypePartie == 1)
  888.    {
  889.       var _loc2_ = 0;
  890.       while(_loc2_ < gNbJoueurs_M[gManche - 1])
  891.       {
  892.          if(gListeJoueurMixed[_loc2_].Type == "REEL")
  893.          {
  894.             coupeBruitPerso(_loc2_);
  895.          }
  896.          _loc2_ = _loc2_ + 1;
  897.       }
  898.    }
  899.    this["JOUEUR_" + gJoueur].AVATAR.gotoAndPlay("E1");
  900.    CAPITAINE.gotoAndPlay("E1");
  901.    gManche += 1;
  902.    gotoAndPlay("TRANSIT_0" + gManche);
  903.    var _loc6_ = MC_SUCCES;
  904.    var _loc3_ = gListeJoueurMixed[gFirst];
  905.    MC_SUCCES.AVATAR.gotoAndPlay("A" + _loc3_.Avatar);
  906.    gTypepartie = 1;
  907.    gFin = 1;
  908.    MC_SUCCES.pseudo.text = _loc3_.Pseudo;
  909.    joueBruitage({nomSon:"B_JINGLE_04",actionFin:"finPartie"});
  910. }
  911. function desinitBT_OK()
  912. {
  913.    Key.removeListener(KeyListener);
  914.    gBT_OKactif = undefined;
  915.    var _loc3_ = this["TABLEAU_M" + gManche];
  916.    var _loc2_ = _loc3_.BT_OK;
  917.    _loc2_.gotoAndPlay("E1");
  918.    _loc2_._alpha = 50;
  919.    desactiveClip(_loc2_);
  920. }
  921. function remplisIndice()
  922. {
  923.    if(gRemplisBarreOK == true)
  924.    {
  925.       var _loc2_ = this["TABLEAU_M" + gManche];
  926.       gIndice += 1;
  927.       gValuePoint = 4 - gIndice;
  928.       var _loc6_ = _loc2_["INDICE_" + gimme2digits(gIndice)];
  929.       var _loc7_ = _loc2_["texte_LMI" + gimme2digits(gIndice)];
  930.       _loc6_._visible = true;
  931.       gereTextes.afficheLM({mc:_loc2_,codeLM:"LM_I" + gimme2digits(gQuestionNum) + gList_ABC[gIndice - 1],numR:gimme2digits(gIndice)});
  932.       var _loc3_ = _loc2_["LM_I" + gimme2digits(gQuestionNum) + gList_ABC[gIndice - 1]];
  933.       var _loc5_ = 30;
  934.       if(_loc3_.LM.texte._height < _loc5_)
  935.       {
  936.          _loc3_._y += _loc3_.LM.texte._height / 2 - 5;
  937.       }
  938.       var _loc4_ = _loc2_.POINT.texte_POINT;
  939.       _loc4_.text = String(Number(_loc4_.text) - 1);
  940.       CAPITAINE.gotoAndPlay("E2");
  941.       joueSon({nomSon:"M3_INDICE_" + gimme2digits(gIndice),zapBlock:"NOZAP_NOBLOCK",actionFin:"finSonDEB"});
  942.       if(gIndice == 3)
  943.       {
  944.          trace("3eme indice done");
  945.          trace("AV M3 IntervalIndice = " + IntervalIndice);
  946.          clearInterval(IntervalIndice);
  947.          trace("AP M3 IntervalIndice = " + IntervalIndice);
  948.       }
  949.    }
  950.    else
  951.    {
  952.       trace("M3 BUG DEJOUE remplisIndice !!!!!!!!");
  953.       clearAllInterval("remplisIndice");
  954.    }
  955. }
  956. function desactiveTOUT()
  957. {
  958.    desinitBT_OK();
  959.    Key.removeListener(KeyListener);
  960.    var _loc4_ = this["TABLEAU_M" + gManche];
  961.    _loc4_.texte_REPONSE.selectable = false;
  962.    _loc4_.texte_REPONSE.type = "dynamic";
  963.    _loc4_.texte_REPONSE.editable = false;
  964.    var _loc5_ = _loc4_.ZAP;
  965.    desactiveClip(_loc5_);
  966.    var _loc2_ = 0;
  967.    while(_loc2_ < gListeReponse.length)
  968.    {
  969.       var _loc3_ = _loc4_["REPONSE_" + gimme2digits(_loc2_ + 1)];
  970.       desactiveClip(_loc3_);
  971.       _loc2_ = _loc2_ + 1;
  972.    }
  973.    _loc5_ = _loc4_.ZAP;
  974.    desactiveClip(_loc3_);
  975. }
  976. function initAfficheManche()
  977. {
  978.    this["BORNE_" + gJoueur].BARIL.gotoAndPlay("E2");
  979.    if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
  980.    {
  981.       this["BORNE_" + gJoueur].BARIL.PICTO_ORDI._visible = false;
  982.    }
  983.    lanceQuestion();
  984. }
  985. function initLanceManche()
  986. {
  987.    coupeBruitPerso();
  988.    this["JOUEUR_" + gJoueur].AVATAR.gotoAndPlay("E2");
  989.    if(gJoueur > 1)
  990.    {
  991.       if(gListeJoueurMixed[gJoueur - 2].Type == "REEL")
  992.       {
  993.          coupeBruitPerso(gJoueur - 2);
  994.       }
  995.       this["JOUEUR_" + (gJoueur - 1)].AVATAR.gotoAndPlay("E1");
  996.    }
  997.    CAPITAINE.gotoAndPlay("E1");
  998.    var _loc4_ = this["TABLEAU_M" + gManche];
  999.    gWidthTexteReponse = _loc4_.texte_REPONSE._width;
  1000.    trace("gWidthTexteReponse = " + gWidthTexteReponse);
  1001.    var _loc2_ = 1;
  1002.    while(_loc2_ <= 5)
  1003.    {
  1004.       var _loc3_ = _loc4_["ROND_" + _loc2_];
  1005.       if(_loc2_ <= gListeNbQ_M[gManche - 1])
  1006.       {
  1007.          _loc3_.gotoAndPlay("E1");
  1008.       }
  1009.       else
  1010.       {
  1011.          _loc3_._visible = false;
  1012.       }
  1013.       _loc2_ = _loc2_ + 1;
  1014.    }
  1015.    gListeJoueurMixed[gJoueur - 1].gListeReponseManche = [];
  1016.    gListeJoueurMixed[gJoueur - 1].gListePosReponseManche = [];
  1017.    gListeJoueurMixed[gJoueur - 1].gListeTirageReponseManche = [];
  1018.    initAfficheManche();
  1019. }
  1020. KeyListener = new Object();
  1021. KeyListener.onKeyDown = function()
  1022. {
  1023.    if(gKeyDown == undefined)
  1024.    {
  1025.       var _loc0_ = null;
  1026.       if((_loc0_ = Key.getCode()) === 13)
  1027.       {
  1028.          if(gDone == 0)
  1029.          {
  1030.             gDone = 1;
  1031.             trace("REPONSE ENTER");
  1032.             gRemplisBarreOK = undefined;
  1033.             clearAllInterval("keyDown");
  1034.             gereCursor(1);
  1035.             var _loc2_ = _root["TABLEAU_M" + gManche];
  1036.             _loc2_.texte_REPONSE.selectable = false;
  1037.             _loc2_.texte_REPONSE.type = "dynamic";
  1038.             _loc2_.texte_REPONSE.editable = false;
  1039.             testeReponseM3(_loc2_);
  1040.          }
  1041.       }
  1042.    }
  1043. };
  1044. KeyListener.onKeyUp = function()
  1045. {
  1046.    gKeyDown = undefined;
  1047. };
  1048.