I have this code to swap buttons. ‘current’ holds the current pages while ‘currenttab’ holds the currently selected tab (button) corresponding to that page.
The page is set to solo when first run then clicking on the button evolution should target the movie instances held by current and current tab hiding them - then the idea is that the variables are updated to reflect the changes so when another button is pressed it will ‘know’ what page is current and target the correct movies…
what actually happens is that even though trace is showing that the variables are changing it keeps targetting the same movie as if the variables are the same…
the variables are being set on the frame above in the same timeline but i have tried making them global on the first frame of the main timeline but no change…
and also my if…then statement doesn’t work - even when trace says that the value of current is ‘evolution’ is still keeps acting as if it isn’t.
evobutton.onRelease = function() {
//checks if the current page is the same as the button clicked //
if(current != “evolution”){
// if it’s not then move and fade out current page //
this._parent[current].gotoAndPlay(2);
this._parent[current].alpha(5, 0);
// puts away the page tab and fades it //
this._parent.titletabs[currenttab].gotoAndPlay(22);
this._parent.titletabs[currenttab].alpha(5, 70);
// fades up the new movie and moves new page tab//
evolution.alpha(5, 100);
titletabs.evotab.gotoAndPlay(2);
//sets the new variables //
var current = “evolution”;
var currenttab = “evotab”;
// //
trace(current);
trace(currenttab);
}
};
any help very much appreciated - in my fourth day of trying to fix this…
:thumb2: