0

我在 ATL 窗口中嵌入了一个 Flash 播放器 (flash9.ocx),并在 swf 中编码了功能以响应按下的返回/输入键。在独立的 swf 播放器上运行良好,但一旦在我的嵌入式播放器中播放,它就不会执行。好像我的窗户以某种方式挡住了路?有没有办法将按键传递给播放器?

仅供参考,表格上没有任何奇怪的地方。

谢谢!

4

2 回答 2

0

我不经常使用闪存,但我是一名 C++ 程序员。=) 让我们看看我能不能帮你。我相信您的应用程序会在您的 Flash 电影之前捕获所有事件。我不知道是否有更好的方法可以做到这一点,但您可以监听表单上的任何键盘事件并使用 ActiveX 组件的 SetVariable 在 Flash 中设置变量。然后,在 Flash 电影中,您可以设置监视此变量的任何更改并触发您的 Enter 事件。

希望这可以帮助。

于 2010-06-12T20:35:12.050 回答
0

I'm not VC++ developer, but I use Flash a lot.

Though not sure, it seems that the embedded player doesn't have the focus. Make sure you've got this part covered on the Flash side of things:

  • the stage exists ( you movie is properly initialized)
  • you set the KeyboardEvent listener to the stage.

You could use the FocusManager to make sure you've got the focus.

I don't know if you can pass the focus from you app to the SWF OLE through some tabIndex or something.

If still this doesn't work you can try using the External Interface to add callbacks from your app to flash player ( basically call and actionscript function from your app ).

This was achieved through fscommand before, but External Interface seems to be the thing to use now.

Good luck!

于 2009-04-12T20:47:43.330 回答