Je débute en flash, et ai trouvé ce script pour faire une présentation de photos.
Je suis scrupuleusement, ce qui est indiqué.
Malheureusement, quand je teste, j'ai une erreur de syntaxe au niveau de la ligne 4: nbr = 15;
15 étant le nombre de photos.
Quelqu'un peut-il m'aider et me dire ce que je dois écrire à ce niveau-là, car nbr et nécessaire dans la suite du script ?
largeur = 300;
hauteur = 220;
espace = 25;
nbr = 15;
infos = new Array();
infos[0] = "Photo N° 0";
infos[1] = "Photo N° 1";
infos[2] = "Photo N° 2";
infos[3] = "Photo N° 3";
infos[4] = "Photo N° 4";
infos[5] = "Photo N° 5";
infos[6] = "Photo N° 6";
infos[7] = "Photo N° 7";
infos[8] = "Photo N° 8";
infos[9] = "Photo N° 9";
infos[10] = "Photo N° 10";
infos[11] = "Photo N° 11";
infos[12] = "Photo N° 12";
infos[13] = "Photo N° 13";
infos[14] = "Photo N° 14";
largeurTotale = nbr*(largeur + espace) + espace;
this.createEmptyMovieClip("diaporama", 0);
diaporama._y = 10;
for(var i = 0; i < nbr; i++) {
var mc = diaporama.createEmptyMovieClip("photo"+i, i);
mc._x = espace + (largeur + espace)*i;
mc.createEmptyMovieClip("conteneur", 0);
mc.conteneur.loadMovie("photos/" + i + ".jpg");
mc.createEmptyMovieClip("cadre", 1);
with(mc.cadre) {
lineStyle(1, "0x000000", 100);
moveTo(0, 0);
lineTo(largeur, 0);
lineTo(largeur, hauteur);
lineTo(0, hauteur);
lineTo(0, 0);
}
mc.nombre = i;
mc.onRollOver = function() {
commentaires.text = "Photo n°" + this.nombre + " : " + infos[this.nombre];
}
mc.onRollOut = function() {
commentaires.text = "";
}
}
onMouseMove = function() {
diaporama._x = (900 - largeurTotale)/900*_xmouse;
}
Tautie