【问题标题】:Serving Alternative Flash Content提供替代 Flash 内容
【发布时间】:2012-06-18 14:05:38
【问题描述】:

我正在调整 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>&nbsp;</p>'
            + '<p>This website requires a newer version of the Adobe Flash Player.</p>'
            + '<p>&nbsp;</p>'
            + '<p>&nbsp;</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>&nbsp;</p>'
            + '<p>&nbsp;</p>';
    document.write(alternateContent);  // insert non-flash content
}

但是,我想要提供的新内容比“获取 Flash”消息要大得多。

有没有更好的方法来提供大量 HTML(和 javascript)?通过某种包含?我不确定我是否要进行任何类型的重定向 - 或者我是否愿意?

【问题讨论】:

    标签: javascript html flash


    【解决方案1】:

    最好的方法是使用SWFObject,

    如果安装了 Flash 播放器,则使用 SWFObject 在该 div 中加载带有备用系统的 div

    在本页查看:如何使用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'}
    

    然后将婴儿车送入您的装载机生产线

    【讨论】:

    • 这只是一种工作方式,但这可能是因为我不太熟悉原始闪存是如何组合在一起的。当我在我的测试页面上尝试时,音乐无法正确加载,并且与我在现场网站上看到的不同。无论如何都可以使用上面的代码,因为我确信 Flash 可以正常工作。现场网址:wot-sound.co.uk 我的测试实现:lisadearaujo.com/clientaccess/wot-sound/indexFlash.htm
    【解决方案2】:

    除了 HotHeadMartin 的回答:这里有一个不错的代码生成器:
    http://www.bobbyvandersluis.com/swfobject/generator/index.html

    只需选择“动态发布”并填写一些文本字段。

    【讨论】:

    • 谢谢你们,很抱歉回复晚了(我花了这么长时间才访问服务器)。工作完美。 (对不起 - 没有足够的分数来投票你的评论,strah)
    猜你喜欢
    • 2010-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-17
    • 1970-01-01
    相关资源
    最近更新 更多