codice:
function loadLivello(docente) {
_global.esiste = 1;
loadMovieNum("docenti.swf", 2);
myroot.onEnterFrame = function() {
_level1._visible = 0;
var _l1 = _level2.getBytesLoaded();
var _l2 = _level2.getBytesTotal();
if (_l1>=100 && _l1>=_l2) {
trace(_l1);
trace(_l2);
_level2[docente].gotoAndStop(13);
_level2.inizio._visible = false;
dati = new LoadVars();
dati.path = _level2;
dati.onLoad = function(success) {
if (success) {
for (var prop in this) {
this.path[prop].html = true;
this.path[prop].htmlText = this[prop];
}
} else {
trace("file inesistente");
}
ASSetPropFlags(dati, ["onLoad", "path"], 7);
};
dati.load("docenti/"+docente+".txt");
myroot.onEnterFrame = function() {
_level2._alpha = _level2._alpha+10;
if (_level1._alpha>=100) {
myroot.onEnterFrame = null;
}
// end if
};
}
// end if
};
}
// End of the function
var myroot = this;
bottone.onRelease=function(){
loadLivello("Boccaccio Carlo");
}
la parte in verde la fa benissimo!
quel ke è peggio è ke ho messo lo stesso codice in docenti.swf per rikiamare insegnamenti.swf(ke sarebbe l'swf su cui sto lavorando ora) e funziona a meraviglia!