So che il problema è stato già affrontato, tuttavia dopo ore di elucubrazioni non ne sono venuto ancora a capo...
Del resto la trattazione di questi argomenti non ha una diffusione ancora così capillare...
Tuttavia,
il punto è questo:
Carico all'interno di un mc chiamato "contenitore" (che è un array che si incrementa tramite for) una serie di Thumbnail prese da un file xml.
Poi c'è un altro mc ("selezione") che mi serve a far vedere la prima immagine ingrandita [per le successive dovrò cliccare sulle thumb].
Tutto funge, il problema che non riesco a risolvere è come realizzare i preload per il mc "contenitore" e per quello che ospiterà invece le immagini ingrandite.
Il codice è questo:
xmlfile = "portfolio.xml";
leggi = function () {
nuovo = new XML();
nuovo.ignoreWhite = true;
nuovo.load(xmlfile);
nuovo.onLoad = function(success) {
if (success) {
nfoto = this.firstChild.childNodes.length;
t = 0;
basso = nfoto;
for (i=0; i<nfoto; i++) {
_root.attachMovie("mc", "mc"+(i+1), i+1);
dim[i] = this.firstChild.childNodes[i].attributes.thumbwidth;
_root["mc"+(i+1)]._y = 200;
_root["mc"+(i+1)]._x = t+gap_x;
if (i==0) {
_root["mc"+(i+1)]._alpha = 50;
}
t += Number(dim[i])+dist_tra_foto;
if (t>basemovie-gap_x) {
kk = false;
bt_giu._visible = true;
}
_root["mc"+(i+1)].a = this.firstChild.childNodes[i].attributes.image;
_root["mc"+(i+1)].contenitore.loadMovie(this.firstChild.childNodes[i].attributes.thumb);
_root["mc"+(i+1)].etichetta.text = this.firstChild.childNodes[i].attributes.worktitle;
_root["mc"+(i+1)].b = this.firstChild.childNodes[i].attributes.worktitle;
_root["mc"+(i+1)].c = this.firstChild.childNodes[i].attributes.imagewidth;
_root["mc"+(i+1)].d = this.firstChild.childNodes[i].attributes.imageheight;
}
// **** Prima foto che si visualizza ****
idPos = setInterval(Centrato,0,_root.selezione)
_root.sipario._visible = true;
_root.sipario.gotoAndPlay(18);
_root.selezione.loadMovie(this.firstChild.childNod es[0].attributes.image);
_root.didascalia.text = this.firstChild.childNodes[0].attributes.worktitle;
// ///////////////////////////////////
letto = true;
} else {
_root.didascalia.text = "errore di lettura";
}
};
};
Grazie infinite in anticipo a chi volesse soccorrermi!