我正在改编Flash页面以在Flash不可用时显示替代内容,但是,它使用的方法对于包含大量内容的完整替代页面并不是很理想。当前,替代内容的提供方式如下:
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) { // if we've detected an acceptable version
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js. In Flash, run \"Apply Active Content Update\" in the Commands menu to copy AC_RunActiveContent.js to the HTML output folder.");
} else {
// embed the flash movie
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0',
'width', '1000',
'height', '688',
'src', 'wot',
//etc, etc...
); //end AC code
}
} else { // flash is too old or we can't detect the plugin
var alternateContent =
'<p> </p>'
+ '<p>This website requires a newer version of the Adobe Flash Player.</p>'
+ '<p> </p>'
+ '<p> </p>'
+ '<p><a href="http://www.macromedia.com/go/getflash/">Get the Latest Flash Player here.</a></p>'
+ '<p><a href="http://www.macromedia.com/go/getflash/"><img src="images/get_flash_player.gif" alt="Download Flash Player" width="88" height="31" border="0" /></a></p>'
+ '<p> </p>'
+ '<p> </p>';
document.write(alternateContent); // insert non-flash content
}
但是,我要提供的新内容比“获取Flash”消息要大得多。
有没有更好的方法来提供大量HTML(和javascript)?通过某种包含?我不确定是否要进行任何重定向-还是?
最佳答案
最好的方法是使用SWFObject,
在其中装有备用系统的div中,然后如果安装了Flash Player,则使用SWFObject在该div中加载Flash Player
看一下:如何在此页面上使用SWFObject动态发布嵌入Flash Player内容:http://code.google.com/p/swfobject/wiki/documentation
在下:如何使用HTML配置Flash内容?
flashvars devicefont (more info)
allowscriptaccess (more info here and here)
seamlesstabbing (more info)
allowfullscreen (more info)
allownetworking (more info)
您需要将它们输入到您的参数中,
var params = {allowscriptaccess:'always', allownetworking:'allways'}
然后将婴儿车送入装载机生产线