views:

1733

answers:

2

Hello

How to prevent Javascript Menu from getting hidden under Flash Video (SWFObject ).

I am using Open Flash Chart and the chart is displaying fine in my php shoppping cart, but my javascript menu is getting hidden behind the Flash Chart.

How to correct this problem?

Here is my script code:


<script type="text/javascript">

swfobject.embedSWF(
  "open-flash-chart.swf", "Dashboard_Chart",
  "800", "400", "9.0.0", "expressInstall.swf",
  {"data-file":"ofc-chart.php"} );

</script>


UPDATE (Solved):

I found the solution.

Here is my new code which works and the menu shows up fine.


<script type="text/javascript">
    var flashvars = {};
    var params = {};
    params.wmode = "opaque";
    var attributes = {};
    swfobject.embedSWF("../swf/open-flash-chart.swf", "Dashboard_Chart", "760", "300", "9.0.0", "expressInstall.swf", {"data-file":"ofc-chart.php"}, flashvars, params, attributes );

</script>


+2  A: 

Try setting the wmode parameter to transparent

swfobject.embedSWF("open-flash-chart.swf", "Dashboard_Chart","800", "400", "9.0.0",
   "expressInstall.swf",
   {"data-file":"ofc-chart.php"},
   {"wmode":"transparent"}
);
Rafael
Thanks, your solution also worked. And it was less verbose :)
Ibn Saeed
A: 

You need to set the wmode to opaque (or transparent). This delegates rendering to the browser and allows z-index elements to sit above the Flash content. Example:

<script type="text/javascript">
var flashvars = {};
var params = {};
params.wmode = "transparent"; 
//params.wmode = "opaque"; 
var attributes = {};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120",
    "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>

Comes with a number of disadvantages, such as broken internationalisation and slower rendering speed, but it will get the Flash under your menu.

spender
I used opaque and i did not notice any delay with the flash. The adobe help shows:#Opaque: makes the application hide everything behind it on the page. -----#Transparent: makes the background of the HTML page show through all the transparent portions of the application and can slow animation performance.
Ibn Saeed