Menu.dataprovider - MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference

Components language reference
Table of Contents

Advertisement

Example
The following example creates a menu with a submenu for the New menu item. It creates the
menu by creating an XML object,
, and adding menu items to it with calls to
my_xml
. It then creates the menu with a call to
, passing the XML
addMenuItem()
createMenu()
object as the data provider.
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();
var newItem_obj:Object = my_xml.addMenuItem({label:"New"});
// Create other submenu items for main menu.
my_xml.addMenuItem({label:"Open", instanceName:"miOpen"});
my_xml.addMenuItem({label:"Save", instanceName:"miSave"});
my_xml.addMenuItem({type:"separator"});
my_xml.addMenuItem({label:"Quit", instanceName:"miQuit"});
// Create submenu items for "New" submenu.
newItem_obj.addMenuItem({label:"File..."});
newItem_obj.addMenuItem({label:"Project..."});
newItem_obj.addMenuItem({label:"Resource..."});
// Create menu.
var my_menu:Menu = Menu.createMenu(myParent_mc, my_xml);
my_menu.show(100, 20);

Menu.dataProvider

Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
menuInstance.dataProvider
Menu.dataProvider
911

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