Actionscript question

I am making a game but i need some help. I have a button with the code:on (release) {
_root.slot1.gotoAndPlay(2);
}

and a movieclip with the instance name of slot1. when both of these (the button and the moveclip) are in the same frame every thing works the movieclip with the name slot1 goes to frame 2 when i release the button, but when i put the button in a different frame and i released it when i went to the new frame the moveclip was still in frame 1, it did not work the moveclip did not go to frame 2. is there a way to make this work? or another way to make a moveclip go to a different frame when you release a button.