Security related problems in Internet Explorer leads to special “feature” in this browser. This means, that your visitors need to click to activate the embedded SWF file. In many cases this is a unwanted behaviour. There is a simple tutorial about how to overcome click to activate requirement using JavaScript.
You will need a portion of JavaScript coding. This method requires an external JavaScript file and references to that file in the <head> and <body> tags of the HTML file. Content of required ac.js file is listed below. The only thing you need to do is edit your HTML content. Place link to the ac.js file in the head like this:
<head>
<title>Your site name</title>
<script src="ac.js" type="text/javascript"></script>
</head>The next step is to edit your object/embed within the <body> code. Use this JavaScript code:
<script type="text/javascript">
AC_FL_RunContent( 'codebase',
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0'
,'width','500','height','500','src','YOUR_SWF_FILENAME','quality','high','pluginspage',
'http://www.macromedia.com/go/getflashplayer',' YOUR_SWF_FILENAME ',
' YOUR_SWF_FILENAME ' );
//end AC code </script>Take care about the width, height and filename values in this code. Replace them with your own values. YOUR_SWF_FILENAME is a filename without .swf extension. For myanimation.swf it should be myanimation. Place this JavaScript ahead your object/embed. Then place your object/embed in the <noscript></noscript> tags, so the users without JavaScript enabled will use the original object/embed with the click to activate feature.
So, there is a listing of ac.js file, you will need:
function AC_AddExtension(src, ext)
{
if (src.indexOf('?') != -1)
return src.replace(/\?/, ext+'?');
else
return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs)
{
var str = '<object ';
for (var i in objAttrs)
str += i + '="' + objAttrs[i] + '" ';
str += '>';
for (var i in params)
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
str += '<embed ';
for (var i in embedAttrs)
str += i + '="' + embedAttrs[i] + '" ';
str += ' ></embed></object>';
document.write(str);
}
function AC_FL_RunContent(){
var ret =
AC_GetArgs
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash"
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
var ret =
AC_GetArgs
( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
, null
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
var ret = new Object();
ret.embedAttrs = new Object();
ret.params = new Object();
ret.objAttrs = new Object();
for (var i=0; i < args.length; i=i+2){
var currArg = args[i].toLowerCase();
switch (currArg){
case "classid":
break;
case "pluginspage":
ret.embedAttrs[args[i]] = args[i+1];
break;
case "src":
case "movie":
args[i+1] = AC_AddExtension(args[i+1], ext);
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;
case "onblur":
case "oncellchange":
case "onclick":
case "ondblClick":
case "ondrag":
case "ondragend":
case "ondragenter":
case "ondragleave":
case "ondragover":
case "ondrop":
case "onfinish":
case "onfocus":
case "onhelp":
case "onmousedown":
case "onmouseup":
case "onmouseover":
case "onmousemove":
case "onmouseout":
case "onkeypress":
case "onkeydown":
case "onkeyup":
case "onload":
case "onlosecapture":
case "onpropertychange":
case "onreadystatechange":
case "onrowsdelete":
case "onrowenter":
case "onrowexit":
case "onrowsinserted":
case "onstart":
case "onscroll":
case "onbeforeeditfocus":
case "onactivate":
case "onbeforedeactivate":
case "ondeactivate":
case "type":
case "codebase":
ret.objAttrs[args[i]] = args[i+1];
break;
case "width":
case "height":
case "align":
case "vspace":
case "hspace":
case "class":
case "title":
case "accesskey":
case "name":
case "id":
case "tabindex":
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
break;
default:
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
}
}
ret.objAttrs["classid"] = classid;
if (mimeType) ret.embedAttrs["type"] = mimeType;
return ret;
}
Recent comments
15 hours 42 min ago
16 hours 2 min ago
16 hours 8 min ago
1 week 4 days ago
5 weeks 20 hours ago
8 weeks 2 days ago
8 weeks 6 days ago
10 weeks 1 day ago
11 weeks 6 days ago
12 weeks 4 days ago