SWF加载和Flash播放器升级

发布于 2024-12-10 11:45:13 字数 1248 浏览 0 评论 0原文

我目前正在开发一款 Flash 游戏。为了确保用户体验一致,我尝试指定 swfVersion 并使用以下代码段调用“swfobject.embedSWF()”。

PD.prototype.loadGame=function(){
var flashvars=this.bootData;
var swfVersion = "11.0.1.152";
var xiSwfUrl = "playerProductInstall.swf";
var params = {
    quality: 'high',
    bgcolor: '#ffffff',
    allowscriptaccess: 'always',
    allowfullscreen: 'true',
    wmode:'opaque'
};
var attributes = {
    id:'Main',
    name:'Main',
    align:'middle'
};

var ref=this;
var mainUrl=this.main+this.version+'&t='+(new Date()).getTime();
swfobject.embedSWF(mainUrl, "flashContent", "100%", "590", swfVersion, this.staticPath+xiSwfUrl, flashvars, params, attributes, function(obj){
    if(obj.success){
        ref.swf=obj.ref;
        $(window).resize(function(){
            var width=$('div#flashContentDiv').width();
            ref.swf.setSize(width,590);
        });
    }else{
        $('div#flashContentDiv').css('background','#ffffff');
        $('div#flashContentDiv').html('<div style="padding-top:250px">Please download the latest version of Flash Player from <a target="_blank" href="http://get.adobe.com/flashplayer/">here</a></div>');
    }
});
};

不过,我仍然收到用户报告升级后无法加载 SWF 的情况。我应该只指定主要版本吗?

I am currently working on a Flash game. In order to ensure the user experience is consistent, I tried to specify the swfVersion and called "swfobject.embedSWF()" using the following code segment.

PD.prototype.loadGame=function(){
var flashvars=this.bootData;
var swfVersion = "11.0.1.152";
var xiSwfUrl = "playerProductInstall.swf";
var params = {
    quality: 'high',
    bgcolor: '#ffffff',
    allowscriptaccess: 'always',
    allowfullscreen: 'true',
    wmode:'opaque'
};
var attributes = {
    id:'Main',
    name:'Main',
    align:'middle'
};

var ref=this;
var mainUrl=this.main+this.version+'&t='+(new Date()).getTime();
swfobject.embedSWF(mainUrl, "flashContent", "100%", "590", swfVersion, this.staticPath+xiSwfUrl, flashvars, params, attributes, function(obj){
    if(obj.success){
        ref.swf=obj.ref;
        $(window).resize(function(){
            var width=$('div#flashContentDiv').width();
            ref.swf.setSize(width,590);
        });
    }else{
        $('div#flashContentDiv').css('background','#ffffff');
        $('div#flashContentDiv').html('<div style="padding-top:250px">Please download the latest version of Flash Player from <a target="_blank" href="http://get.adobe.com/flashplayer/">here</a></div>');
    }
});
};

However I still get users reporting their cases of failing to load the SWF after upgrading. Should I specify only the major version?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

短暂陪伴 2024-12-17 11:45:13

请参阅 SWFObject 文档

version(字符串,必需)指定您的 SWF 的 Flash 播放器版本
已发布(格式为:“major.minor.release”或“major”)

您指定的不仅仅是major.minor.release。尝试简化为

var swfVersion = "11.0.1";

See the SWFObject docs:

version (String, required) specifies the Flash player version your SWF
is published for (format is: "major.minor.release" or "major")

You're specifying more than major.minor.release. Try simplifying to

var swfVersion = "11.0.1";
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文