Var gotoAnd play scene

I’m hoping you guys can help me.

I am working on a nav where when the user clicks on a selection, the nav first plays through a transition/outtro and then is directed to the appropriate scene via a variable embedded into the nav button.

For whatever reason it seems to simply cycle through all the different scenes when I click on a the buttons rather than go to the appropriate scene.

This is what I have:


In the button:

on (release) {
_root.play();
y = “1”;
getURL(“body_home.htm”, “body”);
}


In the last frame of the scene:

stop();
if (y = “1”) {
_root.gotoAndPlay(1);
}
if (y = “2”) {
_root.gotoAndPlay(2);
}
if (y = “3”) {
_root.gotoAndPlay(“portfolio”);
}
if (y == “4”) {
_root.gotoAndPlay(“clients”);
}
if (y == “5”) {
_root.gotoAndPlay(“ftp”);
}
if (y == “6”) {
_root.gotoAndPlay(“contact”);
}