flash 右键菜单

import flash.net.URLRequest;
import flash.ui.ContextMenu;

var right_menu:ContextMenu = new ContextMenu();
var change_right:ContextMenuItem = new ContextMenuItem( "change the item into what you like" );
var free_item:ContextMenuItem = new ContextMenuItem( "Free Item" );

change_right.addEventListener( ContextMenuEvent.MENU_ITEM_SELECT, visit_zhuomalily );
free_item.addEventListener( ContextMenuEvent.MENU_ITEM_SELECT, visit_zhuomalily );
free_item.separatorBefore = false;

right_menu.hideBuiltInItems();//隐藏指定的 ContextMenu 对象中的所有内置菜单项(“设置”除外).

right_menu.customItems.push(change_right, free_item);
this.contextMenu = right_menu;

function visit_zhuomalily(e:Event)
{
    var zml_link:URLRequest = new URLRequest( "http://www.cnblogs.com/flashweb/" );
    navigateToURL(zml_link, "_parent" );

}
原文地址:https://www.cnblogs.com/flashweb/p/2909121.html