home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 148 / MOBICLIC148.ISO / mac / DATA / QZZ148 / QZZ148_00 / QZZ148_00.swf / scripts / frame_76 / DoAction.as
Text File  |  2012-10-16  |  13KB  |  480 lines

  1. function finSonDEB()
  2. {
  3.    CAPITAINE.gotoAndPlay("E1");
  4. }
  5. function initBT_RETOUR()
  6. {
  7.    var _loc2_ = BT_RETOUR;
  8.    _loc2_.pBruit = "B_RETOUR";
  9.    _loc2_.pIB = "IB_07";
  10.    _loc2_.onRollOver = function()
  11.    {
  12.       gereCursor(2);
  13.       this.gotoAndPlay("E2");
  14.       joueBruitage({nomSon:this.pBruit});
  15.       var _loc3_ = this._x - 20;
  16.       var _loc2_ = this._y + 40;
  17.       gereTextes.afficheIB({codeIB:this.pIB,X:_loc3_,Y:_loc2_});
  18.    };
  19.    _loc2_.onRollOut = function()
  20.    {
  21.       gereCursor(1);
  22.       this.gotoAndPlay("E1");
  23.       stopBruitage({nomSon:this.pBruit});
  24.       gereTextes.masqueIB();
  25.    };
  26.    _loc2_.onPress = function()
  27.    {
  28.       gereCursor(1);
  29.       stopBruitage({nomSon:this.pBruit});
  30.       gereTextes.masqueIB();
  31.       gotoAndStop("ATTENTE_1");
  32.       play();
  33.    };
  34. }
  35. function testDebut(lDontDoIt)
  36. {
  37.    if(lDontDoIt == undefined)
  38.    {
  39.       gCarte = "CARTE_2";
  40.       CARTE.CARTE.gotoAndPlay("E2");
  41.    }
  42.    initAVATAR();
  43.    if(gTypePartie == 1)
  44.    {
  45.       if(gFirstTime == 1)
  46.       {
  47.          var _loc2_ = "I_03A_01";
  48.       }
  49.       else
  50.       {
  51.          _loc2_ = "I_03A_02";
  52.          if(lDontDoIt == undefined)
  53.          {
  54.             initPROFIL();
  55.          }
  56.       }
  57.    }
  58.    else
  59.    {
  60.       initBT_OK_CADRE();
  61.       if(gFirstTime == 1)
  62.       {
  63.          _loc2_ = "I_03B_01";
  64.       }
  65.       else
  66.       {
  67.          _loc2_ = "I_03B_02";
  68.          if(lDontDoIt == undefined)
  69.          {
  70.             initPROFIL();
  71.          }
  72.       }
  73.    }
  74.    if(gIntro == true)
  75.    {
  76.       gIntro = undefined;
  77.       CAPITAINE.gotoAndPlay("E2");
  78.       joueSon({nomSon:_loc2_,actionFin:"finSonDEB"});
  79.    }
  80. }
  81. function initAVATAR()
  82. {
  83.    var _loc2_ = CARTE.CARTE[gCarte].AVATAR;
  84.    _loc2_.pBruit = "B_AVATAR";
  85.    _loc2_.pIB = "IB_03";
  86.    _loc2_.onRollOver = function()
  87.    {
  88.       gereCursor(2);
  89.       this.gotoAndPlay("E2");
  90.       joueBruitage({nomSon:this.pBruit});
  91.       var _loc3_ = this._x + CARTE._x - 230;
  92.       var _loc2_ = this._y + CARTE._y + 70;
  93.       gereTextes.afficheIB({codeIB:this.pIB,X:_loc3_,Y:_loc2_});
  94.    };
  95.    _loc2_.onRollOut = function()
  96.    {
  97.       gereCursor(1);
  98.       this.gotoAndPlay("E1");
  99.       stopBruitage({nomSon:this.pBruit});
  100.       gereTextes.masqueIB();
  101.    };
  102.    _loc2_.onPress = function()
  103.    {
  104.       gereCursor(1);
  105.       stopBruitage({nomSon:this.pBruit});
  106.       gereTextes.masqueIB();
  107.       joueBruitage({nomSon:"B_CARTE"});
  108.       gCarte = "CARTE_3";
  109.       CARTE.CARTE.gotoAndPlay("E3");
  110.       if(gTypePartie == 1)
  111.       {
  112.          var _loc2_ = "I_AVATAR_01";
  113.       }
  114.       else
  115.       {
  116.          _loc2_ = "I_AVATAR_02";
  117.       }
  118.       if(gDoneSonAvatar == undefined)
  119.       {
  120.          gDoneSonAvatar = true;
  121.          CAPITAINE.gotoAndPlay("E2");
  122.          joueSon({nomSon:_loc2_,actionFin:"finSonDEB"});
  123.       }
  124.       else
  125.       {
  126.          finSonDEB();
  127.       }
  128.    };
  129. }
  130. function initPROFIL()
  131. {
  132.    var _loc2_ = CARTE.CARTE[gCarte].PROFIL;
  133.    _loc2_.gotoAndPlay("E1");
  134.    _loc2_.pBruit = "B_PROFIL";
  135.    _loc2_.pIB = "IB_PROFIL";
  136.    _loc2_.onRollOver = function()
  137.    {
  138.       gereCursor(2);
  139.       this.gotoAndPlay("E2");
  140.       joueBruitage({nomSon:this.pBruit});
  141.       var _loc3_ = this._x + CARTE._x - 230;
  142.       var _loc2_ = this._y + CARTE._y + 70;
  143.       gereTextes.afficheIB({codeIB:this.pIB,X:_loc3_,Y:_loc2_});
  144.    };
  145.    _loc2_.onRollOut = function()
  146.    {
  147.       gereCursor(1);
  148.       this.gotoAndPlay("E1");
  149.       stopBruitage({nomSon:this.pBruit});
  150.       gereTextes.masqueIB();
  151.    };
  152.    _loc2_.onPress = function()
  153.    {
  154.       gereCursor(1);
  155.       stopBruitage({nomSon:this.pBruit});
  156.       gereTextes.masqueIB();
  157.       joueBruitage({nomSon:"B_CARTE"});
  158.       gCarte = "CARTE_4";
  159.       CARTE.CARTE.gotoAndPlay("E4");
  160.    };
  161. }
  162. function testeAvatarDejaPris(lAvat)
  163. {
  164.    var _loc2_ = false;
  165.    var _loc3_ = gListeJoueur.length;
  166.    var _loc1_ = 0;
  167.    while(_loc1_ <= _loc3_)
  168.    {
  169.       if(gListeJoueur[_loc1_].Avatar == lAvat)
  170.       {
  171.          _loc2_ = true;
  172.          break;
  173.       }
  174.       _loc1_ = _loc1_ + 1;
  175.    }
  176.    return _loc2_;
  177. }
  178. function initAVATARS()
  179. {
  180.    gInfosJoueur = new Object();
  181.    var _loc6_ = 10;
  182.    var _loc4_ = 1;
  183.    while(_loc4_ <= _loc6_)
  184.    {
  185.       var _loc3_ = CARTE.CARTE[gCarte]["AVATAR_" + gimme2digits(_loc4_)];
  186.       _loc3_._alpha = 100;
  187.       _loc3_.pNum = _loc4_;
  188.       _loc3_.pBruit = "B_AVATAR";
  189.       _loc3_.onRollOver = function()
  190.       {
  191.          gereCursor(2);
  192.          this.gotoAndPlay("E2");
  193.          joueBruitage({nomSon:this.pBruit});
  194.       };
  195.       _loc3_.onRollOut = function()
  196.       {
  197.          gereCursor(1);
  198.          this.gotoAndPlay("E1");
  199.          stopBruitage({nomSon:this.pBruit});
  200.       };
  201.       _loc3_.onPress = function()
  202.       {
  203.          trace("PRESS AVATAR " + this.pNum);
  204.          gereCursor(1);
  205.          stopBruitage({nomSon:this.pBruit});
  206.          trace("gInfosJoueur.Pseudo = " + gInfosJoueur.Pseudo);
  207.          gInfosJoueur.Avatar = this.pNum;
  208.          _root.gotoAndPlay("FEN_1");
  209.       };
  210.       _loc4_ = _loc4_ + 1;
  211.    }
  212. }
  213. function desinitAVATARS()
  214. {
  215.    var _loc3_ = 10;
  216.    var _loc1_ = 1;
  217.    while(_loc1_ <= _loc3_)
  218.    {
  219.       var _loc2_ = CARTE.CARTE[gCarte]["AVATAR_" + gimme2digits(_loc1_)];
  220.       desactiveClip(_loc2_);
  221.       _loc1_ = _loc1_ + 1;
  222.    }
  223. }
  224. function initPROFILS(mc, lProfil)
  225. {
  226.    var _loc5_ = CARTE.CARTE[gCarte].gPage;
  227.    var _loc3_ = mc["AVATAR_" + gimme2digits(mc.pInfosJoueur.Avatar)];
  228.    if(mc._visible == true)
  229.    {
  230.       if(getPos(gListeJoueur,mc.pInfosJoueur) == -1)
  231.       {
  232.          _loc3_._alpha = 100;
  233.          _loc3_.useHandCursor = true;
  234.          _loc3_.pNum = lProfil + 10 * (_loc5_ - 1);
  235.          _loc3_.pBruit = "B_PROFIL";
  236.          _loc3_.pIB = "IB_" + mc.pInfosJoueur.Pseudo;
  237.          _loc3_.pIB_texte = mc.pInfosJoueur.Pseudo;
  238.          _loc3_.onRollOver = function()
  239.          {
  240.             gereCursor(2);
  241.             this.gotoAndPlay("E2");
  242.             joueBruitage({nomSon:this.pBruit});
  243.             var _loc3_ = this._parent._x + CARTE._x + CARTE.CARTE._x + CARTE.CARTE[gCarte]._x + 20;
  244.             var _loc2_ = this._parent._y + CARTE._y + CARTE.CARTE._y + CARTE.CARTE[gCarte]._y + 60;
  245.             gereTextes.afficheIB({codeIB:this.pIB,texte:this.pIB_texte,X:_loc3_,Y:_loc2_});
  246.          };
  247.          _loc3_.onRollOut = function()
  248.          {
  249.             gereCursor(1);
  250.             this.gotoAndPlay("E1");
  251.             stopBruitage({nomSon:this.pBruit});
  252.             gereTextes.masqueIB();
  253.          };
  254.          _loc3_.onPress = function()
  255.          {
  256.             this._alpha = 50;
  257.             gereTextes.masqueIB();
  258.             desactiveClip(this);
  259.             gereCursor(1);
  260.             stopBruitage({nomSon:this.pBruit});
  261.             gInfosJoueur = this._parent.pInfosJoueur;
  262.             gListeJoueur.push(this._parent.pInfosJoueur);
  263.             if(gTypePartie == 1)
  264.             {
  265.                gotoAndStop("TRANSIT_01");
  266.                play();
  267.             }
  268.             else
  269.             {
  270.                ajouteCadreJoueur(gInfosJoueur,gJoueur);
  271.                joueBruitage({nomSon:"B_OK"});
  272.                if(gJoueur == 1)
  273.                {
  274.                   CAPITAINE.gotoAndPlay("E2");
  275.                   joueSon({nomSon:"I_03B_CADRE",actionFin:"finSonDEB"});
  276.                }
  277.                if(gJoueur < 4)
  278.                {
  279.                   gJoueur += 1;
  280.                   gInfosJoueur = new Object();
  281.                   testDebut(1);
  282.                   var _loc2_ = 1;
  283.                   while(_loc2_ <= 10)
  284.                   {
  285.                      initProfilChoix(_loc2_);
  286.                      _loc2_ = _loc2_ + 1;
  287.                   }
  288.                }
  289.                else
  290.                {
  291.                   gJoueur += 1;
  292.                   gCarte = "CARTE_1";
  293.                   CARTE.CARTE.gotoAndPlay("E1");
  294.                   CARTE.PANNEAU_CADRE.BT_OK.gotoAndPlay("E3");
  295.                }
  296.             }
  297.          };
  298.       }
  299.       else
  300.       {
  301.          _loc3_._alpha = 50;
  302.          _loc3_.useHandCursor = false;
  303.          delete _loc3_.onPress;
  304.          _loc3_.pIB = "IB_" + mc.pInfosJoueur.Pseudo;
  305.          _loc3_.pIB_texte = mc.pInfosJoueur.Pseudo;
  306.          _loc3_.onRollOver = function()
  307.          {
  308.             var _loc3_ = this._parent._x + CARTE._x + CARTE.CARTE._x + CARTE.CARTE[gCarte]._x + 20;
  309.             var _loc2_ = this._parent._y + CARTE._y + CARTE.CARTE._y + CARTE.CARTE[gCarte]._y + 60;
  310.             gereTextes.afficheIB({codeIB:this.pIB,texte:this.pIB_texte,X:_loc3_,Y:_loc2_});
  311.          };
  312.          _loc3_.onRollOut = function()
  313.          {
  314.             gereTextes.masqueIB();
  315.          };
  316.       }
  317.    }
  318. }
  319. function initProfilChoix(lProfil)
  320. {
  321.    trace("myPage " + CARTE.CARTE[gCarte].gPage);
  322.    var _loc2_ = CARTE.CARTE[gCarte].gPage;
  323.    var _loc4_ = CARTE.CARTE[gCarte]["PROFIL_" + gimme2digits(lProfil)];
  324.    var _loc3_ = CARTE.CARTE[gCarte]["BT_CROIX_" + gimme2digits(lProfil)];
  325.    trace("lProfil = " + lProfil);
  326.    trace("gListeProfil[lProfil-1+(10*(myPage-1))].Pseudo = " + gListeProfil[lProfil - 1 + 10 * (_loc2_ - 1)].Pseudo);
  327.    if(gListeProfil[lProfil - 1 + 10 * (_loc2_ - 1)] !== undefined)
  328.    {
  329.       _loc4_._visible = true;
  330.       _loc3_._visible = true;
  331.       _loc4_.gotoAndStop(gListeProfil[lProfil - 1 + 10 * (_loc2_ - 1)].Avatar);
  332.       _loc4_.pInfosJoueur = gListeProfil[lProfil - 1 + 10 * (_loc2_ - 1)];
  333.       _loc3_.gotoAndPlay("E1");
  334.       _loc3_.pNum = lProfil - 1 + 10 * (_loc2_ - 1);
  335.       initBTSuppProfil(_loc3_);
  336.       initPROFILS(_loc4_,lProfil);
  337.    }
  338.    else
  339.    {
  340.       _loc4_._visible = false;
  341.       _loc3_._visible = false;
  342.    }
  343. }
  344. function initBTSuppProfil(mc)
  345. {
  346.    mc.pIB = "IB_CROIX_SUP";
  347.    var _loc6_ = CARTE.CARTE[gCarte].gPage;
  348.    mc.onRollOver = function()
  349.    {
  350.       gereCursor(2);
  351.       this.gotoAndPlay("E2");
  352.       var _loc3_ = this._x + CARTE._x + CARTE.CARTE._x + CARTE.CARTE[gCarte]._x;
  353.       var _loc2_ = this._y + CARTE._y + CARTE.CARTE._y + CARTE.CARTE[gCarte]._y - 60;
  354.       gereTextes.afficheIB({codeIB:this.pIB,X:_loc3_,Y:_loc2_});
  355.    };
  356.    mc.onRollOut = function()
  357.    {
  358.       gereCursor(1);
  359.       this.gotoAndPlay("E1");
  360.       gereTextes.masqueIB();
  361.    };
  362.    mc.onPress = function()
  363.    {
  364.       gereCursor(1);
  365.       this.gotoAndPlay("E1");
  366.       gereTextes.masqueIB();
  367.       gProfilSup = this.pNum;
  368.       gotoAndStop("FEN_2");
  369.       play();
  370.    };
  371. }
  372. function desinitPROFILS()
  373. {
  374.    var _loc1_ = 1;
  375.    while(_loc1_ < 10)
  376.    {
  377.       var _loc2_ = CARTE.CARTE[gCarte]["PROFIL_" + gimme2digits(_loc1_)];
  378.       desactiveClip(_loc2_);
  379.       _loc1_ = _loc1_ + 1;
  380.    }
  381. }
  382. function desinitTousBTSuppProfil()
  383. {
  384.    var _loc1_ = 1;
  385.    while(_loc1_ < 10)
  386.    {
  387.       var _loc2_ = CARTE.CARTE[gCarte]["BT_CROIX_" + gimme2digits(_loc1_)];
  388.       desactiveClip(_loc2_);
  389.       _loc1_ = _loc1_ + 1;
  390.    }
  391. }
  392. function initFlechesProfilChoix()
  393. {
  394.    var _loc1_ = CARTE.CARTE[gCarte].gPage;
  395.    trace("myPage = " + _loc1_);
  396.    if(_loc1_ == 1)
  397.    {
  398.       CARTE.CARTE[gCarte].BT_FLECHE_D._visible = false;
  399.       trace("gListeProfil.length = " + gListeProfil.length);
  400.       trace("(10*myPage) = " + 10 * _loc1_);
  401.       if(gListeProfil.length <= 10 * _loc1_)
  402.       {
  403.          CARTE.CARTE[gCarte].BT_FLECHE_G._visible = false;
  404.       }
  405.       else
  406.       {
  407.          initProfilBT_FLECHE_G();
  408.       }
  409.    }
  410.    else
  411.    {
  412.       initProfilBT_FLECHE_D();
  413.       trace("gListeProfil.length = " + gListeProfil.length);
  414.       trace("(10*myPage) = " + 10 * _loc1_);
  415.       if(gListeProfil.length <= 10 * _loc1_)
  416.       {
  417.          CARTE.CARTE[gCarte].BT_FLECHE_G._visible = false;
  418.       }
  419.       else
  420.       {
  421.          initProfilBT_FLECHE_G();
  422.       }
  423.    }
  424. }
  425. function initProfilBT_FLECHE_G()
  426. {
  427.    var _loc2_ = CARTE.CARTE[gCarte].BT_FLECHE_G;
  428.    _loc2_.onRollOver = function()
  429.    {
  430.       gereCursor(2);
  431.       this.gotoAndPlay("E2");
  432.    };
  433.    _loc2_.onRollOut = function()
  434.    {
  435.       gereCursor(1);
  436.       this.gotoAndPlay("E1");
  437.    };
  438.    _loc2_.onPress = function()
  439.    {
  440.       gereCursor(1);
  441.       joueBruitage({nomSon:"B_FLECHE"});
  442.       this.gotoAndPlay("E1");
  443.       CARTE.CARTE[gCarte].gPage += 1;
  444.       CARTE.CARTE[gCarte].gotoAndPlay("retour");
  445.    };
  446. }
  447. function initProfilBT_FLECHE_D()
  448. {
  449.    var _loc2_ = CARTE.CARTE[gCarte].BT_FLECHE_D;
  450.    _loc2_.onRollOver = function()
  451.    {
  452.       gereCursor(2);
  453.       this.gotoAndPlay("E2");
  454.    };
  455.    _loc2_.onRollOut = function()
  456.    {
  457.       gereCursor(1);
  458.       this.gotoAndPlay("E1");
  459.    };
  460.    _loc2_.onPress = function()
  461.    {
  462.       gereCursor(1);
  463.       joueBruitage({nomSon:"B_FLECHE"});
  464.       this.gotoAndPlay("E1");
  465.       CARTE.CARTE[gCarte].gPage -= 1;
  466.       CARTE.CARTE[gCarte].gotoAndPlay("retour");
  467.    };
  468. }
  469. delete onEnterFrame;
  470. initBT_RETOUR();
  471. if(gFromSup == undefined)
  472. {
  473.    testDebut();
  474. }
  475. else
  476. {
  477.    gFromSup = undefined;
  478. }
  479. stop();
  480.