0
我使用的是舊版本SWFObject.js的其中嵌入了一個SWF到HTML這樣的遺留代碼:如何遷移SWFObject調用代碼?
var so = new SWFObject("main.swf", "main", "100%", "615", "9.0.115", "#000000");
so.addVariable("deeplink", deeplink);
so.addVariable("cid", cid);
so.addParam("scaleMode", "noscale");
so.addParam("allowScriptAccess", "always");
so.addParam("allowFullScreen", "true");
so.write("flashcontent");
我應該如何重寫最新SWFObject.js?我已經嘗試過,但失敗了,我想首先排除語法不匹配:
var mainSwfProperties = {
flashVars : {
cid : cid,
deeplink : deeplink
},
params : {
allowFullScreen : "true",
allowScriptAccess : "true",
scaleMode : "noscale",
wmode : "window"
},
attributes : {}
};
swfobject.embedSWF("main.swf", "flashcontent", "100%", 615, "9.0.115", null,
mainSwfProperties.flashVars,
mainSwfProperties.params,
mainSwfProperties.attributes
);
SWFObject 2.3 beta修復了此https://github.com/swfobject/swfobject – pipwerks 2013-01-04 17:59:09