将针对 Flash 10 编译的 SWF 加载到 Flash 9 SWF 中

发布于 2024-07-19 06:39:05 字数 120 浏览 3 评论 0原文

这可能吗? 我想要一个主 swf 可供安装了 flash 9 或 flash 10 的用户查看。 在此 swf 内部,仅为安装了 flash 10 的用户加载单独的模块。 该模块将使用一些先进的 flash 10 功能。

Is this possible? I would like to have a main swf that can be viewed by users who either have flash 9 or flash 10 installed. Inside of this swf, a separate module will be loaded only for users who have flash 10 installed. This module will use some advanced flash 10 features.

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

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

发布评论

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

评论(3

作妖 2024-07-26 06:39:05

当然,正如您所描述的那样,这应该可以正常工作。 在 Flash 9 中制作基础 SWF,进行版本检查,并可选择加载作为 10 发布的另一个 SWF。Flash 将呈现 v10 SWF 中的高级功能,无论加载到哪个 SWF 版本。

请记住,版本以字符串形式返回,因此请务必对其执行 parseInt

Sure, this should work fine just as you've described it. Make your base SWF in Flash 9, do a version check, and optionally load in another SWF published as 10. Flash will render the advanced features in the v10 SWF, regardless of the version of the SWF it was loaded into.

Just remember that the version is returned as a String, so be sure to do a parseInt on it.

谁对谁错谁最难过 2024-07-26 06:39:05

这应该可以正常工作,除非您尝试在 Flash 10 SWF 中使用 Flash 10 特定库(这可能就是您正在做的事情)。 我刚刚尝试了一下,Adobe 的 Flash/Flex 库设计和质量再次令人失望。

例如,我试图执行以下操作:

如果用户的 Flash Player 是 10 或更高版本,我有一个 Flash 9 基础 SWF,它将加载 Flash 10 模块。 此 Flash 10 模块最终使用 Flash 10 特定库,例如:
1) flash.net.NetStreamPlayOptions
2) flash.net.NetStreamPlayTransitions
3)NetStream.play2
不幸的是,当我执行此操作时,Flash 运行时会抱怨不存在 NetStreamPlayOptions、NetStreamPlayTransitions 和 NetStream.play2 等内容。 我试图通过复制 NetStreamPlayOptions 和 NetStreamPlayTransitions 来解决这个问题,这让我走得更远,但不幸的是,即使我将 NetStream 实例转换为对象,我也无法调用 NetStream.play2。

我相信它的工作原理是这样的,因为基本 SWf(即 Flash 9)使用适用于 Flash 9 的playerglobal.swc。当它加载 Flash 10 SWF 时,它最终仍会使用 Flash 9 playerglobal.swc,因为环境已针对 Flash 9 进行初始化,这会导致 Flash 10 SWF 出现问题。 我还没有找到解决这个问题的方法。

当Flash从AS1切换时-> AS2-> AS3,它不向后兼容是有道理的,但现在AS3不能总是加载AS3,在我看来这是非常令人失望的。

This should work fine unless you're trying to use Flash 10 specific libraries in the Flash 10 SWF, which is probably what you're doing. I just tried this out, and yet again Adobe disappoints in their Flash/Flex library design and quality.

For example, I was trying to do the following

I have a Flash 9 base SWF which will load up a Flash 10 module, if the user's Flash Player is 10 or greater. This Flash 10 module ends up using the Flash 10 specific libraries, like:
1) flash.net.NetStreamPlayOptions
2) flash.net.NetStreamPlayTransitions
3) NetStream.play2
Unfortunately, when I do this, the Flash runtime complains that there is no such thing as NetStreamPlayOptions, NetStreamPlayTransitions, and NetStream.play2. I tried to get around this by duplicating the NetStreamPlayOptions and NetStreamPlayTransitions, which got me farther, but unfortunately I was unable to call NetStream.play2, even if I cast the NetStream instance as an Object.

I believe it works like this because the base SWf, which is Flash 9, uses the playerglobal.swc, intended for Flash 9. When it loads up the Flash 10 SWF, it still ends up using the Flash 9 playerglobal.swc because the environment was initialized for Flash 9, which causes problem with the Flash 10 SWF. I have yet to find a way around this.

When Flash was switching from AS1 -> AS2 -> AS3, it made sense why it wasn't backwards compatible, but now AS3 cannot always load AS3, which in my opinion is very disappointing.

橙幽之幻 2024-07-26 06:39:05

我已经很长时间没有开发 Flash 应用程序了,但是……这些是我的 2 美分:

您可能必须将主 Flash 编译到 10,这可能会成为一个问题,因为升级警告。

这是一个可能的解决方法:
http://codeofdoom.com /wordpress/2009/02/09/compiling-to-flash-10-requiring-flash-9/

完成此操作后,我认为检测 flash 版本并加载不同的 swf 模块很容易,就像您所说的那样。

It's a long time since I don't develop flash apps but well... these are my 2 cents:

You might have to compile the main Flash to 10 and this can be a problem because of the upgrade warning.

This is a possible workaround:
http://codeofdoom.com/wordpress/2009/02/09/compiling-to-flash-10-requiring-flash-9/

Having done that, I think that it's easy detecting the flash version and loading different swf modules just like you say.

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