/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import flash.display.Sprite; import flash.ui.ContextMenu; import flash.ui.ContextMenuItem; import flash.events.ContextMenuEvent; import flash.net.navigateToURL; import flash.net.URLRequest; var menuItemLabel:String = "©2009 Foo Co."; var url:String = "http://www.foo.com"; var cm:ContextMenu; cm = new ContextMenu(); cm.hideBuiltInItems(); var cmi:ContextMenuItem = new ContextMenuItem(menuItemLabel); cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemSelected); cm.customItems.push(cmi); this.contextMenu = cm; function menuItemSelected(evt:ContextMenuEvent):void { var req:URLRequest = new URLRequest(url); navigateToURL(req, '_blank'); }
URL: http://snipplr.com/favorites/Bonky/