I'm nearing completion of my gadget, but I have one last feature which is stalling me.
My gadget is using an ActiveX control to stream video from a webcam.
Everything is working great, however I'm running into the old problem
of not being able to catch onclick events on the <object> tag.
My workaround so far has been to use onmouseover, which works fine, but
it is less than perfect.
While messing around with g:background, however, I noticed that if the
z-index is higher than the z-index of the ActiveX object, I suddenly
can right-click on the object and get the normal gadget context menu.
Usually, that does not work. Also, the onmouseover event on the object
stops firing, which leads me to believe that in some way the
g:background is layering over the object. However, setting up onclick
events with g:background still doesn't get me anywhere.
Does anyone have any idea why g:background seems to have this
pseduo-functionality? It seems odd to me that placing it over the
object gives me partial functionality, while still not letting me catch
the mouse events.
I presume onmousemove/onmouhappywn/onmouseup events still fire, you could try tracking the mouse with them, but you'd need to manually check for the mouse being over the elements. I've not tried it, so it may not work.
I have been able to use onclick= in the HTML of the g elements without any problems. I can also define gelement.onmouhappywn = in the JavaScript and it works fine as well, so it seems like they pick up the events without any issues. My real problem is getting the <object> tag to pick them up.
In thinking about this more, it appears that I'm suffering the same problem many others have had with how the Sidebar handles transparency. That is, I am getting the exact same behavior as someone who is trying to capture mouse events over the transparent parts of backgrounds. You can left click and drag, you can right click and get the context menu, but you can't capture any mouse events in the code. This makes some sense to me if I think of it as the gbackground element layering over my <object> but making itself transparent wherever the overlap occurs.
I don't think it's going to be productive to try and use g:background to solve any event-driven issues you have; I'd rather figure out why onclick isn't working on the <object> tag. Is this something that works OK if you try it in IE?