在双屏设置中运行两个闪存应用程序



我有一个Adobe Flash应用程序,它在kiosk模式下运行全屏(作为projector exe),并通过简单的基于操作系统的屏幕克隆(Windows 7)镜像到第二个屏幕上。

现在有一个要求,应用程序应该在第二个屏幕上显示其他附加信息,而不是简单地克隆第一个屏幕。

我天真的方法是创建两个独立的Flash应用程序,并让它们通过http代理进行通信。但是,我在Adobe Flash文档中的API中找不到任何允许我将辅助应用程序全屏发送到第二个监视器上的内容。

有人有主意吗?或者有一个应用程序(而不是两个)但宽度是原来的两倍更容易/可能吗?这会延伸到两个屏幕吗?

更新:Ryan下面提到的LocalConnection比http代理更简单,所以我走了这条路。对于双屏问题,我使用了下面提到的Flash Builder工具。

找到了解决方案。这里的这个小工具将swfs转换为无头可执行文件,并具有一些访问文件系统和与flash文件交互的巧妙功能。

http://thesz.diecru.eu/content/flash.php

fscommand("exec","app.exe"); - executes a file which is located in the fscommand subdirectory
fscommand("real_exec","app.exe"); - executes a file which is in the same directory as the executable
fscommand("set_title","Window Title"); - sets the window title
fscommand("quit",""); - exit the flash
fscommand("command","move"); on MouseEvent.MOUSE_DOWN / fscommand("command","mouse_up"); on MouseEvent.MOUSE_UP - drag the window
fscommand("command","resize"); on MouseEvent.MOUSE_DOWN / fscommand("command","mouse_up"); on MouseEvent.MOUSE_UP - resize the window
fscommand("position","save"); / fscommand("position","restore"); / fscommand("position","clear"); - save, restore and clear window position

开发人员非常友好地用扩展了命令集

fscommand("position","100x200 300x400"); // position, then size (optional)

我相信您需要的是LocalConnection。这使两个flash文件(我知道它适用于swf,从未尝试过projector exe文件)能够通信、传递变量并一起工作。如果我正确理解你的问题,这将非常适合你。

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/LocalConnection.html

http://circlecube.com/2008/03/local-connection-actionscript-communicate-between-seperate-flash-files-tutorial/

两个文件都需要位于同一服务器上或本地位于同一文件夹中。从flash中进行测试也不起作用,因为这两个文件会变得相互依赖,这使得测试有点困难。就我个人而言,我帮不了太多忙,因为我只在传递变量和启动tweens等非常基本的事情上使用过LC。希望能有所帮助!

相关内容

最新更新