Unloading on 2 conditions

i basic need to unload a movie off of level5, based on two conditions. the first condition i working, but the second condition isn’t working for me…here is the setup

i have a window open( which has an ‘open’ stage and a ‘close’ stage )on level5. when a button is pressed it unloads and starts whatever that button contains. my script works for when the window is in its ‘open’ stage but i cannot get it to work when it is in its ‘close’ stage, which is on frame 27.

my script looks like this:


stop();
_level4.current_selection = "links";
if (_level4.current_selection == "links") {
unloadMovie(5);
} else {
gotoAndStop(27);
_level4.current_selection = "links";
}

this part above works beautifully!!
now i need a script that says:
if on this frame ( which is 27 ), and the links button has been pressed, unload level5. i tried making a variable for this but for some reason my script failed. check it below:


//my variable
_level5.aboutmovie.current_frame = "27";
if (_level5.aboutmovie.current_frame == "27") {
//i guess i should re-address the initial variable about the button
} else if (_level4.current_selection == "links") {
unloadMovie(5);
_level5.aboutmovie.current_frame = "27";
}

please help. thanks