我想做的是,当我点击嵌入的 Flash 元素上的任意位置时,它会将我带到目标 URL。
这是我当前的代码,它没有产生预期的效果:
<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>
现在它正在使 .swf 文件后面的空间可以点击链接,但 Flash 元素不可点击。
如果正确的做法是以某种方式编辑 .swf 文件,请告诉我。我不认为自己是 Flash 开发人员,但是是否有关于从哪里开始或如何使用现有 .swf 文件执行此基本操作的任何资源?
非常感谢任何建议!
最佳答案
我遇到了同样的问题,找到了这个线程,但最终创建了我自己的解决方案。
我在链接中添加了透明元素,然后使其与嵌入的 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>
注意 - 您可能应该将 css 包含在用于生产代码的单独文件中。
关于html - 在嵌入式 Flash 文件周围添加链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2119296/