The official solution to get rid of the Flash object dotted box in the Web page _flash

Source: Internet
Author: User
Adobe official JS file content: (insert flash from the Dreamweaver editor, will automatically add the file in the site.) )

FileName:AC_RunActiveContent.js
v1.0
Copyright 2006 Adobe Systems, Inc. All rights reserved.
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 "onafterupdate":
Case "onbeforeupdate":
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;
}

Then add the following code in the head area of the page (the path of the JS file can be designed according to the actual situation):

<script language= "javascript" >ac_fl_runcontent = 0;</script>
<script src= "Ac_runactivecontent.js" language= "JavaScript" ></script>


The page needs to output flash where you add the following code (the red Word is the path of the Flash file, in the JS script method in the parameter of the path does not need to write a suffix, the Blue Word section represents the output control ID and name attribute):

<script language= "JavaScript" >
if (ac_fl_runcontent = 0)
{
Alert ("This page requires ac_runactivecontent.js.");
}
Else
{
Ac_fl_runcontent (
' codebase ', ' http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 ',
' Width ', ' 455 ',
' Height ', ' 495 ',
' src ', ' flash/testflash ',
' Quality ', ' high ',
' Pluginspage ', ' http://www.macromedia.com/go/getflashplayer ',
' Align ', ' Middle ',
' Play ', ' true ',
' Loop ', ' true ',
' Scale ', ' ShowAll ',
' Wmode ', ' window ',
' Devicefont ', ' false ',
' id ', ' Test ',
' bgcolor ', ' #000000 ',
' Name ', ' Test ',
' Menu ', ' true ',
' allowFullScreen ', ' false ',
' allowScriptAccess ', ' Samedomain ',
' Movie ', ' Flash/testflash ',
' Salign ', '
);
}
</script>
<noscript>
<object classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase= "http://download.macromedia.com/pub/ shockwave/cabs/flash/swflash.cab#version=8,0,0,0 "width=" 455 "height=" 495 "id=" "Test" align= "Middle" VIEWASTEXT>
<param name= "allowscriptaccess" value= "Samedomain"/>
<param name= "allowFullScreen" value= "false"/>
<param name= "movie" value= "flash/testflash.swf"/>
<param name= "Quality" value= "High"/>
<param name= "bgcolor" value= "#000000"/>
<embed src= "flash/testflash.swf" quality= "High" bgcolor= "#000000" width= "455" height= "495" name= "Test" align= " Middle "allowscriptaccess=" Samedomain "allowfullscreen=" false "Type=" Application/x-shockwave-flash "pluginspage=" Http://www.macromedia.com/go/getflashplayer "/>
</object>
</noscript>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.