/** * Description 版权所有2006@qz http://www.quick35.com * @author crlnet * @version 0.1 * @discription:右键版权类; */ package crlclr.ui{ import flash.events.*; import flash.ui.ContextMenu; import flash.ui.ContextMenuBuiltInItems; import flash.ui.ContextMenuItem; public class QcontextMenu{ private var customItems:Array; public var Qmenu:ContextMenu; /** * 用法:this.contextMenu=(new QcontextMenu()).Qmenu; */ public function QcontextMenu () { bulid(); } function bulid(){ Qmenu=new ContextMenu(); Qmenu.hideBuiltInItems(); var a:ContextMenuItem = new ContextMenuItem ("技术支持-乾庄"); a.separatorBefore = true; a.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuHandler); Qmenu.customItems.push (a); a = new ContextMenuItem ("联系客服"); a.separatorBefore = true; Qmenu.customItems.push (a); a.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuHandler); a = new ContextMenuItem ("Go Full Screen"); Qmenu.customItems.push (a); a.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuHandler); a = new ContextMenuItem ("Exit Full Screen"); Qmenu.customItems.push (a); a.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuHandler); //Qmenu.addEventListener(ContextMenuEvent.MENU_SELECT,menuHandler); } function menuHandler (event:Event) { switch(event.target.caption){ case "": break; default: trace(event.target.caption); break; } } } }