Adobe AIR执行程序

编程入门 行业动态 更新时间:2024-10-28 06:31:06
本文介绍了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执行程序

本文发布于:2023-11-23 15:17:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621910.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序   Adobe   AIR

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!