首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Flex3中获取Fscommand

在Flex3中获取Fscommand
EN

Stack Overflow用户
提问于 2009-10-08 10:53:59
回答 2查看 1K关注 0票数 0

我有一个swf文件,当在该swf中单击submit按钮时,我使用fscommand获得最终输出,在SWFloader in flex3 .i中加载该swf需要以警报的形式获得fscommand值,如何首先获得该值并显示为警报。

提前感谢

EN

回答 2

Stack Overflow用户

发布于 2009-10-08 11:24:12

fscommand不能用于加载和包含主权财富基金之间的通信。

来自丽维多

fscommand:允许SWF文件与Flash或托管Flash的程序(如web浏览器)进行通信。还可以使用fscommand()函数将消息传递给Director或Visual、VisualC++和其他可以承载ActiveX控件的程序。

您可以在加载的SWFs中调用一个方法,直接访问它的属性或使用事件或使用本地连接在父级和加载的swf之间传递数据。

票数 1
EN

Stack Overflow用户

发布于 2009-10-08 13:49:06

从技术上讲,这是可行的,但不是个好主意。您需要注册一个回调,该回调将调用子swf (通常从子swf完成)。但是,您将面临很大的头痛风险,您将不得不更多地依赖浏览器而不是其他选项。它也将比唯一的解决方案慢。

你的情况要好得多(按这个顺序):

  1. Using a shared Singleton. This allows for complete separation of the two swf's without requiring any major coordination between the two. The only real potential problem can be caused if you want the child swf to have its own `ApplicationDomain`, but even with that, there are work-arounds
  2. Using events. This can work if you have the child swf dispatch a bubbling, non-cancel-able event and have the `event.target` recorded by the parent swf. You may have to adjust to avoid `SecuritySandboxViolation`s, however.
  3. Using LocalConnections. The two detriments to LocalConnections are:
    • 您将需要不断地重新生成唯一的连接名称,以避免通过将两个LocalConnections连接到同一个通道而引发的错误。
    • LocalConnections确实有带宽限制,如果流量很大或消息太大,就会调用慢速。

  4. Using direct manipulations like `loader.content.foo.bar.baz`; I don't like this solution because it is much harder to maintain. It is also _much_ worse from a design perspective: you want to use encapsulation as much as possible in this situation -- this technique actively works against that.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1537053

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档