[previous] [next]

Creating menus

NOTE: This section is important and may be a little bit difficult to understand if you know nothing about JavaScript. Read carefully.

First of all you need to define the number of items inside the main program menu(not including any submenus or menu options under the main program menu). Start with the following line.

menu = new menuSystem(#_of_items)
Where

For each submenu, add the following line.

menu[][][menu_num] = new subMenu("name", icon_num, #_of_items)
Where

For each menu option, add the following line.

menu[][][menu_num] = new menuOption("name", icon_num, "action")
Where

NOTE: The object menu is accessed like a multi-demensional array. For example, menu[0] represents the FIRST item of the main program menu, menu[4][6] represents the SEVENTH item of the FIFTH submenu of the main program menu.

You should present items of the same menu level in descending order ie. items with larger menu_num should be placed prior to items with smaller menu_num.

Take a look at the following example.

menu = new menuSystem(3)
memu[2] = new subMenu("This is a submenu system.",0, 2)
menu[1] = new menuOption("This is a menu option.",1, "open:http://animetheme.simplenet.com/")
menu[0] = new menuOption("This is a menu option.",1, "open:http://animetheme.simplenet.com/")

The above code creates the main program menu system with one submenu system(cotaining two items) and two menu options.


[previous] [next]

Return to Dynamic HTML Resource Center