Javascript and dynamic setting wmode to transparent for flash objects

B

BerlinBrown

I am having an issue with setting wmode to transparent for a flash
object. Basically, there are pages within an iframe that I cannot
manually set with regular html. But I must use javascript to iterate
when object is found and then add the dynamic wmode = transparent. It
looks like my code should work, when I check it firebugs. When the
setting is set, it shows up in the Firefox firebugs javascript DOM,
but the effect I want doesn't work.

Basically, I am setting wmode to transparent to allow javascript menus
to overlap flashobjects.

This code is what is shown in javascript dom, and this is what my
javascript code does. If I manually hard code this into the html
file, then I get what I want. but dynamically, the effect of the
javascript menus don't work.

<object width="525" height="300" codebase="https://
download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=7,0,19,0" classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000">
<param value="swf/file.swf" name="movie"/>
<param value="high" name="quality"/>
<embed width="200" height="300" type="application/x-shockwave-flash"
pluginspage="https://www.macromedia.com/go/getflashplayer"
quality="high" src="swf/file.swf" wmode="transparent"/>
<param name="wmode" value="transparent"/>
</object>

Here is my javascript code (pseudo code, I removed some stuff):

function makeOnloadDoubleDelegate(function1, function2) {
return function() {
if (function1) {
function1();
}

if (function2) {
function2();
}
}
}

function otherInits() {
var bottom_doc = document;
if (bottom_doc && bottom_doc.getElementsByName) {
// Find all 'object' tags in the document.
flashObjects = bottom_doc.getElementsByTagName('object');
for (var i = 0; i < flashObjects.length; i++) {
var flashNode = flashObjects[0];
var paramNodes = flashNode.getElementsByTagName('param');
if (flashNode && paramNodes) {
var new_elem = bottom_doc.createElement('PARAM');
new_elem.setAttribute("name", "some_parm");
new_elem.setAttribute("value", "data");
flashNode.appendChild(new_elem);

// For testing, check the param nodes
//for (var j = 0; j < paramNodes.length; j++) {
// var pNode = paramNodes[j];
//}
} // End of If
} // End For
} // End of If
}

window.onload = makeOnloadDoubleDelegate( window.onload,
otherInits );
 
S

Stevo

BerlinBrown said:
I am having an issue with setting wmode to transparent for a flash
object.

You can't set wmode dynamically. That parameter is only read at object
instantiation time. You can add it and change it all you like, but it
won't have any effect on the object itself. Even if you ask the object
it's value, it might tell you the new value you set, but it won't have
made any difference to it.
 
B

BerlinBrown

You can't set wmode dynamically. That parameter is only read at object
instantiation time. You can add it and change it all you like, but it
won't have any effect on the object itself. Even if you ask the object
it's value, it might tell you the new value you set, but it won't have
made any difference to it.

Would it make any sense to recreate the object? taking all of the
parameters and rebuilding it?
Also, where did you get that information, I couldn't find anything
about it on the web. Especially as it relates to flash objects.
 
S

Stevo

BerlinBrown said:
Would it make any sense to recreate the object? taking all of the
parameters and rebuilding it?
Also, where did you get that information, I couldn't find anything
about it on the web. Especially as it relates to flash objects.

Yes recreating the object with the alternate wmode value would work just
fine. I got that information from someone at Adobe.
 
D

David Mark

I am having an issue with setting wmode to transparent for a flash
object.  Basically, there are pages within an iframe that I cannot
manually set with regular html.  But I must use javascript to iterate
when object is found and then add the dynamic wmode = transparent.  It

You mean wmode=opaque.
looks like my code should work, when I check it firebugs.  When the
setting is set, it shows up in the Firefox firebugs javascript DOM,
but the effect I want doesn't work.

There's nothing you can do about that.
Basically, I am setting wmode to transparent to allow javascript menus
to overlap flashobjects.

Hide the Flash movie when menus are shown and display it again when
they hide.
This code is what is shown in javascript dom, and this is what my
javascript code does.  If I manually hard code this into the html
file, then I get what I want.  but dynamically, the effect of the
javascript menus don't work.

<object width="525" height="300" codebase="https://
download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=7,0,19,0" classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000">
<param value="swf/file.swf" name="movie"/>
<param value="high" name="quality"/>
<embed width="200" height="300" type="application/x-shockwave-flash"
pluginspage="https://www.macromedia.com/go/getflashplayer"
quality="high" src="swf/file.swf" wmode="transparent"/>
<param name="wmode" value="transparent"/>
</object>

XHTML with an embed tag?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top