无需 SWFObject.js 的 Javascript 到 Flash 通信

发布于 2024-07-25 07:19:45 字数 326 浏览 2 评论 0原文

想知道是否可以在不使用 SWFobject 或任何其他额外的 javascript 文件的情况下从 javascript 到 flash 进行通信。

目前我正在使用以下指南: http://www.viget.com/inspire/bi-direction- actionscript-javascript-communication

感谢您的宝贵时间。

Wondering if its possible to communication from javascript to flash without the use of SWFobject or any other extra javascript file.

Currently I am using the following guide:
http://www.viget.com/inspire/bi-directional-actionscript-javascript-communication

Thank you for your time.

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

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

发布评论

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

评论(1

浮华 2024-08-01 07:19:45

使用 Flash 的 < /a> externalInterface 以及您自己编写的 JavaScript (这应该是您唯一需要的 JavaScript)。

SWFObject 的存在只是为了抽象化向 HTML 内容添加 Flash 片段,因此根本没有必要(它基本上会根据您的浏览器和情况编写正确的 objectembed 标记)解决 IE 的 ActiveX 点击运行 Flash 警告)。

如果您想将 Flash 片段手动编码到文档中,那完全没问题; SWFObject 使其变得更干净、更简单,但不会启用或添加除此之外的功能。 然而,由于它运行良好,它已成为在网站上使用 Flash 的一种标准方法。

将您的 Flash 片段放在页面上,无论您想要什么,请确保它的 objectembed 标记中设置了 id,并且您应该被设置。

It's perfectly possible using Flash's externalInterface and the JavaScript you're writing yourself alone (which should be the only JavaScript you'll need).

SWFObject exists only to abstract away adding Flash pieces to HTML content, so it's not necessary at all (it's basically going to write the proper object and embed tags depending on your browser and work around the IEs' ActiveX click-to-run-Flash warnings).

If you wanted to hand-code your Flash piece into a document, that's perfectly fine; SWFObject makes it cleaner and easier but doesn't enable or add functionality beyond that. However, because it works so well, it's become kind of a standard method to get Flash on a site.

Drop your Flash piece on a page however you'd like, make sure it has an id set in its object and embed tags and you should be set.

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