Make a SWFObject a Link?
Is it possible to make a link with a .swf flash file, using swfObject?
I would lik开发者_Python百科e 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
This is how that page accomplishes that (simplified):
.video-thumb-holder,
.video-link {
position: absolute;
}
.video-link {
display: block;
width: 54px;
height: 96px;
}
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.
Not really. Your best bet is to absolutely position an <a>
tag over the video (the z-index
of the element that contains the swfObject must be lower than that of the <a>
tag).
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.
精彩评论