1 2 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
|
var concerts_xml:XML = new XML();/* On crée un objet xml */
concerts_xml.ignoreWhite = true;/* On ignore les sauts de ligne */
concerts_xml.load("concerts.xml");/* On charge le fichier */
concerts_xml.onLoad = function(chargement) {
if (chargement) {
var longueur:Array = this.firstChild.childNodes.length;
var nom:XMLNode = this.firstChild;
var mot:String = "champ_";
for (i=0; i<longueur; i++) {
_root.createTextField("test_"+i,5+i,0,53+(i*20),128,128);
format_texte = new TextFormat();
format_texte.color = 0xffffff;
format_texte.font = "Verdana";
format_texte.bold= false;
format_texte.size = 11;
format_texte.align="center";
_root["test_"+i].text = this.firstChild.childNodes[i].childNodes[0].childNodes;
_root["test_"+i].setTextFormat(format_texte);
_root.createEmptyMovieClip("champ_mc"+i, i);
_root["champ_mc"+i].beginFill(0xFFffff);
_root["champ_mc"+i]._alpha = 15;
_root["champ_mc"+i].moveTo(10, 50+(i*20));
_root["champ_mc"+i].lineTo(118, 50+(i*20));
_root["champ_mc"+i].lineTo(118, 68+(i*20));
_root["champ_mc"+i].lineTo(10, 68+(i*20));
_root["champ_mc"+i].lineTo(10, 10+(i*20));
_root["champ_mc"+i].endFill();
}
}
} |
Partager