var myContextMenu:ContextMenu = new ContextMenu();

//声明菜单新项

var item:ContextMenuItem = new ContextMenuItem(“Hello World”);

//添加到菜单显示项目数组

myContextMenu.customItems.push (item);

this.contextMenu = myContextMenu;

//点击按钮引发该事件

item.addEventListener (ContextMenuEvent.MENU_ITEM_SELECT ,mouseRelease);

function mouseRelease (event:ContextMenuEvent)

{

var txtField:TextField=new TextField();

txtField.text=”Hello World”;

addChild (txtField);

}

    博视界科技专注于沉浸式全景数字餐厅、全息酒店宴会厅,旨在帮传统餐饮用科技玩跨界,欢迎咨询!

官方网站:www.boseetech.com

联系方式:    

微信联系我:


    【声明】转载本文请注明出处三人行设计,并保留有效链接:flash as3添加右键菜单 http://www.srxtuan.com/archives/1443,谢谢!

猜您还喜欢: