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