Class mx.controls.Menu

MovieClip
   +--mx.core.UIObject
      +--mx.core.UIComponent
         +--mx.core.View
            +--mx.core.ScrollView
               +--mx.controls.listclasses.ScrollSelectList
                  +--mx.controls.Menu

Description

Menu class - extends ScrollSelectList - gives the user the ability to select an option from a scrolling list

Field Index

__activator, __activeChildren, __anchor, __anchorIndex, __closeDelay, __delayQueue, __enabled, __hScrollPolicy, __iconField, __lastRowRolledOver, __menuBar, __menuCache, __menuDataProvider, __namedItems, __openDelay, __parentMenu, __radioGroups, __rowHeight, __rowRenderer, __timeOut, __timer, __vScrollPolicy, __wasVisible, _inherited_dataProvider, _members, _selection, anchorRow, className, invUpdateSize, menuBarIndex, mixit, mixit2, popupMask, popupTween, supposedToLoseFocus, symbolName, symbolOwner, wasJustCreated
Inherited from ScrollSelectList
__cellRenderer, __dataProvider, __hPosition, __iconField, __iconFunction, __labelField, __labelFunction, __rowCount, __rowHeight, __rowRenderer, __width, addItem, addItemAt, baseRowZ, calcPreferredWidth, cellRenderer, changeFlag, className, clearSelected, CONTENTDEPTH, createLabel, dataProvider, dragEnabled, dragScrolling, dropEnabled, enabled, getDataProvider, getItemAt, getLength, getSelectedIndex, getSelectedIndices, getSelectedItem, getSelectedItems, getValue, iconField, iconFunction, invLayoutContent, invRowHeight, invUpdateControl, isPressed, isRowStyle, isSelected, labelField, labelFunction, lastPosition, lastSelected, lastSelID, layoutX, layoutY, length, listContent, minScrollInterval, mixIt1, mixIt2, modelChanged, multipleSelection, onMouseUp, propertyTable, removeAll, removeItemAt, replaceItemAt, roundUp, rowCount, rowHeight, rows, scrollInterval, selectable, selected, selectedIndex, selectedIndices, selectedItem, selectedItems, selectHolder, selectionDeleted, selectItem, setDataProvider, setSelectedIndex, setSelectedIndices, sortItems, sortItemsBy, tempLabel, tH, topRowZ, tW, value, wasKeySelected
Inherited from ScrollView
__hPosition, __hScrollPolicy, __maxHPosition, __viewMetrics, __vPosition, __vScrollPolicy, className, columnWidth, heightPadding, hPosition, hScroller, hScrollPolicy, invLayout, MASK_DEPTH, mask_mc, maxHPosition, maxVPosition, numberOfCols, oldRndUp, owner, propsInited, rowC, rowH, scrollAreaChanged, specialHScrollCase, symbolName, symbolOwner, viewableColumns, viewableRows, vPosition, vScroller, vScrollPolicy, widthPadding
Inherited from View
__tabIndex, _loadExternalClass, border_mc, boundingBox_mc, childNameBase, className, createClassChildAtDepth, depth, hasBeenLayedOut, loadExternal, numChildren, symbolName, symbolOwner, tabIndex
Inherited from UIComponent
clipParameters, drawFocus, enabled, focusEnabled, focusManager, focusTextField, groupName, height, kStretch, mergedClipParameters, origBorderStyles, origBorderValues, popUp, symbolName, symbolOwner, tabEnabled, tabIndex, width
Inherited from UIObject
__height, __onUnload, __width, _color, _endInit, _id, _maxHeight, _maxWidth, _minHeight, _minWidth, _preferredHeight, _preferredWidth, _tf, _topmost, addEventListener, bottom, buildDepthTable, changeColorStyleInChildren, changeTextStyleInChildren, childrenCreated, className, clipParameters, color, createAccessibilityImplementation, createChildAtDepth, createClassChildAtDepth, createEvent, dispatchEvent, embedFonts, findNextAvailableDepth, fontFamily, fontSize, fontStyle, fontWeight, handleEvent, height, idNames, ignoreClassStyleDeclaration, initProperties, invalidateFlag, left, lineColor, lineWidth, marginLeft, marginRight, methodTable, minHeight, minWidth, notifyStyleChangeInChildren, removeEventListener, right, scaleX, scaleY, setStyle, stylecache, styleName, symbolName, symbolOwner, tabEnabled, textAlign, textColorList, textDecoration, textIndent, tfList, top, validateNow, visible, width, x, y
Inherited from MovieClip
_alpha, _currentframe, _droptarget, _focusrect, _framesloaded, _height, _lockroot, _name, _parent, _quality, _rotation, _soundbuftime, _target, _totalframes, _url, _visible, _width, _x, _xmouse, _xscale, _y, _ymouse, _yscale, enabled, focusEnabled, hitArea, tabChildren, tabEnabled, tabIndex, tooltipText, trackAsMenu, useHandCursor

Method Index

new Menu()

__onMouseUp(), addMenuItem(), addMenuItemAt(), calcHeight(), calcWidth(), callMenuDelay(), callTimeOut(), cancelMenuDelay(), clearMenuDelay(), clearTimeOut(), closeSubMenu(), createChildren(), createMenu(), deinstallAllItems(), deinstallItem(), deleteDependentSubMenus(), draw(), getDataProvider(), getGroupSelection(), getMenuItemAt(), getRootMenu(), hide(), hideAllMenus(), indexOf(), init(), installItem(), invalidateStyle(), isItemEnabled(), isItemSelected(), isMouseOverMenu(), keyDown(), modelChanged(), moveSelBy(), notifyStyleChangeInChildren(), onKillFocus(), onRowDragOver(), onRowPress(), onRowRelease(), onRowRollOut(), onRowRollOver(), onSetFocus(), onTweenEnd(), onTweenUpdate(), openSubMenu(), propagateToSubMenus(), removeAll(), removeMenuItem(), removeMenuItemAt(), runDelayQueue(), setCellRenderer(), setDataProvider(), setGroupSelection(), setIconField(), setIconFunction(), setLabelField(), setLabelFunction(), setMenuDelay(), setMenuItemEnabled(), setMenuItemSelected(), setRowHeight(), setTimeOut(), show(), size(), updateSize()
Inherited from ScrollSelectList
dragScroll(), findInputText(), findString(), getPropertiesAt(), getPropertiesOf(), getRowCount(), getRowHeight(), getStateAt(), getStyle(), layoutContent(), onRowDragOut(), selectRow(), setEnabled(), setPropertiesAt(), setRowCount(), setVPosition(), updateControl()
Inherited from ScrollView
__onMouseWheel(), childLoaded(), createChild(), doLayout(), getHPosition(), getHScrollPolicy(), getMaxHPosition(), getViewMetrics(), getVPosition(), getVScrollPolicy(), invalidate(), onScroll(), scrollProxy(), setHPosition(), setHScrollPolicy(), setMaxHPosition(), setScrollProperties(), setVScrollPolicy()
Inherited from View
addLayoutObject(), convertToUIObject(), destroyChildAt(), extension(), getChildAt(), initLayout()
Inherited from UIComponent
dispatchValueChangedEvent(), enabledChanged(), findFocusFromObject(), findFocusInChildren(), getFocus(), getFocusManager(), isParent(), pressFocus(), releaseFocus(), setFocus(), setVisible()
Inherited from UIObject
__getTextFormat(), _createChildren(), _getTextFormat(), cancelAllDoLaters(), constructObject(), createClassObject(), createEmptyObject(), createLabel(), createObject(), createSkin(), destroyObject(), doLater(), doLaterDispatcher(), drawRect(), getClassStyleDeclaration(), getMinHeight(), getMinWidth(), getSkinIDName(), getStyleName(), initFromClipParameters(), mergeClipParameters(), move(), redraw(), setColor(), setMinHeight(), setMinWidth(), setSize(), setSkin()
Inherited from MovieClip
attachAudio(), attachMovie(), beginFill(), beginGradientFill(), clear(), createEmptyMovieClip(), createTextField(), curveTo(), duplicateMovieClip(), endFill(), getBounds(), getBytesLoaded(), getBytesTotal(), getDepth(), getInstanceAtDepth(), getNextHighestDepth(), getSWFVersion(), getTextSnapshot(), getURL(), globalToLocal(), gotoAndPlay(), gotoAndStop(), hitTest(), lineStyle(), lineTo(), loadMovie(), loadVariables(), localToGlobal(), moveTo(), nextFrame(), onData(), onDragOut(), onDragOver(), onEnterFrame(), onKeyDown(), onKeyUp(), onLoad(), onMouseDown(), onMouseMove(), onMouseUp(), onPress(), onRelease(), onReleaseOutside(), onRollOut(), onRollOver(), onUnload(), play(), prevFrame(), removeMovieClip(), setMask(), startDrag(), stop(), stopDrag(), swapDepths(), unloadMovie(), valueOf()

Constructor Detail

Menu

public function Menu()
Constructor

Field Detail

symbolName

static symbolName:String

symbolOwner

static symbolOwner:Object

className

className:String

mixit

static mixit:Boolean

mixit2

static mixit2:Boolean

__hScrollPolicy

__hScrollPolicy:String

__vScrollPolicy

__vScrollPolicy:String

__rowRenderer

__rowRenderer:String

__rowHeight

__rowHeight:Number

__menuDataProvider

__menuDataProvider:Object

__wasVisible

__wasVisible

__menuBar

__menuBar

__activator

__activator

__parentMenu

__parentMenu:Menu

__menuCache

__menuCache:Object

__namedItems

__namedItems:Object

__radioGroups

__radioGroups:Object

__enabled

__enabled:Boolean

__openDelay

__openDelay:Number

__closeDelay

__closeDelay:Number

__delayQueue

__delayQueue:Array

__timer

__timer

__timeOut

__timeOut

__anchor

__anchor:Number

__anchorIndex

__anchorIndex:Number

__activeChildren

__activeChildren:Object

anchorRow

anchorRow:Object

__lastRowRolledOver

__lastRowRolledOver:Number

menuBarIndex

menuBarIndex:Number

popupTween

popupTween:Tween

popupMask

popupMask:MovieClip

__iconField

__iconField

invUpdateSize

invUpdateSize:Boolean

supposedToLoseFocus

supposedToLoseFocus:Boolean

wasJustCreated

wasJustCreated:Boolean

_selection

_selection:Object

_members

_members:Object

_inherited_dataProvider

_inherited_dataProvider:Array

Method Detail

createMenu

static public function createMenu(parent, mdp, initObj)
Return the Menu instance described by the given MenuDataProvider, and place the instance in the given parent container.
Parameters
parent the container
mdp a MenuDataProvider to base the menu on @returns a Menu instance, already placed inside the parent, but invisible @tiptext Static function to create a menu instance @helpid 3139

isItemEnabled

static public function isItemEnabled(itm:
Object):Boolean
utilities for querying an item's state

isItemSelected

static public function isItemSelected(itm:
Object):Boolean

init

function init(Void):Void
Generic initializer

createChildren

function createChildren(Void):Void
Child construction

propagateToSubMenus

function propagateToSubMenus(prop:
String, value)

setLabelField

function setLabelField(lbl:
String)

setLabelFunction

function setLabelFunction(lbl:
Function)

setCellRenderer

function setCellRenderer(cR):Void

setRowHeight

function setRowHeight(v:
Number):Void

setIconField

function setIconField(v:
String):Void

setIconFunction

function setIconFunction(v:
Function):Void

size

function size(Void):Void

draw

function draw(Void):Void

onSetFocus

function onSetFocus()

setDataProvider

public function setDataProvider(dP):Void

getDataProvider

public function getDataProvider():
Object

addMenuItem

public function addMenuItem(arg:
Object):Object
Append a menu item at the end of this menu.
Parameters
arg may be either (1) a String (to be used as the item's label), (2) an Object (whose properties will be copied into the resulting XMLNode's attributes), (3) an XMLNode (used directly), or (4) an XML instance whose firstChild will be cloned and used. @returns an XMLNode carrying a representation of the menu item's state @tiptext Append a new menu item to the menu @helpid 3141

addMenuItemAt

public function addMenuItemAt(index:
Number, arg:Object):Object
Insert a menu item into this menu.
Parameters
index the index where the item should be inserted
arg may be either (1) a String (to be used as the item's label), (2) an Object (whose properties will be copied into the resulting XMLNode's attributes), (3) an XMLNode (used directly), or (4) an XML instance whose firstChild will be cloned and used. @returns an XMLNode carrying a representation of the menu item's state @tiptext Insert a new menu item into the menu at the given index @helpid 3142

removeMenuItemAt

public function removeMenuItemAt(index:
Number):Object
Remove the item at a given index from the menu. If there's no item at the given index, then do nothing and return undefined.
Parameters
index the index of the item to be removed @returns a reference to the XMLNode that was removed (if any) @tiptext Remove the indicated menu item from the menu @helpid 3143

removeMenuItem

public function removeMenuItem(item:
Object):Object
Remove an item from the menu. If it doesn't belong to this Menu, then do nothing and return undefined.
Parameters
item the item to be removed @returns a reference to the XMLNode that was removed, or undefined if the given item does not belong to this Menu instance. @tiptext Remove the given menu item from the menu @helpid 3144

removeAll

public function removeAll(Void):
Object
Remove all items from the menu.

getMenuItemAt

public function getMenuItemAt(index:
Number):Object
Retrieve a menu item from this menu
Parameters
index the index of the item to be retrieved @returns a reference to the XMLNode that was removed @tiptext Return the menu item at a specific index @helpid 3146

setMenuItemSelected

public function setMenuItemSelected(item:
Object, select:Boolean):Void
Mark a menu item as 'selected' (or not), and notify listeners.
Parameters
item the target item
select a boolean indicating whether the item is selected or not @tiptext Select or deselect a menu item @helpid 3147

setMenuItemEnabled

public function setMenuItemEnabled(item:
Object, enable:Boolean):Void
Mark a menu item as 'enabled' (or not), and notify listeners.
Parameters
item the target item
enable a boolean indicating whether the item is enabled or not @tiptext Enable/disable a menu item @helpid 3148

indexOf

public function indexOf(item:
Object):Number
Return the index of the given item within this menu. If the target item does not belong to this menu, then return undefined.
Parameters
item the target item @returns the index of the given item, or undefined @tiptext Return the index of the given menu item within the menu @helpid 3149

show

public function show(x:
Number, y:Number):Void
If the Menu isn't presently visible, place the top-left corner at the given coordinates within the parent, resize the menu as needed, and make it visible. This method also fires a "show" event to all listeners.
Parameters
x (optional) the horizontal location of the top-left corner
y (optional) the vertical location of the top-left corner @tiptext Make the menu visible @helpid 3150

onTweenUpdate

function onTweenUpdate(val:
Array):Void

onTweenEnd

function onTweenEnd(val:
Array):Void

hide

public function hide(Void):Void
If the Menu is visible, hide it and any visible submenus.

onKillFocus

function onKillFocus()

modelChanged

public function modelChanged(eventObj)

updateSize

private function updateSize():Void

calcWidth

private function calcWidth():
Number

calcHeight

private function calcHeight():
Number

invalidateStyle

function invalidateStyle(propName:
String):Void

notifyStyleChangeInChildren

function notifyStyleChangeInChildren(sheetName, styleProp, newValue):Void

deleteDependentSubMenus

private function deleteDependentSubMenus(menuItem:
Object)

installItem

private function installItem(item:
Object):Void
Install support structures for named items and radio-groups. For named items, add properties to the root Menu object that refer to them. For radio items, add them to the implied radio-group. Do the same for sub-items.

deinstallItem

private function deinstallItem(item:
Object):Void
Scan the given Object (an XMLNode) for sub-elements containing named items and radio items. For named items, remove the previously-added properties from the root Menu object that refer to them. For radio items, remove them from the implied radio-group.

deinstallAllItems

private function deinstallAllItems(Void):Void
Clear out the named and radio-group items from this context

getGroupSelection

function getGroupSelection()

setGroupSelection

function setGroupSelection(item)

onRowRelease

function onRowRelease(rowIndex:
Number):Void

onRowPress

function onRowPress(rowIndex:
Number):Void

onRowRollOut

function onRowRollOut(rowIndex:
Number):Void

onRowRollOver

function onRowRollOver(rowIndex:
Number):Void

onRowDragOver

function onRowDragOver(rowIndex:
Number):Void

__onMouseUp

function __onMouseUp()

setMenuDelay

function setMenuDelay(delay:
Number, request:String, args:Object):Void
Interval functions used to delay submenu tasks setMenuDelay - sets the interval timer or defers to queue callMenuDelay - calls the delayed function and signals to clear the interval clearMenuDelay - clears the interval and checks the queue for more tasks cancelMenuRequest - cancels last request and removes it from the queue runDelayQueue - cycles through delayed tasks setTimeOut - sets a timer to test for out of bounds cursor movement clearTimeOut - clears timeout interval callTimeOut - checks if cursor is out of bounds from branch item openSubMenu - opens a submenu after the specified delay time closeSubMenu - closes a submenu(s) after the specified delay time

callMenuDelay

function callMenuDelay(request:
String, args:Object):Void

clearMenuDelay

function clearMenuDelay(Void):Void

cancelMenuDelay

function cancelMenuDelay(Void):Void

runDelayQueue

function runDelayQueue(Void):Void

setTimeOut

function setTimeOut(delay:
Number, id:Number):Void

clearTimeOut

function clearTimeOut(Void):Void

callTimeOut

function callTimeOut(Void):Void

openSubMenu

function openSubMenu(o:
Object):Void

closeSubMenu

function closeSubMenu(o:
Object):Void

moveSelBy

function moveSelBy(incr:
Number):Void

keyDown

function keyDown(e:
Object):Void

hideAllMenus

function hideAllMenus(Void)

isMouseOverMenu

function isMouseOverMenu(Void)

getRootMenu

function getRootMenu(Void):
Menu
Climb up and find the root menu