MenuBar class (Flash Professional only)

Inheritance MovieClip > UIObject class > UIComponent class > MenuBar

ActionScript Class Name mx.controls.MenuBar

The methods and properties of the MenuBar class let you create a horizontal menu bar with pop-up menus and commands. These methods and properties complement those of the Menu class by allowing you to create a clickable interface to show and hide menus that behave as a group for mouse and keyboard interactivity.

Method summary for the MenuBar class

The following table lists methods of the MenuBar class.

Method

Description

MenuBar.addMenu()

Adds a menu to the menu bar.

MenuBar.addMenuAt()

Adds a menu at a specified location to the menu bar.

MenuBar.getMenuAt()

Gets a reference to a menu at a specified location.

MenuBar.getMenuEnabledAt()

Returns a Boolean value indicating whether a menu is enabled (true) or not (false).

MenuBar.removeMenuAt()

Removes a menu at a specified location from a menu bar.

MenuBar.removeAll()

Removes all menu items from the menu bar.

MenuBar.setMenuEnabledAt()

A Boolean value indicating whether a menu is can be chosen (true) or not (false).

Methods inherited from the UIObject class

The following table lists the methods the MenuBar class inherits from the UIObject class. When calling these methods from the MenuBar object, use the form MenuBar.methodName.

Method

Description

UIObject.createClassObject()

Creates an object on the specified class.

UIObject.createObject()

Creates a subobject on an object.

UIObject.destroyObject()

Destroys a component instance.

UIObject.doLater()

Calls a function when parameters have been set in the Property and Component inspectors.

UIObject.getStyle()

Gets the style property from the style declaration or object.

UIObject.invalidate()

Marks the object so it is redrawn on the next frame interval.

UIObject.move()

Moves the object to the requested position.

UIObject.redraw()

Forces validation of the object so it is drawn in the current frame.

UIObject.setSize()

Resizes the object to the requested size.

UIObject.setSkin()

Sets a skin in the object.

UIObject.setStyle()

Sets the style property on the style declaration or object.

Methods inherited from the UIComponent class

The following table lists the methods the MenuBar class inherits from the UIComponent class. When calling these methods from the MenuBar object, use the form MenuBar.methodName.

Method

Description

UIComponent.getFocus()

Returns a reference to the object that has focus.

UIComponent.setFocus()

Sets focus to the component instance.

Property summary for the MenuBar class

The following table lists properties of the MenuBar class.

Property

Description

MenuBar.dataProvider

The data model for a menu bar.

MenuBar.labelField

A string that determines which attribute of each XMLNode to use as the label text of the menu.

MenuBar.labelFunction

A function that determines what to display in each menu's label.

Properties inherited from the UIObject class

The following table lists the properties the MenuBar class inherits from the UIObject class. When calling these properties from the MenuBar object, use the form MenuBar.propertyName.

Property

Description

UIObject.bottom

The position of the bottom edge of the object, relative to the bottom edge of its parent. Read-only.

UIObject.height

The height of the object, in pixels. Read-only.

UIObject.left

The left edge of the object, in pixels. Read-only.

UIObject.right

The position of the right edge of the object, relative to the right edge of its parent. Read-only.

UIObject.scaleX

A number indicating the scaling factor in the x direction of the object, relative to its parent.

UIObject.scaleY

A number indicating the scaling factor in the y direction of the object, relative to its parent.

UIObject.top

The position of the top edge of the object, relative to its parent. Read-only.

UIObject.visible

A Boolean value indicating whether the object is visible (true) or not (false).

UIObject.width

The width of the object, in pixels. Read-only.

UIObject.x

The left edge of the object, in pixels. Read-only.

UIObject.y

The top edge of the object, in pixels. Read-only.

Properties inherited from the UIComponent class

The following table lists the properties the MenuBar class inherits from the UIComponent class. When calling these properties from the MenuBar object, use the form MenuBar.propertyName.

Property

Description

UIComponent.enabled

Indicates whether the component can receive focus and input.

UIComponent.tabIndex

A number indicating the tab order for a component in a document.

Event summary for the MenuBar class

There are no events exclusive to the MenuBar class.

Events inherited from the Menu class

The following table lists the events the MenuBar class inherits from the Menu class. When calling these events from the MenuBar object, use the form MenuBar.eventName.

Event

Description

Menu.change

Broadcast when a user causes a change in a menu.

Menu.menuHide

Broadcast when a menu closes.

Menu.menuShow

Broadcast when a menu opens.

Menu.rollOut

Broadcast when the pointer rolls off an item.

Menu.rollOver

Broadcast when the pointer rolls over an item.

Events inherited from the UIObject class

The following table lists the events the MenuBar class inherits from the UIObject class. When calling these events from the MenuBar object, use the form MenuBar.eventName.

Event

Description

UIObject.draw

Broadcast when an object is about to draw its graphics.

UIObject.hide

Broadcast when an object's state changes from visible to invisible.

UIObject.load

Broadcast when subobjects are being created.

UIObject.move

Broadcast when the object has moved.

UIObject.resize

Broadcast when an object has been resized.

UIObject.reveal

Broadcast when an object's state changes from invisible to visible.

UIObject.unload

Broadcast when the subobjects are being unloaded.

Events inherited from the UIComponent class

The following table lists the events the MenuBar class inherits from the UIComponent class. When calling these events from the MenuBar object, use the form MenuBar.eventName.

Event

Description

UIComponent.focusIn

Broadcast when an object receives focus.

UIComponent.focusOut

Broadcast when an object loses focus.

UIComponent.keyDown

Broadcast when a key is pressed.

UIComponent.keyUp

Broadcast when a key is released.


Version 8

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00003864.html