.
overview
features
samples
help & support
downloads
buy now
Questions
Overview

Answers

topOverview

Another Multilevel XML driven Vertical Menu

This is a vertical menu with an unlimited number of submenus. The submenus are created dinamicaly. All you have to do is to drag (or dinamicaly attach it with attachMovie method) the "mainMenuItem" symbol from the library to the Stage, give it a name, and set the Node attribute with a XMLNode object (ex: mySymbolName.Node = node; where "node" is a XMLNode object). You will only have to asign the first level of children from your xml file. All the other levels (wich represent submenus) will be created dinamicaly. For example, if the variable "xmlOb" is your XML Object the the first level of children is : xmlOb.firsChild.chilNodes wich is an array of XMLNode objects. The XML file begins and ends with the "<menu>" tag. The tags inside the <menu> are named "item" and have the atributes "label" and "url". Leave the "url" blank and it wont trigger the opening of a link, when you press the coresponding menu item.

When you test your movie you'll se that submenus are alternating skins, wich means that first submenu has a certain skin, a submenu of this submenu has a different skin, then if this has a submenu his skin will like the first one's, and so one.

You can edit this skins by editing the Library symbols in the coresponding directory: "Default Menu Item Assets" is for the default skin, "Alt Default Menu Item Assets" is the alternate skin. In the Library, if you look in the "MenuItems" directory you will se the three types of menu items: altDefaultMenuItem, defaultMenuItem, mainMenuItem.

Double clicking on any of these symbols it will be opened in edit mode and here you will find a movie clip named placeholder_mc. Changing the dimensions of this movie clip from the property inspector, will acualy affect the dimensions of the coresponding menu item on runtime.

Aditional script customization is availabale in the "GenericMenuItem.as" file. Here you can set the show and hide delay of submenus, fade in and fade out intervals, if round corners are used for submenus or if submenus are alternating skins etc.

Changing the font fammily or size is easy. You have to edit two symbols , one for the main items and one for the submenu items. You can find these in the Library, with a name that ends with the string Text Field.

You have two .fla samples , one with the menu generated dinamically and one with symbols dragged from the library.

This menu requires AS 2.0 and Flash 8. It does not use the onMouseMove event or the hitTest method.
It is based on onRollOver/ onRollOut events wich means that it behaves corectly when you move your mouse fast over the menu.

featured componentsfeatured components