[SWFObject] Flash object as hyperlink

David de Kock |TNmedia david at tnmedia.nl
Wed Sep 20 06:17:20 PDT 2006


I think what he means is (Aran, pls correct me when I'm wrong) that you
first have to write out the div containing the flash object and than
append the onclick event by DOM manipulation.

For non-IE browsers you can do this with:

Document.getElementById("adiv").setAtribute("onclick",
"javascript:location='http://some.com'")

But that won't work in IE for some weird reason.

Use this instead (=cross-browser):

Document.getElementById("adiv").onclick = function(){
window.location='http://some.com'; }

David

Ps. This stuff is not really SWFobject related.


-----Original Message-----
From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Dave Pollak
Sent: woensdag 20 september 2006 14:27
To: swfobject at lists.deconcept.com
Subject: Re: [SWFObject] Flash object as hyperlink


I tried Aran's solution but with the same effect that I got when I 
simply surrounded the <div> with anchor tags. The cursor changed to a 
link pointer and the link worked but only on the blank space in the 
<div> not over the flash banner.

I don't know what it means to

make sure the flash has been written before
applying the link to your <div>
.



Aran Rhee wrote:
> Hi all.
>
> Back in July, I posted this solution to the same question. You can 
> make the contents of a div a link like below. I used CSS to change the

> cursor as expected on a link.
>
>
> <style type="text/css">
> 	div.linkdiv {cursor:pointer;}
> </style>
>
> <body>
> <div class="linkdiv" onclick="javascript:location='http://some.com'"
> id="adiv"> ... stuff goes here ...
> </div>
> </body>
>
>
> BTW - you might want to check to make sure the flash has been written 
> before applying the link to your <div>
>
>
> Cheers,
> Aran
>
>  
>
>   
>> -----Original Message-----
>> From: swfobject-bounces at lists.deconcept.com
>> [mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of 
>> Dave Pollak
>> Sent: Wednesday, 20 September 2006 5:08 AM
>> To: swfobject at lists.deconcept.com
>> Subject: [SWFObject] Flash object as hyperlink
>>
>> I've got swfobject working so my flash object displays
>> without  the annoying 'click to activate...' tool tip however 
>> I also want the object to be a hyperlink.
>>
>> I put anchor tags around the 'flashcontent' <div>. Blank
>> space within the <div> is hyperlinked but the object itself 
>> is not. On mouseover of the object the cursor changes back to 
>> a pointer.
>>
>>
>> _______________________________________________
>> SWFObject mailing list
>> SWFObject at lists.deconcept.com 
>> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>>     
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com 
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>
>
>   
_______________________________________________
SWFObject mailing list
SWFObject at lists.deconcept.com
http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.5/451 - Release Date:
19-9-2006
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.5/451 - Release Date:
19-9-2006
 




More information about the Swfobject mailing list