User Guide

964 MenuBar component (Flash Professional only)
MenuBar.removeAll()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
menuBarInstance.removeAll()
Parameters
None.
Returns
Nothing.
Description
Method; removes all menu items on the menu bar.
Example
The following example creates File, Edit, Tools, and Window menus on the menu bar. Then
when a button is clicked, the script calls
removeAll() to remove the menu items.
Drag the MenuBar component onto the Stage, and enter the instance name
myMenuBar in the
Property inspector. Also drag the Button component to the Stage, and enter the instance
name
remBtn. Add the following code to Frame 1 of the timeline:
var menu = myMenuBar.addMenu("File");
var menu = myMenuBar.addMenu("Edit");
var menu = myMenuBar.addMenu("Tools");
var menu = myMenuBar.addMenu("Window");
// Add a button that removes the menu items.
var rem_listener = new Object();
rem_listener.click = function() {
myMenuBar.removeAll();
};
remBtn.addEventListener("click", rem_listener);