Flash embedding

monoVertex

I'm back!
Reaction score
460
Ok, I know how to put a flash file on a webpage. But, if you use IE (6 or below no idea about 7), you know that you must click the flash or to press space to use it first. However, I've seen a couple of websites on which this doesn't happens. Blizzard's sites for example. Anyone has an idea how do they do it? Thanks in advance!
 

mase

____ ___ ____ __
Reaction score
154
I remember finded a javascript code that automattically initiates the flash. Give me a few and I might be able to find it.

-Edit-
Newgrounds FTW

HTML:
<script language="javascript">

	var required_version = 9;
	var maximum_version = 9;
	var this_version = 3;
	var display_notice = false;

	for(var i=2; i<=maximum_version; i++)
	{
		eval("var versions" + i + " = false");
	}

	if((version_status == 1) && (navigator.appVersion.indexOf("MSIE") != -1) && (navigator.appVersion.toLowerCase().indexOf("win") != -1))
	{
		document.write('<SCR' + 'IPT LANGUAGE="VBScript"\> \n');
		document.write('on error resume next \n');
		for(var i=2; i<=maximum_version; i++)
		{
			document.write('versions' + i + ' = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + i + '"))) \n');
		}
		document.write('<\/SCR' + 'IPT\> \n');
	}

	function SniffSniff()
	{
		if(navigator.plugins)
		{
			if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"])
			{
				var v2 = "";
				if(navigator.plugins["Shockwave Flash 2.0"])
				{
					v2 = " 2.0";
				}
				var fs = navigator.plugins["Shockwave Flash" + v2].description;
				var fv = parseInt(fs.substr(16,fs.length));
				eval("versions" + fv + " = true;");
			}
		}

		for(var i=2; i<=maximum_version; i++)
		{
			if (eval("versions" + i) == true)
			{
				this_version = i;
			}
		}

		if(this_version < required_version)
		{
			display_notice = true;
		}
	}
</script>
<body onload="SniffSniff()">
</body>

You might want to change the function name so you don't get in trouble with NG
 

monoVertex

I'm back!
Reaction score
460
Meh, doesn't works :p. I changed the function and added the onload in the body tag, but I still have to click the flash in IE. But leave it, I'll survive xD. Thanks, anyway :).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top