b.编写菜单项选择棒行为脚本(响应范围只限于赋予本行为的角色),按窗口上角的

按钮,新建一个脚本,起名为“Show Bar Script”,设置其脚本类型(type)为“behavior”。然后在脚本编辑窗口里写入以下脚本:
--当鼠标移入当前菜单选择棒时,即用户选中某菜单项了
--让鼠标指针变成小手形状,且把菜单选择棒的透明度改成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
中国网管论坛bbs.bitsCN.com 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
网管下载dl.bitscn.com
网管联盟bitsCN_com