Class fvaswing.utils.FvContextMenuUtils

Description

FvContextMenuUtils provides control over the AsWing components in the Flash Player context menu.

You can use the methods and properties of the Flash ContextMenu class to add custom menu items, control the display of the built-in context menu items.

Example

	public function test() : Void
	{
		var m : ContextMenu = new ContextMenu();
		m.customItems.push( new ContextMenuItem( "submenuA", _proxy, false, true ) );
		m.customItems.push( new ContextMenuItem( "submenuB", _proxy, false, true ) );
		m.customItems.push( new ContextMenuItem( "submenuC", _proxy, false, false ) );
		m.hideBuiltInItems();
		
		var button : Jbutton = new JButton( "test" );
		
		FvContextMenuUtils.applyContextMenu( button, m );
	}
 

Method Index

applyContextMenu(), getContextMenu()

Method Detail

applyContextMenu

static public function applyContextMenu(comp:Component, contextMenu:ContextMenu):Void

Apply a ContextMenu to a component.

Component must be created before any menu definition.
Listen to Component.ON_CREATED event.

Parameters

comptarget Component
contextMenua ContextMenu instance

getContextMenu

static public function getContextMenu(comp:Component):ContextMenu

Returns the ContextMenu instance associated with passed-in component.

Parameters

compThe component source

Return

A ContextMenu instance ( or null