views:

60

answers:

1

Hi,

i need to propagate a click from an invisible div to an embeded flash (the two are superposed).

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="800" height="600">
            <param name="src" value="pub.swf">
            <param name="quality" value="high">
            <param name="wmode" value="opaque">
            <embed src="flash.swf" bgcolor="#CC0000" wmode="opaque"quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="225" height="150"></embed>
        </object>
        <div id="div"></div>

My objects are both well positioned, but I really don't succeed in transmitting the click from the top div to the embeded flash.

Any idea ?

Thanks for your time.

+1  A: 

Plugin events are separate from HTML. You can't catch an HTML click event from Flash and you can't catch a Flash click event from HTML.

You would have to alter the code of the flash.swf to provide an external method that simulated a click in the flash movie. eg. using dispatchEvent. You could then call this method from JavaScript in the HTML document when the invisible div was clicked.

bobince
Thanks for your answer, but is there another method if you don't have access to the flash source code (my case)
Cyril
Sorry, no. (Some people might see this as a deliberate feature, eg. advertisers don't want you messing with their ads.)
bobince