Grazie Stan del tuo aiuto, ma non riesco a lavorare con la questione della variabile che tu dici, allego il file di partenza su cui stò facendo le prove http://www.mediafire.com/?8z24d2n37bpb4fa
var saved va inserito una volta sola oppure devo fare
var saved1
var saved2
var saved3
Non sò se può essere d'aiuto anche questo codice che ho trovato:
Codice PHP:
//create a "blank" variable that can stand in
//for any of your pages:
var currentPage:MovieClip;
//START Initial page load settings
addChild(homestuff);
homestuff.alpha = 0;
TweenLite.to(homestuff, 1, {alpha:1});
currentPage = homestuff;
linkBtn1.addEventListener(MouseEvent.CLICK, showhome);
function showhome(evt:MouseEvent):void {
if(homestuff != currentPage) {
//fade out currentPage:
TweenLite.to(currentPage, 1, {alpha:0});
//fade in homestuff:
addChild(homestuff);
homestuff.alpha = 0;
TweenLite.to(homestuff, 1, {alpha:1, onComplete:switcheroo, onCompleteParams:[homestuff]});
}
}
linkBtn2.addEventListener(MouseEvent.CLICK, showlocation);
function showlocation(evt:MouseEvent):void {
if(locationstuff != currentPage) {
//fade out currentPage:
TweenLite.to(currentPage, 1, {alpha:0});
//fade in locationstuff:
addChild(locationstuff);
locationstuff.alpha = 0;
TweenLite.to(locationstuff, 1, {alpha:1, onComplete:switcheroo, onCompleteParams:[locationstuff]});
}
}
linkBtn3.addEventListener(MouseEvent.CLICK, showtenants);
function showtenants(evt:MouseEvent):void {
if(tenantsstuff != currentPage) {
//fade out currentPage:
TweenLite.to(currentPage, 1, {alpha:0});
//fade in tenantsstuff:
addChild(tenantsstuff);
tenantsstuff.alpha = 0;
TweenLite.to(tenantsstuff, 1, {alpha:1, onComplete:switcheroo, onCompleteParams:[tenantsstuff]});
}
}
linkBtn4.addEventListener(MouseEvent.CLICK, showdesign);
function showdesign(evt:MouseEvent):void {
if(designstuff != currentPage) {
//fade out currentPage:
TweenLite.to(currentPage, 1, {alpha:0});
//fade in designstuff:
addChild(designstuff);
designstuff.alpha = 0;
TweenLite.to(designstuff, 1, {alpha:1, onComplete:switcheroo, onCompleteParams:[designstuff]});
}
}
linkBtn5.addEventListener(MouseEvent.CLICK, showcontact);
function showcontact(evt:MouseEvent):void {
if(contactstuff != currentPage) {
//fade out currentPage:
TweenLite.to(currentPage, 1, {alpha:0});
//fade in contactstuff:
addChild(contactstuff);
contactstuff.alpha = 0;
TweenLite.to(contactstuff, 1, {alpha:1, onComplete:switcheroo, onCompleteParams:[contactstuff]});
}
}
//function that removes the current page and then resets it to the new choice:
function switcheroo(theNewPage:MovieClip):void {
removeChild(currentPage);
currentPage = theNewPage;
}
Ho provato a personalizzarlo ma riscontro questi errori
Codice PHP:
Scena 1, livello 'Livello 1', fotogramma 1, riga 16 1176: Confronto tra un valore di tipo statico Class e un tipo flash.display:MovieClip che potrebbe non essere correlato.
Scena 1, livello 'Livello 1', fotogramma 1, riga 20 1067: Assegnazione forzata implicita di un valore del tipo Class a un tipo flash.display:DisplayObject non correlato.
Scena 1, livello 'Livello 1', fotogramma 1, riga 21 1119: Accesso a una proprietà non definita alpha mediante un riferimento con tipo statico Class.