- crea un file di testo, "testo.txt", con questo contenuto:
- nello stesso frame dove stanno i pulsanti scrivi:
codice:
data_var = new LoadVars();
data_var.path = this;
data_var.onLoad = function(success)
{
if(success){
this.path.foto = this.foto;
this.path.maxf = this.foto;
this.path.avanti._alpha = 0;
this.path.conte.loadMovie("img/" + this.foto + ".jpg");
} else {
}
};
data_var.load("testo.txt");
- associa al pulsante "avanti":
codice:
on (press) {
_root.indietro._alpha = 100;
if (_root.conte._width != 0) {
foto += 1;
_root.conte.loadMovie('img/' + foto + '.jpg');
}
}
on (release) {
if (foto == maxf) {
_root.avanti._alpha = 0;
}
}
- associa al pulsante "indietro":
codice:
on (press) {
_root.avanti._alpha = 100;
if (foto > 1) {
foto -= 1;
_root.conte.loadMovie('img/' + foto + '.jpg');
_root.indietro._alpha = 100;
_root.fine.gotoAndStop(1);
}
}
on (release) {
if (foto == 1) {
_root.indietro._alpha = 0;
}
}