Ho fatto queste windows
ma vorrei ottimizzare il tutto con una funzione invece che inserire per ogni bottone il codice...
...questa la funzione che deve eseguire ogni bottone per aprire le window (istanza:win1, win2...eccc....)
MI DA PROBLEMI DOVE HO ASSOCIATO WITH.NOME
DEVE DARMI WITH.WIN1...ecc..c..
//
Sui bottoni metto:
on(Release){
apriFinestra(win1);
}
//----begin codice apertura windows
function aprifinestra(nome) {
trace("Stato finestra "+statowin);
// ciclo che setta le finestre trasparenti
for (x=1; x<=numero_win; x++) {
_root["win"+x]._alpha = 30;
_root["win"+x].boxtesto._visible = 0;
_root["win"+x].sc._visible = 0;
}
with (this.nome) {
if (statowin == null) {
statowin = "chiusa";
}
if (statowin == "aperta") {
//la lascio dove stà
_x = _x;
_y = _y;
// giusu ne setto lo stato su ON
// giusu mettiamolo con la barretta in basso x chiusura (ON)
if (giusu.bew == null || giusu.bew == "off") {
gotoAndPlay(2);
giusu.bew = "on";
}
if (giusu.bew == "on") {
giusu.gotoAndStop(1);
boxtesto._visible = 1;
sc._visible = 1;
}
//--------------end per stato=aperta
//
//Inizio per stato chiusa
} else if (statowin == "chiusa") {
gotoAndPlay(2);
giusu.bew = "on";
giusu.gotoAndStop(1);
statowin = "aperta";
_x = d+(px*(_name.slice(3)-1));
_y = d+(py*(_name.slice(3)-1));
boxtesto._visible = 1;
sc._visible = 1;
// resettiamo la SCALA della window nel caso sia stata ridimensionata
_xscale = 100;
_yscale = 100;
//--------------end per stato=chiusa
}
}
with (this.nome) {
_alpha = 100;
_visible = 1;
swapDepths(1000+_parent.valoredep);
_parent.valoredep++;
trace("La win è "+statowin);
}
}
![]()
![]()
![]()

Rispondi quotando