home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 136 / MOBICLIC136.ISO / pc / DATA / ENG136 / ENG136_00 / ENG136_00.swf / scripts / frame_1 / DoAction.as
Text File  |  2011-07-20  |  49KB  |  1,908 lines

  1. function initKeyPause()
  2. {
  3.    gPauseOn = 0;
  4.    gPauseSpaceOn = 0;
  5.    gPauseSpaceEnCours = 0;
  6. }
  7. function initGen()
  8. {
  9.    this._lockroot = true;
  10.    gClipGen = this;
  11.    Stage.showMenu = false;
  12.    gLangue = "FR";
  13.    gMusicOn = 1;
  14.    gSousTitre = 0;
  15.    gST = 0;
  16.    gVolume = 100;
  17.    gWidth = moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.width;
  18.    gHeight = moduleInfo.returnNodeByPath("BackOffice").firstChild.attributes.height;
  19.    if(gWidth == undefined)
  20.    {
  21.       gWidth = 800;
  22.    }
  23.    else
  24.    {
  25.       gWidth = Number(gWidth);
  26.    }
  27.    if(gHeight == undefined)
  28.    {
  29.       gHeight = 600;
  30.    }
  31.    else
  32.    {
  33.       gHeight = Number(gHeight);
  34.    }
  35.    initKeyPause();
  36. }
  37. function testeDebutCommentSpecial()
  38. {
  39.    switch(gCommentOn.id.split("_")[gCommentOn.id.split("_").length - 1])
  40.    {
  41.       case "bz":
  42.       case "BZ":
  43.          trace("-------  BZ on-----------");
  44.          DesactiveOEIL();
  45.          if(BT_OEIL.gEtat !== 3)
  46.          {
  47.             trace("E3");
  48.             BT_OEIL.gotoAndPlay("E3");
  49.          }
  50.          else
  51.          {
  52.             trace("PARLE");
  53.             BT_OEIL.OEIL_P.gotoAndPlay("parle");
  54.          }
  55.          break;
  56.       case "ze":
  57.       case "ZE":
  58.          trace("-------  ZE on-----------");
  59.          DesactiveOEIL();
  60.          if(BT_OEIL.gEtat !== 3)
  61.          {
  62.             BT_OEIL.gotoAndPlay("E3");
  63.          }
  64.          else
  65.          {
  66.             BT_OEIL.OEIL_P.gotoAndPlay("parle");
  67.          }
  68.          afficherRolls();
  69.    }
  70. }
  71. function testeFinCommentSpecial()
  72. {
  73.    switch(gCommentOn.id.split("_")[gCommentOn.id.split("_").length - 1])
  74.    {
  75.       case "bz":
  76.       case "BZ":
  77.          trace("-------  BZ off-----------");
  78.          ActiveOEIL();
  79.          BT_OEIL.OEIL_P.gotoAndPlay("rentre");
  80.          BT_OEIL.gClicOn = undefined;
  81.          break;
  82.       case "ze":
  83.       case "ZE":
  84.          trace("-------  ZE off-----------");
  85.          ActiveOEIL();
  86.          BT_OEIL.OEIL_P.gotoAndPlay("rentre");
  87.          BT_OEIL.gClicOn = undefined;
  88.          masquerRolls();
  89.    }
  90. }
  91. function stopComment()
  92. {
  93.    if(gCommentOn !== undefined)
  94.    {
  95.       testeFinCommentSpecial();
  96.       delete gCommentOn.onSoundComplete;
  97.       gCommentOn.stop();
  98.       gCommentOn = undefined;
  99.       if(gPauseOn == undefined || gPauseOn == 0)
  100.       {
  101.          removeMovieClip("mcClicZap");
  102.       }
  103.       gBlockST = undefined;
  104.       gereTextes.masqueST();
  105.       if(gClipTarget !== undefined)
  106.       {
  107.          gClipTarget.gotoAndStop(gClipTargetLabel);
  108.          gClipTarget = undefined;
  109.          gClipTargetLabel = undefined;
  110.       }
  111.    }
  112. }
  113. function pauseComment()
  114. {
  115.    trace("pauseComment " + gCommentOn);
  116.    if(gCommentOn !== undefined)
  117.    {
  118.       gCommentOn.stop();
  119.       mcClicZap._visible = false;
  120.    }
  121. }
  122. function continueComment()
  123. {
  124.    trace("continueComment " + gCommentOn);
  125.    if(gCommentOn !== undefined)
  126.    {
  127.       gCommentOn.start(gCommentOn.position / 1000);
  128.       mcClicZap._visible = true;
  129.    }
  130. }
  131. function joueSon(p)
  132. {
  133.    var _loc4_ = p.nomSon;
  134.    gSoundString = _loc4_;
  135.    if(p.mc !== undefined)
  136.    {
  137.       gClipRef = p.mc;
  138.    }
  139.    else
  140.    {
  141.       gClipRef = _root;
  142.    }
  143.    trace("p.mc" + p.mc);
  144.    if(p.zapBlock !== undefined)
  145.    {
  146.       gClicZap = p.zapBlock;
  147.    }
  148.    else
  149.    {
  150.       gClicZap = "ZAP_BLOCK";
  151.    }
  152.    if(p.actionFin !== undefined)
  153.    {
  154.       gActionFinSon = p.actionFin;
  155.    }
  156.    else
  157.    {
  158.       gActionFinSon = "PLAY";
  159.    }
  160.    stopComment();
  161.    if(p.mcCible !== undefined)
  162.    {
  163.       if(typeof p.mcCible == "movieclip")
  164.       {
  165.          gClipTarget = p.mcCible;
  166.       }
  167.       else
  168.       {
  169.          gClipTarget = gClipRef[p.mcCible];
  170.       }
  171.       if(p.mcLabelOut !== undefined)
  172.       {
  173.          gClipTargetLabel = p.mcLabelOut;
  174.       }
  175.       else
  176.       {
  177.          gClipTargetLabel = gClipTarget._currentframe;
  178.       }
  179.       if(p.mcLabelIn !== undefined)
  180.       {
  181.          gClipTarget.gotoAndPlay(p.mcLabelIn);
  182.       }
  183.       else
  184.       {
  185.          gClipTarget.gotoAndPlay("parle");
  186.       }
  187.    }
  188.    gCommentName = "S_" + gLangue + "_" + gModuleName + "_";
  189.    if(soundObjects[gCommentName + _loc4_] == undefined)
  190.    {
  191.       gCommentName = "S_" + gLangue + "_";
  192.    }
  193.    trace("joueSon " + gCommentName + _loc4_);
  194.    mySound = soundObjects[gCommentName + _loc4_];
  195.    if(mySound !== undefined)
  196.    {
  197.       gCommentOn = mySound;
  198.       gCommentOn.p = p;
  199.       gCommentOn.id = gCommentName + _loc4_;
  200.       testeDebutCommentSpecial();
  201.       if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
  202.       {
  203.          soundObjects[gMusic].setVolume(gVolume * 40 / 100);
  204.       }
  205.       mySound.setVolume(gVolume);
  206.       if(gCommentOnPausePos !== undefined)
  207.       {
  208.          mySound.start(gCommentOnPausePos / 1000);
  209.          gCommentOnPause = undefined;
  210.          gCommentOnPausePos = undefined;
  211.       }
  212.       else
  213.       {
  214.          mySound.start();
  215.       }
  216.    }
  217.    else
  218.    {
  219.       trace("______" + getSoundByID(gCommentName + _loc4_) + gCommentName);
  220.       var _loc5_ = getSoundByID(gCommentName + _loc4_);
  221.       if(_loc5_ !== undefined)
  222.       {
  223.          mySound = new Sound();
  224.          mySound.onLoad = function(success)
  225.          {
  226.             if(success)
  227.             {
  228.                if(gCommentOnPausePos !== undefined)
  229.                {
  230.                   mySound.start(gCommentOnPausePos / 1000);
  231.                   gCommentOnPause = undefined;
  232.                   gCommentOnPausePos = undefined;
  233.                }
  234.                else
  235.                {
  236.                   mySound.start();
  237.                }
  238.             }
  239.          };
  240.          mySound.loadSound(this.gModulePath + _loc5_.attributes.src,true);
  241.          gCommentOn = mySound;
  242.          gCommentOn.p = p;
  243.          gCommentOn.id = gCommentName + _loc4_;
  244.          testeDebutCommentSpecial();
  245.          if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
  246.          {
  247.             soundObjects[gMusic].setVolume(gVolume * 40 / 100);
  248.          }
  249.       }
  250.    }
  251.    if(mySound == undefined)
  252.    {
  253.       return undefined;
  254.    }
  255.    mySound.onSoundComplete = commentFini;
  256.    if(gClicZap !== "NOZAP_NOBLOCK")
  257.    {
  258.       trace("creerRectangle " + creerRectangle + " " + gHeight + " " + gWidth);
  259.       mcClicZap = creerRectangle({nom:"mcClicZap",pere:_root,level:15000,width:gWidth,height:gHeight,x:0,y:0,alpha:0});
  260.       switch(gClicZap.split("_")[0])
  261.       {
  262.          case "ZAP":
  263.             mcClicZap.useHandCursor = false;
  264.             mcClicZap.onPress = function()
  265.             {
  266.                trace("clic zap son");
  267.                stopSon();
  268.             };
  269.             break;
  270.          case "NOZAP":
  271.             mcClicZap.useHandCursor = false;
  272.             mcClicZap.onPress = function()
  273.             {
  274.                trace("no clic allowed");
  275.             };
  276.       }
  277.       mcClicZap._visible = true;
  278.    }
  279.    if(gST == 1 && gBlockST == undefined)
  280.    {
  281.       gereTextes.afficheST(gCommentName + _loc4_);
  282.    }
  283. }
  284. function creerClicZap(p)
  285. {
  286.    if(_global.mcClicZap2 != undefined)
  287.    {
  288.       removeMovieClip(_root.mcClicZap2);
  289.    }
  290.    var _loc0_ = null;
  291.    var _loc4_ = _global.mcClicZap2 = creerRectangle({nom:"mcClicZap2",pere:_root,level:15001,width:gWidth,height:gHeight,x:0,y:0,alpha:0});
  292.    _loc4_.p = p;
  293.    _loc4_.useHandCursor = false;
  294.    _loc4_.onPress = function()
  295.    {
  296.       trace("clic zap " + this.p);
  297.       this.p.retour.call(this.p.ecouteur);
  298.       removeMovieClip(this);
  299.       _global.mcClicZap2 = undefined;
  300.    };
  301.    _loc4_._visible = true;
  302. }
  303. function creerRectangle(p)
  304. {
  305.    var _loc15_ = p.x != undefined ? p.x : 0;
  306.    var _loc13_ = p.y != undefined ? p.y : 0;
  307.    if(p.w != undefined)
  308.    {
  309.       var _loc16_ = p.w;
  310.    }
  311.    else if(p.width != undefined)
  312.    {
  313.       _loc16_ = p.width;
  314.    }
  315.    if(p.h != undefined)
  316.    {
  317.       var _loc14_ = p.h;
  318.    }
  319.    else if(p.height != undefined)
  320.    {
  321.       _loc14_ = p.height;
  322.    }
  323.    var _loc11_ = p.pere != undefined ? p.pere : _root;
  324.    var _loc9_ = p.level != undefined ? p.level : 10;
  325.    var _loc12_ = p.couleur != undefined ? p.couleur : 0;
  326.    var _loc10_ = p.nom != undefined ? p.nom : "ClipSansNom";
  327.    var _loc4_ = p.courbure != undefined ? p.courbure : 0;
  328.    var _loc17_ = p.alpha != undefined ? p.alpha : 100;
  329.    var _loc7_ = 0;
  330.    var _loc8_ = 0;
  331.    var _loc6_ = _loc16_;
  332.    var _loc5_ = _loc14_;
  333.    trace(_loc6_ + " " + _loc5_);
  334.    var _loc3_ = _loc11_.createEmptyMovieClip(_loc10_,_loc9_);
  335.    _loc3_.beginFill(_loc12_,_loc17_);
  336.    _loc3_.moveTo(_loc7_,_loc5_ - _loc4_);
  337.    _loc3_.lineTo(_loc7_,_loc8_ + _loc4_);
  338.    _loc3_.curveTo(_loc7_,_loc8_,_loc7_ + _loc4_,_loc8_);
  339.    _loc3_.lineTo(_loc6_ - _loc4_,_loc8_);
  340.    _loc3_.curveTo(_loc6_,_loc8_,_loc6_,_loc8_ + _loc4_);
  341.    _loc3_.lineTo(_loc6_,_loc5_ - _loc4_);
  342.    _loc3_.curveTo(_loc6_,_loc5_,_loc6_ - _loc4_,_loc5_);
  343.    _loc3_.lineTo(_loc7_ + _loc4_,_loc5_);
  344.    _loc3_.curveTo(_loc7_,_loc5_,_loc7_,_loc5_ - _loc4_);
  345.    _loc3_.endFill();
  346.    _loc3_._x = _loc15_;
  347.    _loc3_._y = _loc13_;
  348.    return _loc3_;
  349. }
  350. function stopSon()
  351. {
  352.    gCommentOn.stop();
  353.    commentFini();
  354. }
  355. function commentFini()
  356. {
  357.    testeFinCommentSpecial();
  358.    if(gClicZap !== "NOZAP_NOBLOCK")
  359.    {
  360.       removeMovieClip("mcClicZap");
  361.    }
  362.    gCommentOn = undefined;
  363.    gBlockST = undefined;
  364.    gereTextes.masqueST();
  365.    if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
  366.    {
  367.       soundObjects[gMusic].setVolume(gVolume);
  368.    }
  369.    if(gClipTarget !== undefined)
  370.    {
  371.       gClipTarget.gotoAndStop(gClipTargetLabel);
  372.       gClipTarget = undefined;
  373.       gClipTargetLabel = undefined;
  374.    }
  375.    switch(gActionFinSon)
  376.    {
  377.       case "RIEN":
  378.          break;
  379.       case "PLAY":
  380.          if(_root.gNextLabel == undefined)
  381.          {
  382.             if(gLineaireOn != undefined)
  383.             {
  384.                if((_loc0_ = gLineaireOn) !== "_")
  385.                {
  386.                   lSonSuivant = gLineaireOn + gimme2digits(Number(gSoundString.split("_")[gSoundString.split("_").length - 1]) + 1);
  387.                   lLabel = lSonSuivant;
  388.                }
  389.                else
  390.                {
  391.                   lSonSuivant = gimme2digits(Number(gSoundString.split("_")[gSoundString.split("_").length - 1]) + 1);
  392.                   lLabel = gLineaireOn + lSonSuivant;
  393.                }
  394.                joueSon({mc:gClipRef,nomSon:lSonSuivant,zapBlock:gClicZap,actionFin:gActionFinSon});
  395.                gClipRef.gotoAndStop(lLabel);
  396.             }
  397.             else
  398.             {
  399.                gClipRef.play();
  400.             }
  401.          }
  402.          else
  403.          {
  404.             gClipRef.gotoAndPlay(_root.gNextLabel);
  405.             _root.gNextLabel = undefined;
  406.             gLineaireOn = undefined;
  407.          }
  408.          break;
  409.       default:
  410.          _root[gActionFinSon]();
  411.    }
  412. }
  413. function joueBruitage(p)
  414. {
  415.    var _loc2_ = soundObjects[gBruitageName + p.nomSon];
  416.    if(gListeBruitage == undefined)
  417.    {
  418.       gListeBruitage = [];
  419.       gListeA_fin_Bruitage = [];
  420.       gListeLoop_Bruitage = [];
  421.    }
  422.    _loc2_.setVolume(gVolume);
  423.    _loc2_.id = p.nomSon;
  424.    gListeBruitage.push(_loc2_.id);
  425.    if(p.actionFin !== undefined)
  426.    {
  427.       gActionFinBruitage = p.actionFin;
  428.       gListeA_fin_Bruitage.push(gActionFinBruitage);
  429.    }
  430.    else
  431.    {
  432.       gActionFinBruitage = undefined;
  433.       gListeA_fin_Bruitage.push("");
  434.    }
  435.    _loc2_.p = p;
  436.    _loc2_.onSoundComplete = mx.utils.Delegate.create(_loc2_,finBruitage);
  437.    if(p.loopSon == undefined)
  438.    {
  439.       _loc2_.start(p.offset);
  440.       gListeLoop_Bruitage.push("");
  441.    }
  442.    else
  443.    {
  444.       _loc2_.start(p.offset,p.loopSon);
  445.       gListeLoop_Bruitage.push(p.loopSon);
  446.    }
  447. }
  448. function stopBruitage(p)
  449. {
  450.    trace("STOP BRUITAGE");
  451.    var _loc1_ = soundObjects[gBruitageName + p.nomSon];
  452.    finBruitage(p.nomSon);
  453.    _loc1_.stop();
  454. }
  455. function finBruitage(lSon)
  456. {
  457.    if(lSon == undefined)
  458.    {
  459.       lSon = this.id;
  460.    }
  461.    if(gListeBruitage !== undefined)
  462.    {
  463.       if(getPos(gListeBruitage,lSon) !== -1)
  464.       {
  465.          if(gListeA_fin_Bruitage[getPos(gListeBruitage,lSon)] !== "")
  466.          {
  467.             if(typeof gListeA_fin_Bruitage[getPos(gListeBruitage,lSon)] == "string")
  468.             {
  469.                gClipGen[gListeA_fin_Bruitage[getPos(gListeBruitage,lSon)]]();
  470.             }
  471.             else
  472.             {
  473.                gListeA_fin_Bruitage[getPos(gListeBruitage,lSon)].call(this.p.MC);
  474.             }
  475.          }
  476.          gListeA_fin_Bruitage.splice(getPos(gListeBruitage,lSon),1);
  477.          gListeLoop_Bruitage.splice(getPos(gListeBruitage,lSon),1);
  478.          gListeBruitage.splice(getPos(gListeBruitage,lSon),1);
  479.          if(gListeBruitage.length == 0)
  480.          {
  481.             gListeBruitage = undefined;
  482.             gListeA_fin_Bruitage = undefined;
  483.             gListeLoop_Bruitage = undefined;
  484.          }
  485.       }
  486.    }
  487. }
  488. function getPos(myList, myValue)
  489. {
  490.    lPresent = -1;
  491.    maPosition = 0;
  492.    while(maPosition <= myList.length)
  493.    {
  494.       if(myList[maPosition] == myValue)
  495.       {
  496.          lPresent = maPosition;
  497.          break;
  498.       }
  499.       maPosition++;
  500.    }
  501.    return lPresent;
  502. }
  503. function trouvePosMax(myList)
  504. {
  505.    lMax = myList[0];
  506.    lPosMax = 0;
  507.    i = 1;
  508.    while(i <= myList.length)
  509.    {
  510.       if(myList[i] > lMax)
  511.       {
  512.          lMax = myList[i];
  513.          lPosMax = i;
  514.       }
  515.       i++;
  516.    }
  517.    return lPosMax;
  518. }
  519. function duplicate(myList)
  520. {
  521.    newList = [];
  522.    i = 0;
  523.    while(i <= myList.length - 1)
  524.    {
  525.       newList.push(myList[i]);
  526.       i++;
  527.    }
  528.    return newList;
  529. }
  530. function randomiseList(myList)
  531. {
  532.    var _loc3_ = duplicate(myList);
  533.    var _loc4_ = [];
  534.    var _loc5_ = _loc3_.length;
  535.    var _loc2_ = 0;
  536.    while(_loc2_ < _loc5_)
  537.    {
  538.       var _loc1_ = randomValue(0,_loc3_.length - 1);
  539.       _loc4_.push(_loc3_[_loc1_]);
  540.       _loc3_.splice(_loc1_,1);
  541.       _loc2_ = _loc2_ + 1;
  542.    }
  543.    return _loc4_;
  544. }
  545. function returnNodeByPathRandomise(nodeSent)
  546. {
  547.    var _loc4_ = new XML();
  548.    var _loc5_ = nodeSent.childNodes.length;
  549.    var _loc1_ = 0;
  550.    while(_loc1_ < _loc5_)
  551.    {
  552.       var _loc2_ = randomValue(0,nodeSent.childNodes.length - 1);
  553.       _loc4_.appendChild(nodeSent.childNodes[_loc2_]);
  554.       _loc1_ = _loc1_ + 1;
  555.    }
  556.    return _loc4_;
  557. }
  558. function zapIntro(myLabel)
  559. {
  560.    mcClicZapIntro = this.createEmptyMovieClip("mcClicZapIntro",16031);
  561.    mcClicZapIntro.attachMovie("ClipInvisible","ClipInvisible",2);
  562.    mcClicZapIntro._width = gClipGen._width;
  563.    mcClicZapIntro._height = gClipGen._height;
  564.    mcClicZapIntro._x = 0;
  565.    mcClicZapIntro._y = 0;
  566.    mcClicZapIntro.useHandCursor = false;
  567.    mcClicZapIntro.onPress = function()
  568.    {
  569.       trace("clic zappIntro " + this);
  570.       stopComment();
  571.       gotoAndPlay(myLabel);
  572.       removeZapIntro();
  573.    };
  574. }
  575. function removeZapIntro()
  576. {
  577.    trace("mcClicZapIntrO " + mcClicZapIntro._name + " " + this);
  578.    if(mcClicZapIntro._x != undefined)
  579.    {
  580.       trace("suppression");
  581.       removeMovieClip(mcClicZapIntro);
  582.    }
  583. }
  584. function onMcOut(myMc)
  585. {
  586.    gereCursor(1);
  587.    if(myMc.pLabelOut == undefined)
  588.    {
  589.       myMc.gotoAndPlay("E1");
  590.    }
  591.    else
  592.    {
  593.       myMc.gotoAndPlay(myMc.pLabelOut);
  594.    }
  595.    if(myMc.pSon.split("")[0] == "B")
  596.    {
  597.       stopBruitage({nomSon:myMc.pSon});
  598.    }
  599.    else
  600.    {
  601.       stopComment();
  602.    }
  603.    if(myMc.pIB !== undefined)
  604.    {
  605.       gereTextes.masqueIB();
  606.    }
  607. }
  608. function onMcOver(p)
  609. {
  610.    trace("MACOVER");
  611.    var myMc = p.mc;
  612.    myMc.pIB = p.codeIB;
  613.    if(p.nomSon == undefined)
  614.    {
  615.       if(p.nomSonC == undefined)
  616.       {
  617.          myMc.pSon = "B_" + myMc._name.split("_")[1];
  618.       }
  619.       else
  620.       {
  621.          myMc.pSon = p.nomSonC;
  622.       }
  623.    }
  624.    else
  625.    {
  626.       myMc.pSon = p.nomSon;
  627.    }
  628.    if(p.actionFin == undefined)
  629.    {
  630.       myMc.actionFin = "RIEN";
  631.    }
  632.    else
  633.    {
  634.       myMc.actionFin = p.actionFin;
  635.    }
  636.    myMc.pLabelOut = p.mcLabelOut;
  637.    myMc.onRollOver = function()
  638.    {
  639.       gereCursor(2);
  640.       if(p.mcLabelIn == undefined)
  641.       {
  642.          this.gotoAndPlay("E2");
  643.       }
  644.       else
  645.       {
  646.          this.gotoAndPlay(p.mcLabelIn);
  647.       }
  648.       trace("BRUITAGE");
  649.       trace(this.pSon.split("")[0]);
  650.       if(this.pSon.split("")[0] == "B")
  651.       {
  652.          joueBruitage({nomSon:this.pSon});
  653.       }
  654.       else
  655.       {
  656.          joueSon({nomSon:this.pSon,zapBlock:"NOZAP_NOBLOCK",actionFin:this.actionFin});
  657.       }
  658.       if(this.pIB !== undefined)
  659.       {
  660.          gereTextes.afficheIB({mc:this,codeIB:this.pIB});
  661.       }
  662.    };
  663.    myMc.onRollOut = myMc.onDragOut = function()
  664.    {
  665.       onMcOut(myMc);
  666.    };
  667. }
  668. function desactiveClip(pClip)
  669. {
  670.    trace(pClip);
  671.    delete pClip.onRollOver;
  672.    delete pClip.onRollOut;
  673.    delete pClip.onDragOut;
  674.    delete pClip.onPress;
  675.    delete pClip.onRelease;
  676.    delete pClip.onReleaseOutside;
  677. }
  678. function afficheClipPos(myMc, myX, myY)
  679. {
  680.    myMc._x = myX;
  681.    myMc._y = myY;
  682.    myMc._visible = true;
  683. }
  684. function gimme2digits(X)
  685. {
  686.    if(Number(X) < 10)
  687.    {
  688.       lX = "0" + Number(X);
  689.    }
  690.    else
  691.    {
  692.       lX = String(X);
  693.    }
  694.    return lX;
  695. }
  696. function randomValue(min, max)
  697. {
  698.    var _loc1_ = Math.floor(Math.random() * (max - min + 1)) + min;
  699.    return _loc1_;
  700. }
  701. function chercheDepthPlus(myMc, myDepth)
  702. {
  703.    var _loc1_ = myDepth;
  704.    while(_loc1_ < 17000)
  705.    {
  706.       if(myMc.getInstanceAtDepth(_loc1_) == undefined)
  707.       {
  708.          break;
  709.       }
  710.       _loc1_ = _loc1_ + 1;
  711.    }
  712.    return _loc1_;
  713. }
  714. function chercheDepthMoins(myMc, myDepth)
  715. {
  716.    var _loc1_ = myDepth;
  717.    while(_loc1_ > -16383)
  718.    {
  719.       if(myMc.getInstanceAtDepth(_loc1_) == undefined)
  720.       {
  721.          break;
  722.       }
  723.       _loc1_ = _loc1_ - 1;
  724.    }
  725.    return _loc1_;
  726. }
  727. function changeST(myST)
  728. {
  729.    trace("changeST   : " + myST);
  730.    if(myST == "1")
  731.    {
  732.       gST = 1;
  733.       if(gCommentOn !== undefined)
  734.       {
  735.          gereTextes.afficheST(gCommentOn.id);
  736.       }
  737.    }
  738.    else
  739.    {
  740.       sousTitre = 0;
  741.       gST = 0;
  742.       gereTextes.masqueST(this);
  743.    }
  744. }
  745. function changeMusicOn(myChangeMusicOn)
  746. {
  747.    trace("changeMusicOn   : " + myChangeMusicOn);
  748.    switch(String(myChangeMusicOn))
  749.    {
  750.       case "1":
  751.          gMusicOn = 1;
  752.          if(gMusic == undefined)
  753.          {
  754.             gMusic = gBruitageName + "MU";
  755.          }
  756.          trace("changeMusicOn2   : " + gMusic + " - " + gVolume);
  757.          if(gBlockMusic == undefined)
  758.          {
  759.             if(gCommentOn !== undefined)
  760.             {
  761.                soundObjects[gMusic].setVolume(gVolume * 0.4);
  762.             }
  763.             else
  764.             {
  765.                soundObjects[gMusic].setVolume(gVolume);
  766.             }
  767.          }
  768.          else
  769.          {
  770.             soundObjects[gMusic].setVolume(0);
  771.          }
  772.          soundObjects[gMusic].start(0,1000);
  773.          break;
  774.       case "0":
  775.          soundObjects[gMusic].stop();
  776.          gMusicOn = 0;
  777.          break;
  778.       default:
  779.          if(gMusic !== undefined)
  780.          {
  781.             soundObjects[gMusic].stop();
  782.          }
  783.          gMusic = gBruitageName + myChangeMusicOn;
  784.          if(gMusicOn == 1)
  785.          {
  786.             if(gBlockMusic == undefined)
  787.             {
  788.                if(gCommentOn !== undefined)
  789.                {
  790.                   soundObjects[gMusic].setVolume(gVolume * 0.4);
  791.                }
  792.                else
  793.                {
  794.                   soundObjects[gMusic].setVolume(gVolume);
  795.                }
  796.             }
  797.             else
  798.             {
  799.                soundObjects[gMusic].setVolume(0);
  800.             }
  801.             soundObjects[gMusic].start(0,1000);
  802.          }
  803.    }
  804. }
  805. function changeVolume(myChangeVolume)
  806. {
  807.    trace("changeVolume   : " + myChangeVolume);
  808.    gVolume = Number(myChangeVolume);
  809.    if(gCommentOn !== undefined)
  810.    {
  811.       gCommentOn.setVolume(gVolume);
  812.       if(gMusicOn == 1)
  813.       {
  814.          soundObjects[gMusic].setVolume(gVolume * 0.4);
  815.       }
  816.    }
  817.    else if(gMusicOn == 1)
  818.    {
  819.       soundObjects[gMusic].setVolume(gVolume);
  820.    }
  821. }
  822. function DesactiveBZ()
  823. {
  824.    BT_BZ.useHandCursor = false;
  825.    BT_BZ.gBZactif = 0;
  826. }
  827. function ActiveBZ()
  828. {
  829.    BT_BZ.useHandCursor = true;
  830.    BT_BZ.gBZactif = 1;
  831. }
  832. function getSoundByID(attributeValue)
  833. {
  834.    var _loc2_ = this.moduleInfo.filterNode(this.moduleInfo.returnNodeByPath("Resources.ResourcesZip"),"type","mp3");
  835.    mySound = undefined;
  836.    mySound = this.recusiveGetSoundByAttribute(_loc2_,"id",attributeValue);
  837.    if(mySound == undefined)
  838.    {
  839.       trace(attributeValue + " n\'existe pas dans XML");
  840.    }
  841.    return mySound;
  842. }
  843. function recusiveGetSoundByAttribute(node, attribute, attributeValue)
  844. {
  845.    var _loc2_ = 0;
  846.    while(_loc2_ < node.childNodes.length)
  847.    {
  848.       if(node.childNodes[_loc2_].attributes[attribute] == attributeValue)
  849.       {
  850.          mySound = node.childNodes[_loc2_];
  851.          break;
  852.       }
  853.       if(node.childNodes[_loc2_].hasChildNodes())
  854.       {
  855.          this.recusiveGetSoundByAttribute(node.childNodes[_loc2_],attribute,attributeValue);
  856.       }
  857.       _loc2_ = _loc2_ + 1;
  858.    }
  859.    return mySound;
  860. }
  861. function gereCursor(myCursor)
  862. {
  863.    switch(myCursor)
  864.    {
  865.       case 1:
  866.       case "fleche":
  867.          myCursor = "fleche";
  868.          break;
  869.       case 2:
  870.       case "doigt":
  871.          myCursor = "doigt";
  872.          break;
  873.       case 3:
  874.       case "mainO":
  875.          myCursor = "mainO";
  876.          break;
  877.       case 4:
  878.       case "mainF":
  879.          myCursor = "mainF";
  880.          break;
  881.       case 0:
  882.       case "O":
  883.          myCursor = "O";
  884.    }
  885.    trace("cursor " + myCursor);
  886.    _global.CURSEUR.Action(myCursor);
  887. }
  888. function ConvertCoord(mc_src, mc_dest)
  889. {
  890.    var _loc1_ = {x:0,y:0};
  891.    mc_src.localToGlobal(_loc1_);
  892.    mc_dest.globalToLocal(_loc1_);
  893.    return _loc1_;
  894. }
  895. function xtrace(p)
  896. {
  897.    var _loc3_ = typeof p != "string" ? "" + p.mess : "" + p;
  898.    var _loc5_ = p.group != undefined ? p.group : "tous";
  899.    if(xtraceGroups[_loc5_] == 1)
  900.    {
  901.       trace(_loc3_);
  902.       if(_global.xtrace_mode != "on")
  903.       {
  904.          return undefined;
  905.       }
  906.       var _loc4_ = new LocalConnection();
  907.       _loc4_.allowDomain = function(sendingDomain)
  908.       {
  909.          return true;
  910.       };
  911.       _loc4_.send("lc_name","AfficherTexte",_loc3_);
  912.    }
  913. }
  914. function xtrace_raz()
  915. {
  916.    if(_global.xtrace_mode != "on")
  917.    {
  918.       return undefined;
  919.    }
  920.    var _loc2_ = new LocalConnection();
  921.    _loc2_.send("lc_name","RazTexte",mess);
  922. }
  923. function xlisteObj(p)
  924. {
  925.    if(xlisteObj_mode != "on")
  926.    {
  927.       return undefined;
  928.    }
  929.    var _loc1_ = p.obj != undefined ? p.obj : p;
  930.    p.mess = p.mess != undefined ? p.mess : "";
  931.    xtrace({mess:"\r____________________" + p.mess + " " + _loc1_._name + "______________________",group:p.group});
  932.    for(props in _loc1_)
  933.    {
  934.       xtrace({mess:props + " = " + _loc1_[props],group:p.group});
  935.    }
  936.    xtrace({mess:"_________________________________________________\r",group:p.group});
  937. }
  938. function IncString(str, seuil)
  939. {
  940.    var _loc2_ = str.split("_");
  941.    var _loc1_ = _loc2_.length - 1;
  942.    var _loc3_ = Number(_loc2_[_loc1_]) + 1;
  943.    while(_loc3_ > seuil)
  944.    {
  945.       _loc2_[_loc1_] = gimme2digits(0);
  946.       _loc1_ = _loc1_ - 1;
  947.       _loc3_ = Number(_loc2_[_loc1_]) + 1;
  948.    }
  949.    _loc2_[_loc1_] = gimme2digits(_loc3_);
  950.    return _loc2_.join("_");
  951. }
  952. function DecString(str)
  953. {
  954.    var _loc1_ = str.split("_");
  955.    trace(_loc1_);
  956.    var _loc2_ = _loc1_.length - 1;
  957.    trace(Number(_loc1_[_loc2_]));
  958.    _loc1_[_loc2_] = gimme2digits(Number(_loc1_[_loc2_]) - 1);
  959.    return _loc1_.join("_");
  960. }
  961. function xGetConfig()
  962. {
  963.    _root.xConfig = new Object();
  964.    _root.xConfig.Set = function(p)
  965.    {
  966.       if(_root.xConfig[p.nom] == undefined)
  967.       {
  968.          if(p.defaut != "OBLIGATOIRE")
  969.          {
  970.             _root.xConfig[p.nom] = p.defaut;
  971.             if(p.type == "number")
  972.             {
  973.                _root.xConfig[p.nom] = Number(_root.xConfig[p.nom]);
  974.             }
  975.          }
  976.       }
  977.    };
  978.    _root.xConfig._name = "xConfig";
  979.    var _loc2_ = _root.moduleInfo.returnNodeByPath("Module.Config.Params").childNodes;
  980.    for(props in _loc2_)
  981.    {
  982.       _root.xConfig[_loc2_[props].attributes.nom] = _loc2_[props].attributes.valeur;
  983.    }
  984. }
  985. function GetFilePath(fichier)
  986. {
  987.    var _loc2_ = AntiSlashToSlash(fichier);
  988.    var _loc1_ = _loc2_.split("/");
  989.    _loc1_.pop();
  990.    return _loc1_.join("/");
  991. }
  992. function AntiSlashToSlash(chaine)
  993. {
  994.    return str_replace(chaine,"\\","/");
  995. }
  996. function str_replace(str, search, replace)
  997. {
  998.    return str.split(search).join(replace);
  999. }
  1000. function JoindreObjets(objects)
  1001. {
  1002.    var _loc2_ = new Object();
  1003.    var _loc1_ = 0;
  1004.    while(_loc1_ < objects.length)
  1005.    {
  1006.       p1 = objects[_loc1_];
  1007.       for(props in p1)
  1008.       {
  1009.          _loc2_[props] = p1[props];
  1010.       }
  1011.       _loc1_ = _loc1_ + 1;
  1012.    }
  1013.    return _loc2_;
  1014. }
  1015. function GetOriginalSize(mc)
  1016. {
  1017.    var _loc2_ = mc._rotation;
  1018.    mc._rotation = 0;
  1019.    var _loc3_ = {w:mc._width * mc._xscale / 100,h:mc._height * mc._yscale / 100};
  1020.    mc._rotation = _loc2_;
  1021.    return _loc3_;
  1022. }
  1023. function GetOriginalWidth(mc)
  1024. {
  1025.    var _loc2_ = mc._rotation;
  1026.    mc._rotation = 0;
  1027.    var _loc3_ = mc._width * mc._xscale / 100;
  1028.    var _loc4_ = mc._height * mc._yscale / 100;
  1029.    mc._rotation = _loc2_;
  1030.    return _loc3_;
  1031. }
  1032. function GetOriginalHeight(mc)
  1033. {
  1034.    var _loc2_ = mc._rotation;
  1035.    mc._rotation = 0;
  1036.    var _loc4_ = mc._width * mc._xscale / 100;
  1037.    var _loc3_ = mc._height * mc._yscale / 100;
  1038.    mc._rotation = _loc2_;
  1039.    return _loc3_;
  1040. }
  1041. function CreerCache(p)
  1042. {
  1043.    var _loc4_ = p.level != undefined ? p.level : _global.Levels.cache;
  1044.    var _loc2_ = p.mc.createEmptyMovieClip("CACHE",_loc4_);
  1045.    _loc2_.beginFill(65280,50);
  1046.    _loc2_.moveTo(0,0);
  1047.    _loc2_.lineTo(p.width,0);
  1048.    _loc2_.lineTo(p.width,p.height);
  1049.    _loc2_.lineTo(0,p.height);
  1050.    _loc2_.lineTo(0,0);
  1051.    _loc2_.endFill();
  1052.    p.mc.setMask(_loc2_);
  1053. }
  1054. function ConvertCoord(mc_src, mc_dest)
  1055. {
  1056.    var _loc1_ = {x:0,y:0};
  1057.    mc_src.localToGlobal(_loc1_);
  1058.    mc_dest.globalToLocal(_loc1_);
  1059.    return _loc1_;
  1060. }
  1061. function getGlobalCoord(xc, yc, mc)
  1062. {
  1063.    var _loc1_ = {x:xc * 100 / mc._xscale,y:yc * 100 / mc._yscale};
  1064.    mc.localToGlobal(_loc1_);
  1065.    return _loc1_;
  1066. }
  1067. function getLocalCoord(xc, yc, mc)
  1068. {
  1069.    var _loc1_ = new Object({x:xc,y:yc});
  1070.    mc.globalToLocal(_loc1_);
  1071.    _loc1_.x = _loc1_.x / 100 * mc._xscale;
  1072.    _loc1_.y = _loc1_.y / 100 * mc._yscale;
  1073.    return _loc1_;
  1074. }
  1075. function length_ass(arr)
  1076. {
  1077.    var _loc1_ = 0;
  1078.    for(prop in arr)
  1079.    {
  1080.       _loc1_ = _loc1_ + 1;
  1081.    }
  1082.    return _loc1_;
  1083. }
  1084. function ExplodeString(chaine)
  1085. {
  1086.    var _loc3_ = new Array();
  1087.    var _loc1_ = 0;
  1088.    while(_loc1_ < chaine.length)
  1089.    {
  1090.       _loc3_.push(chaine.charAt(_loc1_));
  1091.       _loc1_ = _loc1_ + 1;
  1092.    }
  1093.    return _loc3_;
  1094. }
  1095. function BloquerActives()
  1096. {
  1097.    if(_global.ClipBloquant == undefined)
  1098.    {
  1099.       var _loc0_ = null;
  1100.       var _loc2_ = _global.ClipBloquant = _MOD_.createEmptyMovieClip("ClipBloquant",10123);
  1101.       _loc2_.attachMovie("ClipInvisible","ClipInvisible",2);
  1102.       _loc2_._width = Stage.width;
  1103.       _loc2_._height = Stage.height;
  1104.       _loc2_._x = 0;
  1105.       _loc2_._y = 0;
  1106.       _loc2_.useHandCursor = false;
  1107.       _loc2_.onPress = function()
  1108.       {
  1109.       };
  1110.    }
  1111. }
  1112. function DebloquerActives()
  1113. {
  1114.    if(_global.ClipBloquant != undefined)
  1115.    {
  1116.       removeMovieClip(_global.ClipBloquant);
  1117.       _global.ClipBloquant = undefined;
  1118.    }
  1119. }
  1120. function afficheLM_x2(p)
  1121. {
  1122.    viderLM_x2();
  1123.    _root.gereTextes.afficheLM({codeLM:p.codeLM,X:p.LMrep._x,Y:p.LMrep._y,width:p.LMrep._width,height:p.LMrep._height});
  1124.    LMaVider2.push(p);
  1125. }
  1126. function viderLM_x2()
  1127. {
  1128.    var _loc3_ = 0;
  1129.    while(_loc3_ < _global.LMaVider2.length)
  1130.    {
  1131.       _root.gereTextes.masqueLM(_global.LMaVider2[_loc3_]);
  1132.       _loc3_ = _loc3_ + 1;
  1133.    }
  1134. }
  1135. function afficheLM_x(p)
  1136. {
  1137.    _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});
  1138.    _global.LMaVider.push(p);
  1139. }
  1140. function viderLM_x()
  1141. {
  1142.    var _loc3_ = 0;
  1143.    while(_loc3_ < _global.LMaVider.length)
  1144.    {
  1145.       _root.gereTextes.masqueLM(_global.LMaVider[_loc3_]);
  1146.       _loc3_ = _loc3_ + 1;
  1147.    }
  1148. }
  1149. function InitMC(p)
  1150. {
  1151.    trace("initMC " + p.mc);
  1152.    var mc = typeof p != "movieclip" ? p.mc : p;
  1153.    if(p.level != undefined)
  1154.    {
  1155.       var ceMC_name_old = mc._name + "_old";
  1156.       var ceMC_name = mc._name;
  1157.       mc._name = ceMC_name_old;
  1158.       mc.duplicateMovieClip(ceMC_name,p.level);
  1159.       mc._visible = false;
  1160.       mc = this[ceMC_name];
  1161.    }
  1162.    var fonction = p.fonction != undefined ? eval("InitMC_" + p.fonction) : InitMC_standart;
  1163.    mc.InitMC = fonction;
  1164.    mc.InitMC(p);
  1165. }
  1166. function InitMC_standart(p)
  1167. {
  1168.    if(p.IB != undefined)
  1169.    {
  1170.       if(typeof p.IBrep == "movieclip")
  1171.       {
  1172.          var IBrepere = p.IBrep;
  1173.       }
  1174.       else if(p.IBrep == true)
  1175.       {
  1176.          var IBrepere = _MOD_["IBrep_" + p.IB];
  1177.       }
  1178.       else
  1179.       {
  1180.          var IBrepere = p.mc;
  1181.       }
  1182.       this.afficheIB = function()
  1183.       {
  1184.          _MOD_.gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  1185.       };
  1186.       this.masqueIB = function()
  1187.       {
  1188.          _MOD_.gereTextes.masqueIB();
  1189.       };
  1190.    }
  1191.    this.reposFrame = p.reposFrame != undefined ? p.reposFrame : "E1";
  1192.    this.pressFrame = p.pressFrame != undefined ? p.pressFrame : "E2";
  1193.    this.overFrame = p.overFrame != undefined ? p.overFrame : "E2";
  1194.    this.outFrame = p.outFrame != undefined ? p.outFrame : "E1";
  1195.    this.releaseFrame = p.releaseFrame != undefined ? p.releaseFrame : "E1";
  1196.    this.releaseOutFrame = p.releaseOutFrame != undefined ? p.releaseOutFrame : "E1";
  1197.    this.activeFrame = p.activeFrame != undefined ? p.activeFrame : undefined;
  1198.    this.desactiveFrame = p.desactiveFrame != undefined ? p.desactiveFrame : undefined;
  1199.    if(p.reposFrame != undefined)
  1200.    {
  1201.       this.gotoAndStop(p.reposFrame);
  1202.    }
  1203.    this.p = p;
  1204.    ┬º┬ºpush(this);
  1205.    ┬º┬ºpush("joueson");
  1206.    if(p.son == undefined)
  1207.    {
  1208.       ┬º┬ºpush(undefined);
  1209.    }
  1210.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1211.    ┬º┬ºpush(this);
  1212.    ┬º┬ºpush("stopson");
  1213.    if(p.nostop != undefined)
  1214.    {
  1215.       ┬º┬ºpush(undefined);
  1216.    }
  1217.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1218.    if(p.sonOnPress != undefined)
  1219.    {
  1220.       this.sonOnPress = p.sonOnPress;
  1221.       this.sonOnPress_offset = p.sonOnPress_offset != undefined ? Number(p.sonOnPress_offset) : 0;
  1222.       this.sonOnPress_loopSon = p.sonOnPress_loopSon != undefined ? Number(p.sonOnPress_loopSon) : 0;
  1223.       this.jouesonOnPress = function()
  1224.       {
  1225.          joueBruitage({nomSon:this.sonOnPress,offset:this.sonOnPress_offset,loopSon:this.sonOnPress_loopSon});
  1226.       };
  1227.       this.stopsonOnPress = function()
  1228.       {
  1229.          stopBruitage({nomSon:this.sonOnPress});
  1230.       };
  1231.    }
  1232.    else
  1233.    {
  1234.       this.jouesonOnMove = undefined;
  1235.       this.stopsonOnMove = undefined;
  1236.    }
  1237.    this.curseur_after_press = p.goto != undefined ? "fleche" : "doigt";
  1238.    this.curseur_after_press = p.curseurAfterPress != undefined ? p.curseurAfterPress : "doigt";
  1239.    this.goto = p.goto;
  1240.    this.Activer = function()
  1241.    {
  1242.       if(this.Actif == true)
  1243.       {
  1244.          return undefined;
  1245.       }
  1246.       this.enabled = true;
  1247.       this.BTN.enabled = true;
  1248.       this.Actif = true;
  1249.       this.gotoAndStop(this.activeFrame);
  1250.    };
  1251.    this.Desactiver = function()
  1252.    {
  1253.       if(this.Actif == false)
  1254.       {
  1255.          return undefined;
  1256.       }
  1257.       this.enabled = false;
  1258.       this.BTN.enabled = false;
  1259.       this.Actif = false;
  1260.       this.stopsonOnPress();
  1261.       this.masqueIB();
  1262.       this.gotoAndStop(this.desactiveFrame);
  1263.    };
  1264.    this.Activer();
  1265.    this.GS = this.gotoAndStop;
  1266.    this.MConPress = function()
  1267.    {
  1268.       if(this.p.blockOnPress == true)
  1269.       {
  1270.          this.enabled = false;
  1271.       }
  1272.       this.stopson();
  1273.       this.jouesonOnPress();
  1274.       this.masqueIB();
  1275.       this.gotoAndStop(this.pressFrame);
  1276.       gereCursor(this.curseur_after_press);
  1277.       _root.gotoAndStop(this.goto);
  1278.       var p = this.OnPress();
  1279.    };
  1280.    this.MConRollOver = function()
  1281.    {
  1282.       this.joueson();
  1283.       this.afficheIB();
  1284.       this.gotoAndStop(this.overFrame);
  1285.       gereCursor("doigt");
  1286.       var _loc2_ = this.OnRollOver();
  1287.    };
  1288.    this.MConRollOut = function()
  1289.    {
  1290.       this.stopson();
  1291.       this.masqueIB();
  1292.       this.gotoAndStop(this.outFrame);
  1293.       gereCursor("fleche");
  1294.       var _loc2_ = this.OnRollOut();
  1295.    };
  1296.    this.MConRelease = function()
  1297.    {
  1298.       this.gotoAndStop(this.releaseFrame);
  1299.       gereCursor("doigt");
  1300.       var _loc2_ = this.OnRelease();
  1301.    };
  1302.    this.MConReleaseOutside = function()
  1303.    {
  1304.       this.gotoAndStop(this.releaseOutFrame);
  1305.       gereCursor("fleche");
  1306.       var _loc2_ = this.OnReleaseOutside();
  1307.    };
  1308.    if(p.BTN != true)
  1309.    {
  1310.       this.onPress = this.MConPress;
  1311.       this.onRollOver = this.MConRollOver;
  1312.       this.onRollOut = this.MConRollOut;
  1313.       this.onRelease = this.MConRelease;
  1314.       this.onReleaseOutside = this.MConReleaseOutside;
  1315.    }
  1316.    else
  1317.    {
  1318.       this.BTN.onPress = function()
  1319.       {
  1320.          this._parent.MConPress();
  1321.       };
  1322.       this.BTN.onRollOver = function()
  1323.       {
  1324.          this._parent.MConRollOver();
  1325.       };
  1326.       this.BTN.onRollOut = function()
  1327.       {
  1328.          this._parent.MConRollOut();
  1329.       };
  1330.       this.BTN.onRelease = function()
  1331.       {
  1332.          this._parent.MConRelease();
  1333.       };
  1334.       this.BTN.onReleaseOutside = function()
  1335.       {
  1336.          this._parent.MConReleaseOutside();
  1337.       };
  1338.    }
  1339. }
  1340. function InitMC_BTN(p)
  1341. {
  1342.    if(p.IB != undefined)
  1343.    {
  1344.       if(p.IBrep == true)
  1345.       {
  1346.          var IBrepere = _MOD_["IBrep_" + p.IB];
  1347.       }
  1348.       else
  1349.       {
  1350.          var IBrepere = p.mc;
  1351.       }
  1352.       this.afficheIB = function()
  1353.       {
  1354.          gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  1355.       };
  1356.       this.masqueIB = function()
  1357.       {
  1358.          gereTextes.masqueIB();
  1359.       };
  1360.    }
  1361.    this.enabled = true;
  1362.    ┬º┬ºpush(this);
  1363.    ┬º┬ºpush("joueson");
  1364.    if(p.son == undefined)
  1365.    {
  1366.       ┬º┬ºpush(undefined);
  1367.    }
  1368.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1369.    ┬º┬ºpush(this);
  1370.    ┬º┬ºpush("stopson");
  1371.    if(p.nostop != undefined)
  1372.    {
  1373.       ┬º┬ºpush(undefined);
  1374.    }
  1375.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1376.    var curseur_after_press = p.goto != undefined ? "fleche" : "doigt";
  1377.    this.goto = p.goto;
  1378.    this.BTN.onPress = function()
  1379.    {
  1380.       this._parent.stopson();
  1381.       this._parent.masqueIB();
  1382.       this._parent.gotoAndStop("E3");
  1383.       gereCursor(curseur_after_press);
  1384.       _root.gotoAndStop(this.goto);
  1385.       var _loc3_ = this._parent.OnPress();
  1386.    };
  1387.    this.BTN.onRollOver = function()
  1388.    {
  1389.       this._parent.joueson();
  1390.       this._parent.afficheIB();
  1391.       this._parent.gotoAndStop("E2");
  1392.       gereCursor("doigt");
  1393.       var _loc2_ = this._parent.OnRollOver();
  1394.    };
  1395.    this.BTN.onRollOut = function()
  1396.    {
  1397.       this._parent.stopson();
  1398.       this._parent.masqueIB();
  1399.       this._parent.gotoAndStop("E1");
  1400.       gereCursor("fleche");
  1401.       var _loc2_ = this._parent.OnRollOut();
  1402.    };
  1403.    this.BTN.onRelease = function()
  1404.    {
  1405.       this._parent.gotoAndStop("E2");
  1406.       gereCursor("doigt");
  1407.       var _loc2_ = this._parent.OnRelease();
  1408.    };
  1409.    this.BTN.onReleaseOutside = function()
  1410.    {
  1411.       this._parent.gotoAndStop("E1");
  1412.       gereCursor("fleche");
  1413.       var _loc2_ = this._parent.OnReleaseOutside();
  1414.    };
  1415. }
  1416. function InitMC_dragdrop(p)
  1417. {
  1418.    xtrace("InitMC");
  1419.    if(p.IB != undefined)
  1420.    {
  1421.       if(p.IBrep == true)
  1422.       {
  1423.          var IBrepere = _MOD_["IBrep_" + p.IB];
  1424.       }
  1425.       else
  1426.       {
  1427.          var IBrepere = p.mc;
  1428.       }
  1429.       this.afficheIB = function()
  1430.       {
  1431.          gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  1432.       };
  1433.       this.masqueIB = function()
  1434.       {
  1435.          gereTextes.masqueIB();
  1436.       };
  1437.    }
  1438.    this.pDepth = this.getDepth();
  1439.    this.pressFrame = p.pressFrame != undefined ? p.pressFrame : "E3";
  1440.    ┬º┬ºpush(this);
  1441.    ┬º┬ºpush("joueson");
  1442.    if(p.son == undefined)
  1443.    {
  1444.       ┬º┬ºpush(undefined);
  1445.    }
  1446.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1447.    ┬º┬ºpush(this);
  1448.    ┬º┬ºpush("stopson");
  1449.    if(p.son == undefined)
  1450.    {
  1451.       ┬º┬ºpush(undefined);
  1452.    }
  1453.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1454.    ┬º┬ºpush(this);
  1455.    ┬º┬ºpush("jouesonOnPress");
  1456.    if(p.son == undefined)
  1457.    {
  1458.       ┬º┬ºpush(undefined);
  1459.    }
  1460.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1461.    ┬º┬ºpush(this);
  1462.    ┬º┬ºpush("stopsonOnPress");
  1463.    if(p.son == undefined)
  1464.    {
  1465.       ┬º┬ºpush(undefined);
  1466.    }
  1467.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1468.    ┬º┬ºpush(this);
  1469.    ┬º┬ºpush("jouesonOnOverCible");
  1470.    if(p.son == undefined)
  1471.    {
  1472.       ┬º┬ºpush(undefined);
  1473.    }
  1474.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1475.    ┬º┬ºpush(this);
  1476.    ┬º┬ºpush("stopsonOnOverCible");
  1477.    if(p.son == undefined)
  1478.    {
  1479.       ┬º┬ºpush(undefined);
  1480.    }
  1481.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1482.    var _loc5_ = p.goto != undefined ? "fleche" : "doigt";
  1483.    this.goto = p.goto;
  1484.    this.DetectDrag = function()
  1485.    {
  1486.       this._x = _xmouse - this.ecart_mousex;
  1487.       this._y = _ymouse - this.ecart_mousey;
  1488.       this.CiblesTouchees = [];
  1489.       var _loc2_ = 0;
  1490.       while(_loc2_ < this.CiblesDrag.length)
  1491.       {
  1492.          if(this.hitTest(this.CiblesDrag[_loc2_]))
  1493.          {
  1494.             this.CiblesDrag[_loc2_].gotoAndStop("E3");
  1495.             this.CiblesTouchees.push(this.CiblesDrag[_loc2_]);
  1496.             this.touche = this.touche + 1;
  1497.          }
  1498.          else
  1499.          {
  1500.             this.CiblesDrag[_loc2_].gotoAndStop("E1");
  1501.          }
  1502.          _loc2_ = _loc2_ + 1;
  1503.       }
  1504.       if(this.touche == 1)
  1505.       {
  1506.          this.jouesonOnOverCible();
  1507.       }
  1508.       if(this.CiblesTouchees.length <= 0)
  1509.       {
  1510.          this.touche = 0;
  1511.          this.stopsonOnOverCible();
  1512.       }
  1513.       this.PendantDrag();
  1514.    };
  1515.    this.StartDrag = function()
  1516.    {
  1517.       this.ecart_mousex = _xmouse - this._x;
  1518.       this.ecart_mousey = _ymouse - this._y;
  1519.       this.IntervalId = setInterval(mx.utils.Delegate.create(this,this.DetectDrag),10);
  1520.       this.swapDepths(15800);
  1521.    };
  1522.    this.ComeBack = function()
  1523.    {
  1524.       this._x = this.xOri;
  1525.       this._y = this.yOri;
  1526.       this.gotoAndStop("E1");
  1527.    };
  1528.    this.onPress = function()
  1529.    {
  1530.       this.jouesonOnPress();
  1531.       this.xOri = this._x;
  1532.       this.yOri = this._y;
  1533.       this.masqueIB();
  1534.       this.gotoAndStop(this.pressFrame);
  1535.       gereCursor("mainF");
  1536.       this.StartDrag();
  1537.       var _loc2_ = this.OnPress();
  1538.    };
  1539.    this.onRollOver = function()
  1540.    {
  1541.       this.joueson();
  1542.       this.afficheIB();
  1543.       this.gotoAndStop("E2");
  1544.       gereCursor("mainO");
  1545.       var _loc2_ = this.OnRollOver();
  1546.    };
  1547.    this.onRollOut = function()
  1548.    {
  1549.       this.stopson();
  1550.       this.gotoAndStop("E1");
  1551.       this.masqueIB();
  1552.       gereCursor("fleche");
  1553.       var _loc2_ = this.OnRollOut();
  1554.    };
  1555.    this.onRelease = function()
  1556.    {
  1557.       gereCursor("mainO");
  1558.       this.stopsonOnPress();
  1559.       this.gotoAndStop("E2");
  1560.       clearInterval(this.IntervalId);
  1561.       this.CiblesTouchees = [];
  1562.       var _loc2_ = 0;
  1563.       while(_loc2_ < this.CiblesDrag.length)
  1564.       {
  1565.          if(this.hitTest(this.CiblesDrag[_loc2_]))
  1566.          {
  1567.             _;
  1568.             this.CiblesTouchees.push(this.CiblesDrag[_loc2_]);
  1569.          }
  1570.          _loc2_ = _loc2_ + 1;
  1571.       }
  1572.       this.swapDepths(this.pDepth);
  1573.       this.ApresDrag();
  1574.       var _loc3_ = this.OnRelease();
  1575.    };
  1576.    this.onReleaseOutside = this.onRelease;
  1577. }
  1578. function InitMC_slider(p)
  1579. {
  1580.    if(p.IB != undefined)
  1581.    {
  1582.       if(p.IBrep == true)
  1583.       {
  1584.          var IBrepere = _MOD_["IBrep_" + p.IB];
  1585.       }
  1586.       else
  1587.       {
  1588.          var IBrepere = p.mc;
  1589.       }
  1590.       this.afficheIB = function()
  1591.       {
  1592.          gereTextes.afficheIB({codeIB:p.IB,mc:IBrepere});
  1593.       };
  1594.       this.masqueIB = function()
  1595.       {
  1596.          gereTextes.masqueIB();
  1597.       };
  1598.    }
  1599.    ┬º┬ºpush(this);
  1600.    ┬º┬ºpush("joueson");
  1601.    if(p.son == undefined)
  1602.    {
  1603.       ┬º┬ºpush(undefined);
  1604.    }
  1605.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1606.    ┬º┬ºpush(this);
  1607.    ┬º┬ºpush("stopson");
  1608.    if(p.son == undefined)
  1609.    {
  1610.       ┬º┬ºpush(undefined);
  1611.    }
  1612.    ┬º┬ºpop()[┬º┬ºpop()] = ┬º┬ºpop();
  1613.    var _loc6_ = p.goto != undefined ? "fleche" : "doigt";
  1614.    this.goto = p.goto;
  1615.    this.EnMouvement = false;
  1616.    if(p.sonOnMove != undefined)
  1617.    {
  1618.       this.sonOnMove = p.sonOnMove;
  1619.       this.sonOnMove_offset = p.sonOnMove_offset != undefined ? Number(p.sonOnMove_offset) : 0;
  1620.       this.sonOnMove_loopSon = p.sonOnMove_loopSon != undefined ? Number(p.sonOnMove_loopSon) : 0;
  1621.       this.jouesonOnMove = function()
  1622.       {
  1623.          joueBruitage({nomSon:this.sonOnMove,offset:this.sonOnMove_offset,loopSon:this.sonOnMove_loopSon});
  1624.       };
  1625.       this.stopsonOnMove = function()
  1626.       {
  1627.          stopBruitage({nomSon:this.sonOnMove});
  1628.       };
  1629.    }
  1630.    else
  1631.    {
  1632.       this.jouesonOnMove = undefined;
  1633.       this.stopsonOnMove = undefined;
  1634.    }
  1635.    if(p.sonOnPress != undefined)
  1636.    {
  1637.       this.sonOnPress = p.sonOnPress;
  1638.       this.sonOnPress_offset = p.sonOnPress_offset != undefined ? Number(p.sonOnPress_offset) : 0;
  1639.       this.sonOnPress_loopSon = p.sonOnPress_loopSon != undefined ? Number(p.sonOnPress_loopSon) : 0;
  1640.       this.jouesonOnPress = function()
  1641.       {
  1642.          joueBruitage({nomSon:this.sonOnPress,offset:this.sonOnPress_offset,loopSon:this.sonOnPress_loopSon});
  1643.       };
  1644.       this.stopsonOnPress = function()
  1645.       {
  1646.          stopBruitage({nomSon:this.sonOnPress});
  1647.       };
  1648.    }
  1649.    else
  1650.    {
  1651.       this.jouesonOnMove = undefined;
  1652.       this.stopsonOnMove = undefined;
  1653.    }
  1654.    this.DragZone = {left:this._x,right:this._x + p.DragZoneLargeur,top:this._y,bottom:this._y};
  1655.    this.DragZoneLargeur = p.DragZoneLargeur;
  1656.    this.DragZoneLargeur_pourcent = p.DragZoneLargeur / 100;
  1657.    this.SetPosition = function(pourcent)
  1658.    {
  1659.       this._x = this.DragZone.left + this.DragZoneLargeur_pourcent * pourcent;
  1660.    };
  1661.    this.GetPosition = function()
  1662.    {
  1663.       return (this._x - this.DragZone.left) / this.DragZoneLargeur_pourcent;
  1664.    };
  1665.    this.DetectDrag = function()
  1666.    {
  1667.       this._x = _root._xmouse - this.ecart_mousex;
  1668.       this._y = _root._ymouse - this.ecart_mousey;
  1669.       if(this._x <= this.DragZone.left)
  1670.       {
  1671.          this._x = this.DragZone.left;
  1672.       }
  1673.       if(this._y < this.DragZone.top)
  1674.       {
  1675.          this._y = this.DragZone.top;
  1676.       }
  1677.       if(this._x >= this.DragZone.right)
  1678.       {
  1679.          this._x = this.DragZone.right;
  1680.       }
  1681.       if(this._y > this.DragZone.bottom)
  1682.       {
  1683.          this._y = this.DragZone.bottom;
  1684.       }
  1685.       updateAfterEvent();
  1686.       if(this._x == this.lastx && this._y == this.lasty)
  1687.       {
  1688.          if(this.EnMouvement == true)
  1689.          {
  1690.             this.EnMouvement = false;
  1691.             this.stopsonOnMove();
  1692.          }
  1693.       }
  1694.       else if(this.EnMouvement == false)
  1695.       {
  1696.          this.EnMouvement = true;
  1697.          this.jouesonOnMove();
  1698.       }
  1699.       this.lastx = this._x;
  1700.       this.lasty = this._y;
  1701.       this.PendantSlide();
  1702.    };
  1703.    this.StartDrag = function()
  1704.    {
  1705.       this.ecart_mousex = _root._xmouse - this._x;
  1706.       this.ecart_mousey = _root._ymouse - this._y;
  1707.       this.lastx = this._x;
  1708.       this.lasty = this._y;
  1709.       this.IntervalId = setInterval(mx.utils.Delegate.create(this,this.DetectDrag),1);
  1710.    };
  1711.    this.onPress = function()
  1712.    {
  1713.       this.jouesonOnPress();
  1714.       this.masqueIB();
  1715.       this.gotoAndStop("E3");
  1716.       gereCursor("mainF");
  1717.       this.StartDrag();
  1718.       var _loc2_ = this.OnPress();
  1719.    };
  1720.    this.onRollOver = function()
  1721.    {
  1722.       this.joueson();
  1723.       this.afficheIB();
  1724.       this.gotoAndStop("E2");
  1725.       gereCursor("mainO");
  1726.       var _loc2_ = this.OnRollOver();
  1727.    };
  1728.    this.onRollOut = function()
  1729.    {
  1730.       this.stopson();
  1731.       this.stopsonOnPress();
  1732.       this.stopsonOnMove();
  1733.       this.gotoAndStop("E1");
  1734.       this.masqueIB();
  1735.       gereCursor("fleche");
  1736.       var _loc2_ = this.OnRollOut();
  1737.    };
  1738.    this.onRelease = function()
  1739.    {
  1740.       this.gotoAndStop("E2");
  1741.       clearInterval(this.IntervalId);
  1742.       this.stopson();
  1743.       this.stopsonOnPress();
  1744.       this.stopsonOnMove();
  1745.       gereCursor("mainO");
  1746.       var _loc2_ = this.OnRelease();
  1747.    };
  1748.    this.onReleaseOutside = function()
  1749.    {
  1750.       this.onRelease();
  1751.       gereCursor("fleche");
  1752.       var _loc2_ = this.OnReleaseOutside();
  1753.    };
  1754. }
  1755. function InitMC_titre(p)
  1756. {
  1757.    this.LMaVider = [];
  1758.    this.offsetx = p.offsetx != undefined ? Number(p.offsetx) : 0;
  1759.    this.offsety = p.offsety != undefined ? Number(p.offsety) : 0;
  1760.    this.ChangeTexte = function(p)
  1761.    {
  1762.       this.viderLM();
  1763.       _root.gereTextes.afficheLM({codeLM:p.codeLM,X:this._x + this.offsetx,Y:this._y + this.offsety,width:this._width,height:this._height});
  1764.       this.LMaVider.push(p);
  1765.    };
  1766.    this.viderLM = function()
  1767.    {
  1768.       var _loc3_ = 0;
  1769.       while(_loc3_ < this.LMaVider.length)
  1770.       {
  1771.          _root.gereTextes.masqueLM(this.LMaVider[_loc3_]);
  1772.          _loc3_ = _loc3_ + 1;
  1773.       }
  1774.    };
  1775. }
  1776. function initMoteur()
  1777. {
  1778.    trace(" ____ __ 111111__ _ __ _");
  1779.    var _loc5_ = this;
  1780.    var _loc6_ = _loc5_.createEmptyMovieClip("_moteur_",12354);
  1781.    this.mclR = new MovieClipLoader();
  1782.    if(_global.HOTE != undefined)
  1783.    {
  1784.       var _loc4_ = _global.gPARAMS.HOTE_DIR + "/DATA/HOTE/prod_gen/moteur.swf";
  1785.    }
  1786.    else
  1787.    {
  1788.       _loc4_ = "../../HOTE/prod_gen/moteur.swf";
  1789.    }
  1790.    this.mclR.loadClip(_loc4_,_loc6_);
  1791.    this.mclR.onLoadInit = function(myClip)
  1792.    {
  1793.       trace("_________ allooo ");
  1794.       _root.ChargeMoteur();
  1795.    };
  1796. }
  1797. stop();
  1798. this._lockroot = true;
  1799. _global._MOD_ = this;
  1800. this.CIBLE = this;
  1801. _global.stopComment = stopComment;
  1802. _global.joueSon = joueSon;
  1803. _root.creerClicZap = creerClicZap;
  1804. _global.joueBruitage = joueBruitage;
  1805. _global.gimme2digits = gimme2digits;
  1806. this.randRange = randomValue;
  1807. _global.chercheDepthPlus = chercheDepthPlus;
  1808. _global.chercheDepthMoins = chercheDepthMoins;
  1809. _global.DesactiveBZ = DesactiveBZ;
  1810. _root.DesactiveBZ = DesactiveBZ;
  1811. _global.ActiveBZ = ActiveBZ;
  1812. _root.ActiveBZ = ActiveBZ;
  1813. _global.xtraceGroups = [];
  1814. xtraceGroups.tous = 1;
  1815. xtraceGroups.doc = 1;
  1816. xtraceGroups.debug = 0;
  1817. xtraceGroups.route = 0;
  1818. xtraceGroups.error = 0;
  1819. _global.xtrace = xtrace;
  1820. _global.xtrace_raz = xtrace_raz;
  1821. _global.xlisteObj = xlisteObj;
  1822. _global.xtrace_mode = _global.xtrace_mode != undefined ? _global.xtrace_mode : "off";
  1823. _global.xlisteObj_mode = _global.xlisteObj_mode != undefined ? _global.xlisteObj_mode : "off";
  1824. this.ChargeMoteur = function(p)
  1825. {
  1826.    this.initVariables();
  1827. };
  1828. trace("XLIBBB");
  1829. this.ChargeMoteur = function(p)
  1830. {
  1831.    trace("Charge Moteur xlib");
  1832.    this.initVariables();
  1833. };
  1834. _global.LMaVider = new Array();
  1835. _global.LMaVider2 = new Array();
  1836. _global.InitMC = InitMC;
  1837. _global.InitMC_standart = InitMC_standart;
  1838. _global.InitMC_BTN = InitMC_BTN;
  1839. _global.InitMC_dragdrop = InitMC_dragdrop;
  1840. _global.InitMC_slider = InitMC_slider;
  1841. _global.InitMC_titre = InitMC_titre;
  1842. _global.IncString = IncString;
  1843. _global.DecString = DecString;
  1844. _global.GetFilePath = GetFilePath;
  1845. _global.AntiSlashToSlash = AntiSlashToSlash;
  1846. _global.str_replace = str_replace;
  1847. _global.JoindreObjets = JoindreObjets;
  1848. _global.xGetConfig = xGetConfig;
  1849. _global.GetOriginalSize = GetOriginalSize;
  1850. _global.GetOriginalHeight = GetOriginalHeight;
  1851. _global.CreerCache = CreerCache;
  1852. _global.ConvertCoord = ConvertCoord;
  1853. _global.getGlobalCoord = getGlobalCoord;
  1854. _global.getLocalCoord = getLocalCoord;
  1855. _global.length_ass = length_ass;
  1856. _global.ExplodeString = ExplodeString;
  1857. _global.BloquerActives = BloquerActives;
  1858. _global.DebloquerActives = DebloquerActives;
  1859. _global.afficheLM_x = afficheLM_x;
  1860. _global.viderLM_x = viderLM_x;
  1861. _global.afficheLM_x2 = afficheLM_x2;
  1862. _global.viderLM_x2 = viderLM_x2;
  1863. _global.xtrace_mode = "on";
  1864. _global.xlisteObj_mode = "on";
  1865. this.initVariables = function()
  1866. {
  1867.    this.gotoAndStop("INIT");
  1868.    trace({mess:"- execution du code de prod/module/init.as",group:"doc"});
  1869.    trace("init.as");
  1870. };
  1871. this.Init = function()
  1872. {
  1873.    trace(" ____ __ __ _ __ _");
  1874.    this.initMoteur();
  1875. };
  1876. this.InitOk = function()
  1877. {
  1878.    trace("InitOk");
  1879.    if(HOTE == undefined)
  1880.    {
  1881.       this.Start();
  1882.    }
  1883.    else
  1884.    {
  1885.       HOTE.InitFin(this);
  1886.    }
  1887. };
  1888. this.Start = function()
  1889. {
  1890.    gereCursor("fleche");
  1891.    this.gotoAndStop("START");
  1892.    trace("start.as");
  1893. };
  1894. if(HOTE == undefined)
  1895. {
  1896.    this.onEnterFrame = function()
  1897.    {
  1898.       var _loc2_ = this.getBytesLoaded();
  1899.       var _loc3_ = this.getBytesTotal();
  1900.       if(_loc2_ >= _loc3_)
  1901.       {
  1902.          this.Init();
  1903.          delete this.onEnterFrame;
  1904.       }
  1905.    };
  1906. }
  1907. stop();
  1908.