怎样使Flex仅消耗滚动鼠标和键盘事件时,它是非常有用的,否则它传递给浏览器?鼠标、它是、消耗、有用

2023-09-09 21:23:44 作者:深巷与她

这一个被irking我一会儿。当我使用鼠标滚轮向上滚动,并在网页中下来,和flash动画进入光标的路径,滚轮停止工作。此外,当一个Flash影片具有焦点,则无法使用浏览器快捷方式,比如控制 + →或控制 + 研究。

This one's been irking me for a while. When I'm using the mouse scroll wheel to scroll up and down in a webpage, and a flash movie comes into the path of the cursor, the scroll wheel stops working. Also, when a flash movie has focus, you can't use browser shortcuts like Ctrl + L or Ctrl + R.

我正在写一个Flex应用程序,现在,我想找到一个解决方案,这样至少我的用户不受此不一致的用户界面行为的困扰。

I'm writing a flex application now and I'd like to find a solution, so that at least my users aren't plagued by this inconsistency of the user interface behavior.

我认为会有办法告诉闪光,除非它们出现为他们是有用的,就像是弯曲的textarea元素传播此类事件的鼠标滚轮和键盘输入备份浏览器。我找不到任何解决方案在那里,虽然,甚至也没有人谈论它。

I should think there would be a way to tell flash to propagate such events as the mouse scroll wheel and keyboard input back up to the browser unless they occur in an element for which they are useful, like in a flex textarea. I can't find any solutions out there though, nor even anyone talking about it.

具体而言,我怎样才能让这个:

Specifically, how can I make it so that:

当用户滚动鼠标,浏览器,除非滚动鼠标在柔性容器滚动,或者想要滚动另一个组件。 当用户presses按钮或键盘上的按钮的组合,它会被传播到浏览器,除非有一个活动的键盘侦听,或光标位于文本字段,等等。

推荐答案

浏览器和Flash之间的通信是通过ExternalInterface的完成。 ExternalInterface的让你从JavaScript中调用ActionScript方法,反之亦然。

Communication between the browser and flash is done via ExternalInterface. ExternalInterface allow you to call ActionScript methods from JavaScript and vice-versa.

祝你好运,因为经验表明它往往不好受处理键盘快捷键和浏览器世态炎凉

Good luck with that because experience shows it's often painfull to deal with keyboard shortcuts and browser inconstancy