Newbie scripting question

Newbie scripting question.
Overriding visibility properties

Hi folks,

I have a scrolling gallery on the bottom of the stage, it’s made up of 5 buttons. Each of these 5 buttons is scripted with a command that loads 1 of 5 corresponding movies in the middle of the stage when its numbered button is clicked below.

There’s a script in frame #1 to keep the movies invisible until their buttons are clicked. (B1M, for instance is the first movie):
**
{
setProperty (“B1M”, _visible, false);
setProperty (“B2M”, _visible, false);
setProperty (“B3M”, _visible, false);
setProperty (“B4M”, _visible, false);
setProperty (“B5M”, _visible, false);
}**

And a script attached to each corresponding button to make the movie visibility with a click of the button (script below):
**
on (release)

{
setProperty (“B1M”, _visible, true);
}**

When the animation loops back to the beginning, I want the numbered movie above to remain visible if its button was clicked before the animation reached the end of the timeline and looped back to the beginning (frame #1).

Meaning, I need to override the script in frame #1.

I tried writing a script in the last frame of the timeline, forcing the animation to skip the first frame, but the numbered movie’s visibility still cuts out.

I’ve attached the .fla, thanks in advance.

~hessa