将 SWFObject 设为链接?
是否可以使用 swfObject 与 .swf flash 文件建立链接?
我希望整个视频成为一个可点击的链接...我不知道如何实现它。
如果您访问此处:http://us.burberry.com/store/menswear/brit/jackets/prod-10000020849-packable-two-in-one-parka/sku-37604181001/ ,在左边的缩略图上,你看到他们是如何得到一个 swf 对象作为链接的吗?
有人知道这背后的原理吗?我该怎么做呢?似乎无论我在 Flash 上放置一个 div,我的浏览器都不会响应单击。
我真的很想得到这方面的帮助,谢谢!
编辑:我无法直接在Flash文件中建立链接,因为1.我没有项目文件2.我需要在链接中回显PHP代码
Is it possible to make a link with a .swf flash file, using swfObject?
I would like the entire video to be a clickable link... I'm out of ideas on how to make it happen.
If you go here: http://us.burberry.com/store/menswear/brit/jackets/prod-10000020849-packable-two-in-one-parka/sku-37604181001/
, on the left thumbnails, do you see how they got a swf object to be a link?
Anyone know the principle behind this? How would I do it? It seems like however I lay a div over the flash, my browser will not respond to the click.
I would really like help on this, thank you!
Edit: I cannot make a link directly in the flash file, because 1. I dont have the project file 2. I need to echo PHP code in the link
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这就是该页面完成此操作的方式(简化):
http://jsfiddle.net/xBzWv/1/
本质上,z-index 是 auto 并且元素是绝对定位的,因此元素流 (div[object]->a) 允许下一个元素具有比前一个元素“更高”的 z-index包含 目的。
此示例适用于 FF5。我相信这可能是某些浏览器/版本(IE6,也许其他)中的问题,需要替代方法将对象放置在正确的 z-index 位置。
编辑
事实上,在 IE (9) 中,上述内容不起作用。
编辑
IE 使用 Flash 对象,并且使用 IE 的
方法。然而,由于某种原因,这个小提琴 http://jsfiddle.net/xBzWv/11/ 仍然不是在职的。
This is how that page accomplishes that (simplified):
http://jsfiddle.net/xBzWv/1/
Essentially, the z-index is auto and the elements are positioned absolutely, so the flow of the elements (div[object]->a) allows the next element to have a "higher" z-index than the previous element that contains the object.
This example works in FF5. I believe this may be a problem in some browsers/versions (IE6, maybe others), that need alternative methods to put an object in it's correct z-index position.
EDIT
In fact, in IE (9) the above does not work.
EDIT
IE is using a Flash object, and is using the
<param NAME="wmode" VALUE="transparent">
approach for IE. However, for some reason this fiddle http://jsfiddle.net/xBzWv/11/ is still not working.并不真地。最好的办法是在视频上绝对放置
标记(包含 swfObject 的元素的
z-index
必须低于 <代码> 标签)。Not really. Your best bet is to absolutely position an
<a>
tag over the video (thez-index
of the element that contains the swfObject must be lower than that of the<a>
tag).为了创建一个适用于所有浏览器的解决方案,我将创建一个在视频 SWF 中加载的包装器 SWF。然后,您可以在视频文件上方放置一个按钮,并使用ExternalInterface 让它回调到页面,或者使用FlashVars 从PHP 传递所需的信息。
To make a solution that works in all browsers I would create a wrapper SWF that loads in the video SWF. You can then place a button above the video file, and either have it call back to the page using ExternalInterface or pass in the required info from PHP using FlashVars.