How do they do this

Its me again

This site has menu buttons that open movie clips. ineed to know is when a different button is pressed how does it know to close the movie clip before then go and open the movie clip that was pressed. i hope i make sence here is the site