var myContextMenu:ContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
//声明菜单新项
var item:ContextMenuItem = new ContextMenuItem("@author amyflash");
//添加到菜单显示项目数组
myContextMenu.customItems.push (item);
root.contextMenu = myContextMenu;
//点击按钮引发该事件
item.addEventListener (ContextMenuEvent.MENU_ITEM_SELECT ,mouseRelease);
function mouseRelease (event:ContextMenuEvent):void
{
navigateToURL(new URLRequest("http://www.111com.net/"));
}
|