Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink a flash object in IE7/IE8 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I seem to be going round in circles trying to find a way to hyperlink a flash banner object.

I've tried wrapping it in an anchor, a div with an onclick, placing onlick on the object.

Nothing I try seems to work.

I see conflicting statements on the web saying to do what I've done claiming it woks, but I can't get it to, with others stating it is not possible and the hyperlink has to be included in the flash object itself.

this is what I have...

Code:
                <a href="<tmpl_var name='url_to_cgi'>/track_it.pl?USER=<tmpl_var name='user'>&FA=TRK&DESC=Exeter Family June 2013&URL=https%3A%2F%2Fdocuments.exeterfamily.co.uk%2FBrochure.ashx%3Fcode%3DSACS%20" target="_blank">
                <div style="float:right; width:45%; z-index:99999;" onclick="window.open('<tmpl_var name='url_to_cgi'>/track_it.pl?USER=<tmpl_var name='user'>&FA=TRK&DESC=Exeter Family June 2013&URL=https%3A%2F%2Fdocuments.exeterfamily.co.uk%2FBrochure.ashx%3Fcode%3DSACS%20');" >
                    <object style="z-index:1;" type="application/x-shockwave-flash" title="Double click for brochure." width="400" height="70" data="<tmpl_var name='url_to_domain'>/images/banners/claims_leaderboard.swf" onclick="window.open('<tmpl_var name='url_to_cgi'>/track_it.pl?USER=<tmpl_var name='user'>&FA=TRK&DESC=Exeter Family June 2013&URL=https%3A%2F%2Fdocuments.exeterfamily.co.uk%2FBrochure.ashx%3Fcode%3DSACS%20');">                
                        <param name="movie" value="<tmpl_var name='url_to_domain'>/images/banners/claims_leaderboard.swf" />
                        <param name="wmode" value="transparent" />
                    </object>
                </div></a>

If I click anywhere over the flash object nothing happens in IE7/IE8

In IE10 , if I double click, three windows open!

What I do notice is when I hover over the flash object in IE8 is the status bar shows the URL of the hyperlink (as hyperlinks normally do), so the browser is recognising the anchor, but I guess flash is receiving the click event not the browser?

What am I doing wrong?

Thanks,
1DMF.

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Free Dance Music Downloads
 
I guess flash is receiving the click event not the browser?
Yep.

<object> elements are always at the top of the stacking order because they are are "windowed" elements handled by the OS rather than the browser.

And yes the only way to make it work reliably across browsers and operating systems is to have the onclick event handled by the flash object directly.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top