I am trying to finish up a collapsable flash navigation menu for a website but I’m having one problem. The menu is set up with the top level buttons sliding up or down through actionscript. The sub button animation is tweened. Anyway the menu works except for 1 thing. I am trying to get it so that if one top level button is expanded and another is clicked the open one plays it’s close tween and then the clicked button opens. Right now It is set up so when another buttons is clicked the first one closes and the clicked one opens at the same time.
All my buttons do when clicked is call functions, I tried calling my function to check and close any other menus if they are open first. Then I created a close variable for each button which was 0 if the button is close and 1 if it is open. I then have another variable CloseChk which adds all the other variables up. This variable is located on an EnterFrame so it should loop constantly. I then put a while (_root.CloseChk == 1){} command in. From what I understand of the while command it loops while the statement is true and if it’s false it goes on with the commands after it.
I thought this would do it by telling any open buttons to close then checking repeatedly if they are all closed at which point CloseChk should equal 0 and then it would continue on with my script which would play my open animation. However when I run it and open a button and try to click another I get an unending loop which I then have to exit out of. Just wondering if anyone can help me out here, I can’t post my code there is just too much of it.