Return to Snippet

Revision: 36777
at November 26, 2010 06:39 by tuffstudio


Initial Code
var myMenu:ContextMenu = new ContextMenu();
		myMenu.hideBuiltInItems();
		var menuItem1:ContextMenuItem = new ContextMenuItem("Hello World");
		var menuItem2:ContextMenuItem = new ContextMenuItem("Go to My Page");
		menuItem2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doSomething);
		myMenu.customItems.push(menuItem1);
		this.contextMenu = myMenu;
		
		function doSomething(e:ContextMenuEvent):void 
		{
		var url:String = "http://www.kennylin.com";
		var request:URLRequest = new URLRequest(url);
		navigateToURL(request, '_blank');
			}

Initial URL

                                

Initial Description

                                

Initial Title
AS3 right-click menu

Initial Tags

                                

Initial Language
ActionScript 3