SWF加载和Flash播放器升级
我目前正在开发一款 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 SWFObject 文档:
您指定的不仅仅是major.minor.release。尝试简化为
See the SWFObject docs:
You're specifying more than major.minor.release. Try simplifying to