Collapsing/Expanding Menu Help I feel cursed. Seems like some days no code I write, even though it should work, just won't work. Here's an example of what i'm trying to do.
I'm building a simple menu that collapses and expands to reveal a lower level within the navigation. I'm using actionscript 2.0 cause that's what the site template i started from was using.
The code in question looks like this:
on (release) {
if (_root.link<>num) {
if (_root.link == 1) {
_root.submenu.but1.gotoAndPlay("s2");
}
_root.menu1.gotoAndPlay("open1");
_root.link = num;
}
}
So far, this works perfectly fine to expand the section of the menu. My problem lies in writing code to check if a portion of the menu is already expanded, and close it prior to opening the new section. The animation for open/closing exists in the parent of the movie clip on which this code resides.
I was hoping to set something like a sectionOpen = true or false, if statement that would play the collapsing animation prior to playing the next expanding animation.
Any help would be very appreciated. |