赶上右击AS3 [英] Catch Right-Click AS3

查看:145
本文介绍了赶上右击AS3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能赶上右击闪存(AS3)里面?

Is it possible to catch a right-click inside of flash (AS3)?

没有JQuery的/ JavaScript的。

No JQuery/JavaScript.

我需要暂停游戏时,右键单击被抓住了,所以我没有那么多要禁用上下文菜单,我只是想告诉大家,单击右键发生。是否有一个事件监听器,我可以添加?任何其他的想法?

I need to pause gameplay when a right-click is caught, so I don't so much want to disable the context-menu as I do just want to tell that a right-click has happened. Is there an EventListener I can add? Any other ideas?

更新:
我需要的事件被触发,因为他们实际上是右击,不只是后上下文菜单中消失。

UPDATE:
I need the event to be triggered as they are actually right clicking, not just after the context-menu has disappeared.

推荐答案

有只有两种方式来捕获右击事件:

There are only two ways to capture a right click event:

  1. 有关网页浏览器应用程序:使用JavaScript 。您可以在Flash直接做到这一点,因为你无法禁用上下文菜单。

  1. For a web browser application: Use JavaScript. You can't do it directly in Flash, because you can't disable the context menu.

对于桌面应用程序:部署为AIR应用程序。 AIR具有 RIGHT_CLICK的MouseEvent

For a desktop application: Deploy as an AIR application. AIR has a RIGHT_CLICK MouseEvent built in.

有没有第三步。 :(

P.S:也就是说,如果<一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/ContextMenu.html?filter_flex=4.1&filter_flashplayer=10.1&filter_air=2#event%3amenuSelect"相对=nofollow> menuSelect 真的不适合你的工作 - 文件说,这是触发的的菜单中打开

P.S: That is, if menuSelect really doesn't work for you - the documentation says it is triggered before the menu is opened.

这篇关于赶上右击AS3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆