Friday, 14 September 2007

No more "Click to activate and use this control"

Well, I kind of know this trick for ages (really long long time ago). Actually most of the big websites now have changed their code so the annoying "Click to activate and use this control" for objects like flash does not appear anymore. All you have to do, is to have a javascript funcition for creating the object in an external js file. Use the script in your html and call the function to write the object out, like what Sony, Samsung, etc does.

See also : No more "Click to activate and use this control" (2)

Or, like my wedding website (sorry for being budget not having my own domain but rely on blogspot), have external header and footer generation functions, but leave the middle part inside the html. I can't remember why did I do that, but I did.

Anyway a js file with a function like this and call the function in your html will do:

function CreateObject(){
document.write(' <OBJECT id="WeddingHP4.swf");
document.write(' codeBase="...');
document.write(' height="470" width="700" align="middle" classid="..." style="border:solid 2px #FFCECC"');
document.write(' VIEWASTEXT>');
document.write(' <PARAM NAME="Movie" VALUE="WeddingHP4.swf"');
document.write(' <PARAM NAME="Src" VALUE="WeddingHP4.swf">');
document.write(' <embed src="WeddingHP4.swf" quality="high" bgcolor="#ffffff" width="800" height="470" name="WeddingHP4.swf" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="..."> </embed>');
document.write(' </OBJECT>');
}

No comments:

Post a Comment