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 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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
| _root.mc_onglet_1.mc_barreMarron.gotoAndStop(6);
var ongletActif:Number = 1;
var adresseUrlTexte:Array = new Array;
var titre_paragraphe:Array = new Array;
var textes:Array = new Array;
XMLprestations = new XML();
XMLprestations.ignoreWhite = true;
XMLprestations.direction = "receive";
XMLprestations.ignoreWhite = true;
XMLprestations.onLoad = function(success:Boolean) {
if (success) {
nombreDeParagraphes = XMLprestations.firstChild.childNodes.length;
for (i=0; i<nombreDeParagraphes; i++) {
adresseUrlTexte.push(XMLprestations.firstChild.childNodes[i].childNodes[0].attributes.url);
}
for (i=0; i<nombreDeParagraphes; i++) {
titre_paragraphe.push(XMLprestations.firstChild.childNodes[i].attributes.titre);
}
_root.mc_onglet_1.text_titre_onglet.text = XMLprestations.firstChild.childNodes[0].attributes.titre;
_root.mc_onglet_2.text_titre_onglet.text = XMLprestations.firstChild.childNodes[1].attributes.titre;
_root.mc_onglet_3.text_titre_onglet.text = XMLprestations.firstChild.childNodes[2].attributes.titre;
_root.text_titre.text = titre_paragraphe[0];
//Load the text.
var loadit_lv_1:LoadVars = new LoadVars();
loadit_lv_1.load(adresseUrlTexte[0]);
loadit_lv_1.onData = function(src:String) {
if (src != undefined) {
textes.push(src);
text_courant_para_1.text = textes[0];
} else {
text_courant_para_1.text = "un problème est survenu lors du téléchargement des données";
}
}
var loadit_lv_2:LoadVars = new LoadVars();
loadit_lv_2.load(adresseUrlTexte[1]);
loadit_lv_2.onData = function(src:String) {
if (src != undefined) {
textes.push(src);
}
}
var loadit_lv_3:LoadVars = new LoadVars();
loadit_lv_3.load(adresseUrlTexte[2]);
loadit_lv_3.onData = function(src:String) {
if (src != undefined) {
textes.push(src);
}
}
}
};
//////// chargement de l adresse du fichier xml a recuperer /////////////////////////////////
XMLprestations.load("désolé mais je prefere masquer l adresse");
///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////// gestion des onPress//////////////////////////////////////////////////////
MovieClip.prototype.ChoixOnglet = function (x:Number) {
if (x!=ongletActif) {
_root["mc_onglet_"+ongletActif].mc_barreMarron.gotoAndPlay(7);
}
if(_root["mc_onglet_"+x].mc_barreMarron._currentframe===1) {
_root["mc_onglet_"+x].mc_barreMarron.gotoAndPlay(2);
}
ongletActif = x;
_root.text_titre.text = titre_paragraphe[x-1];
_root.text_courant_para_1.text = textes[x-1];
}
_root.mc_onglet_1.onPress = function () {
this.ChoixOnglet(1);
}
_root.mc_onglet_2.onPress = function () {
this.ChoixOnglet(2);
}
_root.mc_onglet_3.onPress = function () {
this.ChoixOnglet(3);
} |
Partager