如何用鼠标左右键控制场景的切换

我有三个场景1,2,3,如何能够实现点击鼠标左键使场景切换从1->2->3,点击右键实现场景切换从3->2->1。
如果用按钮实现了这个功能,那很容易的,但如果不想看到按钮,那就只能用鼠标左右键来控制了!下面给大伙看下我的解决方法:

代码:

每一个场景第一桢写:

fscommand(“showmenu”, “false”);//隐藏鼠标右键

_root.onEnterFrame = function() {

if (Key.isDown(2)) { //点击鼠标左键时

nextScene(); //到下一场景

}

if (Key.isDown(1)) { //点击鼠标右键时

prevScene(); //到上一场景

}

};

Need a translation service?

Please enter your personal details and we will contact you shortly

Words translated by CCJK

146,096,379

Our Client Satisfaction

Rating for previous quarterr

4.00

Over 95% of our clients recommend our language services to others

Copyright © CCJK Technologies Co., Ltd. 2000-2017. All rights reserved.
TOP