PDA

View Full Version : <object> tag within <a> tag...


edtsch
10-26-2006, 06:29 PM
It doesn't work, apparently, to surround an object tag with an <A> tag to turn the whole movie into a link. I feel silly asking such a simple question, but the obvious is escaping me.

Anyone know what HTML to use to turn the entire movie into a link? I don't want to add anything within the SWF itself. I want to be able to pull up a simple, actionscript-less animation that someone else has made.

I also tried wrapping the <object> tag with <div onclick="javascript:location.href='whatever.html'>...</div> but that didn't work either.

I'm using an external JS file to write the aforementioned code to the innerHTML of a div tag on my page, so as to avoid the EOLAS "click to activate..." message.

:confused:

edtsch
10-27-2006, 05:41 PM
Let me rephrase the question, which may or may not be a flash-specific issue:

If I try to work around this problem by using the legitimate onclick handler of the object tag itself, it still doesn't work. Flash seems to capture the mouse events and the object tag's onclick handler never fires.

Anyone have any wisdom on Flash and/or event bubbling that might address this issue?

duncanhall
10-30-2006, 12:09 PM
Try this:

Embed the flash object into the page as you are doing at the moment, but without any anchor tags or onClick stuff.

Using the css z-index attribute, create an invisible div that sits on top of the swf, and then make this div a link to whatever you want.

edtsch
10-30-2006, 03:17 PM
Thanks for the idea. Turns out I've already given up and am passing the info to the flash movie so that it can use a mouse event handler.

I'll give it a try, but I doubt highly that it will work. Previous experiments with z indeces and active content like flash movies has always resulted in the active content being on top, no matter what the z index. Inherent problem with the way browsers display the active content.

duncanhall
11-01-2006, 12:38 PM
I've never tried to do exactly what you want, but Ive manipulated swf z-index levels before without problems. Just make sure you give each element a "position:" attribute, otherwise z-index has no effect.

edtsch
11-01-2006, 03:42 PM
I've never tried to do exactly what you want, but Ive manipulated swf z-index levels before without problems. Just make sure you give each element a "position:" attribute, otherwise z-index has no effect.
I'll give it a try. I don't recall setting the position attribute, so that might be why it hasn't worked for me in the past. CSS is funny like that sometimes.

edtsch
11-01-2006, 06:55 PM
Well, I tried it, but I still can't get a CSS div to show over active (swf) content. For example:
<div style="position:absolute; top:100px; left:100px; width:100px; height:100px; background-color:#FF00FF; z-index:22"></div>
<div style="position:absolute; top:100px; left:100px; z-index:11">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="279" height="215">
<param name="movie" value="moviename.swf">
<param name="quality" value="high">
<embed src="moviename.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="279" height="215"></embed>
</object>
</div>
The CSS box displays underneath the flash movie. I'm testing this in Firefox so I can simplify and bypass the EOLAS fix for now.

If any of you have ever been able to make a CSS div show up on top of a flash movie, will you please post example code so I can see how it's done?