Static publishing uses regular markup to embed the file to the document and also do checks with JavaScript that you can't make with regular markup alone. This is good as if you have customers that can't have JavaScript turned on (search engines, some portable devices...), the file will still show up (if they have the correct Flash plug-in installed). But if you have people on legacy/unpatched Internet Explorer (between April 2006 and April 2008) they will have the dreaded "click to activate" to interact with the Flash.
Dynamic publishing uses JavaScript to embed the Flash. This will get rid of the "click to activate" feature on old IE but if JavaScript is off the Flash will not be there at all.
Both methods have its advantages and inconvenients. In an utopic world we would all use the dynamic publishing method, but we (or at least some of us like me) are stuck with customers using really old systems with IE 6 (they would like to upgrade but they can't because of badly designed software that would cost 10K+$ to upgrade). I need to support legacy IE and want to get rid of the "click to activate" feature while supporting people with JavaScript off.
What about combining static and dynamic publishing methods? What about something like:
I showed that to an integrator and he told me I should use <object> and <embed> tags...
What would be the ultimate way to embed Flash to Web projects? A solution that:
Will work with JavaScript off (Flash embedded in alternate content)
Will pass the W3C validator
Will remove the "click to activate" on legacy/unpatched IE
Will use the Flash detection/auto-install of SWFObject
EDIT: Added bounty. Please, I don't want to see answers like "don't bother no one have JavaScript off nowdays" or "if javascript is off most likely Flash will be off too".
EDIT 2: The answer I'm looking for is the best way to embed Flash statically (with regular HTML tags). Over that, I will add dynamic publishing. Something like this that will work in all major browsers since IE 6 and that will pass W3C validation.
<head>
<script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script>
var flashVars = {};
var params = {};
params.allowScriptAccess = "always";
params.allowFullScreen = false;
params.bgcolor = "#1a1a1a";
params.wmode = "opaque";
var atts = {};
atts.id = "my-swf";
swfobject.embedSWF("my.swf", "my-swfobject", "100%", "100%", "10.1.0", "playerProductInstall.swf", flashVars, params, atts);
</script>
</head>
<body>
<div id="my-swfobject">
<!-- Any <object></object>, <embed></embed>, and everything else here will be rendered for users without JavaScript. If JavaScript is on, SWFObject will destroy div#my-swfobject and replace it with object#my-swf. -->
</div>
</body>
<head>
<script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script>
var flashVars = {};
var params = {};
params.allowScriptAccess = "always";
params.allowFullScreen = false;
params.bgcolor = "#1a1a1a";
params.wmode = "opaque";
var atts = {};
atts.id = "my-swf";
swfobject.embedSWF("my.swf", "my-swfobject", "100%", "100%", "10.1.0", "playerProductInstall.swf", flashVars, params, atts);
</script>
</head>
<body>
<div id="my-swfobject">
<!-- Any <object></object>, <embed></embed>, and everything else here will be rendered for users without JavaScript. If JavaScript is on, SWFObject will destroy div#my-swfobject and replace it with object#my-swf. -->
</div>
</body>
Let me know if this is what you're looking for. I can elaborate more if needed. You might also consider suggesting that your IE6 slaves install Google Chrome Frame: http://code.google.com/chrome/chromeframe/
我过去所做的是将 Flash 内容静态地放入 div 中(使用 object 和 embed 标签),然后让 SWFObject 在加载时覆盖该 div 的内容。这将尽可能接近您想要做的事情。
What I've done in the past is statically put my flash content in a div (using both object and embed tags), and then have SWFObject overwrite the contents of that div when it loads. This will be as close to what you want to do as you can get.
Is there a way to get your clients to install another browser (like Firefox) alongside their legacy one, and use IE6 for the legacy app and FF for yours?
there is no better option i think. this will work in IE , Mozilla and Webkit browsers and is xhtml valid. but there is no flash installer and no replacement.
发布评论
评论(7)
如果这就是您要找的,请告诉我。如果需要的话我可以详细说明。您还可以考虑建议您的 IE6 从属设备安装 Google Chrome 浏览器内嵌框架:http://code.google.com /chrome/chromeframe/
Let me know if this is what you're looking for. I can elaborate more if needed. You might also consider suggesting that your IE6 slaves install Google Chrome Frame: http://code.google.com/chrome/chromeframe/
在这里:
Here it is:
我过去所做的是将 Flash 内容静态地放入 div 中(使用 object 和 embed 标签),然后让 SWFObject 在加载时覆盖该 div 的内容。这将尽可能接近您想要做的事情。
What I've done in the past is statically put my flash content in a div (using both object and embed tags), and then have SWFObject overwrite the contents of that div when it loads. This will be as close to what you want to do as you can get.
采用动态发布。如果用户关闭了 javascript,则放弃。他们也不希望 Flash 运行。
Go with dynamic publishing. If the user has javascript turned off, give up. They won't want Flash to run either.
有没有办法让您的客户在旧浏览器旁边安装另一种浏览器(例如 Firefox),并使用 IE6 作为旧应用程序,使用 FF 作为您的应用程序?
Is there a way to get your clients to install another browser (like Firefox) alongside their legacy one, and use IE6 for the legacy app and FF for yours?
我会从 YouTube 等允许嵌入 Flash 的网站中得到启发。不确定这是否适用于非“电影”类型。
来自 YouTube:
I would take a cue from sites such as YouTube that allow embedding of Flash. Not sure if this will work for non "movie" types.
From YouTube:
我认为唯一的方法是做这样的事情:
我认为没有更好的选择。这适用于 IE、Mozilla 和 Webkit 浏览器,并且 xhtml 有效。但没有闪存安装程序,也没有替代品。
the only way i see, is doing something like this:
there is no better option i think. this will work in IE , Mozilla and Webkit browsers and is xhtml valid. but there is no flash installer and no replacement.