如何传递 Vector。<>从具有外部接口的闪存

发布于 2024-10-07 18:54:54 字数 294 浏览 0 评论 0 原文

我有一个用于 Flash ActiveX 控件的自定义容器 (C#),并且正在来回传递数据。以前我会使用ExternalInterface.call 并传递一个数组作为参数。我更愿意使用 Vector 类,因为它可用,但似乎当我这样做时,永远不会进行调用。

然而,如果它嵌入在 IE 中,它就会被制作出来。看来在 IE 中,Flash 会发送 JavaScript 来执行,而不是序列化为 XML。我的猜测是 Vector XML 序列化未内置,因此 Flash 只是忽略该调用。

有人有什么想法吗?除了重新使用数组之外,我现在已经这样做了。

I have a custom container (C#) for the Flash ActiveX control and am passing data back and forth. Previously I would use ExternalInterface.call and pass an Array as a parameter. I would prefer to use the Vector class now that it is available, but it appears that when I do that the call is never made.

It is however made if it is embedded in IE. It appears that when in IE, Flash will send out JavaScript to execute rather than serializing to XML. My guess is that the Vector XML serialization isn't baked in, so Flash just ignores the call.

Anyone have any ideas? Other than just going back to using Array, I've already done that for now.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

段念尘 2024-10-14 18:54:54

文档指出:

其他内置或自定义类 -
ActionScript 将其他对象编码为
null 或作为空对象。在任一
如果任何属性值丢失。

目前尚不完全清楚这意味着什么,因为自定义类也是对象 - 我猜只有普通对象才算数?但无论如何,Vector 看起来属于“其他内置类”类别,因此您需要使用 Array,或者在传递数据之前重新转换为 Array。

The docs note that:

Other built-in or custom classes -
ActionScript encodes other objects as
null or as an empty object. In either
case any property values are lost.

It's not completely clear what that means, since custom classes are also Objects - I guess only vanilla objects count? But at any rate it looks like Vector falls into that "other built-in classes" category, so you'll need to either use Array, or re-cast to Array before you pass the data.

少跟Wǒ拽 2024-10-14 18:54:54

您可以使用带有 [ArrayElementType("type")] 的数组。或者为 Vector 编写序列化函数

you can use arrays with [ArrayElementType("type")] instead. or write a serialization function for Vector

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文