在Flex中添加右键菜单及页面跳转

来源:互联网 发布:servlet获取ajax json 编辑:程序博客网 时间:2024/06/05 18:30
Flex做的添加右键菜单及页面跳转事件。
  
  var myContextMenu : ContextMenu = new ContextMenu();
      var GoUrl : ContextMenuItem = new ContextMenuItem("铁芒网博,欢迎您!");
      GoUrl.addEventListener(ContextMenuEvent.MENU_ITEM_Select,GoUrlClick);
      myContextMenu.customItems.push(GoUrl);
      myContextMenu.hideBuiltInItems();
      this.contextMenu = myContextMenu;

  private function GoUrlClick(event:ContextMenuEvent):void
       {
            navigateToURL(new URLRequest("http://www.techmango.com/blog/ViewStory.asp"),"_blank");
       }


  发现在Flex所用的页面跳转方法跟flash的不一样,flash中是这样用的:
  getUrl("http://www.techmango.com/blog/ViewStory.asp","_blank");
原创粉丝点击