Adobe AIR执行程序 [英] Adobe AIR to execute program

查看:179
本文介绍了Adobe AIR执行程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按下Adobe AIR应用程式中的按钮,并执行一些已安装的程式。例如,我会有一个名为Start Winamp的按钮。当按下它应该启动Winamp.exe直接...我不想要一些命令行执行,我只想要一个exe开始。或者是同样的事情吗?

解决方案



<

没有直接的方法。尝试 CommandProxy



仔细阅读博客文章。您真的需要创建两个不同的项目:本机操作系统可执行文件和AIR应用程序。本机可执行程序将激活AIR应用程序。 AIR应用程序又请求可执行文件处理操作系统级请求。



Google代码并创建两个项目 - Visual Studio / Mono用于示例C#exe,另一个用于AIR应用程序。 这里是一个介绍如何设置前者的链接。



在您的AIR应用程序的主MXML文件中,您需要执行以下操作:




  • p>创建 CommandProxy 对象,添加一些事件侦听器,用于连接检测,命令响应和错误。 / p>

  • 透过连线呼叫

    连接原生exe b
  • connect 的事件处理程序中,创建一个新的命令 ScreenshotCommand 并执行它(通过 CommandProxy.execute 方法)




...就是这样!



希望这有帮助。


I would like to press a button from an Adobe AIR application and execute some installed program. For example, I would have a button named "Start Winamp". When this is pressed it should start Winamp.exe directly...I don't want some command line thing executed, I only want an exe to start. Or...is it the same thing ? Please, let me know if this is possible.

Thank you.

解决方案

There's no direct way of doing it. Try CommandProxy.

Read the blog post very carefully. You really need to create two different projects: a native OS executable and an AIR app. The native executable fires up your AIR application. The AIR application in turn requests for the executable to process OS-level requests.

Download the source from Google Code and create two projects -- a Visual Studio/Mono for the sample C# exe and another -- for the AIR application. Here is a link that describes how to set up the former.

In your AIR app's main MXML file, you need to do the following:

  • Create a CommandProxy object, add a few event listeners, for connection detection, and Command response and error.

  • Connect to the native exe via a connect call

  • In the event handler for connect, create a new Command e.g. ScreenshotCommand and execute it (via CommandProxy.execute method)

... and that's it!

Hope this helps.

这篇关于Adobe AIR执行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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