954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Reloading flash after setting wmode=transparent?

Hello,

I'm trying to write some javascript that will always allow me to float content over a flah player. To do this, the tag needs to have a tag added to set the wmode to transparent, and the tag needs to have the wmode attribute set to transparent also.

So the source will first look like:

<object width="560" height="340">
	<param name="movie" value="http://www.youtube.com/v/V6dScKlrDwU&hl=en_GB&fs=1&"></param>
	<param name="allowFullScreen" value="true"></param>
	<param name="allowscriptaccess" value="always"></param>
	<embed src="http://www.youtube.com/v/V6dScKlrDwU&hl=en_GB&fs=1&" 
			type="application/x-shockwave-flash" 
			allowscriptaccess="always" 
			allowfullscreen="true" 
			width="560" 
			height="340">
	</embed>
</object>


And I want the javascript to change it to:

<object width="560" height="340">
	<param name="movie" value="http://www.youtube.com/v/V6dScKlrDwU&hl=en_GB&fs=1&"></param>
	<param name="allowFullScreen" value="true"></param>
	<param name="allowscriptaccess" value="always"></param>
	<param name="wmode" value="transparent"></param>
	<embed src="http://www.youtube.com/v/V6dScKlrDwU&hl=en_GB&fs=1&" 
			type="application/x-shockwave-flash" 
			allowscriptaccess="always" 
			allowfullscreen="true" 
			width="560" 
			height="340"
			wmode="transparent">
	</embed>
</object>


The thing is, I currently have code that adds the parameters to the object and the embed tags, but I am unable to float content over the player. The javascript I currently have is:

function init(){
				var embedCollection = document.getElementsByTagName("embed");
				var objectCollection = document.getElementsByTagName("object");
				for(i=0;i<objectCollection.length;i++){
					var myParam = document.createElement("param");
					myParam.setAttribute("name","wmode");
					myParam.setAttribute("value","transparent");
					objectCollection[i].appendChild(myParam);
				}
				for(i=0;i<embedCollection.length;i++){
					embedCollection[i].setAttribute("wmode","transparent");
				}
			}
window.onload=init;


If I use Firebug to inspect the page after it has loaded, I can see that all the elements have been updated with the appropriate tags and attributes, but the floating content does not appear above the flash player. I'm sure the floating content is coded correctly, because if I hard code the tags and attributes into the HTML instead of using javascript, the floating content appears.

I've been told on an IRC chatroom that I need to find away to reload the flash player after I've added my new tags and attributes, so that its aware of the new tags and attributes.

Does anyone know how can I use javascript to force the flash player to reload itself?

Thanks for any help you can provide! :)

2eXtreme
Light Poster
35 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

Can anyone help me please?

2eXtreme
Light Poster
35 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

I'm too in search of script which simply updates the flash reloads/initiates it.

shastry_1985
Newbie Poster
3 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

May be you can create the element within a div and have the zindex of that div to the lower one.

rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
 

I got this, i used the method "innerHTML" just saving them in a variable and re-inserting the same causing the video to reload, since it's a fresh. And wmode now working in ff, chrome, safari.

Regards,
Shastry Chamarthi
[email]sathyanarayanasastry@gmail.com[/email]

shastry_1985
Newbie Poster
3 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

Thank you for quick reply.

Regards,
Shastry Chamarthi
[email]sathyanarayanasastry@gmail.com[/email]

shastry_1985
Newbie Poster
3 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: