Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help needed with swfobject.js and wmode=transparent

Status
Not open for further replies.

okiiyama

IS-IT--Management
Jan 3, 2003
269
US
Hopefully someone else has ran into this issue...
On our company's homepage, I've got a flash object that is now sitting below a drop down menu. I need to have the flash element stay behind the drop down menu when the menu appears.( The offending menu is from the top horizontal nav "Find a Home". (Should work in IE not in FF).

I found that wmode=transparent should fix this problem, but since flash is being written to the page from the js file, I am a bit unsure where to add it. So far I've put the wmode=transparent within the code below (Just a snippet of the swfobject code that I got from
Code:
var _1c="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
	if(this.getAttribute("doExpressInstall")){
		this.addVariable("MMplayerType","PlugIn");
	}
	_1c="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
	_1c+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
	var _1d=this.getParams();
	for(var key in _1d){
		_1c+=[key]+"=\""+_1d[key]+"\" ";
	}
	var _1f=this.getVariablePairs().join("&");
	if(_1f.length>0){
		_1c+="flashvars=\""+_1f+"\"";
	}
	_1c+="/>";
}else{
	if(this.getAttribute("doExpressInstall")){
		this.addVariable("MMplayerType","ActiveX");
	}
	_1c="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
	_1c+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
	var _20=this.getParams();
	for(var key in _20){
		_1c+="<param name=\""+key+"\" value=\""+_20[key]+"\" />";
	}
	var _22=this.getVariablePairs().join("&");
	if(_22.length>0){
		_1c+="<param name=\"flashvars\" value=\""+_22+"\" />";
	}
}

//Here is the code I've added
_1c+="<param name=\"wmode\" value=\"transparent\" />";
_1c+="<param name=\"embed\" value=\"transparent\" />";
//End of the code I've added

_1c+="</object>";
return _1c;
adding the code there fixed it for IE, but certain versions of firefox still don't work.

Is there a better place in the code to add the parameter or is there something I need to do to the flash file?

Thanks.
 
I'm ashamed that I'd rather spend the 5 to 10 minutes writing out the question than to spend the 30 seconds searching for the answer on the web...

After a google search, the answer seems to be:

within the javascript code on my page add:
fo.addParameter("wmode", "transparent");

So it looks like:
Code:
<script type="text/javascript"> 
var fo = new FlashObject("[URL unfurl="true"]http://xwy.abc.com/mymovie.swf","mymovie","460","175","7","#ffffff");[/URL] 
fo.addParameter("wmode", "transparent");
fo.write("flashcontent"); 
</script>
 
Well, its not addParameter(...) its addParam() ... Now everything is proper.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top