gpt4 book ai didi

闪存到 C# 通信

转载 作者:行者123 更新时间:2023-12-02 08:50:45 28 4
gpt4 key购买 nike

我正在尝试在浏览器中嵌入的 flash 实例与在 C# WinForms 应用程序中运行的 flash 实例之间进行通信...我收到一个编译错误,内容为:

1119 Access of possibly undefined property printOut through a reference with static type flash.net:LocalConnection

这是 ActionScript :

var feedback = "";

var receiving_lc:LocalConnection = new LocalConnection();

receiving_lc.connect("fromClient")

receiving_lc.printOut = function (textRecieved:String):void

{
feedback.text += textRecieved+"\n";
ExternalInterface.call("ReceiveData", feedback);
};

最佳答案

您似乎在 ActionScript 3 中使用了 ActionScript 2 示例。在 ActionScript 3 中,您无法定义自定义函数并将其直接分配给 LocalConnection 对象(这是在 AS2 中使用 LocalConnection 的方式)。因此编译错误。

LocalConnection.send(...) 方法用于在定义为连接客户端的对象上调用公共(public)函数。请参阅文档中的示例:

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

关于闪存到 C# 通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8620123/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com