Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu Tree Navigation

Status
Not open for further replies.

jazerr

Programmer
Dec 13, 2000
152
US
I am using FlashMX.

Iam working on a windows Explorer style nav tree. You can click on a top level item, and it expands down to view the subitems. Everything is in order, except:

If a user opens one top level node, then opens another, i want the first node to close automatically.

How do I do this? I would be happy to send the files for y'all to see...

Make sense? Please help!
 
Use variables to keep track of the currently opened option, then close it before opening another. For example, on a button inside a menu clip, you could have:
Code:
on (release){
    if (_root.currentOption != undefined){
        _root[currentOption].gotoAndStop("closed");
    }
    this.gotoAndStop("open");
    _root.currentOption = this._name;
}
That would close the open menu (if there is one open), tell the current menu to open, and set the currentOption variable to the open menu clip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top