var cat = _level0.l1;
var sot = _level0.l2;
var mf = _level0.mf;
var st_x = 430;
var st_y = 430;
var limit = mf + 1;
_root.createEmptyMovieClip("contenitore",1000);
function preload(clip){
car = clip.getBytesLoaded();
tot = clip.getBytesTotal();
perc = Math.round((car/tot)*100);
clip.createTextField("testo", 1, (this._width/2), (this._height/2), 200, 20);
clip.testo.wordWrap = true;
testoformat = new TextFormat();
testoformat.color = "0x123466";
testoformat.font = "Verdana";
clip.testo.setTextFormat(testoformat);
if(!isNaN(perc)) {
clip.testo.text = "Caricamento..."+perc+"%";
clip.testo.setTextFormat(testoformat);
}
if (car == tot && car > 1024) {
clearInterval(a);
clip.testo.text = "";
}
}
function carica() {
carichiamoFoto = new LoadVars();
carichiamoFoto.load("gallery_Extractor.php?l1="+ca t+"&l2="+sot);
carichiamoFoto.onLoad = function(success) {
if (success) {
max_foto = this.nr;
for (i=1; i < max_foto+1; i++) {
contenitore.createEmptyMovieClip("foto"+i,100-i);
dim_w = this["imw"+i];
dim_h = this["imh"+i];
immagine = _root.contenitore["foto"+i];
immagine.loadMovie(this.perc+this["foto"+i]);
//loadMovie(this.perc+this["foto"+i],contenitore.foto+i);
//immagine2 = _root["foto1"];
//immagine2.loadMovie(this.perc+this["foto1"]);
a = setInterval(preload,50,immagine);
// centro l'immagine in orizzontale ed in verticale
//_root.contenitore.immagine._x = (st_x / 2) - (dim_w / 2);
//_root.contenitore.immagine._y = (st_y / 2) - (dim_h / 2);
// perfeziono il caricamento dell'immagine (smoth)
//var new_img = new flash.display.BitmapData(dim_w, dim_h);
//new_img.draw(_root["foto"+i]);
//this.my_img.attachBitmap(new_img, 1, "auto", true);
//if(i<>1) {
_root.contenitore["foto"+i]._alpha = 0;
//}
}
}
}
}
//_root.createEmptyMovieClip("foto",100);
//immagine = _root["foto"];
//immagine.loadMovie("foto.jpg");
//a = setInterval(preload,50,immagine);
carica();
stop();