Forum de discussion
Forum « Flash et Shockwave » (archives)
Re: image
Envoyé: 6 septembre 2004, 8h33 par gyome314
Voici les scripts qu'il te faut
Image1:
gallerieXml = new XML();
gallerieXml.ignoreWhite = true;
gallerieXml.load("images.xml");
Image3:
// Si le xml n'est pas chargé...
if(!gallerieXml.loaded)
gotoAndPlay(2);
Image4:
// tableau des attributs XML
_root.gallerie_tab = gallerieXml.firstChild.childNodes;
// nb d'image = nb de colonnes du tableau
_root.lon = gallerie_tab.length;
for (i = 0; i<_root.lon; i++) {
//URL de l'image indiquer par le fichier urlimage dans le fixhier XML
var nom = gallerie_tab[i].attributes.urlimage;
// Création d'un clip vide:
_root.createEmptyMovieClip("nv_img"+i, i+10);
_root["nv_img"+i].loadMovie(nom);
}
Image6:
// Vérif du chargement des images
for(i=0;i<_root.lon;i++){
if(_root["nv_img"+i].getBytesLoaded() !=_root["nv_img"+i].getBytesTotal())
_root.gotoAndPlay(5);
}
Image 7,8,...:
Il ne te reste plus qu'à positionner, redimensionner tes clips '_root["nv_img"+1]','_root["nv_img"+2]',...
Voila...
Sinon le fichier XML doit ressembler à ca:
images.xml:
<album>
<photo urlimage="images/img1.jpg"
>
<photo urlimage="images/img2.jpg"
>
...
</album>
J'espère avoir été suffisamment clair
A+
Gyome
Réponses
|