var myContextMenu : ContextMenu = new ContextMenu();
var GoUrl : ContextMenuItem = new ContextMenuItem("欢迎您!");
GoUrl.addEventListener(ContextMenuEvent.MENU_ITEM_Select,GoUrlClick);
myContextMenu.customItems.push(GoUrl);
myContextMenu.hideBuiltInItems();
this.contextMenu = myContextMenu;
private function GoUrlClick(event:ContextMenuEvent):void
{
navigateToURL(new URLRequest("http://94cool.cnblogs.com"),"_blank");
}
发现在Flex所用的页面跳转方法跟flash的不一样,flash中是这样用的:
getUrl("http://94cool.cnblogs.com","_blank");
var GoUrl : ContextMenuItem = new ContextMenuItem("欢迎您!");
GoUrl.addEventListener(ContextMenuEvent.MENU_ITEM_Select,GoUrlClick);
myContextMenu.customItems.push(GoUrl);
myContextMenu.hideBuiltInItems();
this.contextMenu = myContextMenu;
private function GoUrlClick(event:ContextMenuEvent):void
{
navigateToURL(new URLRequest("http://94cool.cnblogs.com"),"_blank");
}
发现在Flex所用的页面跳转方法跟flash的不一样,flash中是这样用的:
getUrl("http://94cool.cnblogs.com","_blank");
本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/archive/2009/10/23/1588799.html,如需转载请自行联系原作者