Having problems with if/else

I am currently working on a project where i have to create a timeline of events in flash. each event is a button where you can press it and they show the info for that date. and i have a legend for each type of event that will call all events of the same color. now this is were i run into problems, if an event is already active and you press the legend button for that color it will close that event and open all other events. I’m currently working on an if/else statement to work around this but it not working, if anyone has any advice or a different way around this i’d love to hear.