在 WordPress 帖子中嵌入 Flash 影片

发布于 2024-08-16 23:11:42 字数 1913 浏览 4 评论 0原文

我正在尝试让这个 Flash 轮播出现在 WordPress 帖子中。我可以右键单击应有的空白区域并调出 Flash 选项菜单,但没有显示电影。它链接到一个提取图像和文本的 xml 文档。是xml的问题吗?下面是我在 WordPress 模板标题中放置的内容,以允许 Flash 影片运行:

<script src="<?php bloginfo('template_directory'); ?>/scripts/swfobject.js" type="text/javascript"></script>

<!-- JavaScript function - called by the animation -->
<script type="text/javascript">
  function MyFunction(p1){
    alert("You have clicked on: " + p1);
  }
</script>

一切都在它应该在的位置,包括对主题“scripts”文件夹中的 swfobject 的引用。现在这是我在我正在处理的帖子中放入的代码:

    <!-- BEGIN embed 3D Carousel -->

<!-- This <div> is replaced by the Flash content! (see "SWFObject embed by Geoff Stearns ..." below)
    Place your alternate content here and users without the Flash plugin 
or with Javascript turned off will see this.-->
<div id="flashcontent">
  <br />
  <br />
  <center>
    <a target="_blank" href="http://www.macromedia.com/go/getflash/">
      <img border="0" alt="" src="images/getflash.png" />
    </a>
  </center>
</div>

<!-- SWFObject embed by Geoff Stearns [email protected] http://blog.deconcept.com/swfobject/ -->
<script type="text/javascript"> 
  var so = new SWFObject("3dcarouseldev.swf", "3dcarouseldev", "780", "460", "8.0.0.0", "#ffffff"); 
  so.addParam("quality", "high"); 
  so.addParam("scale", "noscale"); 
  so.addParam("menu", "false"); 
  so.addParam("salign", "lt"); 
  so.addParam("wmode", "transparent");
  so.addParam("flashvars", "configfile=3dcarousel.xml");
  so.write("flashcontent");
</script>

<!-- END embed 3D Carousel -->

即使我正确链接到所有支持文件,这也不起作用,有什么原因吗? WordPress不喜欢嵌入Flash吗?如果有帮助的话,托管在 Godaddy 上。

谢谢!

I am trying to get this flash carousel to show up in a Wordpress post. I can right click on the blank space where it should be and bring up the flash options menu, but no movie is showing. It links to an xml document that pulls in the images and text. Is it an xml issue? Below is what I placed in my wordpress template header to allow the flash movie to run:

<script src="<?php bloginfo('template_directory'); ?>/scripts/swfobject.js" type="text/javascript"></script>

<!-- JavaScript function - called by the animation -->
<script type="text/javascript">
  function MyFunction(p1){
    alert("You have clicked on: " + p1);
  }
</script>

Everything is where it should be including the reference to the swfobject being in the themes "scripts" folder. Now here is the code I put in the post I am working on:

    <!-- BEGIN embed 3D Carousel -->

<!-- This <div> is replaced by the Flash content! (see "SWFObject embed by Geoff Stearns ..." below)
    Place your alternate content here and users without the Flash plugin 
or with Javascript turned off will see this.-->
<div id="flashcontent">
  <br />
  <br />
  <center>
    <a target="_blank" href="http://www.macromedia.com/go/getflash/">
      <img border="0" alt="" src="images/getflash.png" />
    </a>
  </center>
</div>

<!-- SWFObject embed by Geoff Stearns [email protected] http://blog.deconcept.com/swfobject/ -->
<script type="text/javascript"> 
  var so = new SWFObject("3dcarouseldev.swf", "3dcarouseldev", "780", "460", "8.0.0.0", "#ffffff"); 
  so.addParam("quality", "high"); 
  so.addParam("scale", "noscale"); 
  so.addParam("menu", "false"); 
  so.addParam("salign", "lt"); 
  so.addParam("wmode", "transparent");
  so.addParam("flashvars", "configfile=3dcarousel.xml");
  so.write("flashcontent");
</script>

<!-- END embed 3D Carousel -->

Any reason this won't work even though I am linked correctly to all support files? Does Wordpress not like embedding Flash? The hosting is on Godaddy if that helps any.

Thanks!

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

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

发布评论

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

评论(2

〗斷ホ乔殘χμё〖 2024-08-23 23:11:42

默认情况下,WordPress.org 会阻止 SCRIPT/EMBED/OBJECT 标签。

您可以通过一些黑客手段禁用此功能,或者有一些插件提供自定义语法,例如 [youtube][/youtube],但更好的解决方案可能是升级到 WordPress 2.9,具有 oEmbed 支持

WordPress.org blocks SCRIPT/EMBED/OBJECT tags by default.

You can disable this with some hackery, or there are a few plugins that provide a custom syntax like [youtube][/youtube], but the better solution may be to upgrade to WordPress 2.9, which has oEmbed support.

没有你我更好 2024-08-23 23:11:42

我认为您的实际 Flash 影片的链接未正确链接。请记住,当您引用文件名时,您需要使用主题目录的正确路径。您这样做是为了加载 swfobject.js 文件,但不是为了加载 3dcarouseldev.swf。

将脚本中的以下行:更改

var so = new SWFObject("3dcarouseldev.swf", "3dcarouseldev", "780", "460", "8.0.0.0", "#ffffff"); 

为:

var so = new SWFObject("<?php bloginfo('template_directory'); ?>/3dcarouseldev.swf", "3dcarouseldev", "780", "460", "8.0.0.0", "#ffffff"); 

这将为您的 javascript 变量提供主题目录的完整路径。这假设您的 3dcarouseldev.swf 文件位于主题文件夹中(而不是子目录)。如果文件位于其他位置,则必须调整目录以指向正确的位置。

I think that the link to your actual flash movie is not linked correctly. Remember that when you reference a file name, you need to use the correct path to your theme directory. You've done this to load your swfobject.js file, but not for 3dcarouseldev.swf.

Change the following line in your script:

var so = new SWFObject("3dcarouseldev.swf", "3dcarouseldev", "780", "460", "8.0.0.0", "#ffffff"); 

to this:

var so = new SWFObject("<?php bloginfo('template_directory'); ?>/3dcarouseldev.swf", "3dcarouseldev", "780", "460", "8.0.0.0", "#ffffff"); 

This will give the complete path to your theme directory to your javascript variable. This assumes that your 3dcarouseldev.swf file is in your theme folder (and not a sub directory). If the file is somewhere else, you'll have to adjust the directory to point to the right place.

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