If this movie clip...go to this frame

Is there a way, using actionscript to tell a button to gotoandplay 1 of 2 different frames within a movie clip, depending on the conditions of an if statement?

For example, on a site I am doing, when a user clicks on the “photos” button, the background drops out, and the pictures load. If they click on “about” after looking at pictures, the background stays gone. I want the background to load back in if a user clicks on any of the nav buttons, after clicking on “photos”, but only if they have clicked on photos first. If they go from “contact” to “about” the background stays in tact, so there is no reason for it to re-load.

Does this make sense??