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);
}



猜您还喜欢:
- [Flash AS3实例教程]中自定义函数参数说明 (此文被围观2702次)
- WPF vs Flash,同一屋檐下的较量与共存 (此文被围观5141次)
- [Flash AS3实例教程]如何载入库中的影片剪辑 (此文被围观1507次)
- [Flash AS3实例教程]AS3经典实例:拖拽影片,乘法口诀表,时钟 (此文被围观3167次)
- flash as3简单的鼠标跟随文字 (此文被围观4487次)
- [Flash AS3入门教程]示例:动画公文包片段 (此文被围观2634次)
- [flash AS3系列教程]创建MovieClip类 (此文被围观3693次)
- FLASH中如何跟踪多个触摸点 (此文被围观4732次)
perfectly.
It informational resource, I’ll bookmark it and visit it again!