User Guide

About initialization object properties (Flash Professional only) 891
About initialization object properties
(Flash Professional only)
The initObject (initialization object) parameter is a fundamental concept in creating the
layout for the Menu component. This parameter is an object with properties. Each property
represents one of the possible the XML attributes of a menu item. (For a description of the
properties allowed in the
initObject parameter, see About menu item XML attributes
on page 887.)
The
initObject parameter is used in the following methods:
Menu.addMenuItem()
Menu.addMenuItemAt()
MenuDataProvider.addMenuItem()
MenuDataProvider.addMenuItemAt()
The following example creates an initObject parameter with two properties, label and
instanceName:
var i = myMenu.addMenuItem({label:"myMenuItem",
instanceName:"myFirstItem"});
Several of the properties work together to create a particular type of menu item. You assign
specific properties to create certain types of menu items (normal, separator, check box, or
radio button).
For example, you can initialize a normal menu item with the following
initObject
parameter:
myMenu.addMenuItem({label:"myMenuItem", enabled:true, icon:"myIcon",
instanceName:"myFirstItem"});
You can initialize a separator menu item with the following initObject parameter:
myMenu.addMenuItem({type:"separator"});
You can initialize a check box menu item with the following initObject parameter:
myMenu.addMenuItem({type:"check", label:"myMenuCheck", enabled:false,
selected:true, instanceName:"myFirstCheckItem"})
You can initialize a radio button menu item with the following initObject parameter:
myMenu.addMenuItem({type:"radio", label:"myMenuRadio1", enabled:true,
selected:false, groupName:"myRadioGroup",
instanceName:"myFirstRadioItem"})