我需要将文本从嵌入式 SWF(Web 浏览器)发送到基于 AIR 的桌面应用程序。我做了文档中解释的所有事情,但我无法建立连接。
有没有人看到我做错了什么或者可以指出一个可行的例子?
来自主权财富基金:
function startConnection(e:Event=null):void
{
var localConnection:LocalConnection
localConnection = new LocalConnection();
localConnection.client = this;
localConnection.allowDomain("app#com.example.desktop");
var textToSend = "Hello world! Source: http://www.foobar.com";
localConnection.send("app#com.example.desktop:connectionName", "methodName",textToSend);
}
从 AIR 桌面应用程序:
function onBrowserInvoke (event:BrowserInvokeEvent):void{
var localConnection:LocalConnection
localConnection = new LocalConnection();
localConnection.client = this
localConnection.allowDomain("example.com");
localConnection.connect("connectionName");
}
谢谢你。乌里