在嵌入式Flash文件周围添加链接

JWM*_*JWM 15 html css flash clicktag

我想这样做,当我点击嵌入式Flash元素的任何地方时,它会将我带到目标网址.

这是我当前的代码,它不会产生预期的效果:

<div class="contentdiv" style="margin:-72px 0 10px 0px; cursor:pointer;" onclick="location.href='http://example.com/';">

<object height="410" width="720">
<param name="movie" value="images/tri.swf">
<embed src="images/tri.swf" height="400" width="700"> 
</embed>
</object>

</div>
Run Code Online (Sandbox Code Playgroud)

现在,它使.swf文件后面的空间可以单击链接,但Flash元素不可点击.

如果正确的做法是以某种方式编辑.swf文件,请告诉我.我不认为自己是Flash开发人员,但是有没有关于从哪里开始的资源或者如何使用现有的.swf文件执行此基本操作?

任何建议都非常感谢!

小智 14

我有同样的问题,找到了这个帖子,但最终创建了我自己的解决方案.

我在链接中添加了透明元素,然后使其与嵌入的swf重叠

<a href="http://example.com/" target="_blank">
  <object height="410" width="720"><param name="movie" value="http://www.theslap.com/swf/slap_logo.swf">
    <embed src="http://www.theslap.com/swf/slap_logo.swf" height="400" width="700"></embed>
  </object>
  <i style="display:block; height: 410px; width: 720px;  position: relative; z-index: 9; margin-top: -410px;"></i>
</a>
Run Code Online (Sandbox Code Playgroud)

注意 - 您应该将css包含在生产代码的单独文件中.


Ric*_*lis 6

更多研究后更新:

之前已经问过这个问题,最好的答案是你必须在flash中创建链接.

通常,这是通过将参数(通常命名为clickTAG)传递给.swf来动态完成的,以告诉它链接到哪里.

在你的情况下(因为其他人提供了你的swf文件)我可以看到2个选项:

  1. 您的.swf作者可能已经实现了clickTAG方法(您可以询问它们,或者只是在.swf上试一试,看它是否有效.)
  2. 您可以创建一个实现clickTag的flash包装器文件,并让它加载并显示您的.swf文件.我知道这似乎是一个黑客,但我看不到任何其他选择.

希望这可以帮助!


我也见过这样的东西[编辑:但是我无法让它起作用!谷歌搜索表明这是不可能的]

<a href="http://example.com/" target="_blank">
 <object height="410" width="720"><param name="movie" value="images/tri.swf">
 <embed src="images/tri.swf" height="400" width="700"></embed>
 </object>
</a>
Run Code Online (Sandbox Code Playgroud)

(例如这里)