zoukankan      html  css  js  c++  java
  • 自定义Flash右键上下文选项——自定义类BlockRightClick

    package {
    	import flash.ui.ContextMenu;
    	import flash.ui.ContextMenuItem;
    	import flash.events.ContextMenuEvent;
    	import flash.net.URLRequest;
    	import flash.net.navigateToURL;
    
    	public class BlockRightClick {
    
    		private static var _contextMenu:ContextMenu;
    		
    		private static var _copyrightTitle:String = "版权声明:";
    		private static var _copyrightContext:String = "未经允许不得以任何方式复制.盗用.链接..";
    		private static var _linkTitle:String = "链接网址:";
    		private static var _linkUrl:String = "http://www.baidu.com";
    
    		private static var copyrightTitle_item:ContextMenuItem;
    		private static var copyrightContext_item:ContextMenuItem;
    		private static var link_item:ContextMenuItem;
    
    
    		public function BlockRightClick():void {
    			init();
    		}
    
    		public static function setRigthButton():ContextMenu {
    			
    			_contextMenu=new ContextMenu();
    			_contextMenu.hideBuiltInItems();			
    			
    			copyrightTitle_item = new ContextMenuItem(_copyrightTitle);
    			copyrightContext_item = new ContextMenuItem(_copyrightContext);
    
    			link_item = new ContextMenuItem(_linkTitle+_linkUrl);
    			link_item.separatorBefore = true;			
    
    			link_item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink,false,0,true);
    			
    			_contextMenu.customItems.push(copyrightTitle_item,copyrightContext_item,link_item);
    			
    			return _contextMenu;
    		}
    
    		private static function openLink(evt:ContextMenuEvent):void {
    			navigateToURL(new URLRequest(_linkUrl));
    		}
    		
    		//------------------------------------------------------------------------------@get、set
    		public static function get copyrightTitle():String{
    			return _copyrightTitle;
    		}
    		public static function set copyrightTitle(value_:String):void{
    			_copyrightTitle=value_;
    		}
    		
    		public static function get copyrightContext():String{
    			return _copyrightContext;
    		}
    		public static function set copyrightContext(value_:String):void{
    			_copyrightContext=value_;
    		}
    		
    		public static function get linkTitle():String{
    			return _linkTitle;
    		}
    		public static function set linkTitle(value_:String):void{
    			_linkTitle=value_;
    		}
    		
    		public static function get linkUrl():String{
    			return _linkUrl;
    		}
    		public static function set linkUrl(value_:String):void{
    			_linkUrl=value_;
    		}
    	}
    }
    

  • 相关阅读:
    前端分页功能的实现以及原理
    Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法总结
    Jquery实现的几款漂亮的时间轴
    jQuery点击弹出层,弹出模态框,点击模态框消失
    如何用CSS快速布局(一)—— 布局元素详细
    验证控件jQuery Validation Engine调用外部函数验证
    Javascript实现页面跳转的几种方式
    最详细win7下手动搭建PHP环境:apache2.4.23+php7.0.11
    spark调优——JVM调优
    spark调优——Shuffle调优
  • 原文地址:https://www.cnblogs.com/leon3286/p/1802756.html
Copyright © 2011-2022 走看看