Making a control panel

Hi, I’m making an expanding/closing control panel. One of the problems I’ve ran into is the buttons on the control panel change depending on what page the person is on.

How can I make it so I can change the actions of the buttons inside the control panel, while still having flash remember if the panel is open or closed?