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