[AS2][CS3]Help getting variable to store text

Okay so I’m working on this website where theres a bunch of embedded movie clips in once frame and each one pops up when you click on the btn (also a movie clip but given extension of btn for easy reference). Each smaller movie clip pops up in a different portion of the screen so the close button (solutionClose_mc) moves wherever. This all worked well and good until they wanted me to put in a link from one movie clip to another one of the other movie clips. Now I had to add another clip (premLink_mc) to try to link from the premTrack_mc to prem_mc. I’ve tried what feels like 100 different variations to make it work and I’m stuck. The conclusion I’ve come to is that the variable isn’t holding the string correctly or for some reason or another the if statement isn’t registering it correctly? This is the code:


var currentPage:String;
 
function animateOn(service:String) {
            eval(service).gotoAndPlay("down");
}
 
function animateOff(service:String) {
            eval(service).gotoAndPlay("out");
}
 
overview_btn.onRelease = function() {
            if (currentPage != "overview_mc") {
                        animateOn("overview_mc");
                        solutionsClose_mc._x = "-216.1";
                        solutionsClose_mc._y = "278.8";
                        solutionsClose_mc.gotoAndPlay("stop");
                        currentPage = "overview_mc";
            }
};
prem_btn.onRelease = function() {
            if (currentPage != "prem_mc") {
                        animateOn("prem_mc");
                        solutionsClose_mc._x = "-226.1";
                        solutionsClose_mc._y = "208.9";
                        solutionsClose_mc.gotoAndPlay("stop");
                        currentPage = "prem_mc";
            }
};
premTrack_btn.onRelease = function() {
            if (currentPage != "premTrack_mc") {
                        animateOn("premTrack_mc");
                        solutionsClose_mc._x = "-212.1";
                        solutionsClose_mc._y = "-5";
                        solutionsClose_mc.gotoAndPlay("stop");
                        premLink_mc._x = "-67";
                        premLink_mc._y = "-44.1";
                        premLink_mc.gotoAndPlay("stop");
                        currentPage = "premTrack_mc";
            }
};
base_btn.onRelease = function() {
            if (currentPage != "base_mc") {
                        animateOn("base_mc");
                        solutionsClose_mc._x = "-215.6";
                        solutionsClose_mc._y = "22.8";
                        solutionsClose_mc.gotoAndPlay("stop");
                        currentPage = "base_mc";
            }
};
 
solutionsClose_mc.onRelease = function() {
            if (currentPage != "prem_link") {
                        animateOff(currentPage);
                        solutionsClose_mc.gotoAndPlay("start");
                        currentPage = "solutionsClose_mc";
            }
            else {
                        animateOff("prem_mc");
                        premLink_mc.gotoAndPlay("start");
                        solutionsClose_mc.gotoAndPlay("start");
                        currentPage = "solutionsClose_mc";
            }
};
 
premLink_mc.onRelease = function () {
            soltuionsClose_mc.gotoAndPlay("start");
            premLink_mc.gotoAndPlay("start");
            animateOff(currentPage);
            animateOn("prem_mc");
            solutionsClose_mc.gotoAndPlay("stop");
            solutionsClose_mc._x = "-226.1";
            solutionsClose_mc._y = "208.9";
            currentPage = "prem_link";
};
 
button3_mc.onRelease = function() {
            if (currentPage != "overview_mc") {
                        animateOn("overview_mc");
                        solutionsClose_mc._x = "-216.1";
                        solutionsClose_mc._y = "278.8";
                        solutionsClose_mc.gotoAndPlay("stop");
                        currentPage = "overview_mc";
            }
};

Now with this way if you click the premTrack_mc button it animates in all well and good but when you click the close button it does not animate out the premLink_mc. So I altered the code as such:


solutionsClose_mc.onRelease = function() {
            if (currentPage = "prem_link") {
                        animateOff(currentPage);
                        solutionsClose_mc.gotoAndPlay("start");
                        currentPage = "solutionsClose_mc";
            }
            else if (currentPage = "premTrack_mc"){
                        animateOff(currentPage);
                        premLink_mc.gotoAndPlay("start");
                        solutionsClose_mc.gotoAndPlay("start");
                        currentPage = "solutionsClose_mc";
            }
            else {
                        animateOff(currentPage);
                        solutionsClose_mc.gotoAndPlay("start");
                        currentPage = "solutionsClose_mc";
            }
};

This is where everything went crazy. Now nothing is working. So I’m thinking that my variable isn’t holding the string? Anyone have any thoughts? Thanks in advance.