【问题标题】:Adobe AIR NativeProcess Hello WorldAdobe AIR NativeProcess Hello World
【发布时间】:2010-12-31 18:52:47
【问题描述】:

我有

<supportedProfiles>extendedDesktop</supportedProfiles>

在我的 Application.xml 文件中,但以下内容会产生此错误:

错误 #1034:类型强制失败:无法将 flash.filesystem::File@619de81 转换为 flash.desktop.NativeProcessStartupInfo。

<html>
<head>
<title>New Adobe AIR Project</title>
<script type="text/javascript" src="lib/air/AIRAliases.js"></script>
<script type="text/javascript" src="lib/air/AIRIntrospector.js"></script>
<script type="text/javascript" src="lib/jquery/jquery-1.4.2.js"></script>
<script>
function Init(){
    var myAIRFile = new air.File('C:/Program Files (x86)/Windows NT/Accessories/Wordpad.exe');
    var myProcess = new air.NativeProcess();
    var myStartup = new air.NativeProcessStartupInfo();
    myStartup.executable = myAIRFile;
    myProcess.start(myAIRFile);

}
</script>
</head>
<body onload="Init();">
</body>
</html>

【问题讨论】:

    标签: air


    【解决方案1】:

    只需在它所属的地方使用 myStartup:

    myProcess.start(myStartup);
    

    【讨论】:

      【解决方案2】:

      代码看起来像 HTML 代码,这意味着您正在创建一个 web 应用程序。

      本机进程仅适用于桌面上的应用程序。 不适用于网络应用程序。

      谢谢 ,
      尼拉杰

      【讨论】:

      • @PiotrekOkoński 为什么不解释一下!
      • AIR 应用程序是桌面软件,而不是网页。只需 google AIR 而不是询问。
      • @PiotrekOkoński 希望你懂英语。因为这正是我所说的 AIR nativeprocess 是用于桌面的,而 sn-p 共享的代码是 HTML。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-08
      • 1970-01-01
      • 1970-01-01
      • 2012-12-13
      相关资源
      最近更新 更多