codice:
function loadIMG(img){
this.map.map_file._alpha = 0;
this.map.map_file.loadMovie(img);
this.prel = setInterval(this, "preloadIMG", 30);
}
function preloadIMG() {
var car = this.map.map_file.getBytesLoaded();
var tot = this.map.map_file.getBytesTotal();
var perc = Math.round((car/tot)*100);
if (car == tot && car > 4) {
clearInterval(this.prel);
this.map.map_file._alpha = 100;
return;
}
}
dati = new LoadVars();
dati.path = this;
dati.onLoad = function(success)
{
if(success){
this.path.loadIMG(this.img);
} else {
trace("IMMAGINE INESISTENTE");
}
};
dati.checkJPG = function(img)
{
this.img = img;
this.load(this.img);
};
dati.checkJPG("cartine/" + varprov);