home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 149 / MOBICLIC149.ISO / pc / DATA / EPP149 / EPP149_00 / EPP149_00.swf / scripts / frame_1 / DoAction.as < prev   
Text File  |  2012-11-21  |  27KB  |  1,105 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.          break;
  70.       case "bi":
  71.       case "BI":
  72.          trace("-------  BI on-----------");
  73.          BT_AIDE.BT_AIDE.gotoAndPlay("E2");
  74.    }
  75. }
  76. function testeFinCommentSpecial()
  77. {
  78.    switch(gCommentOn.id.split("_")[gCommentOn.id.split("_").length - 1])
  79.    {
  80.       case "bz":
  81.       case "BZ":
  82.          trace("-------  BZ off-----------");
  83.          ActiveOEIL();
  84.          BT_OEIL.OEIL_P.gotoAndPlay("rentre");
  85.          BT_OEIL.gClicOn = undefined;
  86.          break;
  87.       case "ze":
  88.       case "ZE":
  89.          trace("-------  ZE off-----------");
  90.          ActiveOEIL();
  91.          BT_OEIL.OEIL_P.gotoAndPlay("rentre");
  92.          BT_OEIL.gClicOn = undefined;
  93.          masquerRolls();
  94.          break;
  95.       case "bi":
  96.       case "BI":
  97.          trace("-------  BI off-----------");
  98.          BT_AIDE.BT_AIDE.gotoAndPlay("E1");
  99.    }
  100. }
  101. function stopComment()
  102. {
  103.    if(gCommentOn !== undefined)
  104.    {
  105.       testeFinCommentSpecial();
  106.       delete gCommentOn.onSoundComplete;
  107.       gCommentOn.stop();
  108.       gCommentOn = undefined;
  109.       if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
  110.       {
  111.          soundObjects[gMusic].setVolume(gVolume);
  112.       }
  113.       if(gPauseOn == undefined || gPauseOn == 0)
  114.       {
  115.          removeMovieClip("mcClicZap");
  116.       }
  117.       gBlockST = undefined;
  118.       gereTextes.masqueST();
  119.       if(gClipTarget !== undefined)
  120.       {
  121.          gClipTarget.gotoAndStop(gClipTargetLabel);
  122.          gClipTarget = undefined;
  123.          gClipTargetLabel = undefined;
  124.       }
  125.    }
  126. }
  127. function pauseComment()
  128. {
  129.    trace("pauseComment " + gCommentOn);
  130.    if(gCommentOn !== undefined)
  131.    {
  132.       gCommentOn.stop();
  133.       mcClicZap._visible = false;
  134.    }
  135. }
  136. function continueComment()
  137. {
  138.    trace("continueComment " + gCommentOn);
  139.    if(gCommentOn !== undefined)
  140.    {
  141.       gCommentOn.start(gCommentOn.position / 1000);
  142.       mcClicZap._visible = true;
  143.    }
  144. }
  145. function joueSon(p)
  146. {
  147.    var _loc4_ = p.nomSon;
  148.    gSoundString = _loc4_;
  149.    if(p.mc !== undefined)
  150.    {
  151.       gClipRef = p.mc;
  152.    }
  153.    else
  154.    {
  155.       gClipRef = _root;
  156.    }
  157.    if(p.zapBlock !== undefined)
  158.    {
  159.       gClicZap = p.zapBlock;
  160.    }
  161.    else
  162.    {
  163.       gClicZap = "ZAP_BLOCK";
  164.    }
  165.    if(p.actionFin !== undefined)
  166.    {
  167.       gActionFinSon = p.actionFin;
  168.    }
  169.    else
  170.    {
  171.       gActionFinSon = "PLAY";
  172.    }
  173.    stopComment();
  174.    if(p.mcCible !== undefined)
  175.    {
  176.       if(typeof p.mcCible == "movieclip")
  177.       {
  178.          gClipTarget = p.mcCible;
  179.       }
  180.       else
  181.       {
  182.          gClipTarget = gClipRef[p.mcCible];
  183.       }
  184.       if(p.mcLabelOut !== undefined)
  185.       {
  186.          gClipTargetLabel = p.mcLabelOut;
  187.       }
  188.       else
  189.       {
  190.          gClipTargetLabel = gClipTarget._currentframe;
  191.       }
  192.       if(p.mcLabelIn !== undefined)
  193.       {
  194.          gClipTarget.gotoAndPlay(p.mcLabelIn);
  195.       }
  196.       else
  197.       {
  198.          gClipTarget.gotoAndPlay("parle");
  199.       }
  200.    }
  201.    gCommentName = "S_" + gLangue + "_" + gModuleName + "_";
  202.    trace("joueSon " + gCommentName + _loc4_);
  203.    mySound = soundObjects[gCommentName + _loc4_];
  204.    if(mySound !== undefined)
  205.    {
  206.       gCommentOn = mySound;
  207.       gCommentOn.p = p;
  208.       gCommentOn.id = gCommentName + _loc4_;
  209.       testeDebutCommentSpecial();
  210.       if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
  211.       {
  212.          soundObjects[gMusic].setVolume(gVolume * 40 / 100);
  213.       }
  214.       mySound.setVolume(gVolume);
  215.       if(gCommentOnPausePos !== undefined)
  216.       {
  217.          mySound.start(gCommentOnPausePos / 1000);
  218.          gCommentOnPause = undefined;
  219.          gCommentOnPausePos = undefined;
  220.       }
  221.       else
  222.       {
  223.          mySound.start();
  224.       }
  225.    }
  226.    else
  227.    {
  228.       trace("______" + getSoundByID(gCommentName + _loc4_) + gCommentName);
  229.       var _loc5_ = getSoundByID(gCommentName + _loc4_);
  230.       if(_loc5_ !== undefined)
  231.       {
  232.          mySound = new Sound();
  233.          mySound.onLoad = function(success)
  234.          {
  235.             if(success)
  236.             {
  237.                if(gCommentOnPausePos !== undefined)
  238.                {
  239.                   mySound.start(gCommentOnPausePos / 1000);
  240.                   gCommentOnPause = undefined;
  241.                   gCommentOnPausePos = undefined;
  242.                }
  243.                else
  244.                {
  245.                   mySound.start();
  246.                }
  247.             }
  248.          };
  249.          mySound.loadSound(this.gModulePath + _loc5_.attributes.src,true);
  250.          gCommentOn = mySound;
  251.          gCommentOn.p = p;
  252.          gCommentOn.id = gCommentName + _loc4_;
  253.          testeDebutCommentSpecial();
  254.          if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
  255.          {
  256.             soundObjects[gMusic].setVolume(gVolume * 40 / 100);
  257.          }
  258.       }
  259.    }
  260.    if(mySound == undefined)
  261.    {
  262.       return undefined;
  263.    }
  264.    mySound.onSoundComplete = commentFini;
  265.    if(gClicZap !== "NOZAP_NOBLOCK")
  266.    {
  267.       mcClicZap = creerRectangle({nom:"mcClicZap",pere:_root,level:15000,width:gWidth,height:gHeight,x:0,y:0,alpha:0});
  268.       switch(gClicZap.split("_")[0])
  269.       {
  270.          case "ZAP":
  271.             mcClicZap.useHandCursor = false;
  272.             mcClicZap.onPress = function()
  273.             {
  274.                if(gCommentOn.position !== gCommentOn.duration)
  275.                {
  276.                   trace("clic zap son");
  277.                   stopSon();
  278.                }
  279.             };
  280.             break;
  281.          case "NOZAP":
  282.             mcClicZap.useHandCursor = false;
  283.             mcClicZap.onPress = function()
  284.             {
  285.                trace("no clic allowed");
  286.             };
  287.       }
  288.       mcClicZap._visible = true;
  289.    }
  290.    if(gST == 1 && gBlockST == undefined)
  291.    {
  292.       gereTextes.afficheST(gCommentName + _loc4_);
  293.    }
  294. }
  295. function creerClicZap(p)
  296. {
  297.    if(_global.mcClicZap2 != undefined)
  298.    {
  299.       removeMovieClip(_root.mcClicZap2);
  300.    }
  301.    var _loc0_ = null;
  302.    var _loc4_ = _global.mcClicZap2 = creerRectangle({nom:"mcClicZap2",pere:_root,level:15001,width:gWidth,height:gHeight,x:0,y:0,alpha:0});
  303.    _loc4_.p = p;
  304.    _loc4_.useHandCursor = false;
  305.    _loc4_.onPress = function()
  306.    {
  307.       trace("clic zap " + this.p);
  308.       this.p.retour.call(this.p.ecouteur);
  309.       removeMovieClip(this);
  310.       _global.mcClicZap2 = undefined;
  311.    };
  312.    _loc4_._visible = true;
  313. }
  314. function creerRectangle(p)
  315. {
  316.    var _loc15_ = p.x != undefined ? p.x : 0;
  317.    var _loc13_ = p.y != undefined ? p.y : 0;
  318.    if(p.w != undefined)
  319.    {
  320.       var _loc16_ = p.w;
  321.    }
  322.    else if(p.width != undefined)
  323.    {
  324.       _loc16_ = p.width;
  325.    }
  326.    if(p.h != undefined)
  327.    {
  328.       var _loc14_ = p.h;
  329.    }
  330.    else if(p.height != undefined)
  331.    {
  332.       _loc14_ = p.height;
  333.    }
  334.    var _loc11_ = p.pere != undefined ? p.pere : _root;
  335.    var _loc9_ = p.level != undefined ? p.level : 10;
  336.    var _loc12_ = p.couleur != undefined ? p.couleur : 0;
  337.    var _loc10_ = p.nom != undefined ? p.nom : "ClipSansNom";
  338.    var _loc4_ = p.courbure != undefined ? p.courbure : 0;
  339.    var _loc17_ = p.alpha != undefined ? p.alpha : 100;
  340.    var _loc6_ = 0;
  341.    var _loc7_ = 0;
  342.    var _loc8_ = _loc16_;
  343.    var _loc5_ = _loc14_;
  344.    var _loc3_ = _loc11_.createEmptyMovieClip(_loc10_,_loc9_);
  345.    _loc3_.beginFill(_loc12_,_loc17_);
  346.    _loc3_.moveTo(_loc6_,_loc5_ - _loc4_);
  347.    _loc3_.lineTo(_loc6_,_loc7_ + _loc4_);
  348.    _loc3_.curveTo(_loc6_,_loc7_,_loc6_ + _loc4_,_loc7_);
  349.    _loc3_.lineTo(_loc8_ - _loc4_,_loc7_);
  350.    _loc3_.curveTo(_loc8_,_loc7_,_loc8_,_loc7_ + _loc4_);
  351.    _loc3_.lineTo(_loc8_,_loc5_ - _loc4_);
  352.    _loc3_.curveTo(_loc8_,_loc5_,_loc8_ - _loc4_,_loc5_);
  353.    _loc3_.lineTo(_loc6_ + _loc4_,_loc5_);
  354.    _loc3_.curveTo(_loc6_,_loc5_,_loc6_,_loc5_ - _loc4_);
  355.    _loc3_.endFill();
  356.    _loc3_._x = _loc15_;
  357.    _loc3_._y = _loc13_;
  358.    return _loc3_;
  359. }
  360. function stopSon()
  361. {
  362.    gCommentOn.stop();
  363.    commentFini();
  364. }
  365. function commentFini()
  366. {
  367.    testeFinCommentSpecial();
  368.    gCommentOn = undefined;
  369.    if(gClicZap !== "NOZAP_NOBLOCK")
  370.    {
  371.       removeMovieClip("mcClicZap");
  372.    }
  373.    gBlockST = undefined;
  374.    gereTextes.masqueST();
  375.    if(gMusicOn == 1 && gMusic !== undefined && gBlockMusic == undefined)
  376.    {
  377.       soundObjects[gMusic].setVolume(gVolume);
  378.    }
  379.    if(gClipTarget !== undefined)
  380.    {
  381.       gClipTarget.gotoAndStop(gClipTargetLabel);
  382.       gClipTarget = undefined;
  383.       gClipTargetLabel = undefined;
  384.    }
  385.    switch(gActionFinSon)
  386.    {
  387.       case "RIEN":
  388.          break;
  389.       case "PLAY":
  390.          if(_root.gNextLabel == undefined)
  391.          {
  392.             if(gLineaireOn != undefined)
  393.             {
  394.                var _loc2_ = gimme2digits(Number(gSoundString.split("_")[gSoundString.split("_").length - 1]) + 1);
  395.                var _loc3_ = gLineaireOn + _loc2_;
  396.                gClipRef.gotoAndStop(_loc3_);
  397.                joueSon({mc:gClipRef,nomSon:_loc2_,zapBlock:gClicZap,actionFin:gActionFinSon});
  398.             }
  399.             else
  400.             {
  401.                gClipRef.play();
  402.             }
  403.          }
  404.          else
  405.          {
  406.             gClipRef.gotoAndPlay(_root.gNextLabel);
  407.             _root.gNextLabel = undefined;
  408.             gLineaireOn = undefined;
  409.          }
  410.          break;
  411.       default:
  412.          gClipRef[gActionFinSon]();
  413.    }
  414. }
  415. function joueBruitage(p)
  416. {
  417.    var _loc1_ = soundObjects[gBruitageName + p.nomSon];
  418.    if(gListeBruitage == undefined)
  419.    {
  420.       gListeBruitage = [];
  421.       gListeA_fin_Bruitage = [];
  422.       gListeLoop_Bruitage = [];
  423.    }
  424.    _loc1_.setVolume(gVolume);
  425.    _loc1_.id = p.nomSon;
  426.    gListeBruitage.push(_loc1_.id);
  427.    if(p.actionFin !== undefined)
  428.    {
  429.       gActionFinBruitage = p.actionFin;
  430.       gListeA_fin_Bruitage.push(gActionFinBruitage);
  431.    }
  432.    else
  433.    {
  434.       gActionFinBruitage = undefined;
  435.       gListeA_fin_Bruitage.push("");
  436.    }
  437.    _loc1_.p = p;
  438.    _loc1_.onSoundComplete = mx.utils.Delegate.create(_loc1_,finBruitage);
  439.    if(p.loopSon == undefined)
  440.    {
  441.       _loc1_.start(p.offset);
  442.       gListeLoop_Bruitage.push("");
  443.    }
  444.    else
  445.    {
  446.       _loc1_.start(p.offset,p.loopSon);
  447.       gListeLoop_Bruitage.push(p.loopSon);
  448.    }
  449.    if(_loc1_ == undefined)
  450.    {
  451.       trace("joueBruitage : " + p.nomSon + " : " + _loc1_);
  452.    }
  453. }
  454. function stopBruitage(p)
  455. {
  456.    var _loc1_ = soundObjects[gBruitageName + p.nomSon];
  457.    finBruitage(p.nomSon);
  458.    _loc1_.stop();
  459. }
  460. function finBruitage(lSon)
  461. {
  462.    if(lSon == undefined)
  463.    {
  464.       lSon = this.id;
  465.    }
  466.    if(gListeBruitage !== undefined)
  467.    {
  468.       var _loc2_ = getPos(gListeBruitage,lSon);
  469.       if(_loc2_ !== -1)
  470.       {
  471.          if(gListeA_fin_Bruitage[_loc2_] !== "")
  472.          {
  473.             if(typeof gListeA_fin_Bruitage[_loc2_] == "string")
  474.             {
  475.                gClipGen[gListeA_fin_Bruitage[_loc2_]]();
  476.             }
  477.             else
  478.             {
  479.                gListeA_fin_Bruitage[_loc2_].call(this.p.MC);
  480.             }
  481.          }
  482.          gListeA_fin_Bruitage.splice(_loc2_,1);
  483.          gListeLoop_Bruitage.splice(_loc2_,1);
  484.          gListeBruitage.splice(_loc2_,1);
  485.          if(gListeBruitage.length == 0)
  486.          {
  487.             gListeBruitage = undefined;
  488.             gListeA_fin_Bruitage = undefined;
  489.             gListeLoop_Bruitage = undefined;
  490.          }
  491.       }
  492.    }
  493. }
  494. function stopBruit(p)
  495. {
  496.    if(gListeBruitage !== undefined)
  497.    {
  498.       if(getPos(gListeBruitage,p.nomSon) !== -1)
  499.       {
  500.          var _loc1_ = soundObjects[gBruitageName + p.nomSon];
  501.          delete _loc1_.onSoundComplete;
  502.          lSon = p.nomSon;
  503.          gListeA_fin_Bruitage.splice(getPos(gListeBruitage,lSon),1);
  504.          gListeLoop_Bruitage.splice(getPos(gListeBruitage,lSon),1);
  505.          gListeBruitage.splice(getPos(gListeBruitage,lSon),1);
  506.          if(gListeBruitage.length == 0)
  507.          {
  508.             gListeBruitage = undefined;
  509.             gListeA_fin_Bruitage = undefined;
  510.             gListeLoop_Bruitage = undefined;
  511.          }
  512.          _loc1_.stop();
  513.       }
  514.    }
  515. }
  516. function stopAllBruitages(lFinBruitage)
  517. {
  518.    if(gListeBruitage !== undefined)
  519.    {
  520.       var _loc3_ = gListeBruitage.length;
  521.       var _loc1_ = _loc3_ - 1;
  522.       while(_loc1_ >= 0)
  523.       {
  524.          if(lFinBruitage == 1)
  525.          {
  526.             stopBruitage({nomSon:gListeBruitage[_loc1_]});
  527.          }
  528.          else
  529.          {
  530.             stopBruit({nomSon:gListeBruitage[_loc1_]});
  531.          }
  532.          _loc1_ = _loc1_ - 1;
  533.       }
  534.    }
  535. }
  536. function getPos(myList, myValue)
  537. {
  538.    lPresent = -1;
  539.    maPosition = 0;
  540.    while(maPosition < myList.length)
  541.    {
  542.       if(myList[maPosition] == myValue)
  543.       {
  544.          lPresent = maPosition;
  545.          break;
  546.       }
  547.       maPosition++;
  548.    }
  549.    return lPresent;
  550. }
  551. function trouvePosMax(myList)
  552. {
  553.    lMax = myList[0];
  554.    lPosMax = 0;
  555.    i = 1;
  556.    while(i < myList.length)
  557.    {
  558.       if(myList[i] > lMax)
  559.       {
  560.          lMax = myList[i];
  561.          lPosMax = i;
  562.       }
  563.       i++;
  564.    }
  565.    return lPosMax;
  566. }
  567. function duplicate(myList)
  568. {
  569.    newList = [];
  570.    i = 0;
  571.    while(i < myList.length - 1)
  572.    {
  573.       newList.push(myList[i]);
  574.       i++;
  575.    }
  576.    return newList;
  577. }
  578. function randomiseList(myList)
  579. {
  580.    var _loc3_ = duplicate(myList);
  581.    var _loc4_ = [];
  582.    var _loc5_ = _loc3_.length;
  583.    var _loc2_ = 0;
  584.    while(_loc2_ < _loc5_)
  585.    {
  586.       var _loc1_ = randomValue(0,_loc3_.length - 1);
  587.       _loc4_.push(_loc3_[_loc1_]);
  588.       _loc3_.splice(_loc1_,1);
  589.       _loc2_ = _loc2_ + 1;
  590.    }
  591.    return _loc4_;
  592. }
  593. function returnNodeByPathRandomise(nodeSent)
  594. {
  595.    var _loc4_ = new XML();
  596.    var _loc5_ = nodeSent.childNodes.length;
  597.    var _loc1_ = 0;
  598.    while(_loc1_ < _loc5_)
  599.    {
  600.       var _loc2_ = randomValue(0,nodeSent.childNodes.length - 1);
  601.       _loc4_.appendChild(nodeSent.childNodes[_loc2_]);
  602.       _loc1_ = _loc1_ + 1;
  603.    }
  604.    return _loc4_;
  605. }
  606. function zapIntro(myLabel)
  607. {
  608.    mcClicZapIntro = this.createEmptyMovieClip("mcClicZapIntro",16031);
  609.    mcClicZapIntro.attachMovie("ClipInvisible","ClipInvisible",2);
  610.    mcClicZapIntro._width = gClipGen._width;
  611.    mcClicZapIntro._height = gClipGen._height;
  612.    mcClicZapIntro._x = 0;
  613.    mcClicZapIntro._y = 0;
  614.    mcClicZapIntro.useHandCursor = false;
  615.    mcClicZapIntro.onPress = function()
  616.    {
  617.       trace("clic zappIntro " + this);
  618.       stopComment();
  619.       gotoAndPlay(myLabel);
  620.       removeZapIntro();
  621.    };
  622. }
  623. function removeZapIntro()
  624. {
  625.    trace("mcClicZapIntrO " + mcClicZapIntro._name + " " + this);
  626.    if(mcClicZapIntro._x != undefined)
  627.    {
  628.       trace("suppression");
  629.       removeMovieClip(mcClicZapIntro);
  630.    }
  631. }
  632. function onMcOut(myMc)
  633. {
  634.    gereCursor(1);
  635.    if(myMc.pLabelOut == undefined)
  636.    {
  637.       myMc.gotoAndPlay("E1");
  638.    }
  639.    else
  640.    {
  641.       myMc.gotoAndPlay(myMc.pLabelOut);
  642.    }
  643.    if(myMc.pSon.split("")[0] == "B")
  644.    {
  645.       stopBruitage({nomSon:myMc.pSon});
  646.    }
  647.    else
  648.    {
  649.       stopComment();
  650.    }
  651.    if(myMc.pIB !== undefined)
  652.    {
  653.       gereTextes.masqueIB();
  654.    }
  655. }
  656. function onMcOver(p)
  657. {
  658.    var myMc = p.mc;
  659.    myMc.pIB = p.codeIB;
  660.    if(p.nomSon == undefined)
  661.    {
  662.       if(p.nomSonC == undefined)
  663.       {
  664.          myMc.pSon = "B_" + myMc._name.split("_")[1];
  665.       }
  666.       else
  667.       {
  668.          myMc.pSon = p.nomSonC;
  669.       }
  670.    }
  671.    else
  672.    {
  673.       myMc.pSon = p.nomSon;
  674.    }
  675.    if(p.actionFin == undefined)
  676.    {
  677.       myMc.actionFin = "RIEN";
  678.    }
  679.    else
  680.    {
  681.       myMc.actionFin = p.actionFin;
  682.    }
  683.    myMc.pLabelOut = p.mcLabelOut;
  684.    myMc.onRollOver = function()
  685.    {
  686.       gereCursor(2);
  687.       if(p.mcLabelIn == undefined)
  688.       {
  689.          this.gotoAndPlay("E2");
  690.       }
  691.       else
  692.       {
  693.          this.gotoAndPlay(p.mcLabelIn);
  694.       }
  695.       if(this.pSon.split("")[0] == "B")
  696.       {
  697.          joueBruitage({nomSon:this.pSon});
  698.       }
  699.       else
  700.       {
  701.          joueSon({nomSon:this.pSon,zapBlock:"NOZAP_NOBLOCK",actionFin:this.actionFin});
  702.       }
  703.       if(this.pIB !== undefined)
  704.       {
  705.          gereTextes.afficheIB({mc:this,codeIB:this.pIB});
  706.       }
  707.    };
  708.    myMc.onRollOut = myMc.onDragOut = function()
  709.    {
  710.       onMcOut(myMc);
  711.    };
  712. }
  713. function desactiveClip(pClip)
  714. {
  715.    delete pClip.onRollOver;
  716.    delete pClip.onRollOut;
  717.    delete pClip.onDragOut;
  718.    delete pClip.onPress;
  719.    delete pClip.onRelease;
  720.    delete pClip.onReleaseOutside;
  721. }
  722. function afficheClipPos(myMc, myX, myY)
  723. {
  724.    myMc._x = myX;
  725.    myMc._y = myY;
  726.    myMc._visible = true;
  727. }
  728. function gimme2digits(X)
  729. {
  730.    if(Number(X) < 10)
  731.    {
  732.       lX = "0" + Number(X);
  733.    }
  734.    else
  735.    {
  736.       lX = String(X);
  737.    }
  738.    return lX;
  739. }
  740. function randomValue(min, max)
  741. {
  742.    var _loc1_ = Math.floor(Math.random() * (max - min + 1)) + min;
  743.    return _loc1_;
  744. }
  745. function chercheDepthPlus(myMc, myDepth)
  746. {
  747.    var _loc1_ = myDepth;
  748.    while(_loc1_ < 17000)
  749.    {
  750.       if(myMc.getInstanceAtDepth(_loc1_) == undefined)
  751.       {
  752.          break;
  753.       }
  754.       _loc1_ = _loc1_ + 1;
  755.    }
  756.    return _loc1_;
  757. }
  758. function chercheDepthMoins(myMc, myDepth)
  759. {
  760.    var _loc1_ = myDepth;
  761.    while(_loc1_ > -16383)
  762.    {
  763.       if(myMc.getInstanceAtDepth(_loc1_) == undefined)
  764.       {
  765.          break;
  766.       }
  767.       _loc1_ = _loc1_ - 1;
  768.    }
  769.    return _loc1_;
  770. }
  771. function changeST(myST)
  772. {
  773.    trace("changeST   : " + myST);
  774.    if(myST == "1")
  775.    {
  776.       gST = 1;
  777.       if(gCommentOn !== undefined)
  778.       {
  779.          gereTextes.afficheST(gCommentOn.id);
  780.       }
  781.    }
  782.    else
  783.    {
  784.       sousTitre = 0;
  785.       gST = 0;
  786.       gereTextes.masqueST(this);
  787.    }
  788. }
  789. function changeMusicOn(myChangeMusicOn)
  790. {
  791.    trace("changeMusicOn   : " + myChangeMusicOn);
  792.    switch(String(myChangeMusicOn))
  793.    {
  794.       case "1":
  795.          gMusicOn = 1;
  796.          if(gMusic == undefined)
  797.          {
  798.             gMusic = gBruitageName + "MU";
  799.          }
  800.          trace("changeMusicOn2   : " + gMusic + " - " + gVolume);
  801.          if(gBlockMusic == undefined)
  802.          {
  803.             if(gCommentOn !== undefined)
  804.             {
  805.                soundObjects[gMusic].setVolume(gVolume * 0.4);
  806.             }
  807.             else
  808.             {
  809.                soundObjects[gMusic].setVolume(gVolume);
  810.             }
  811.          }
  812.          else
  813.          {
  814.             soundObjects[gMusic].setVolume(0);
  815.          }
  816.          soundObjects[gMusic].start(0,1000);
  817.          break;
  818.       case "0":
  819.          soundObjects[gMusic].stop();
  820.          gMusicOn = 0;
  821.          break;
  822.       default:
  823.          if(gMusic !== undefined)
  824.          {
  825.             soundObjects[gMusic].stop();
  826.          }
  827.          gMusic = gBruitageName + myChangeMusicOn;
  828.          if(gMusicOn == 1)
  829.          {
  830.             if(gBlockMusic == undefined)
  831.             {
  832.                if(gCommentOn !== undefined)
  833.                {
  834.                   soundObjects[gMusic].setVolume(gVolume * 0.4);
  835.                }
  836.                else
  837.                {
  838.                   soundObjects[gMusic].setVolume(gVolume);
  839.                }
  840.             }
  841.             else
  842.             {
  843.                soundObjects[gMusic].setVolume(0);
  844.             }
  845.             soundObjects[gMusic].start(0,1000);
  846.          }
  847.    }
  848. }
  849. function changeVolume(myChangeVolume)
  850. {
  851.    trace("changeVolume   : " + myChangeVolume);
  852.    gVolume = Number(myChangeVolume);
  853.    if(gCommentOn !== undefined)
  854.    {
  855.       gCommentOn.setVolume(gVolume);
  856.       if(gMusicOn == 1)
  857.       {
  858.          soundObjects[gMusic].setVolume(gVolume * 0.4);
  859.       }
  860.    }
  861.    else if(gMusicOn == 1)
  862.    {
  863.       soundObjects[gMusic].setVolume(gVolume);
  864.    }
  865. }
  866. function DesactiveBZ()
  867. {
  868.    BT_BZ.useHandCursor = false;
  869.    BT_BZ.gBZactif = 0;
  870. }
  871. function ActiveBZ()
  872. {
  873.    BT_BZ.useHandCursor = true;
  874.    BT_BZ.gBZactif = 1;
  875. }
  876. function getRessourceByID(attributeValue, typeRessource)
  877. {
  878.    var _loc2_ = this.moduleInfo.filterNode(this.moduleInfo.returnNodeByPath("Resources.ResourcesZip"),"type",typeRessource);
  879.    mySound = undefined;
  880.    mySound = this.recusiveGetSoundByAttribute(_loc2_,"id",attributeValue);
  881.    if(mySound == undefined)
  882.    {
  883.       trace(attributeValue + " n\'existe pas dans XML");
  884.    }
  885.    return mySound;
  886. }
  887. function getSoundByID(attributeValue)
  888. {
  889.    var _loc2_ = this.moduleInfo.filterNode(this.moduleInfo.returnNodeByPath("Resources.ResourcesZip"),"type","mp3");
  890.    mySound = undefined;
  891.    mySound = this.recusiveGetSoundByAttribute(_loc2_,"id",attributeValue);
  892.    if(mySound == undefined)
  893.    {
  894.       trace(attributeValue + " n\'existe pas dans XML");
  895.    }
  896.    return mySound;
  897. }
  898. function recusiveGetSoundByAttribute(node, attribute, attributeValue)
  899. {
  900.    var _loc2_ = 0;
  901.    while(_loc2_ < node.childNodes.length)
  902.    {
  903.       if(node.childNodes[_loc2_].attributes[attribute] == attributeValue)
  904.       {
  905.          mySound = node.childNodes[_loc2_];
  906.          break;
  907.       }
  908.       if(node.childNodes[_loc2_].hasChildNodes())
  909.       {
  910.          this.recusiveGetSoundByAttribute(node.childNodes[_loc2_],attribute,attributeValue);
  911.       }
  912.       _loc2_ = _loc2_ + 1;
  913.    }
  914.    return mySound;
  915. }
  916. function gereCursor(myCursor)
  917. {
  918.    switch(myCursor)
  919.    {
  920.       case 1:
  921.       case "fleche":
  922.          myCursor = "fleche";
  923.          break;
  924.       case 2:
  925.       case "doigt":
  926.          myCursor = "doigt";
  927.          break;
  928.       case 3:
  929.       case "mainO":
  930.          myCursor = "mainO";
  931.          break;
  932.       case 4:
  933.       case "mainF":
  934.          myCursor = "mainF";
  935.          break;
  936.       case 0:
  937.       case "O":
  938.          myCursor = "O";
  939.    }
  940.    _global.CURSEUR.Action(myCursor);
  941. }
  942. function ConvertCoord(mc_src, mc_dest)
  943. {
  944.    var _loc1_ = {x:0,y:0};
  945.    mc_src.localToGlobal(_loc1_);
  946.    mc_dest.globalToLocal(_loc1_);
  947.    return _loc1_;
  948. }
  949. function OnPadRollOver()
  950. {
  951.    if(gDrag !== undefined)
  952.    {
  953.    }
  954. }
  955. function OnPadRollOut()
  956. {
  957.    if(gDrag !== undefined)
  958.    {
  959.    }
  960. }
  961. function ModulePause()
  962. {
  963.    var _loc0_ = null;
  964.    if((_loc0_ = HOTE.LocalConfig.magSom) !== "MOB")
  965.    {
  966.       trace("pause ModulePause");
  967.       if(gPauseBI == undefined)
  968.       {
  969.          pauseIntervals();
  970.       }
  971.       _moteur_.activePause(this);
  972.    }
  973. }
  974. function ModuleResume()
  975. {
  976.    var _loc0_ = null;
  977.    if((_loc0_ = HOTE.LocalConfig.magSom) !== "MOB")
  978.    {
  979.       trace("pause ModuleResume");
  980.       if(gPauseBI == undefined)
  981.       {
  982.          repriseIntervals();
  983.       }
  984.       _moteur_.desactivePause(this);
  985.    }
  986. }
  987. function initLib(p)
  988. {
  989.    trace(" ____ __ initLib _ __ _");
  990.    var _loc3_ = this;
  991.    var _loc4_ = _loc3_.createEmptyMovieClip("_" + p.nom + "_",this.getNextHighestDepth());
  992.    var _loc5_ = gLibsPath + "/" + nom_lib + "/" + nom_lib + ".swf";
  993.    this.mclR = new MovieClipLoader();
  994.    this.mclR.loadClip(p.url,_loc4_);
  995.    this.mclR.onLoadInit = function(myClip)
  996.    {
  997.       trace("onLoadInit " + myClip._name);
  998.       myClip.ChargeMoteur();
  999.       _root.Init();
  1000.    };
  1001. }
  1002. stop();
  1003. this._lockroot = true;
  1004. this.prodVersion = "prod_gen_ED";
  1005. if(_global.gModulePath == undefined)
  1006. {
  1007.    this.gModulePath = _global.gModulePath = "";
  1008. }
  1009. else
  1010. {
  1011.    this.gModulePath = _global.gModulePath;
  1012. }
  1013. _global._MOD_ = this;
  1014. this.CIBLE = this;
  1015. if(_global.HOTE != undefined)
  1016. {
  1017.    MovieClip.prototype.gHotePath = _global.gPARAMS.HOTE_DIR + "/DATA/HOTE";
  1018. }
  1019. else
  1020. {
  1021.    MovieClip.prototype.gHotePath = "../../HOTE";
  1022. }
  1023. this.prodPath = gHotePath + "/" + this.prodVersion;
  1024. MovieClip.prototype.gLibsPath = gHotePath + "/libs";
  1025. _global.stopComment = stopComment;
  1026. _global.joueSon = joueSon;
  1027. _root.creerClicZap = creerClicZap;
  1028. _global.joueBruitage = joueBruitage;
  1029. _global.stopBruitage = stopBruitage;
  1030. _global.stopBruit = stopBruit;
  1031. _global.gimme2digits = gimme2digits;
  1032. _global.randomValue = randomValue;
  1033. this.randRange = randomValue;
  1034. _global.chercheDepthPlus = chercheDepthPlus;
  1035. _global.chercheDepthMoins = chercheDepthMoins;
  1036. _global.DesactiveBZ = DesactiveBZ;
  1037. _root.DesactiveBZ = DesactiveBZ;
  1038. _global.ActiveBZ = ActiveBZ;
  1039. _root.ActiveBZ = ActiveBZ;
  1040. _global.gereCursor = gereCursor;
  1041. this.initVariables = function()
  1042. {
  1043.    trace("initVariables()");
  1044.    this.gotoAndStop("INIT");
  1045. };
  1046. _global._o_ = new Object();
  1047. MovieClip.prototype._o_ = _o_;
  1048. MovieClip.prototype._xlib1_ = undefined;
  1049. this.Init = function()
  1050. {
  1051.    trace("<<<<<<<<<<<<< Init() >>>>>>>>>>>");
  1052.    if(_xlib1_ == undefined)
  1053.    {
  1054.       initLib({nom:"xlib1",url:gLibsPath + "/xlib1/xlib1.swf"});
  1055.       return undefined;
  1056.    }
  1057.    if(_ed_ == undefined)
  1058.    {
  1059.       initLib({nom:"ed",url:gLibsPath + "/o/ed.swf"});
  1060.       return undefined;
  1061.    }
  1062.    if(_xb_ == undefined)
  1063.    {
  1064.       initLib({nom:"xb",url:gLibsPath + "/o/xb.swf"});
  1065.       return undefined;
  1066.    }
  1067.    if(_moteur_ == undefined)
  1068.    {
  1069.       initLib({nom:"moteur",url:this.prodPath + "/moteur.swf"});
  1070.       return undefined;
  1071.    }
  1072. };
  1073. this.InitOk = function()
  1074. {
  1075.    trace("<<<<<<<<<<<<< InitOk() >>>>>>>>>>>");
  1076.    if(HOTE == undefined)
  1077.    {
  1078.       this.Start();
  1079.    }
  1080.    else
  1081.    {
  1082.       HOTE.InitFin(this);
  1083.    }
  1084. };
  1085. this.Start = function()
  1086. {
  1087.    trace("<<<<<<<<<<<<< Start() >>>>>>>>>>>");
  1088.    gereCursor("fleche");
  1089.    this.gotoAndStop("START");
  1090. };
  1091. if(HOTE == undefined)
  1092. {
  1093.    this.onEnterFrame = function()
  1094.    {
  1095.       var _loc2_ = this.getBytesLoaded();
  1096.       var _loc3_ = this.getBytesTotal();
  1097.       if(_loc2_ >= _loc3_)
  1098.       {
  1099.          this.Init();
  1100.          delete this.onEnterFrame;
  1101.       }
  1102.    };
  1103. }
  1104. stop();
  1105.