Menubar.getmenuat() - MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference

Components language reference
Table of Contents

Advertisement

MenuBar.getMenuAt()

Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
menuBarInstance.getMenuAt(index)
Parameters
An integer indicating the position of the menu.
index
Returns
A reference to the menu at the specified index. This value is
if there is no menu at
undefined
that position.
Description
Method; returns a reference to the menu at the specified index. Because
returns
getMenuAt()
a reference, it is possible to add items to a menu at the specified index.
Example
The following example creates a File menu and calls
, which creates a reference
getMenuAt()
to it. It then uses the reference to add two menu items, New and Open, to the File menu.
Drag an instance of the MenuBar component onto the Stage, and enter the instance name
in the Property inspector. Add the following code to Frame 1 of the timeline:
my_mb
/**
Requires:
- MenuBar component on Stage (instance name: my_mb)
*/
var my_mb:mx.controls.MenuBar;
my_mb.addMenu("File");
var my_menu:mx.controls.Menu = my_mb.getMenuAt(0);
my_menu.addMenuItem({label:"New",instanceName:"newInst"});
my_menu.addMenuItem({label:"Open",instanceName:"openInst"});
960
MenuBar component (Flash Professional only)

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents