home *** CD-ROM | disk | FTP | other *** search
- function initFermerCadre()
- {
- var _loc2_ = FEN_01.BT_FERMER_FEN;
- _loc2_.onRollOver = function()
- {
- gereCursor(2);
- this.gotoAndPlay("E2");
- };
- _loc2_.onRollOut = function()
- {
- gereCursor(1);
- this.gotoAndPlay("E1");
- };
- _loc2_.onPress = function()
- {
- this.gotoAndPlay("E1");
- gereCursor(1);
- var _loc2_ = CARTE.CARTE[gCarte]["AVATAR_" + gimme2digits(gInfosJoueur.Avatar)];
- _loc2_.gotoAndPlay("E1");
- gFromSup = true;
- gotoAndStop("ATTENTE_2");
- play();
- };
- }
- function initFille()
- {
- var _loc2_ = FEN_01.BT_FILLE;
- _loc2_.pLettre = "F";
- _loc2_.gotoAndPlay("E1");
- _loc2_.onRollOver = function()
- {
- gereCursor(2);
- };
- _loc2_.onRollOut = function()
- {
- gereCursor(1);
- };
- _loc2_.onPress = function()
- {
- this.gotoAndPlay("E2");
- gereCursor(1);
- gInfosJoueur.Sexe = this.pLettre;
- desactiveClip(this);
- initGarcon();
- };
- }
- function initGarcon()
- {
- var _loc2_ = FEN_01.BT_GARCON;
- _loc2_.pLettre = "G";
- _loc2_.gotoAndPlay("E1");
- _loc2_.onRollOver = function()
- {
- gereCursor(2);
- };
- _loc2_.onRollOut = function()
- {
- gereCursor(1);
- };
- _loc2_.onPress = function()
- {
- this.gotoAndPlay("E2");
- gereCursor(1);
- gInfosJoueur.Sexe = this.pLettre;
- initFille();
- desactiveClip(this);
- };
- }
- function testePseudoDejaPris(lPseudo)
- {
- var _loc3_ = videEspaces(lPseudo);
- trace("lPseudoSansEspace = ." + _loc3_ + ".");
- trace("testePseudoDejaPris " + lPseudo);
- var _loc4_ = false;
- var _loc5_ = gListeProfil.length;
- var _loc1_ = 0;
- while(_loc1_ < _loc5_)
- {
- trace("gListeProfil[j].Pseudo = " + gListeProfil[_loc1_].Pseudo);
- trace("String(gListeProfil[j].Pseudo) == String(lPseudo) = " + (String(gListeProfil[_loc1_].Pseudo) == String(lPseudo)));
- trace("String(gListeProfil[j].Pseudo) == lPseudo = " + (String(gListeProfil[_loc1_].Pseudo) == lPseudo));
- if(String(gListeProfil[_loc1_].Pseudo) == lPseudo || String(gListeProfil[_loc1_].Pseudo) == _loc3_)
- {
- trace("pris !");
- _loc4_ = true;
- break;
- }
- _loc1_ = _loc1_ + 1;
- }
- return _loc4_;
- }
- function initBT_OK()
- {
- var _loc2_ = FEN_01.BT_OK;
- _loc2_._alpha = 100;
- _loc2_.pIB = "IB_valider";
- _loc2_.pBruit = "B_OK";
- _loc2_.onRollOver = function()
- {
- gereCursor(2);
- this.gotoAndPlay("E2");
- var _loc3_ = this._x + FEN_01._x;
- var _loc2_ = this._y + FEN_01._y + 10;
- gereTextes.afficheIB({codeIB:this.pIB,X:_loc3_,Y:_loc2_});
- };
- _loc2_.onRollOut = function()
- {
- gereCursor(1);
- this.gotoAndPlay("E1");
- gereTextes.masqueIB();
- };
- _loc2_.onPress = function()
- {
- trace("PRESS OK CREA PROFIL");
- joueBruitage({nomSon:this.pBruit});
- this.gotoAndPlay("E2");
- gereTextes.masqueIB();
- if(testePseudoDejaPris(FEN_01.texte_pseudo.text.toLowerCase()))
- {
- FEN_01.texte_pseudo.text = "";
- FEN_DEJA_PRIS._visible = true;
- }
- else
- {
- gereCursor(1);
- delete onEnterFrame;
- gInfosJoueur.Pseudo = videEspaces(FEN_01.texte_pseudo.text.toLowerCase());
- trace("AJOUT gInfosJoueur.Pseudo = " + gInfosJoueur.Pseudo);
- gInfosJoueur.Age = FEN_01.texte_age.text;
- gListeJoueur.push(gInfosJoueur);
- gListeProfil.push(gInfosJoueur);
- saveUSERS();
- if(gTypePartie == 1)
- {
- gotoAndStop("TRANSIT_01");
- play();
- }
- else
- {
- ajouteCadreJoueur(gInfosJoueur,gJoueur);
- joueBruitage({nomSon:"B_OK"});
- if(gJoueur == 1)
- {
- CAPITAINE.gotoAndPlay("E2");
- joueSon({nomSon:"I_03B_CADRE",actionFin:"finSonDEB"});
- }
- if(gJoueur < 4)
- {
- gJoueur += 1;
- gInfosJoueur = new Object();
- gFromSup = true;
- gotoAndStop("ATTENTE_2");
- play();
- }
- else
- {
- gJoueur += 1;
- gCarte = "CARTE_1";
- CARTE.CARTE.gotoAndPlay("E1");
- gFromSup = true;
- gotoAndStop("ATTENTE_2");
- play();
- }
- }
- }
- };
- }
- function desinitBT_OK()
- {
- var _loc1_ = FEN_01.BT_OK;
- _loc1_._alpha = 50;
- desactiveClip(_loc1_);
- }
- function finCAP_parle()
- {
- CAPITAINE.gotoAndPlay("E1");
- }
- FEN_DEJA_PRIS._visible = false;
- FOND.useHandCursor = false;
- FOND.onRollOver = function()
- {
- };
- FOND.onRollOut = function()
- {
- };
- FOND.onPress = function()
- {
- };
- initFermerCadre();
- initFille();
- initGarcon();
- FEN_01.BT_OK._alpha = 50;
- FEN_01.texte_age.restrict = "0-9";
- FEN_01.texte_age.onChanged = function()
- {
- joueBruitage({nomSon:"B_TAPE"});
- };
- FEN_01.texte_pseudo.onChanged = function()
- {
- FEN_01.texte_pseudo.text = FEN_01.texte_pseudo.text.toLowerCase();
- joueBruitage({nomSon:"B_TAPE"});
- };
- onEnterFrame = function()
- {
- if(pauseOnMod == undefined)
- {
- var _loc1_ = 0;
- if(gInfosJoueur.Sexe !== undefined)
- {
- if(FEN_01.texte_pseudo.text !== "Ton pseudo" && videEspaces(FEN_01.texte_pseudo.text) !== "")
- {
- if(FEN_01.texte_age.text !== "Ton âge" && FEN_01.texte_age.text !== "")
- {
- if(!isNaN(Number(FEN_01.texte_age.text)))
- {
- _loc1_ = 1;
- }
- }
- }
- }
- if(_loc1_ == 1 && gDoneOkAvat == undefined)
- {
- gDoneOkAvat = true;
- initBT_OK();
- }
- else if(_loc1_ == 0)
- {
- gDoneOkAvat = undefined;
- desinitBT_OK();
- }
- }
- };
- stop();
-