as3.0右键功能代码

<textarea cols="50" rows="15" name="code" class="c-sharp">&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"&gt; &lt;mx:Script&gt; &lt;!--[CDATA[ private function init():void { var menuItem1:ContextMenuItem = new ContextMenuItem("欢迎访问剪裁人生Blog"); var menuItem2:ContextMenuItem = new ContextMenuItem("CSDN技术站点"); menuItem1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,navToAngine); menuItem2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,navToCsdn); var myMenu:ContextMenu = new ContextMenu(); myMenu.hideBuiltInItems(); myMenu.customItems.push(menuItem1); myMenu.customItems.push(menuItem2); contextMenu = myMenu; } private function navToAngine(e:ContextMenuEvent):void { var tagetURL:URLRequest = new URLRequest("http://blog.csdn.net/jamesjun"); navigateToURL(tagetURL); } private function navToCsdn(e:ContextMenuEvent):void { var tagetURL:URLRequest = new URLRequest("http://www.csdn.net"); navigateToURL(tagetURL); } ]]--&gt; &lt;/mx:Script&gt; &lt;mx:Text x="373" y="113" text="请点击右键" width="256" height="45" fontWeight="bold" fontSize="22" color="#34FF0C" textAlign="center"/&gt; &lt;/mx:Application&gt;</textarea>

你可能感兴趣的:(as3.0右键功能代码)