home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 161 / MOBICLIC161.ISO / mac / DATA / QZZ161 / QZZ161_00 / QZZ161_00.swf / scripts / frame_95 / DoAction.as
Text File  |  2014-01-15  |  6KB  |  234 lines

  1. function initFermerCadre()
  2. {
  3.    var _loc2_ = FEN_01.BT_FERMER_FEN;
  4.    _loc2_.onRollOver = function()
  5.    {
  6.       gereCursor(2);
  7.       this.gotoAndPlay("E2");
  8.    };
  9.    _loc2_.onRollOut = function()
  10.    {
  11.       gereCursor(1);
  12.       this.gotoAndPlay("E1");
  13.    };
  14.    _loc2_.onPress = function()
  15.    {
  16.       this.gotoAndPlay("E1");
  17.       gereCursor(1);
  18.       var _loc2_ = CARTE.CARTE[gCarte]["AVATAR_" + gimme2digits(gInfosJoueur.Avatar)];
  19.       _loc2_.gotoAndPlay("E1");
  20.       gFromSup = true;
  21.       gotoAndStop("ATTENTE_2");
  22.       play();
  23.    };
  24. }
  25. function initFille()
  26. {
  27.    var _loc2_ = FEN_01.BT_FILLE;
  28.    _loc2_.pLettre = "F";
  29.    _loc2_.gotoAndPlay("E1");
  30.    _loc2_.onRollOver = function()
  31.    {
  32.       gereCursor(2);
  33.    };
  34.    _loc2_.onRollOut = function()
  35.    {
  36.       gereCursor(1);
  37.    };
  38.    _loc2_.onPress = function()
  39.    {
  40.       this.gotoAndPlay("E2");
  41.       gereCursor(1);
  42.       gInfosJoueur.Sexe = this.pLettre;
  43.       desactiveClip(this);
  44.       initGarcon();
  45.    };
  46. }
  47. function initGarcon()
  48. {
  49.    var _loc2_ = FEN_01.BT_GARCON;
  50.    _loc2_.pLettre = "G";
  51.    _loc2_.gotoAndPlay("E1");
  52.    _loc2_.onRollOver = function()
  53.    {
  54.       gereCursor(2);
  55.    };
  56.    _loc2_.onRollOut = function()
  57.    {
  58.       gereCursor(1);
  59.    };
  60.    _loc2_.onPress = function()
  61.    {
  62.       this.gotoAndPlay("E2");
  63.       gereCursor(1);
  64.       gInfosJoueur.Sexe = this.pLettre;
  65.       initFille();
  66.       desactiveClip(this);
  67.    };
  68. }
  69. function testePseudoDejaPris(lPseudo)
  70. {
  71.    var _loc3_ = videEspaces(lPseudo);
  72.    trace("lPseudoSansEspace  = ." + _loc3_ + ".");
  73.    trace("testePseudoDejaPris " + lPseudo);
  74.    var _loc4_ = false;
  75.    var _loc5_ = gListeProfil.length;
  76.    var _loc1_ = 0;
  77.    while(_loc1_ < _loc5_)
  78.    {
  79.       trace("gListeProfil[j].Pseudo = " + gListeProfil[_loc1_].Pseudo);
  80.       trace("String(gListeProfil[j].Pseudo) == String(lPseudo) = " + (String(gListeProfil[_loc1_].Pseudo) == String(lPseudo)));
  81.       trace("String(gListeProfil[j].Pseudo) == lPseudo = " + (String(gListeProfil[_loc1_].Pseudo) == lPseudo));
  82.       if(String(gListeProfil[_loc1_].Pseudo) == lPseudo || String(gListeProfil[_loc1_].Pseudo) == _loc3_)
  83.       {
  84.          trace("pris !");
  85.          _loc4_ = true;
  86.          break;
  87.       }
  88.       _loc1_ = _loc1_ + 1;
  89.    }
  90.    return _loc4_;
  91. }
  92. function initBT_OK()
  93. {
  94.    var _loc2_ = FEN_01.BT_OK;
  95.    _loc2_._alpha = 100;
  96.    _loc2_.pIB = "IB_valider";
  97.    _loc2_.pBruit = "B_OK";
  98.    _loc2_.onRollOver = function()
  99.    {
  100.       gereCursor(2);
  101.       this.gotoAndPlay("E2");
  102.       var _loc3_ = this._x + FEN_01._x;
  103.       var _loc2_ = this._y + FEN_01._y + 10;
  104.       gereTextes.afficheIB({codeIB:this.pIB,X:_loc3_,Y:_loc2_});
  105.    };
  106.    _loc2_.onRollOut = function()
  107.    {
  108.       gereCursor(1);
  109.       this.gotoAndPlay("E1");
  110.       gereTextes.masqueIB();
  111.    };
  112.    _loc2_.onPress = function()
  113.    {
  114.       trace("PRESS OK CREA PROFIL");
  115.       joueBruitage({nomSon:this.pBruit});
  116.       this.gotoAndPlay("E2");
  117.       gereTextes.masqueIB();
  118.       if(testePseudoDejaPris(FEN_01.texte_pseudo.text.toLowerCase()))
  119.       {
  120.          FEN_01.texte_pseudo.text = "";
  121.          FEN_DEJA_PRIS._visible = true;
  122.       }
  123.       else
  124.       {
  125.          gereCursor(1);
  126.          delete onEnterFrame;
  127.          gInfosJoueur.Pseudo = videEspaces(FEN_01.texte_pseudo.text.toLowerCase());
  128.          trace("AJOUT gInfosJoueur.Pseudo = " + gInfosJoueur.Pseudo);
  129.          gInfosJoueur.Age = FEN_01.texte_age.text;
  130.          gListeJoueur.push(gInfosJoueur);
  131.          gListeProfil.push(gInfosJoueur);
  132.          saveUSERS();
  133.          if(gTypePartie == 1)
  134.          {
  135.             gotoAndStop("TRANSIT_01");
  136.             play();
  137.          }
  138.          else
  139.          {
  140.             ajouteCadreJoueur(gInfosJoueur,gJoueur);
  141.             joueBruitage({nomSon:"B_OK"});
  142.             if(gJoueur == 1)
  143.             {
  144.                CAPITAINE.gotoAndPlay("E2");
  145.                joueSon({nomSon:"I_03B_CADRE",actionFin:"finSonDEB"});
  146.             }
  147.             if(gJoueur < 4)
  148.             {
  149.                gJoueur += 1;
  150.                gInfosJoueur = new Object();
  151.                gFromSup = true;
  152.                gotoAndStop("ATTENTE_2");
  153.                play();
  154.             }
  155.             else
  156.             {
  157.                gJoueur += 1;
  158.                gCarte = "CARTE_1";
  159.                CARTE.CARTE.gotoAndPlay("E1");
  160.                gFromSup = true;
  161.                gotoAndStop("ATTENTE_2");
  162.                play();
  163.             }
  164.          }
  165.       }
  166.    };
  167. }
  168. function desinitBT_OK()
  169. {
  170.    var _loc1_ = FEN_01.BT_OK;
  171.    _loc1_._alpha = 50;
  172.    desactiveClip(_loc1_);
  173. }
  174. function finCAP_parle()
  175. {
  176.    CAPITAINE.gotoAndPlay("E1");
  177. }
  178. FEN_DEJA_PRIS._visible = false;
  179. FOND.useHandCursor = false;
  180. FOND.onRollOver = function()
  181. {
  182. };
  183. FOND.onRollOut = function()
  184. {
  185. };
  186. FOND.onPress = function()
  187. {
  188. };
  189. initFermerCadre();
  190. initFille();
  191. initGarcon();
  192. FEN_01.BT_OK._alpha = 50;
  193. FEN_01.texte_age.restrict = "0-9";
  194. FEN_01.texte_age.onChanged = function()
  195. {
  196.    joueBruitage({nomSon:"B_TAPE"});
  197. };
  198. FEN_01.texte_pseudo.onChanged = function()
  199. {
  200.    FEN_01.texte_pseudo.text = FEN_01.texte_pseudo.text.toLowerCase();
  201.    joueBruitage({nomSon:"B_TAPE"});
  202. };
  203. onEnterFrame = function()
  204. {
  205.    if(pauseOnMod == undefined)
  206.    {
  207.       var _loc1_ = 0;
  208.       if(gInfosJoueur.Sexe !== undefined)
  209.       {
  210.          if(FEN_01.texte_pseudo.text !== "Ton pseudo" && videEspaces(FEN_01.texte_pseudo.text) !== "")
  211.          {
  212.             if(FEN_01.texte_age.text !== "Ton ├óge" && FEN_01.texte_age.text !== "")
  213.             {
  214.                if(!isNaN(Number(FEN_01.texte_age.text)))
  215.                {
  216.                   _loc1_ = 1;
  217.                }
  218.             }
  219.          }
  220.       }
  221.       if(_loc1_ == 1 && gDoneOkAvat == undefined)
  222.       {
  223.          gDoneOkAvat = true;
  224.          initBT_OK();
  225.       }
  226.       else if(_loc1_ == 0)
  227.       {
  228.          gDoneOkAvat = undefined;
  229.          desinitBT_OK();
  230.       }
  231.    }
  232. };
  233. stop();
  234.