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
| /*----------------------------------------------------------------------------------
CREATION de champs textes et images dynamiques
----------------------------------------------------------------------------------*/
//creation d'un mc conteneur qui s'appelle "liste_livres".
this.createEmptyMovieClip("liste_livres", 0);
liste_livres._x = 5;
liste_livres._y = 10;
liste_livres.width = 365;
liste_livres.height = 520;
/*----------------------------------------------------------------------------------
RECUP VARIABLES
----------------------------------------------------------------------------------*/
// Création d'un objet LoadVars pour récupérer les données
liste_lv = new LoadVars();
// Définition de la fonction à appeler au chargement des données
liste_lv.onLoad = function(pSucces){
// Si le chargement s'est bien déroulé...
if(pSucces){
// Si le premier résultat vaut "Echec", on affiche le message d'erreur :
if (this.resultat_0 == "Echec"){
liste_erreur.htmlText = "ERREUR";
// Sinon on affiche les résultats
} else {
for (var i=0 ; i<this.total ; i++){
// CREATION de la zone image
var a = 100+i;
//Dans le clip "liste_livres" je crée des clips vides qui s'appellent respectivement photos0, photos1, ... aux levels 100,101,102 etc...
var photo = liste_livres.createEmptyMovieClip("photos"+a, a);
//-------------- Placement du clip ----------------------
photo._x = 0;
photo._y = Math.floor(i/1)*90+5;
photo.width = 80;
photo.height = 80;
//Dans le clip "photo" je crée un nouveau clip vide qui s'appelle "img".
photo.createTextField("img", 1, 0, 0, 80, 80);
photo.img.multiline = true;
photo.img.wordWrap = true;
photo.img.html = true;
// je recupere enfin l'image à partir d'un php et d'une base SQL
photo.img.htmlText = "<img src='"+this['resultatPhoto_'+i]+"'>";
// CREATION de la zone texte
var b = 200+i;
//Dans le clip "liste_livres" je crée des clips vides qui s'appellent respectivement textes200, textes201, ... aux levels 200,201,202 etc...
var texte = liste_livres.createEmptyMovieClip("textes"+b, b);
//-------------- Placement du clip----------------------
texte._x = 90;
texte._y = Math.floor(i/1)*90+5;
texte.width = 265;
texte.height = 80;
//Dans le clip "texte" je crée un nouveau clip vide qui s'appelle "info".
texte.createTextField("info", 0, 0, 0, 265, 80);
texte.info.multiline = true;
texte.info.wordWrap = true;
texte.info.html = true;
// je recupere enfin le prenom et nom à partir d'un php et d'une base SQL
texte.info.htmlText = this['resultatPrenom_'+i]+" "+this['resultatNom_'+i];
}
}
// Si le fichier n'a pas pu être chargé...
} else {
css = "<b>FICHIER INTROUVABLE</b>";
}
}
// Chargement du fichier
liste_lv.load("./liste-librairie_fr.php"); |
Partager