hé bien tu réponds à ma question de mon précédent post

, reste plus que la réponse à celui là

, merci en tout cas !
ci joint le code du parent
CODE
package _class {
import _class.MenuDeroulant;
import mx.containers.Canvas;
import mx.core.UIComponent;
import mx.events.FlexEvent;
import mx.controls.Label;
import mx.controls.Image;
import mx.effects.Resize;
import mx.events.TweenEvent;
import mx.effects.Move;
import mx.effects.Rotate;
import flash.events.MouseEvent;
public class ModuleRecherche extends Canvas {
// ===============================================
// Elements
// ===============================================
// Bouton Depliant
private var bouton:UIComponent = new UIComponent();
// Contour Haut
private var contourHaut:UIComponent = new UIComponent();
// Contour Bas
private var contourBas:UIComponent = new UIComponent();
// Contour Droit
private var contourDroit:Canvas = new Canvas();
// Ligne Pointillé
private var lignePointille:UIComponent = new UIComponent();
// Label du titre du module
private var titreLabel:Label = new Label();
// Puce Image
private var puceImage:Image = new Image();
[b]// Menu Deroulant
private var DeroulantMenu:MenuDeroulant = new MenuDeroulant();
[/b]
// ===============================================
// Animation
// ===============================================
// Animation en hauteur du module de Recherche
private var animationHeight:Resize = new Resize();
// Animation du filet bas
private var animationFiletBas:Move = new Move();
// Animation du filet droit
private var animationFiletDroit:Resize = new Resize();
// Rotaation de la puce
private var animationPuceRotate:Rotate = new Rotate();
// Animation de la puce
private var animationPuceMove:Move = new Move();
// ===============================================
// Embed Image
// ===============================================
[Embed(source='../import/swf/puce.swf')] private var puceModule:Class;
// ===============================================
// Propriété statique
// ===============================================
// Largeur du cartouche
private static var moduleWidth:Number = new Number(223);
// Hauteur du cartouche
private static var moduleHeight:Number = new Number(47);
// Durée de l'animation
private static var durationAnimation:Number = new Number(500);
// ===============================================
// Propriétés dynamique
// ===============================================
// Titre du module de recherche
private var __titre:String = new String();
// nom du Bindable à surveiller
private var __critere:Object = new Object();
// nom des données du fichier XML
private var __data:Object = new Object();
// ===============================================
// Propriétés
// ===============================================
// Etat du menu deroulant
private var menuDeroulant:Boolean = new Boolean();
// Nombre de noeud dans le fichier XML
public var nbNode:Number = new Number();
// ===============================================
// Constructeur
// ===============================================
public function ModuleRecherche():void {
this.width = moduleWidth;
this.height = moduleHeight;
this.horizontalScrollPolicy = "off";
this.verticalScrollPolicy = "off";
this.setStyle("backgroundColor", "0xFFFFFF");
menuDeroulant = false;
animationHeight.duration = durationAnimation;
animationHeight.target = this;
animationFiletBas.duration = durationAnimation;
animationFiletBas.target = contourBas;
animationFiletDroit.duration = durationAnimation;
animationFiletDroit.target = contourDroit;
animationPuceRotate.duration = durationAnimation;
animationPuceRotate.target = puceImage;
animationPuceMove.duration = durationAnimation;
animationPuceMove.target = puceImage;
createPointLine(1, 1, 2, 0);
bouton.graphics.beginFill(0xFFFFFF,0);
bouton.graphics.drawRect(0, 0, moduleWidth - 196, moduleHeight);
bouton.graphics.endFill();
bouton.x = 196;
titreLabel.x = 14;
titreLabel.y = 13;
titreLabel.text = "Par agence";
titreLabel.setStyle("fontSize", "13");
titreLabel.setStyle("color",0x111111);
contourHaut.graphics.lineStyle(1,0x6D6B6C,1);
contourHaut.graphics.moveTo(0, 0);
contourHaut.graphics.lineTo(moduleWidth - 1, 0);
contourDroit.graphics.lineStyle(1,0x6D6B6C,1);
contourDroit.graphics.moveTo(0, 0);
contourDroit.graphics.lineTo(0, moduleHeight);
contourDroit.x = 0;
contourDroit.y = 0;
contourDroit.setStyle("backgroundColor", 0x6D6B6C);
contourDroit.x = moduleWidth - 1;
contourDroit.y = 0;
contourDroit.width = 1;
contourDroit.height = moduleHeight;
contourHaut.graphics.lineStyle(1,0x6D6B6C,1);
contourHaut.graphics.moveTo(196, 0);
contourHaut.graphics.lineTo(196, moduleHeight);
lignePointille.x = 0;
lignePointille.y = moduleHeight;
contourBas.graphics.lineStyle(1,0x6D6B6C,1);
contourBas.graphics.moveTo(moduleWidth - 1, 0);
contourBas.graphics.lineTo(0, 0);
contourBas.y = moduleHeight;
puceImage.x = 206;
puceImage.y = moduleHeight - 17;
puceImage.source = puceModule;
bouton.addEventListener(MouseEvent.CLICK, changementEtat);
bouton.buttonMode = true;
DeroulantMenu.visible = false;
DeroulantMenu.x = 0;
DeroulantMenu.y = moduleHeight;
this.addEventListener(FlexEvent.CREATION_COMPLETE, _createElements);
}
// Ajout des éléments au container
private function _createElements(event:FlexEvent):void {
this.addChild(DeroulantMenu);
this.addChild(titreLabel);
this.addChild(puceImage);
this.addChild(contourHaut);
this.addChild(lignePointille);
this.addChild(contourDroit);
this.addChild(contourBas);
this.addChild(bouton);
}
// Création de ligne en pointilé
private function createPointLine(largeur:Number, hauteur:Number, espaceLargeur:Number, espaceHauteur:Number):void {
for (var j:Number = 0; j < (this.width / espaceLargeur); j++) {
lignePointille.graphics.beginFill(0x404040, 1)
lignePointille.graphics.drawRect(j * espaceLargeur, j * espaceHauteur, largeur, hauteur);
lignePointille.graphics.endFill();
}
}
private function changementEtat(event:MouseEvent):void {
// Fermeture du menu deroulant
if (menuDeroulant) {
animationHeight.heightFrom = this.height;
animationHeight.heightTo = moduleHeight;
animationFiletDroit.heightFrom = moduleHeight + 85;
animationFiletDroit.heightTo = moduleHeight;
animationFiletBas.yFrom = contourBas.y;
animationFiletBas.yTo = moduleHeight;
animationPuceRotate.angleFrom = puceImage.rotation;
animationPuceRotate.angleTo = 0;
animationPuceMove.xFrom = puceImage.x;
animationPuceMove.yFrom = puceImage.y;
animationPuceMove.yTo = moduleHeight - 15.5;
animationPuceMove.xTo = 211.5;
menuDeroulant = false;
// Ouverture du menu deroulant
} else {
animationHeight.heightFrom = this.height;
animationHeight.heightTo = moduleHeight + 85;
animationFiletDroit.heightFrom = moduleHeight;
animationFiletDroit.heightTo = moduleHeight + 85;
animationFiletBas.yFrom = contourBas.y;
animationFiletBas.yTo = moduleHeight + 85;
animationPuceRotate.angleFrom = puceImage.rotation;
animationPuceRotate.angleTo = 90;
animationPuceMove.xFrom = puceImage.x;
animationPuceMove.yFrom = puceImage.y;
animationPuceMove.yTo = moduleHeight - 16.5;
animationPuceMove.xTo = 210.5;
menuDeroulant = true;
}
animationFiletDroit.play();
animationHeight.play();
animationFiletBas.play();
animationPuceRotate.play();
animationPuceMove.play();
animationPuceMove.addEventListener(TweenEvent.TWEEN_START, etatMenuDeroulant);
animationPuceMove.addEventListener(TweenEvent.TWEEN_END, etatMenuDeroulant);
}
private function etatMenuDeroulant(event:TweenEvent):void {
if (event.type == "tweenStart") {
if (menuDeroulant == false) {
DeroulantMenu.visible = false;
}
} else if (event.type == "tweenEnd") {
if (menuDeroulant == true) {
DeroulantMenu.visible = true;
}
}
}
// Mise à jour du titre
private function setTitre():void { titreLabel.text = __titre; }
// Mise à jour des critères
private function setCritere():void { trace(__critere); }
// Mise à jour des données
private function setData():void {
nbNode = __data.agences.agence.length;
trace(nbNode);
for (var i:Number = new Number(0); i < nbNode; i++) {
trace(__data.agences.agence[i].id + " - " + __data.agences.agence[i].nom);
}
DeroulantMenu._vince();
}
// ===============================================
// Getter / Setter
// ===============================================
public function set _titre(value:String):void { __titre = value; setTitre(); }
public function set _critere(value:Object):void { __critere = value; setCritere(); }
public function set _data(value:Object):void { __data = value; setData(); }
}
}
j'ai rajouter dans mon MenuDeroulant, une fonction _vince qui doit renvoyer la valeur, pour info le parentApplication fonctionne, mais comme le parent dans le cas présent n'est pas la "racine" de l'application, ne problème est toujours là !
Merci encore pour les réponses !