metti tutto il tuo cod nel primo frame ovviamente togli il popolamento dei dati
e alla fine della lettura dei dati richiami la funzione che dispone i clip sullo stage con una cosa del genere
Codice PHP:
onClipEvent (load) {
this.stop();
mio_xml = new XML();
mio_xml.path = this;
mio_xml.ignoreWhite = true;
mio_xml.onLoad = function(success)
{
if(success){
var t1 = "<font color='#000000'>";
var t2 = "<font color='#000000'>";
var t3 = "</font>";
var nodes = this.firstChild.childNodes;
for(var i = 0; i < nodes.length; i++){
var myID = nodes[i].attributes.myID;
var foto_small = nodes[i].attributes.foto_small;
//questa parte ora non ti serve magari basta che togli la vcasella dallo stage
this.path.testo += t1 + myID + t3 + "
";
this.path.testo += t2 + foto_small + t3 + "
";
this.path.testo += "
";
}
} else {
this.path.testo = "caricamento errato";
}
//qua se ho ben capito e il tot dovrebbe essere nodes.length
disponi(_root.mc, nodes.length, 2, 5, 5);
};
mio_xml.load("xml_thumbs.php");
}
function disponi(clip, numTot, numRig, distHor, distVert) {
numCol = Math.ceil(numTot/numRig);
posX = new Array();
posY = new Array();
startX = clip._x;
startY = clip._y;
cont = 0;
for (xx=0; xx<numCol; xx++) {
for (a=0; a<numRig; a++) {
posX.push(startX+(clip._width+distHor)*a);
}
}
for (yy=0; yy<numCol; yy++) {
for (b=0; b<numRig; b++) {
posY.push((startY)+(clip._height+distVert)*yy);
}
}
for (num=0; num<numTot; num++) {
duplicateMovieClip(clip, "clipDuplicato"+num, num);
_root["clipDuplicato"+num]._x = posX[num];
_root["clipDuplicato"+num]._y = posY[num];
_root["clipDuplicato"+num]._alpha = 0;
}
function effetto() {
_root["clipDuplicato"+cont]._alpha = 100;
if (cont == numTot) {
clearInterval(intv);
}
cont++;
}
intv = setInterval(effetto, 10);
}