Salve a tutti. Sto aiutando un amico son un progetto, peccato che non faccio siti ed alla prima cosa che va oltre il 'goto' mi sono arenato.

Potete vedere il sito test qui. Alla voce galleria c'é una interfaccia molto semplice: sotto una fila di riquadri 35x35px per the thumbnail, sopra un box dove caricare l'immagine selezionata.

La galleria é un mc con la maschera che rivela l'interfaccia, specifico in caso l'as in uso non vada per questione di root. Nel ultimo frame di questa semplice animazione (la maschera che rivela l'interfaccia) ho messo lo script più semplice che ho trovato in giro.

myPhoto = new XML();
//create a new xml object
myPhoto.ignoreWhite = true;
// ignore any whitespace without this the xml file loading may fail due to small spacing errors
myPhoto.load("xmlphoto.xml");
//actually load the file
myPhoto.onLoad = function(success) {
//function performed once the loading is complete.
numimages = this.firstChild.childNodes.length;
spacing = 40;
//sets the spacing variable for use later on
for (i=0; i<numimages; i++) {
/* create a loop which repeats it self for the total number of images.*/
this.picHolder = this.firstChild.childNodes[i];
/* assigns a temporary name for each of the childNodes so that they can be referenced later on in the loop.*/
this.thumbHolder = _root.thumbnails.createEmptyMovieClip("thumbnail"+ i, i);
//create a unique movie clip for each thumbnail, assign a temporary reference thumbholder for the movieclips
this.thumbHolder._x = i*spacing;
//set the x vaues for each newly created movieclip.
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_i mage"+i, i);
this.thumbLoader.loadMovie(picHolder.attributes.th mb);
//create new movie and then load the thumbnails into it.
thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
};
}
};
Come dice il tutorial ho chiamato 'loader' l'mc del box grande mentre 'thumbnails' il box piccolo (che via script dovrebbe essere ripetuto 16 volte, come il numero delle thumbnail). Al mc contenente il tutto ho dato nome instanza 'gallery', se servisse.

Ovviamente esiste il file xmlphoto.xml che flash va a chiamare. Di seguito il suo contenuto.

<gallery>
<main="assets/assets/images/1.jpg" thmb="assets/thumbnails/1thmb.jpg"/>
<main="assets/assets/images/2.jpg" thmb="assets/thumbnails/2thmb.jpg"/>
<main="assets/assets/images/3.jpg" thmb="assets/thumbnails/3thmb.jpg"/>
<main="assets/assets/images/4.jpg" thmb="assets/thumbnails/4thmb.jpg"/>
<main="assets/images/5.jpg" thmb="assets/thumbnails/5thmb.jpg"/>
<main="assets/images/6.jpg" thmb="assets/thumbnails/6thmb.jpg"/>
<main="assets/images/7.jpg" thmb="assets/thumbnails/7thmb.jpg"/>
<main="assets/images/8.jpg" thmb="assets/thumbnails/8thmb.jpg"/>
<main="assets/images/9.jpg" thmb="assets/thumbnails/9thmb.jpg"/>
<main="assets/images/10.jpg" thmb="assets/thumbnails/10thmb.jpg"/>
<main="assets/images/11.jpg" thmb="assets/thumbnails/11thmb.jpg"/>
<main="assets/images/12.jpg" thmb="assets/thumbnails/12thmb.jpg"/>
<main="assets/images/13.jpg" thmb="assets/thumbnails/13thmb.jpg"/>
<main="assets/images/14.jpg" thmb="assets/thumbnails/14thmb.jpg"/>
<main="assets/images/15.jpg" thmb="assets/thumbnails/15thmb.jpg"/>
<main="assets/images/16.jpg" thmb="assets/thumbnails/16thmb.jpg"/>
</gallery>
La sintassi pare giusta, il filmato chiama l'xml ma nulla appare... A colpo d'occhio capite cosa c'é di sbagliato? :master:

Approfitto per aggiungere che mi piacerebbe aggiungere il fade per apparizione a transizione immagini.

Altra cosa che mi piacerebbe fare, ma qui forse sarebbe da stravolgere il tutto, sarebbe avere l'immagine grande a riempire il box per il lato minore, trovandosi quindi con parti dell'immagine tagliate dal riquadro, avendo però la possibilità che al passaggio del mouse l'immagine si muova rivelando le porzioni nascoste. Una cosa alla volta però, perché non va?