zoukankan      html  css  js  c++  java
  • 屏蔽Flash右键菜单

    import flash.ui.ContextMenu;
    import flash.net.URLRequest;
    import flash.net.navigateToURL;
    
    var copyright:String="版权声明:";
    var context:String="未经允许不得以任何方式复制.盗用.链接.";
    var link:String="http://www.baidu.com";
    
    var _contextMenu:ContextMenu;
    var copyright_CM:ContextMenuItem;
    var context_CM:ContextMenuItem;
    var link_CM:ContextMenuItem;
    
    _contextMenu=new ContextMenu();
    _contextMenu.hideBuiltInItems();
    
    copyright_CM=new ContextMenuItem(copyright);
    context_CM=new ContextMenuItem(context);
    //context_CM.separatorBefore = true;//在copyright上加入分隔线
    
    link_CM=new ContextMenuItem(link);
    link_CM.separatorBefore = true
    link_CM.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink);
    
    
    _contextMenu.customItems.push(copyright_CM,context_CM,link_CM);
    
    function openLink(evt:ContextMenuEvent):void{
    	navigateToURL(new URLRequest(link));
    }
    
    this.contextMenu = _contextMenu;//将当前菜单drMenu设置为主菜单
    

  • 相关阅读:
    Linux系统安装
    设计模式的原则
    vue基础
    软考常考题目及解题技巧
    软件设计师
    Wireshark 使用教程
    JVM 调优
    Shell脚本编写
    Linux相关知识
    HTTP缓存机制及原理
  • 原文地址:https://www.cnblogs.com/leon3286/p/1801455.html
Copyright © 2011-2022 走看看