MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 582

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

myMenu = myMenuBar.addMenu("File");
myMenu.addMenuItem({label:"New", instanceName:"newInstance"});
myMenu.addMenuItem({label:"Open", instanceName:"openInstance"})
Usage 2: The following example adds a Font menu with the menu items Bold and Italic that are
defined in the MenuDataProvider instance
var myMenuDP2 = new XML();
myMenuDP2.addMenuItem({type:"check", label:"Bold", instanceName:"check1"});
myMenuDP2.addMenuItem({type:"check", label:"Italic", instanceName:"check2"});
menu = myMenuBar.addMenu("Font",myMenuDP2);
MenuBar.addMenuAt()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
Usage 1:
myMenuBar.addMenuAt(index, label)
Usage 2:
myMenuBar.addMenuAt(index, label, menuDataProvider)
Parameters
An integer indicating the position where the menu should be inserted. The first position
index
is 0. To append to the end of the menu, call
A string indicating the label of the new menu.
label
menuDataProvider
XML instance, the instance's first child is used.
Returns
A reference to the new Menu object.
Description
Method; Usage 1 adds a single menu and menu activator at the specified index with the specified
label. Usage 2 adds a single menu and a labeled menu activator at the specified index. The content
for the menu is defined in the
Example
Usage 1: The following example places a menu to the left of all MenuBar menus:
menu = myMenuBar.addMenuAt(0,"Toreador");
menu.addMenuItem("About Macromedia Flash", instanceName:"aboutInst");
menu.addMenuItem("Preferences", instanceName:"PrefInst");
582
Chapter 6: Components Dictionary
myMenuDP2
An XML or XMLNode instance that describes the menu. If the value is an
menuDataProvider
:
MenuBar.addMenu(label)
parameter.
.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents