Bonjour a tous,
Je debute en ActionScrit et grace a de l'aide, j'ai fait un petit diapo interactif (gauche/droite) avec defilement d'images.
Voila le source (bon, je debute ...il doit y avoir mieux !) :
largeur = 135;
hauteur = 101;
espace = 25;
nbr = 12;
vitesse = -10;
page = 0;
largeurTotale = nbr*(largeur + espace) + espace;
photos = new Array();
this.createEmptyMovieClip("diaporama", 0);
diaporama._y = 20;
diaporama._x = 10;
var variables = new LoadVars();
variables.onLoad = function()
{
var testaff = this.designation;
infos = new Array();
infos = testaff.split(",");
for (var i = 0; i<infos[i].length; i++) {
}
}
variables.load("textes.txt");
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("D:/essai-photoshop/photos/" + i + ".jpg");
photos[i] = mc.conteneur;
mc.nombre = i;
mc.onRollOver = function() {
commentaires.text = "Photo n°" + this.nombre + " : " + infos[this.nombre];
posLar = photos[this.nombre]._x;
posHaut = photos[this.nombre]._y;
photos[this.nombre]._x = posLar - 10;
photos[this.nombre]._y = posHaut - 10;
photos[this.nombre]._xscale = 120;
photos[this.nombre]._yscale = 120;
}
mc.onRollOut = function() {
commentaires.text = "";
photos[this.nombre]._x = posLar;
photos[this.nombre]._y = posHaut;
photos[this.nombre]._xscale = largeur - espace - 10;
photos[this.nombre]._yscale = hauteur;
}
}
onEnterFrame = function() {
if (page == 1) { vitesse = 10; }
else {
if (diaporama._x < (-1300)) {page = 1;}
else {page = 0;}
}
diaporama._x += vitesse;
if (diaporama._x > -20) { page = 0; vitesse = -10; }
}
onMouseMove = function() {
if (_xmouse < 100) {page = 0; vitesse = -10;}
if (_xmouse > 500) {page = 1; vitesse = +10;}
}
Et je voudrais maintenant afficher un clip sur chacune des photos.
Par exemple afficher le commentaire sur la photo ou une etoile ou un rond, peut etre les 2 a la fois.
Est-ce possible ?
Merci a tous et bonne journee.