copyright.as

来自「Flex3实现的掼蛋游戏」· AS 代码 · 共 43 行

AS
43
字号
/*
*鼠标右键
*使用方法
*import com.DMH2002.copyRight
*var cr:copyRight=new copyRight(this)
*/
package com.dmh2002.util{
	import flash.ui.*;
	import flash.display.*;
	import flash.net.*;
	import flash.events.ContextMenuEvent;
	public class CopyRight {
		private var myName:String="作者:DMH2002";
		private var myUrl:String="http://www.08baby.com";
		//
		private var myCompanyName:String="版权:芦苇网";
		private var myCompanyUrl:String="http://www.ruvita.com";
		//
		private var target:InteractiveObject;
		//
		public function CopyRight(target:InteractiveObject) {
			this.target=target;
			this.removeAndAddItem();
		}
		private function removeAndAddItem():void {
			var myContextMenu = new ContextMenu();
			var item1:ContextMenuItem=new ContextMenuItem(myName);
			var item2:ContextMenuItem=new ContextMenuItem(myCompanyName);
			myContextMenu.hideBuiltInItems();
			myContextMenu.customItems.push(item1);
			myContextMenu.customItems.push(item2);
			target.contextMenu=myContextMenu;
			item1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, item1SelectHandler);
			item2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, item2SelectHandler);
		}
		private function item1SelectHandler(e:ContextMenuEvent):void {
			navigateToURL(new URLRequest(myUrl),"_blank");
		}
		private function item2SelectHandler(e:ContextMenuEvent):void {
			navigateToURL(new URLRequest(myCompanyUrl),"_blank");
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?