|
看到别人作了一个右键菜单.感觉不错.其它大家可以多多应用他.所以作个小例子出来. 大家可以应用于多媒体演示等地方.<br /><br />核心代码如下:<br /><br />var empiremue = new ContextMenu();<br />//删除原始菜单状态!<br />empiremue.hideBuiltInItems();<br />//自定义菜单项目!<br />empiremue.customItems.push(new ContextMenuItem("返回首界面", home));<br />empiremue.customItems.push(new ContextMenuItem("返回到一副", h1));<br />empiremue.customItems.push(new ContextMenuItem("返回到二副", h2));<br />empiremue.customItems.push(new ContextMenuItem("返回到三副", h3));<br />empiremue.customItems.push(new ContextMenuItem("返回到四副", h4));<br />empiremue.customItems.push(new ContextMenuItem("返回到五副", h5));<br />empiremue.customItems.push(new ContextMenuItem("返回到六副", h6));<br />empiremue.customItems.push(new ContextMenuItem("去[闪客帝国]学习", gotoempire));<br />//菜单子程序执行目标...<br />function home() {<br /> _root.gotoAndStop(1);<br />}<br />function h1() {<br /> _root.gotoAndStop(2);<br />}<br />function h2() {<br /> _root.gotoAndStop(3);<br />}<br />function h3() {<br /> _root.gotoAndStop(4);<br />}<br />function h4() {<br /> _root.gotoAndStop(5);<br />}<br />function h5() {<br /> _root.gotoAndStop(6);<br />}<br />function h6() {<br /> _root.gotoAndStop(7);<br />}<br />function gotoempire() {<br /> getURL("http://www.flashempire.com/school/", "_blank");<br />}<br />_root.menu = empiremue;<br /><br /><br /><blockquote class="blockquote">From: http://www.photoep.cn/read.php?tid=121 Powered by PHPWind.com</blockquote> |