【发布时间】:2008-09-22 21:57:27
【问题描述】:
我有一个应用程序可以加载外部 SWF 文件并通过 SWFLoader Flex component 在 Adobe Flex / Air 应用程序中播放它们。我一直在尝试找到一种从按钮单击事件中卸载它们的方法。我在 Google 上搜索的范围很广,似乎没有人能够在没有 hack 的情况下做到这一点。我看到人们使用的代码组合是:
swfLoader.source = ""; // Removes the external link to the SWF.
swfLoader.load(null); // Forces the loader to try to load nothing.
// Note: At this point sound from the SWF is still playing, and
// seems to still be playing in memory.
flash.media.SoundMixer.stopAll();
// Stops the sound. This works on my development machine, but not
// on the client's.
如果 SWF 以这种方式关闭(隐藏),最终程序会崩溃。
有什么想法吗?我在各种论坛上发现了大量的帖子,人们有同样的问题。我想我会在这里得到一个错误/不完整的答案,然后我的帖子会像往常一样陷入虚无,但无论如何,提前致谢!
编辑 1:我无法编辑实际的 SWF 电影,它们是由客户端创建的。如果我无法关闭通过 Flex 打开的任何 SWF,这不是 Flex 架构的问题吗?将 SWF 发送到 Web 浏览器是我唯一的选择吗?
【问题讨论】:
-
编辑:似乎是 Flash 9 的一个错误。希望现在已修复:D
标签: apache-flex air adobe swfloader