User Guide
Menu component (Flash Professional only) 551
5.
Open the symbols you want to customize for editing.
For example, open the MenuCheckEnabled symbol.
6.
Customize the symbol as desired.
For example, change the image to be an X instead of a check mark.
7.
Repeat steps 6-7 for all symbols you want to customize.
8.
Click the Back button to return to the main Timeline.
9.
Drag a Menu component to the Stage and delete it.
This adds the Menu component to the library and makes it available at runtime.
10.
Add ActionScript to the main timline to create a Menu instance at runtime:
var myMenu = mx.controls.Menu.createMenu();
myMenu.addMenuItem({label: "One", type: "check", selected: true});
myMenu.addMenuItem({label: "Two", type: "check"});
myMenu.addMenuItem({label: "Three", type: "check"});
myMenu.show(0, 0);
11.
Select Control > Test Movie.
Menu class (Flash Professional only)
Inheritance MovieClip > UIObject class > UIComponent class > View > ScrollView >
ScrollSelectList > Menu
ActionScript Class Name mx.controls.Menu
The methods and properties of the Menu class let you create and edit menus at runtime.
Setting a property of the menu class with ActionScript overrides the parameter of the same name
set in the Property inspector or Component inspector.
Each component class has a
version property, which is a class property. Class properties are
available only on the class itself. The
version property returns a string that indicates the version
of the component. To access this property, use the following code:
trace(mx.controls.Menu.version);
Note: The code
trace(myMenuInstance.version); returns undefined.
Method summary for the Menu class
The following table lists methods of the Menu class.
Method Description
Menu.addMenuItem() Adds a menu item to the menu.
Menu.addMenuItemAt() Adds a menu item to the menu at a specific location.
Menu.createMenu() Creates an instance of the Menu class. This is a static method.
Menu.getMenuItemAt() Gets a reference to a menu item at a specified location.
Menu.hide() Closes a menu.