views:

2708

answers:

3

I have a html div layered on top of an interactive flash movie, but when the mouse moves over the div, it can't interact with the flash (the view changes as the mouse moves or is clicked). Is there a way to have the flash recieve the mouse movements and clicks but leaving the html visible?

I can't modify the flash SWF file.

Edit: To make it clearer, this is an layer of information sitting on top of Google Street View (flash), the trouble is that I can't move the street view around where the layer overlaps.

+1  A: 

Try something like this:

<object> 
    <param name="wmode" value="transparent" /> 
    <embed src="example.swf" wmode="transparent"></embed> 
</object>

The main things to note are the <param /> tag with the transparent attribute, and the wmode="transparent" in the embed tag. You'll also need to run the following javascript code to make this work across all browsers:

theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++) {
    theObjects[i].outerHTML = theObjects[i].outerHTML;
}

This code should be run when the document is loaded. The site I got this code from claims that it must be run from an external file in order to work (although I haven't tested that).

I got this answer from here, where you can get more detail and a working example:
http://www.cssplay.co.uk/menus/flyout_flash.html

Dan Herbert
Thanks, but it's not quite what I'm looking for. The problem is not getting the html to sit over the top of the flash, but to do it without stopping the flash (Google Streetview) receiving mouse motion.
Steve X
+1  A: 

I believe the short answer is: No.

Sorry.

However, If you had complete control over how the Flash object is authored - you might be able to expose a public API to the javascript - allowing it to "manually" forward live mouse-coordinate, and mouse-button information into the flash, as you operate the mouse on top of the HTML overlay.

It might be worth checking, if Google's street-view Flash object exposes a public javascript API that might allow you to take some control of the flash - based on mouse-events picked up by your HTML overlay.

Expect the skies to fall, if you try this. :-)

Már Örlygsson
A: 

should be aware that wmode=transparent will kill use of scroll wheel in firefox. this is true even in FP10

Scott Evernden