Impossible d'effacer/réinitialiser movieclip
	
	
		Bonjour,
Je récupère sans problème les résultats d'un sondage (dans un fichier XML) que j'affiche également sans problème à l'écran.
Sauf que lorsque je veux rafraîchir mon affichage en rechargeant mon fichier xml je n'arrive pas à réinitialiser le movieClip dans lequel j'ai placé mes résultats sous forme de texte et d'histogramme.
Merci pour l'aide
	Code:
	
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 
 | stop();
 
//récupération du titre de la question
var question =myXML.childNodes[0].attributes.caption;
titre_txt.text=question;
 
//récupération du nombre de réponses proposées  
var enfants =myXML.firstChild.childNodes.length-3;
 
//récupération des données dans un tableau
var tableau=new Array();
for (var n=0;n<enfants;n++){
var valueNoeud = myXML.firstChild.childNodes[n].attributes.value;
var labelNoeud = myXML.firstChild.childNodes[n].attributes.label;
tableau.push({label:labelNoeud,valeur:valueNoeud});
	}
 
	//récupération du nombre total de réponses
	var total:Number = 0;
	var inter:Number;
	var tot2:Number;
	for (var i=0;i<enfants;i++){
		var inter:Number = total;
		var tot2 = + inter + Number(tableau[i].valeur) ;
		var total = tot2;
		}
 
	//affichage...
	var x=0;
	var z=0;
	var y =100;
	var y2 = -20+(300/enfants);
	//...createEmptyMovieClip()
	var mc:MovieClip=this.createEmptyMovieClip ("barre",this.getNextHighestDepth());
 
	for (var i=0;i<enfants;i++){
 
		with (this.mc){
			//...du pourcentage pour chaque réponse
			var x2 = 400*Number(tableau[i].valeur)/total;
			this.createTextField("mon_sco"+i,this.getNextHighestDepth(),200+x2,y,180,50);
			var sco:TextField=this["mon_sco"+i];
			var PourCent:String=(Math.round(100*Number(tableau[i].valeur)/total))+"%";
			sco.multiline = true;
			sco.wordWrap = true;
			sco.autoSize = true;
			sco.text= PourCent;
 
			//...de l'intitulé des réponses
			this.createTextField("mon_txt"+i,this.getNextHighestDepth(),10,y,180,50);
			var txt:TextField=this["mon_txt"+i];
			txt.multiline = true;
			txt.wordWrap = true;
			txt.autoSize = true;
			txt.text=(tableau[i].label);
 
			//...de la réponse sous forme d'histogramme horizontal
   			lineStyle (2, 0xff00ff, 100);
   			var x = 400*Number(tableau[i].valeur)/total;
			beginFill(0x0000FF,100);
			moveTo (200, y);
   			lineTo (200, y+y2);
    			lineTo (200+x, y+y2);
    			lineTo (200+x, y);
			lineTo (200, y);
			endFill();
			z=y+y2+20;
			y=z;
			}
 
	}
 
btn_reload.onPress = function () {
 
	this.mc.removeMovieClip();
 
	gotoAndPlay(2);
} |