Ces *** de chemins et de texte

cs_cesarion Messages postés 7 Date d'inscription lundi 21 novembre 2005 Statut Membre Dernière intervention 1 octobre 2007 - 15 mai 2006 à 16:29
cs_cesarion Messages postés 7 Date d'inscription lundi 21 novembre 2005 Statut Membre Dernière intervention 1 octobre 2007 - 16 mai 2006 à 11:40
Bonjour à tous !!
ça va faire 2 jours que je me prends la tête sur un pb de chemin cible.
Voilà, mon fla se compose de 4 niveaux.
La scène principale
sur laquelle est placé un clip nommé "carte", cette carte est redimensionnée par un variateur.
dans "carte", il y a une série de clip identiques en forme de maison nommés angleterre, croatie,...qui réagissent par roll over de deux façons depuis un script placé dans "carte"
1_un petit gotoAndPlay() et quand la tête de lecture est arrêtée il y a un clip nommé mcPanneau ausein du clip
2_si hitTest sur ce clip est true, cela crée un champ de text et charge d données depuis un fichier xml.
Jusque là tout va bien.Mon souci, c'est que j'aimerais aligner ce champ de texte crée sur le clip nommé mcPanneau

J'ai tenté plein de chemins différents, mais y a rien qui marche
Please help !!!

Voici le script :
//////////////////////maison/////////////////////////////////
//
panneau = function ()
{
//
if (this.hitTest (_root._xmouse, _root._ymouse, true))
{
this.getNextHighestDepth ();
var format : TextFormat = new TextFormat ();
format.font = "verdana";
format.size = 9;
format.align = "center";
format.color = 0xCC0000;
//
var txtField : TextField = _parent.createTextField ("txtField", this.getNextHighestDepth () ,posX, posY, 71, 30);
txtField.html = true;
txtField.multiline = true;
txtField.autoSize = true;
txtField.wordWrap = true;
txtField.selectable = false;
//
txtField.setNewTextFormat (format);
//
var chargeTxt = new XML ();
chargeTxt.load ("as/description.xml");
chargeTxt.ignoreWhite = true;
chargeTxt.onLoad = function ()
{
txtField.text = chargeTxt.idMap [i].childNodes [0].firstChild+ "\n";
txtField.text += chargeTxt.idMap [i].childNodes [3].firstChild;
};
}
}
//
/////////////////////////ONROLLOVER
//angleterre.onRollOver mael.onRollOver hautefeuille.onRollOver = garchy.onRollOver = champfleury.onRollOver = stHilaire.onRollOver = laFaute.onRollOver = ile.onRollOver = peisey.onRollOver = stSulpice.onRollOver = pontCirq.onRollOver = bourboule.onRollOver = croatie.onRollOver = morillo.onRollOver = porta.onRollOver = argeles.onRollOver = corse.onRollOver = function ()
{
this.gotoAndPlay (2);
i = this._name;
trace(i);
posX = i._x;
posY = i._y;
panneau ();
};
//
/////////////////////////ONROLLOUT
//angleterre.onRollOut mael.onRollOut hautefeuille.onRollOut = garchy.onRollOut = champfleury.onRollOut = stHilaire.onRollOut = laFaute.onRollOut = ile.onRollOut = peisey.onRollOut = stSulpice.onRollOut = pontCirq.onRollOut = bourboule.onRollOut = croatie.onRollOut = morillo.onRollOut = porta.onRollOut = argeles.onRollOut = corse.onRollOut = function ()
{
txtField.removeTextField ();
this.gotoAndPlay (5);
};
//
merci d'avance

1 réponse

cs_cesarion Messages postés 7 Date d'inscription lundi 21 novembre 2005 Statut Membre Dernière intervention 1 octobre 2007
16 mai 2006 à 11:40
Sans avoir réèlement trouvé la solution, g réussi à trouver un compromis. Voici le code et un lien pour voir le résultat
En espérant que cela puisse être utile à certains...

http://cesarion.1.free.fr/tests/carte2.html

//////////////////////maison/////////////////////////////////
//
panneau = function ()
{
//
if (this.hitTest (_root._xmouse, _root._ymouse, true))
{
var format : TextFormat = new TextFormat ();
format.font = "verdana";
format.size = 9;
format.align = "center";
format.color = 0xCC0000;
//
this.carte.getNextHighestDepth ()
//
var txtField : TextField = this.createTextField ("txtField", 99, posX, posY, 100, 30);
txtField.html = true;
txtField.multiline = true;
txtField.autoSize = true;
txtField.wordWrap = true;
txtField.selectable = false;
txtField.antiAliasType = "normal";
//
txtField.setNewTextFormat (format);
//
var chargeTxt = new XML ();
chargeTxt.load ("as/description.xml");
chargeTxt.ignoreWhite = true;
chargeTxt.onLoad = function ()
{
txtField.text = chargeTxt.idMap [i].childNodes [0].firstChild + "\n";
txtField.text += chargeTxt.idMap [i].childNodes [3].firstChild;
};
}
}
//
/////////////////////////ONROLLOVER
//angleterre.onRollOver mael.onRollOver hautefeuille.onRollOver = garchy.onRollOver = champfleury.onRollOver = stHilaire.onRollOver = laFaute.onRollOver = ile.onRollOver = peisey.onRollOver = stSulpice.onRollOver = pontCirq.onRollOver = bourboule.onRollOver = croatie.onRollOver = morillo.onRollOver = porta.onRollOver = argeles.onRollOver = corse.onRollOver = function ()
{
this.gotoAndPlay (2);
i = this._name;
posX = this._x;
posY = this._y;
posX = posX - 51;
posY = posY - 44;
panneau ();
};
0
Rejoignez-nous