Flash AS

Résolu
gozila Messages postés 38 Date d'inscription vendredi 3 février 2006 Statut Membre Dernière intervention 30 novembre 2006 - 12 nov. 2006 à 16:44
gozila Messages postés 38 Date d'inscription vendredi 3 février 2006 Statut Membre Dernière intervention 30 novembre 2006 - 17 nov. 2006 à 22:05
Alors je vous presente mon probleme.
Je veux deplacer mon perso et qu'il se remette de face a chaque fois que l'on relache les fleches car la sur mon code lorsque l'on relache la fleche il reste en direction de la ou il aller, il s'arrete mais il reste de profil j'aimerais qu'il se remette de face quand on la relache
voila mon code

onClipEvent (enterFrame) {
 _root.anim._x = this._x;
 _root.anim._y = this._y;
 if (Key.isDown(Key.LEFT) && !Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)) {
  if (!_root.cadre.hitTest(_x-_width/2, _y-_height/2, true) && !_root.cadre.hitTest(_x-_width/2, _y+_height/2, true)) {
   _x -= 5;
   _root.anim.gotoAndStop("left");
  }
 } else if (Key.isDown(Key.RIGHT) && !Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)) {
  if (!_root.cadre.hitTest(_x+_width/2, _y-_height/2, true) && !_root.cadre.hitTest(_x+_width/2, _y+_height/2, true)) {
   _x += 5;
   _root.anim.gotoAndStop("right");
  }
 }
 if (Key.isDown(Key.UP)) {
  if (!_root.cadre.hitTest(_x+_width/2, _y-_height/2, true) && !_root.cadre.hitTest(_x-_width/2, _y-_height/2, true)) {
   _y -= 5;
   _root.anim.gotoAndStop("up");
  } else {
   _root.anim.gotoAndStop("inactive");
  }
 } else if (Key.isDown(Key.DOWN)) {
  if (!_root.cadre.hitTest(_x+_width/2, _y+_height/2, true) && !_root.cadre.hitTest(_x-_width/2, _y+_height/2, true)) {
   _y += 5;
   _root.anim.gotoAndStop("down");
   
  }
 }
}

42 réponses

gozila Messages postés 38 Date d'inscription vendredi 3 février 2006 Statut Membre Dernière intervention 30 novembre 2006
17 nov. 2006 à 15:31
En attendant j'ai essayer de ramener ce que j'aivais fait avant ce qui donne ce code

// //avec bouton/////////////////////////////////////////////////////////////////////////////
/*_root.createTextField("saisie_txt", 99, 10, 10, 300, 20);
_root.saisie_txt.border = true;*/
_root.saisie_txt.multiline = false;
_root.saisie_txt.type = "input";
/*_root.createTextField("affichage_txt", 100, 10, 40, 170, 350);
_root.affichage_txt.border = true;*/
_root.affichage_txt.multiline = true;
_root.affichage_txt.type = "dynamic";
// action monBouton
_root.monBouton.onRelease = function() {
 {
  
  //triste
  if (saisie_txt == "triste") {
   this.anim.perso.corps.mood.gotoAndStop("triste");
   
  } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   //yo
   if (saisie_txt == "^^") {
   this.anim.perso.corps.mood.gotoAndStop("yo");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   // ;)
   if (saisie_txt == ";)") {
   this.anim.perso.corps.mood.gotoAndStop("clindoeil");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   // yo
   if (saisie_txt == "yo") {
   this.anim.perso.corps.mood.gotoAndStop("yo");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   //triste
   if (saisie_txt == ":(") {
   this.anim.perso.corps.mood.gotoAndStop("triste");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   if (saisie_txt == "XD") {
   this.anim.perso.corps.mood.gotoAndStop("xd");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   if (saisie_txt == ":|") {
   this.anim.perso.corps.mood.gotoAndStop("gloup");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   if (saisie_txt == ":s") {
   this.anim.perso.corps.mood.gotoAndStop("gloups");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   _root.affichage_txt = _root.saisie_txt;
   }
   saisie_txt = "";
};

ce code marche mais ne rempli pas tout, lorsque je marque mon texte il apparait mais en revanche lorsque je marque les emotions comme ^^ il apparait dans le recipient mais n'apparrait pas sur le personnage, j'ai essayer alors de mettre ce code sur le bouton
on (press) {
 {
  
  //triste
  if (saisie_txt == "triste") {
   this.anim.perso.corps.mood.gotoAndStop("triste");
   
  } else {
  this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   //yo
   if (saisie_txt == "^^") {
   this.anim.perso.corps.mood.gotoAndStop("yo");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   // ;)
   if (saisie_txt == ";)") {
   this.anim.perso.corps.mood.gotoAndStop("clindoeil");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   // yo
   if (saisie_txt == "yo") {
   this.anim.perso.corps.mood.gotoAndStop("yo");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   //triste
   if (saisie_txt == ":(") {
   this.anim.perso.corps.mood.gotoAndStop("triste");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   if (saisie_txt == "XD") {
   this.anim.perso.corps.mood.gotoAndStop("xd");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   if (saisie_txt == ":|") {
   this.anim.perso.corps.mood.gotoAndStop("gloup");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
   if (saisie_txt == ":s") {
   this.anim.perso.corps.mood.gotoAndStop("gloups");
   
   } else {
   this.anim.perso.corps.mood.gotoAndStop("normal");
   } 
 }
 saisie_txt = "";
}

et l'enlever du deuxieme donc il reste

// //avec bouton/////////////////////////////////////////////////////////////////////////////
/*_root.createTextField("saisie_txt", 99, 10, 10, 300, 20);
_root.saisie_txt.border = true;*/
_root.saisie_txt.multiline = false;
_root.saisie_txt.type = "input";
/*_root.createTextField("affichage_txt", 100, 10, 40, 170, 350);
_root.affichage_txt.border = true;*/
_root.affichage_txt.multiline = true;
_root.affichage_txt.type = "dynamic";
// action monBouton
_root.monBouton.onRelease = function() {
 {
   _root.affichage_txt = _root.saisie_txt;
   }
   saisie_txt = "";
};

mais dans ce cas la l'emotion n'apparrait pas dans le recipient mais il apparrait sur le perso comment faire pour qu'il apparrait dans le recipient et sur le perso voila le premier cas en flash
http://f.bateman.free.fr/flkode/newconcept2.swf  (texte mais pas emotion)
le deuxieme cas en flash :
http://f.bateman.free.fr/flkode/newconcept.swf (emotion mais pas texte)
0
gozila Messages postés 38 Date d'inscription vendredi 3 février 2006 Statut Membre Dernière intervention 30 novembre 2006
17 nov. 2006 à 22:05
HELP ME
0
Rejoignez-nous