User Guide

932 Menu component (Flash Professional only)
Menu.show()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
menuInstance.show(x, y)
Parameters
x The x coordinate.
y The y coordinate.
Returns
Nothing.
Description
Method; opens a menu at a specific location. The menu is automatically resized so that all of
its top-level items are visible, and the upper left corner is placed at the specified location in the
coordinate system provided by the components parent.
If the
x and y parameters are omitted, the menu is shown at its previous location.
Example
The following example creates a menu from an XML menu object and calls the menu.show()
method to display it.
You first drag a Menu component to the library; and then add the following code to Frame 1:
/**
Requires:
- Menu component in library
*/
import mx.controls.Menu;
var my_xml:XML = new XML();
// Create items for the menu.
var newItem_obj:Object = my_xml.addMenuItem({label:"New"});
my_xml.addMenuItem({label:"Open", instanceName:"miOpen"});
my_xml.addMenuItem({label:"Save", instanceName:"miSave"});
my_xml.addMenuItem({type:"separator"});