my_cm = new ContextMenu(); // 申明一个新的菜单对象 my_cm.hideBuiltInItems(); // 屏敞当前的右键菜单 my_cm.customItems.push(new ContextMenuItem("大众计算机学习网", menu1)); // 创建一个新的子菜单,名为“大众计算机学习网”,并设置menu1为响应函数 function menu1(obj, item) { trace("大众计算机学习网"); getURL("http://www.dzwebs.net", "_blank"); // “大众计算机学习网”的响应函数具体内容 } _root.menu = my_cm; // 将当前定义的菜单绑定到主场景的右键菜单上
var my_cm:ContextMenu = new ContextMenu(); my_cm.hideBuiltInItems(); //my_cm.builtInItems.quality = true; //my_cm.builtInItems.print = true; my_cm.customItems.push(new ContextMenuItem("网址①", sktt)); my_cm.customItems.push(new ContextMenuItem("网址②", skdg, false)); my_cm.customItems.push(new ContextMenuItem("网址③", xiatian)); this.menu = my_cm; function sktt() { getURL("http://xxx.xxx.xxx/", "_blank"); } function skdg() { getURL("http://xxx.xxx.xxx", "_blank"); } function xiatian() { getURL("http://xxx.xxx.xxx", "_blank"); }
var empiremue = new ContextMenu(); //删除原始菜单状态! empiremue.hideBuiltInItems(); //自定义菜单项目! empiremue.customItems.push(new ContextMenuItem("返回首界面", home)); empiremue.customItems.push(new ContextMenuItem("返回到一副", h1)); empiremue.customItems.push(new ContextMenuItem("返回到二副", h2)); empiremue.customItems.push(new ContextMenuItem("返回到三副", h3)); empiremue.customItems.push(new ContextMenuItem("返回到四副", h4)); empiremue.customItems.push(new ContextMenuItem("返回到五副", h5)); empiremue.customItems.push(new ContextMenuItem("返回到六副", h6)); empiremue.customItems.push(new ContextMenuItem("去大众计算机学习网学习", gotoempire)); //菜单子程序执行目标... function home() { _root.gotoAndStop(1); } function h1() { _root.gotoAndStop(2); } function h2() { _root.gotoAndStop(3); } function h3() { _root.gotoAndStop(4); } function h4() { _root.gotoAndStop(5); } function h5() { _root.gotoAndStop(6); } function h6() { _root.gotoAndStop(7); } function gotoempire() { getURL("http://xxx.xxx.xxx", "_blank"); } _root.menu = empiremue; [办公软件]PowerPoint2003设置对象的自定义动画 [Web开发]asp.net C#查询SQL数据并分页的可参考代码 [网页制作]如何实现网页文字的自动换行 [办公软件]如何取消Word插入自选图形及文本框所出现的虚框的… [操作系统]电脑开机总是自检的几种原因及解决方法(可参考) [网络技术]ADSL宽带上网掉线的原因及可参考的解决办法 [电脑技术]可参考的扫描仪故障解决方案 [电脑技术]网页自动关闭的原因及可参考的解决办法下篇 [电脑技术]网页自动关闭的原因及可参考的解决办法上篇 [电脑技术]多种参考满足您重新安装IE浏览器的愿望
|