SWFObject 无法通过 Google Libraries API 运行?

发布于 2024-09-28 14:58:29 字数 829 浏览 3 评论 0原文

当我在本地加载 swfobject.js 时,以下嵌入代码工作正常。但是,当我尝试从 Google Library API 加载 swfobject.js 时,Flash 影片无法加载。我知道我使用的是有效密钥,并且 swfobject.js 文件已明确加载,但我收到“未捕获的引用错误:SWFObject 未定义” (匿名函数)”

有什么想法吗?

<body> 

<!-- DOESN'T WORK -->
<script type="text/javascript" src="http://www.google.com/jsapi?key=(VALID KEY)"></script>
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> 
<!-- WORKS -->
<!--script type="text/javascript" src="swfobject.js"></script-->

<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
   var so = new SWFObject("mySwf.swf", "mymovie", "400", "200", "8", "#336699");
   so.write("flashcontent");
</script>


</body>

The following embed code works fine when I load swfobject.js locally. However, when I try to load the swfobject.js from Google Library APIs, the Flash movie fails to load. I know I'm using a valid key, and the swfobject.js file is definetely being loaded, but I get an "Uncaught ReferenceError: SWFObject is not defined
(anonymous function)"

Any ideas?

<body> 

<!-- DOESN'T WORK -->
<script type="text/javascript" src="http://www.google.com/jsapi?key=(VALID KEY)"></script>
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> 
<!-- WORKS -->
<!--script type="text/javascript" src="swfobject.js"></script-->

<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
   var so = new SWFObject("mySwf.swf", "mymovie", "400", "200", "8", "#336699");
   so.write("flashcontent");
</script>


</body>

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

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

发布评论

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

评论(1

娇俏 2024-10-05 14:58:29

v2.2 不使用旧的 1.x api。

尝试这样的事情。

var flashvars = { };
var params = { wmode:'opaque' };
var attributes = { name:"mymovie" };
swfobject.embedSWF("mySwf.swf", "flashcontent", "400", "200", "8.0.0","expressInstall.swf", flashvars, params, attributes);

v2.2 does not use the old 1.x api.

Try something like this.

var flashvars = { };
var params = { wmode:'opaque' };
var attributes = { name:"mymovie" };
swfobject.embedSWF("mySwf.swf", "flashcontent", "400", "200", "8.0.0","expressInstall.swf", flashvars, params, attributes);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文