我正在使用swfobject在我的网站上加载swf文件。一切都运行正常但是因为我安装了Flash版本14,在IE中我得到了一个空白页面,我的swf文件应该是。在Chrome和Firefox中一切正常,但在IE(8,9,10和11)中我遇到了这个问题。
这是我加载swf的方式:
var flashvars = {
viewlog: "0",
wsurl: "WebServices/DynamicComposition.asmx?WSDL",
colorSelected: "0x0066FF",
colorBlocked: "0xEDBF3F",
colorPending: "0xBEE1BE",
colorNotSolved: "0xcccccc",
colorAdded: "0xFF7D7D",
fontfamily: "Tahoma",
fontSize: "11",
viewBoundingBox: "0",
viewPending: "1",
viewHighPriorityParts: "0",
hideLowPriority: "1",
zoomMore_tooltip: "Zoom (Aumentar)",
zoomLess_tooltip: "Zoom (Disminuir)",
zoomAdjust_tooltip: "Mostrar imagen a tamaño completo",
print_tooltip: "Imprimir",
lowPriority_tooltip: "Mostrar piezas con baja prioridad",
viewPending_tooltip: "Mostrar piezas no visibles",
hidePending_tooltip: "Ocultar piezas no visibles",
lateralityRight_tooltip: "Bloquear lado derecho",
lateralityLeft_tooltip: "Bloquear lado izquierdo",
lateralityLock_tooltip: "Eliminar bloqueo lateral",
checkBinaryData: "1",
fontSizeHeaderPrint: "11",
fontSizeFooterPrint: "7",
gradientType: "linear",
gradientRatio1: "0",
gradientRatio2: "210"
};
var params = {
movie: "flash/Main.swf",
bgcolor: "#FFFFFF",
quality: "high",
allowScriptAccess: "always",
wmode: "transparent"
};
var attributes = {
id: "CD",
name: "CD"
};
swfobject.embedSWF("flash/Main.swf", "capaComposicion", "98%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes, swfCallback);
这是它应该加载的容器
<asp:Panel ID="pnlCD" runat="server" Width="100%" Height="100%">
<div id="capaComposicion"></div>
</asp:Panel>
这是swfCallback函数,但当event.success应为true或false时为空。
function swfCallback( event ) {
alert("flash object is created:", event.success );
}
我错过了什么?我做错了什么?
谢谢你帮助一个绝望的男人:D
答案 0 :(得分:0)
如果有人对这个问题感兴趣,我发现问题是有时候第一次打电话给你的瑞士法郎时flashvars没有正确发送。您需要刷新页面,然后使用我发送的值正确加载swf。
现在我需要弄清楚如何确保swf接收我发送的flashvars。使用预加载器可能吗?