codice:
var loader = new LoadVars();
loader.__reset = function() {
clearInterval(this.__interval);
};
loader.onData = function(dt) {
this.__reset();
trace( dt );
};
loader.onLoad = function(success) {
this.__reset();
if (success) {
// fai quello che devi fare
} else {
// ciao
}
};
loader.onLoadProgress = function(bL, tL) {
if (
isNaN(bL) == false &&
isNaN(tL) == false &&
bLn != undefined &&
tL != undefined &&
tL >= 0
) {
// metti le cose da fare al preload
trace(bL+' => '+tL);
}
};
loader.loadWithProgress = function(txt:String) {
this.load(txt);
this.__interval = setInterval(
this,
'onLoadProgress',
20,
this.getBytesLoaded(),
this.getBytesTotal()
);
};
loader.loadWithProgress( "myfile.txt" );
piu' o meno una cosa di questo tipo