Bonjour, j'adore chipoter dans Flash, et là, j'aimerais faire une gallerie dynamique. J'ai réussi à mettre des images l'une à côté de l'autre en boucle. Et là, j'aimerais réussir à ce qu'il mette les images à la ligne suivante au bout d'un certains nombre. Pourriez-vous m'aider svp? J'ai pas mal de difficulté pour le code, donc comme j'ai compris ce que j'ai fait pour le moment, j'aimerais savoir si il est possible de le rajouter à mon propre code, qui est....
import mx.transitions.Tween;
import mx.transitions.easing.*;
myXML = new XML();//
myXML.ignoreWhite = true;//
myXML.onLoad = function(flag) {//
album = myXML.firstChild;//
maxPhoto = album.childNodes.length;// Calculer le nbr d'images ds l'album
bande = _root.createEmptyMovieClip("bande",3);
for (i=0; i<maxPhoto; i++) {// Permet de boucler (for) sur le nom des images
miniaturePhoto = album.childNodes[i].attributes.miniature;// cherche l attibut nom de chaque photo
bigPhoto = album.childNodes[i].attributes.big;
remarque2Photo = album.childNodes[i].attributes.remarque2;
remarquePhoto = album.childNodes[i].attributes.remarque;
widthPhoto = album.childNodes[i].attributes.width;
heightPhoto = album.childNodes[i].attributes.height;
//clip vide qui va recevoir chaques clip qui recoit lui les images
bigCont = bande.createEmptyMovieClip("MyCont"+i, 10+i);
//on va chercher le clip dans la bibliotheque
clipAttacher = bigCont.attachMovie("clipImage", "clipImage"+i, 10+i);
//charge l image dans le clip attaché
clipAttacher.clipImg.loadMovie("mignaturesRetouche/"+miniaturePhoto,"img");
//chaque clip va posséder se propre valeur de bigimage et de remarque
clipAttacher.bigPhoto=bigPhoto;
clipAttacher.remarque2Photo=remarque2Photo;
clipAttacher.remarquePhoto=remarquePhoto;
clipAttacher.widthPhoto=widthPhoto;
clipAttacher.heightPhoto=heightPhoto;
//attribue le RollOver
clipAttacher.onRollOver = function() {
this.play();
};
//attribue le RollOut
clipAttacher.onRollOut = function() {
this.gotoAndPlay(16);
};
clipAttacher.onPress = function() {
clipBigImg = _root.attachMovie("clipBigImg", "clipBigImg", 99999);
clipBigImg.grandeImg.loadMovie("imageRetouche/"+this.bigPhoto,"img");
clipAnim=clipBigImg.grandeImg;
w=this.widthPhoto;
h=this.heightPhoto;
center=((w/2)/(1024))*1000;
clipImg.remarque2.htmlText=this.remarque2Photo;
clipBigImg.remarque.htmlText=this.remarquePhoto;
if (w==900) {
var Anim1:Tween = new Tween (clipAnim,"_x",Elastic.easeOut,1000,-450,2,true);
} else if(w>h){
var Anim1:Tween = new Tween (clipAnim,"_x",Elastic.easeOut,1000,center-580,2,true);
}
else{
var Anim1:Tween = new Tween (clipAnim,"_x",Elastic.easeOut,1000,-220,2,true);
}
var Anim2:Tween = new Tween (clipAnim,"_y",Strong.easeOut,-1000,-320,2,true);
var Anim3:Tween = new Tween (clipAnim,"_rotation",Strong.easeOut,180,360,2,true);
var Anim4:Tween = new Tween (clipAnim,"_xscale",Elastic.easeOut,0,100,2,true);
var Anim5:Tween = new Tween (clipAnim,"_yscale",Strong.easeOut,0,100,2,true);
btn=clipBigImg.btn;
btn.onPress= function(){
clipBigImg.gotoAndPlay(21);
Anim1.yoyo();
Anim2.yoyo();
Anim3.yoyo();
Anim4.yoyo();
Anim5.yoyo();
}
clipBigImg._x = 513;
clipBigImg._y = 353;
};
//
bigCont._x = 170*i; /* changer l'emplacement de gauche à droite. Ecart entre les photos */
bigCont._y = 70;/* changer l'emplacement du haut vers le bas */
}
};
myXML.load("photosRetouche.xml");// Charge Le XML
Merci, Dina