DFdou's Blog Life is short,Be yourself.

1701/090

Flash-自定义右键菜单

AS2版本:

myMenu = new ContextMenu();//新建自定义的右键menu
myMenu.hideBuiltInItems();//隐藏系统鼠标右键
myMenu.customItems.push(new ContextMenuItem("DFdou's Blog", blog, false));
function blog() {
getURL("http://nwhy.org","_blank");
}
_root.menu = myMenu;

AS3版本:

var myMenu:ContextMenu = new ContextMenu();
var myBlog:ContextMenuItem = new ContextMenuItem("DFdou's Blog");
var blogURL:String = "http://nwhy.org";
var request:URLRequest = new URLRequest(blogURL);
myMenu.hideBuiltInItems();
myMenu.customItems.push(myBlog);
myBlog.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,blog);
function blog(e:ContextMenuEvent):void
{
navigateToURL(request);
}
this.contextMenu = myMenu;

Some Related Posts

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

:zhuang :xizao :wuwu :wenhao :wc :touxiang :shuaya :shuajian :shengtian :paopao :no :meinv :maonv :loveu :leilei :kua :jrjr :dahan :chi :chaocai :byebye


CommentLuv Enabled

No trackbacks yet.