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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
|
// les images vont s'inscrire dans un carre de coté:
_root.posy = -105;
_root.posy1 = -99;
_root.posy2 = -80;
_root.posy3 = -40;
_root.posy4 = 0;
_root.posy5 = 40;
_root.posy6 = -110;
_root.posy8 = -94;
_root.posy9 = -110;
Nbr = xmlobject.firstChild.childNodes.length ; // représente le nombre des nodes (noeuds)
for (i=0; i < Nbr ; i++) {
Nbr2 = xmlobject.firstChild.childNodes[i].childNodes.length ; // i représente le nombre des nodes (noeuds) enfants
var imgn = xmlobject.firstChild.childNodes[i].attributes.imgn; //recupére le nom du fichier image
var id = xmlobject.firstChild.childNodes[i].attributes.id; //recupére l'ID
var daten = xmlobject.firstChild.childNodes[i].attributes.daten; //recupére la date
var titre = xmlobject.firstChild.childNodes[i].attributes.titre; //recupére le titre
var datevent = xmlobject.firstChild.childNodes[i].attributes.datevent; //date de l'évènement
var fondh = xmlobject.firstChild.childNodes[i].attributes.fondh; //recupére le nom du fichier image de fond
var fondm = xmlobject.firstChild.childNodes[i].attributes.fondm; //recupére le nom du fichier image de fond
var fondb = xmlobject.firstChild.childNodes[i].attributes.fondb; //recupére le nom du fichier image de fond
for (j=0; j < Nbr2 ; j++) {
//----------------------------------------------------------------------------------------------
//Affichage titre
//----------------------------------------------------------------------------------------------
var mv:MovieClip = this.createEmptyMovieClip("mv", this.getNextHighestDepth());
var tit:TextField = mv.createTextField("tit", -400, -140, _root.posy, 507,30 );
tit.tabEnabled = true;
tit.multiline = true;
tit.html = true;
var tit_fmt:TextFormat = new TextFormat();
tit_fmt.font = "Verdana";
tit_fmt.size = 16;
tit_fmt.bold = true;
tit.htmlText = titre;
tit.setTextFormat(tit_fmt);
tit.textColor = 0xFFFF99;
tit.tabIndex = 1;
//----------------------------------------------------------------------------------------------
//Affichage date news
//----------------------------------------------------------------------------------------------
var dat_fmt:TextFormat = new TextFormat();
if (imgn=="noimg")
{
dat_fmt.rightMargin = 115;
}
else
{
dat_fmt.rightMargin = 315;
}
dat_fmt.align = "right";
dat_fmt.font = "Verdana";
dat_fmt.size = 8;
dat_fmt.bold = false;
dat_fmt.color = 0xffff99;
var mv1:MovieClip = this.createEmptyMovieClip("mv1", this.getNextHighestDepth());
var dat:TextField = mv1.createTextField("dat", -400, 0, _root.posy1, 507, 20);
dat.tabEnabled = true;
dat.multiline = false;
dat.html = true;
dat.htmlText = daten;
dat.setTextFormat(dat_fmt);
dat.tabIndex = 2;
//----------------------------------------------------------------------------------------------
//Affichage texte intro
//----------------------------------------------------------------------------------------------
var mv2:MovieClip = this.createEmptyMovieClip("mv2", this.getNextHighestDepth());
if (imgn=="noimg")
{
_root.txtlarg = 500;
}
else
{
_root.txtlarg = 350;
}
var texte = xmlobject.firstChild.childNodes[i].childNodes[j].firstChild.nodeValue; // Récupère le texte intro de la news // <= traitement théorique zone de texte 1
var txt:TextField = mv2.createTextField("txt", -400, -140, _root.posy2, _root.txtlarg, 100);
txt.tabEnabled = true;
txt.multiline = true;
txt.wordWrap = true;
txt.html = true;
var txt_fmt:TextFormat = new TextFormat();
txt_fmt.font = "Verdana";
txt_fmt.size = 13;
txt_fmt.bold = false;
txt.htmlText = texte;
txt.setTextFormat(txt_fmt);
txt.textColor = 0xffffff;
txt.tabIndex = 3;
txt._height = txt.textHeight+10;
_root.dimfnd = txt._height;
//----------------------------------------------------------------------------------------------
//Affichage date évènement
//----------------------------------------------------------------------------------------------
if (datevent!="nodate"){
var dat_fmt2:TextFormat = new TextFormat();
if (imgn=="noimg")
{
dat_fmt.rightMargin = 115;
}
else
{
dat_fmt.rightMargin = 315;
}
dat_fmt2.align = "Center";
dat_fmt2.font = "Verdana";
dat_fmt2.size = 13;
dat_fmt2.bold = true;
dat_fmt2.color = 0xffffff;
var mv3:MovieClip = this.createEmptyMovieClip("mv3", this.getNextHighestDepth());
var dat2:TextField = mv3.createTextField("dat2", -400, _root.dep, _root.posy3, 507, 20);
dat2.tabEnabled = true;
dat2.multiline = true;
dat2.html = true;
dat2.htmlText = datevent;
dat2.setTextFormat(dat_fmt2);
dat2.tabIndex = 4;
dat2._height = dat2.textHeight+10;
_root.dimfnd = _root.dimfnd+dat2._height;
}
Nbr3 = xmlobject.firstChild.childNodes[i].childNodes[j].childNodes.length ; // j représente le nombre des nodes (noeuds) enfants
for (k=0; k < Nbr3 ; k++) {
//----------------------------------------------------------------------------------------------
//Affichage texte news
//----------------------------------------------------------------------------------------------
var texten = xmlobject.firstChild.childNodes[i].childNodes[j].childNodes[k].firstChild.nodeValue; // Récupère le texte de la news // <= traitement théorique zone de texte 2
if (texten!="notexte"){
var txtn:TextField = mv4.createTextField("txt", -400, -140, _root.posy2, 500, 100);
txtn.tabEnabled = true;
txtn.multiline = true;
txtn.wordWrap = true;
txtn.html = true;
txtn.htmlText = texten;
txtn.setTextFormat(txt_fmt);
txtn.textColor = 0xffffff;
txtn.tabIndex = 5;
txtn._height = txtn.textHeight+10;
_root.dimfnd = _root.dimfnd+txtn._height;
}
}
//----------------------------------------------------------------------------------------------
//Affichage image
//----------------------------------------------------------------------------------------------
var mvimg = "bitmap"+i;
var mvimg:MovieClip = this.createEmptyMovieClip("bitmap"+i, this.getNextHighestDepth());
loadMovie(+imgn, mvimg);
mvimg.tabEnabled = true;
mvimg._x = 210;
mvimg._y = _root.posy8;
mvimg.tabIndex = 8;
//----------------------------------------------------------------------------------------------
//Fond de la news
//----------------------------------------------------------------------------------------------
var fondhn = "fondh"+i;
var fondhn:MovieClip = this.createEmptyMovieClip("fondh"+i, this.getNextHighestDepth());
loadMovie(+fondh, fondhn);
fondhn.tabEnabled = true;
fondhn._alpha = 25;
fondhn._x = -155;
fondhn._y = _root.posy9;
fondhn.tabIndex = 9;
var fondmn = "fondm"+i;
var fondmn:MovieClip = this.createEmptyMovieClip("fondm"+i, this.getNextHighestDepth());
loadMovie(+fondm, fondmn);
fondmn.tabEnabled = true;
fondmn._alpha = 25;
fondmn._x = -155;
fondmn._y = _root.posy9+29;
fondmn._height = fondmn._height+_root.dimfnd;
fondmn.tabIndex = 10;
var fondbn = "fondb"+i;
var fondbn:MovieClip = this.createEmptyMovieClip("fondb"+i, this.getNextHighestDepth());
loadMovie(+fondb, fondbn);
fondbn.tabEnabled = true;
fondbn._alpha = 25;
fondbn._x = -155;
fondbn._y = _root.posy9+29+_root.dimfnd;
fondbn.tabIndex = 11;
//----------------------------------------------------------------------------------------------
_root.posy = _root.posy+190+txt._height;
_root.posy1 = _root.posy1+190+txt._height;
_root.posy2 = _root.posy2+190+txt._height;
_root.posy3 = _root.posy3+190+txt._height;
_root.posy4 = _root.posy4+190+txt._height;
_root.posy5 = _root.posy5+190+txt._height;
_root.posy6 = _root.posy2+190+txt._height;
_root.posy7 = _root.posy3+190+txt._height;
_root.posy8 = _root.posy4+190+txt._height;
_root.posy9 = _root.posy5+190+txt._height;
}
}
_root.test = scrolledMC._y;
_root.test2 = scrolledMC.height;
stop(); |
Partager