hello,
i have a basic formula i use on most websites that i make. the current site i am making is not working properly. when i open a new page, the current page does not always animate off. sometimes it does, but 50% of the time it does not. this is freaking me out big time. does anyone know why this might be happening?
my code
var currentPage = "contentHome_mc";
_root.onLoad = function() {
animateOn("contentHome_mc");
};
function animateOn(page:String) {
eval(page).gotoAndPlay("on");
}
function animateOff(page:String) {
eval(page).gotoAndPlay("off");
}
home_mc.onRelease = function() {
if (currentPage != "contentHome_mc") {
animateOff(currentPage);
animateOn("contentHome_mc");
currentPage = "contentHome_mc";
}
};
services_mc.onRelease = function() {
if (currentPage != "contentServices_mc") {
animateOff(currentPage);
animateOn("contentServices_mc");
currentPage = "contentServices_mc";
}
};
gardens_mc.onRelease = function() {
if (currentPage != "contentGardens_mc") {
animateOff(currentPage);
animateOn("contentGardens_mc");
currentPage = "contentGardens_mc";
}
};
design_mc.onRelease = function() {
if (currentPage != "contentDesign_mc") {
animateOff(currentPage);
animateOn("contentDesign_mc");
currentPage = "contentDesign_mc";
}
};
contact_mc.onRelease = function() {
if (currentPage != "contentContact_mc") {
animateOff(currentPage);
animateOn("contentContact_mc");
currentPage = "contentContact_mc";
}
};
any help is greatly appreciated. i am using the exact same code on a different site and it works fine. and because it works half the time on this problematic site, i know all my instance names are correct. so what gives?