I am trying to script buttons to open and close content windows; I have them currently scripted so you click on the button to close the content window again but I want them to close if you click the other button as well. Below is the script I am using for the two buttons, frame 2 plays the movie clip which expands the content window, frame 10 retracts the content window:
function toggleContent2(event:MouseEvent) {
if (togglescreen2.currentFrame == 1) {
togglescreen2.gotoAndPlay(2);
} else {
togglescreen2.gotoAndPlay(10);
}
}
toggle_btn2.addEventListener(MouseEvent.CLICK, toggleContent2);
OTHER BUTTON:
function toggleContent(event:MouseEvent) {
if (togglescreen.currentFrame == 1) {
togglescreen.gotoAndPlay(2);
} else {
togglescreen.gotoAndPlay(10);
}
}
toggle_btn.addEventListener(MouseEvent.CLICK, toggleContent);
Thank you in advance for any assistance!
E