views:

746

answers:

3

Scenario: You have a SWF file with a built-in click event that takes you to a certain web page. You want to use that SWF file (source isn't available), but have the click event take you to a different web page. Wrapping the embedded SWF in an anchor tag and setting the swf to wmode=transparent only seems to work in FF, not IE, and since the website in question caters to a non-tech-savvy crowd, IE compatibility is pretty important.

What settings need to be changed such that the anchor tag will be respected in a browser compatible way?

A: 

If you've asked this question few months ago, I would tell you to put transparent gif in front of the swf, but these days it's could be considered clikljacking and noscript and some antivirus tools may go berserk when they see it. (on the other hand, may not, because that transparent image will be directly in <a> tag, and if swf "accidentally" goes beneath it, well... no big deal)

Slartibartfast
A: 

Try using a very high z-index for the clickable part. By default, Flash in IE places itself very high in the stacking order, causing all clicks to go to it by default. Judging by http://www.webmasterworld.com/css/3639440.htm, 99 should do it, but remember that the actual z-index used by Flash could have changed since that post (if there's a maximum value for the z-index, they could be using that now, making it impossible - that would depend on the implementation, I believe).

Also, test with other browsers AND on other operating systems. Behavior may differ.

IE8 has new Clickjacking protection, but I don't think it will affect this scenario. You may want to look at http://blogs.msdn.com/ie/archive/2009/01/27/ie8-security-part-vii-clickjacking-defenses.aspx before deciding to go down this route, just in case.

Michael Madsen
+1  A: 

Create your own flash app, which embeds the main SWF, and puts a transparent sprite on top of it to capture the mouse clicks. You could pass the target URL in a parameter.

David Hanak