| 域名空间 下载中心 社区论坛 信息公告 my小屋 |
![]() |
联系我们 设为首页 加入收藏 |
|
首页 | 新闻资讯 | 编程开发 | 网页设计 | 图形图象 | 网络媒体 | 网站模板 | 数 据 库 | 投稿 论坛 | 操作系统 | 系统优化 | 网络安全 | 黑客技术 | 硬件学堂 | 硬件报价 | 服 务 器 | 地图 专题 | 应用软件 | 聊天通讯 | q q 专栏 | 建站经验 | 在线工具 | 站长club | 注 册 表 | 旧版 社会 | 游戏娱乐 | 设计欣赏 | 疑难解答 | 社区论坛 | 韩国素材 | 素材图库 | 广告服务 | 服务 |
| 新版上线![旧版] | |||||
注:打开慢时请稍等
director 制作具有win xp 风格的菜单(2)http://www.iyit.net 日期:2006-5-29 8:55:35 来源:网络转载 点击: |
4 .撰写 lingo 脚本 ( 1 )程序构思: 当用户在舞台范围内点击鼠标右键时,在鼠标右键点击的位置,淡入淡出地弹出(显示)一个快捷菜单,让用户选择他要观看的内容,按下鼠标左键后选定内容,然后让计算机执行相应的演示。 ( 2 )程序实现 a. 编写菜单控制脚本(响应范围是全局的),按 打开脚本编辑窗口,起名为 “menu control script” ,按脚本编辑窗口右上角的 然后在脚本编辑窗口里写入以下脚本: -- 程序初始化 on startmovie -- 开始时菜单应为不可见 , 直到用户点击鼠标右键时才显示 , 所以先隐藏菜单 hidemenu -- 初始化菜单和菜单阴影的基点 ( 使其能显示在正确的位置 ) set the regpoint of member "menu" to point(0,0) set the regpoint of member "shadow" to point(0,0) alert“ 在舞台范围内按鼠标右键观看效果! ” end startmovie -- 显示菜单事件 on showmenu -- 打开通道 2 至 12, 显示菜单和菜单选择棒 ( 由于选择棒的透明度 (blend) 为 0 所以暂时看不到 ) repeat with i=2 to 12 set the visible of sprite i to 1 end repeat -- 设置菜单和阴影的位置为鼠标点击的位置 ( 使菜单能动态跟随鼠标 ) set the loc of sprite 2 to the mouseloc set the loc of sprite 3 to the mouseloc -- 菜单选择棒动态跟随菜单(以菜单的位置为基准坐标,相对地改变选择棒位置) repeat with i=1 to 9 --96 是菜单选择棒相对于菜单水平坐标的偏移值 sprite (i+3).loch = sprite(3).loch + 96 --32 是菜单选择棒相对于菜单垂直坐标的偏移值 --19 是菜单棒的高度 sprite (i+3).locv = sprite(3).locv + 32 + (i-1)*19 end repeat -- 菜单的淡入淡出效果 ( 透明度从 10 渐变到 100) repeat with i=10 to 100 set the blend of sprite 3 to i i=i+10 updatestage end repeat end -- 隐藏菜单事件 ( 只是将通道 2 至 12 关闭,使其不可见 ) on hidemenu repeat with i=2 to 12 set the visible of sprite i to 0 end repeat end b. 编写菜单项选择棒行为脚本(响应范围只限于赋予本行为的角色),按窗口上角的 -- 当鼠标移入当前菜单选择棒时 , 即用户选中某菜单项了 -- 让鼠标指针变成小手形状 , 且把菜单选择棒的透明度改成 100( 完全可见 ) on mouseenter sprite (the currentspritenum).blend = 100 cursor 280 end mouseenter -- 当鼠标移出当前菜单选择棒时 , 即用户不选某菜单项了 -- 把鼠标指针还原成原来指针形状 , 且把菜单选择棒的透明度改成 0( 不可见 ) on mouseleave sprite (the currentspritenum).blend = 0 cursor -1 end mouseleave -- 当用户在某一菜单选择棒上按下鼠标时 , 执行相应的操作 on mousedown -- 通过 the currentspritenum( 鼠标点击的菜单选择棒的角色编号 ) 属性 , -- 可以让计算机知道用户选择的菜单项,进而使计算机做出相应的操作。 case (the currentspritenum) of 4:alert" 跳转到 windows xp 画面 !" 5:alert" 跳转到 windows 2000 画面 !" 6:alert" 跳转到 windows nt workstation 4.0 画面 !" 7:alert" 跳转到 windows nt sever 4.0 画面 !" 8:alert" 跳转到 windows me 画面 !" 9:alert" 跳转到 windows 98 画面 !" 10:alert" 跳转到 windows 95 画面 !" 11:alert" 跳转到 windows ce 3.0 画面 !" 12:alert" 跳转到 windows nt embedded 画面 !" end case end mousedown 编辑:黑鹰 [发送给好友] [打印本页] [关闭窗口] [返回顶部] 上一篇:director 制作具有win xp 风格的菜单(3) 下一篇:director mx 2004教程--director mx 2004都支持些什么? 转载请注明来源:www.iyit.net 特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。 |
| 最新更新 | 热点排行 | 推荐新闻 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| 友情链接 | ||||||
| 设置首 页 - 版权声明 - 广告服务 - 关于我们 - 联系我们 - 友情连接 |
| |||||||